1152
|
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
2 #ifndef _ICQ_PACKET_H_
|
|
3 #define _ICQ_PACKET_H_
|
|
4
|
|
5 #ifdef HAVE_CONFIG_H
|
|
6 #include <config.h>
|
|
7 #endif
|
|
8
|
|
9 #include "icqtypes.h"
|
|
10
|
|
11 #define ICQ_PACKET_DATA_SIZE 4096
|
|
12
|
|
13 typedef struct icq_Packet_s
|
|
14 {
|
|
15 DWORD id;
|
|
16 WORD cursor;
|
|
17 WORD length;
|
|
18 BYTE data[ICQ_PACKET_DATA_SIZE];
|
|
19 } icq_Packet;
|
|
20
|
|
21 icq_Packet *icq_PacketNew();
|
|
22 void icq_PacketDelete(void *);
|
|
23
|
|
24 void icq_PacketAppend(icq_Packet *, const void *, int);
|
|
25 void icq_PacketAppend32(icq_Packet *, DWORD);
|
|
26 void icq_PacketAppend32n(icq_Packet *, DWORD);
|
|
27 void icq_PacketAppend16(icq_Packet *, WORD);
|
|
28 void icq_PacketAppend16n(icq_Packet *, WORD);
|
|
29 void icq_PacketAppend8(icq_Packet *, BYTE);
|
|
30 void icq_PacketAppendString(icq_Packet *, const char *);
|
|
31 void icq_PacketAppendStringFE(icq_Packet *, const char *);
|
|
32 void icq_PacketAppendString0(icq_Packet *, const char *);
|
|
33
|
|
34 const void *icq_PacketRead(icq_Packet*, int);
|
|
35 DWORD icq_PacketRead32(icq_Packet*);
|
|
36 DWORD icq_PacketRead32n(icq_Packet*);
|
|
37 WORD icq_PacketRead16(icq_Packet*);
|
|
38 WORD icq_PacketRead16n(icq_Packet*);
|
|
39 BYTE icq_PacketRead8(icq_Packet*);
|
|
40 const char *icq_PacketReadString(icq_Packet*);
|
|
41 char *icq_PacketReadStringNew(icq_Packet*);
|
|
42 WORD icq_PacketReadUDPOutVer(icq_Packet*);
|
|
43 WORD icq_PacketReadUDPOutCmd(icq_Packet*);
|
|
44 WORD icq_PacketReadUDPOutSeq1(icq_Packet*);
|
|
45 WORD icq_PacketReadUDPOutSeq2(icq_Packet*);
|
|
46 WORD icq_PacketReadUDPInVer(icq_Packet*);
|
|
47 WORD icq_PacketReadUDPInCmd(icq_Packet*);
|
|
48 WORD icq_PacketReadUDPInSeq1(icq_Packet*);
|
|
49 WORD icq_PacketReadUDPInSeq2(icq_Packet*);
|
|
50 DWORD icq_PacketReadUDPInUIN(icq_Packet*);
|
|
51
|
|
52 void icq_PacketDump(icq_Packet*);
|
|
53 void icq_PacketUDPDump(icq_Packet*);
|
|
54 void icq_PacketBegin(icq_Packet*);
|
|
55 void icq_PacketEnd(icq_Packet*);
|
|
56 void icq_PacketAdvance(icq_Packet*, int);
|
|
57 void icq_PacketGoto(icq_Packet*, int);
|
|
58 void icq_PacketGotoUDPOutData(icq_Packet*, int);
|
|
59 void icq_PacketGotoUDPInData(icq_Packet*, int);
|
|
60 WORD icq_PacketPos(icq_Packet*);
|
|
61 int icq_PacketSend(icq_Packet*, int);
|
|
62
|
|
63 #endif /* _ICQ_PACKET_H_ */
|