Mercurial > pidgin
comparison plugins/icq/stdpackets.c @ 1309:0a766047b4fd
[gaim-migrate @ 1319]
Yay, new icqlib
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 19 Dec 2000 10:08:29 +0000 |
parents | 201ec77f3a60 |
children | 4c510ca3563f |
comparison
equal
deleted
inserted
replaced
1308:4741b5a75b9f | 1309:0a766047b4fd |
---|---|
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* | 2 /* |
3 $Id: stdpackets.c 1162 2000-11-28 02:22:42Z warmenhoven $ | 3 $Id: stdpackets.c 1319 2000-12-19 10:08:29Z warmenhoven $ |
4 $Log$ | 4 $Log$ |
5 Revision 1.1 2000/11/28 02:22:42 warmenhoven | 5 Revision 1.2 2000/12/19 10:08:29 warmenhoven |
6 icq. whoop de doo | 6 Yay, new icqlib |
7 | |
8 Revision 1.11 2000/12/19 06:00:07 bills | |
9 moved members from ICQLINK to ICQLINK_private struct | |
7 | 10 |
8 Revision 1.10 2000/06/15 01:51:23 bills | 11 Revision 1.10 2000/06/15 01:51:23 bills |
9 added creation functions for cancel and refuse operations | 12 added creation functions for cancel and refuse operations |
10 | 13 |
11 Revision 1.9 2000/05/04 15:50:38 bills | 14 Revision 1.9 2000/05/04 15:50:38 bills |
378 return p; | 381 return p; |
379 } | 382 } |
380 | 383 |
381 void icq_TCPAppendSequence(ICQLINK *link, icq_Packet *p) | 384 void icq_TCPAppendSequence(ICQLINK *link, icq_Packet *p) |
382 { | 385 { |
383 p->id=link->icq_TCPSequence--; | 386 p->id=link->d->icq_TCPSequence--; |
384 icq_PacketEnd(p); | 387 icq_PacketEnd(p); |
385 icq_PacketAppend32(p, p->id); | 388 icq_PacketAppend32(p, p->id); |
386 } | 389 } |
387 | 390 |
388 void icq_TCPAppendSequenceN(ICQLINK *link, icq_Packet *p, DWORD seq) | 391 void icq_TCPAppendSequenceN(ICQLINK *link, icq_Packet *p, DWORD seq) |
527 | 530 |
528 icq_Packet *icq_UDPCreateStdPacket(ICQLINK *link, WORD cmd) | 531 icq_Packet *icq_UDPCreateStdPacket(ICQLINK *link, WORD cmd) |
529 { | 532 { |
530 icq_Packet *p = icq_PacketNew(); | 533 icq_Packet *p = icq_PacketNew(); |
531 | 534 |
532 /* if(!link->icq_UDPSession) | 535 /* if(!link->d->icq_UDPSession) |
533 link->icq_UDPSession = rand() & 0x3FFFFFFF; | 536 link->d->icq_UDPSession = rand() & 0x3FFFFFFF; |
534 if(!link->icq_UDPSeqNum2) | 537 if(!link->d->icq_UDPSeqNum2) |
535 link->icq_UDPSeqNum2 = rand() & 0x7FFF;*/ | 538 link->d->icq_UDPSeqNum2 = rand() & 0x7FFF;*/ |
536 | 539 |
537 icq_PacketAppend16(p, ICQ_UDP_VER); /* ver */ | 540 icq_PacketAppend16(p, ICQ_UDP_VER); /* ver */ |
538 icq_PacketAppend32(p, 0); /* zero */ | 541 icq_PacketAppend32(p, 0); /* zero */ |
539 icq_PacketAppend32(p, link->icq_Uin); /* uin */ | 542 icq_PacketAppend32(p, link->icq_Uin); /* uin */ |
540 icq_PacketAppend32(p, link->icq_UDPSession); /* session */ | 543 icq_PacketAppend32(p, link->d->icq_UDPSession); /* session */ |
541 icq_PacketAppend16(p, cmd); /* cmd */ | 544 icq_PacketAppend16(p, cmd); /* cmd */ |
542 icq_PacketAppend16(p, link->icq_UDPSeqNum1++); /* seq1 */ | 545 icq_PacketAppend16(p, link->d->icq_UDPSeqNum1++); /* seq1 */ |
543 icq_PacketAppend16(p, link->icq_UDPSeqNum2++); /* seq2 */ | 546 icq_PacketAppend16(p, link->d->icq_UDPSeqNum2++); /* seq2 */ |
544 icq_PacketAppend32(p, 0); /* checkcode */ | 547 icq_PacketAppend32(p, 0); /* checkcode */ |
545 | 548 |
546 return p; | 549 return p; |
547 } | 550 } |
548 | 551 |
551 icq_Packet *p = icq_PacketNew(); | 554 icq_Packet *p = icq_PacketNew(); |
552 | 555 |
553 icq_PacketAppend16(p, ICQ_UDP_VER); /* ver */ | 556 icq_PacketAppend16(p, ICQ_UDP_VER); /* ver */ |
554 icq_PacketAppend32(p, 0); /* zero */ | 557 icq_PacketAppend32(p, 0); /* zero */ |
555 icq_PacketAppend32(p, link->icq_Uin); /* uin */ | 558 icq_PacketAppend32(p, link->icq_Uin); /* uin */ |
556 icq_PacketAppend32(p, link->icq_UDPSession); /* session */ | 559 icq_PacketAppend32(p, link->d->icq_UDPSession); /* session */ |
557 icq_PacketAppend16(p, cmd); /* cmd */ | 560 icq_PacketAppend16(p, cmd); /* cmd */ |
558 icq_PacketAppend16(p, seq); /* seq1 */ | 561 icq_PacketAppend16(p, seq); /* seq1 */ |
559 icq_PacketAppend16(p, 0); /* seq2 */ | 562 icq_PacketAppend16(p, 0); /* seq2 */ |
560 icq_PacketAppend32(p, 0); /* checkcode */ | 563 icq_PacketAppend32(p, 0); /* checkcode */ |
561 | 564 |