1152
|
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
2 #ifndef _ICQTCPPACKETS_H
|
|
3 #define _ICQTCPPACKETS_H
|
|
4
|
|
5 #ifdef HAVE_CONFIG_H
|
|
6 #include <config.h>
|
|
7 #endif
|
|
8
|
|
9 #define ICQ_UDP_VER 0x0005
|
|
10 #define ICQ_TCP_VER 0x0003
|
|
11
|
|
12 /* TCP Packet Commands */
|
|
13 #define ICQ_TCP_HELLO 0xFF
|
|
14 #define ICQ_TCP_CANCEL 0x07D0
|
|
15 #define ICQ_TCP_ACK 0x07DA
|
|
16 #define ICQ_TCP_MESSAGE 0x07EE
|
|
17
|
|
18 /* TCP Message Types */
|
|
19 #define ICQ_TCP_MSG_MSG 0x0001
|
|
20 #define ICQ_TCP_MSG_CHAT 0x0002
|
|
21 #define ICQ_TCP_MSG_FILE 0x0003
|
|
22 #define ICQ_TCP_MSG_URL 0x0004
|
|
23 #define ICQ_TCP_MSG_READAWAY 0x03E8
|
|
24 #define ICQ_TCP_MSG_READOCCUPIED 0x03E9
|
|
25 #define ICQ_TCP_MSG_READNA 0x03EA
|
|
26 #define ICQ_TCP_MSG_READDND 0x03EB
|
|
27 #define ICQ_TCP_MSG_READFFC 0x03EC
|
|
28
|
|
29 /* TCP Message Command Types */
|
|
30 #define ICQ_TCP_MSG_ACK 0x0000
|
|
31 #define ICQ_TCP_MSG_AUTO 0x0000
|
|
32 #define ICQ_TCP_MSG_REAL 0x0010
|
|
33 #define ICQ_TCP_MSG_LIST 0x0020
|
|
34 #define ICQ_TCP_MSG_URGENT 0x0040
|
|
35 #define ICQ_TCP_MSG_INVISIBLE 0x0090
|
|
36 #define ICQ_TCP_MSG_UNK_1 0x00A0
|
|
37 #define ICQ_TCP_MSG_AWAY 0x0110
|
|
38 #define ICQ_TCP_MSG_OCCUPIED 0x0210
|
|
39 #define ICQ_TCP_MSG_UNK_2 0x0802
|
|
40 #define ICQ_TCP_MSG_NA 0x0810
|
|
41 #define ICQ_TCP_MSG_NA_2 0x0820
|
|
42 #define ICQ_TCP_MSG_DND 0x1010
|
|
43
|
|
44 /* TCP Message Statuses */
|
|
45 #define ICQ_TCP_STATUS_ONLINE 0x0000
|
|
46 #define ICQ_TCP_STATUS_REFUSE 0x0001
|
|
47 #define ICQ_TCP_STATUS_AWAY 0x0004
|
|
48 #define ICQ_TCP_STATUS_OCCUPIED 0x0009
|
|
49 #define ICQ_TCP_STATUS_DND 0x000A
|
|
50 #define ICQ_TCP_STATUS_NA 0x000E
|
|
51 #define ICQ_TCP_STATUS_FREE_CHAT ICQ_TCP_STATUS_ONLINE
|
|
52 #define ICQ_TCP_STATUS_INVISIBLE ICQ_TCP_STATUS_ONLINE
|
|
53
|
|
54 #include "icqpacket.h"
|
|
55 #include "tcplink.h"
|
|
56
|
|
57 icq_Packet *icq_TCPCreateInitPacket(icq_TCPLink *plink);
|
|
58 icq_Packet *icq_TCPCreateStdPacket(icq_TCPLink *plink, WORD icq_TCPCommand,
|
|
59 WORD type, const unsigned char *msg, WORD status,
|
|
60 WORD msg_command);
|
|
61 icq_Packet *icq_TCPCreateMessagePacket(icq_TCPLink *plink, const unsigned char *message);
|
|
62 icq_Packet *icq_TCPCreateURLPacket(icq_TCPLink *plink, const char *message,
|
|
63 const char *url);
|
|
64 icq_Packet *icq_TCPCreateChatReqPacket(icq_TCPLink *plink, const unsigned char *message);
|
|
65 icq_Packet *icq_TCPCreateFileReqPacket(icq_TCPLink *plink,
|
|
66 const char *message, const char *filename, DWORD size);
|
|
67 void icq_TCPAppendSequence(ICQLINK *link, icq_Packet *p);
|
|
68 void icq_TCPAppendSequenceN(ICQLINK *link, icq_Packet *p, DWORD seq);
|
|
69
|
|
70 icq_Packet *icq_TCPCreateMessageAck(icq_TCPLink *plink, const unsigned char *message);
|
|
71 icq_Packet *icq_TCPCreateURLAck(icq_TCPLink *plink, const unsigned char *message);
|
|
72 icq_Packet *icq_TCPCreateWebPagerAck(icq_TCPLink *plink, const unsigned char *message);
|
|
73 icq_Packet *icq_TCPCreateChatReqAck(icq_TCPLink *plink, WORD port);
|
|
74 icq_Packet *icq_TCPCreateChatReqCancel(icq_TCPLink *plink, WORD port);
|
|
75 icq_Packet *icq_TCPCreateChatReqRefuse(icq_TCPLink *plink, WORD port,
|
|
76 const char *reason);
|
|
77 icq_Packet *icq_TCPCreateFileReqAck(icq_TCPLink *plink, WORD port);
|
|
78 icq_Packet *icq_TCPCreateFileReqCancel(icq_TCPLink *plink, WORD port);
|
|
79 icq_Packet *icq_TCPCreateFileReqRefuse(icq_TCPLink *plink, WORD port,
|
|
80 const char *reason);
|
|
81
|
|
82 icq_Packet *icq_TCPCreateChatInfoPacket(icq_TCPLink *plink, const char *name,
|
|
83 DWORD foreground, DWORD background);
|
|
84 icq_Packet *icq_TCPCreateChatInfo2Packet(icq_TCPLink *plink, const char *name,
|
|
85 DWORD foreground, DWORD background);
|
|
86 icq_Packet *icq_TCPCreateChatFontInfoPacket(icq_TCPLink *plink);
|
|
87
|
|
88 icq_Packet *icq_TCPCreateFile00Packet(DWORD num_files, DWORD total_bytes, DWORD speed, const char *name);
|
|
89 icq_Packet *icq_TCPCreateFile01Packet(DWORD speed, const char *name);
|
|
90 icq_Packet *icq_TCPCreateFile02Packet(const char *filename, DWORD filesize, DWORD speed);
|
|
91 icq_Packet *icq_TCPCreateFile03Packet(DWORD filesize, DWORD speed);
|
|
92 icq_Packet *icq_TCPCreateFile04Packet(DWORD filenum);
|
|
93 icq_Packet *icq_TCPCreateFile05Packet(DWORD speed);
|
|
94 icq_Packet *icq_TCPCreateFile06Packet(int length, void *data);
|
|
95
|
|
96 icq_Packet *icq_UDPCreateStdPacket(ICQLINK *link, WORD cmd);
|
|
97 icq_Packet *icq_UDPCreateStdSeqPacket(ICQLINK *link, WORD cmd, WORD seq);
|
|
98
|
|
99 #endif /* _ICQTCPPACKETS_H */
|
|
100
|
|
101 /* From `tcppackets.c': */
|
|
102
|