[gaim-migrate @ 3063]
[pidgin-git.git] / src / protocols / icq / icqpacket.h
blob0058d8b83c46f154d5c1a6c899a252b9f95e3eb9
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /*
4 * $Id: icqpacket.h 2096 2001-07-31 01:00:39Z warmenhoven $
6 * Copyright (C) 1998-2001, Denis V. Dmitrienko <denis@null.net> and
7 * Bill Soudan <soudan@kde.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #ifndef _ICQ_PACKET_H_
26 #define _ICQ_PACKET_H_
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
32 #include "icqtypes.h"
34 #define ICQ_PACKET_DATA_SIZE 4096
36 typedef struct icq_Packet_s
38 DWORD id;
39 WORD cursor;
40 WORD length;
41 BYTE data[ICQ_PACKET_DATA_SIZE];
42 } icq_Packet;
44 icq_Packet *icq_PacketNew();
45 void icq_PacketDelete(void *);
47 void icq_PacketAppend(icq_Packet *, const void *, int);
48 void icq_PacketAppend32(icq_Packet *, DWORD);
49 void icq_PacketAppend32n(icq_Packet *, DWORD);
50 void icq_PacketAppend16(icq_Packet *, WORD);
51 void icq_PacketAppend16n(icq_Packet *, WORD);
52 void icq_PacketAppend8(icq_Packet *, BYTE);
53 void icq_PacketAppendString(icq_Packet *, const char *);
54 void icq_PacketAppendStringFE(icq_Packet *, const char *);
55 void icq_PacketAppendString0(icq_Packet *, const char *);
57 const void *icq_PacketRead(icq_Packet*, int);
58 DWORD icq_PacketRead32(icq_Packet*);
59 DWORD icq_PacketRead32n(icq_Packet*);
60 WORD icq_PacketRead16(icq_Packet*);
61 WORD icq_PacketRead16n(icq_Packet*);
62 BYTE icq_PacketRead8(icq_Packet*);
63 const char *icq_PacketReadString(icq_Packet*);
64 char *icq_PacketReadStringNew(icq_Packet*);
65 WORD icq_PacketReadUDPOutVer(icq_Packet*);
66 WORD icq_PacketReadUDPOutCmd(icq_Packet*);
67 WORD icq_PacketReadUDPOutSeq1(icq_Packet*);
68 WORD icq_PacketReadUDPOutSeq2(icq_Packet*);
69 WORD icq_PacketReadUDPInVer(icq_Packet*);
70 WORD icq_PacketReadUDPInCmd(icq_Packet*);
71 WORD icq_PacketReadUDPInCmdV3(icq_Packet*);
72 WORD icq_PacketReadUDPInSeq1(icq_Packet*);
73 WORD icq_PacketReadUDPInSeq2(icq_Packet*);
74 DWORD icq_PacketReadUDPInUIN(icq_Packet*);
76 void icq_PacketDump(icq_Packet*);
77 void icq_PacketUDPDump(icq_Packet*);
78 void icq_PacketBegin(icq_Packet*);
79 void icq_PacketEnd(icq_Packet*);
80 void icq_PacketAdvance(icq_Packet*, int);
81 void icq_PacketGoto(icq_Packet*, int);
82 void icq_PacketGotoUDPOutData(icq_Packet*, int);
83 void icq_PacketGotoUDPInData(icq_Packet*, int);
84 WORD icq_PacketPos(icq_Packet*);
85 int icq_PacketSend(icq_Packet*, int);
87 #endif /* _ICQ_PACKET_H_ */