Mercurial > pidgin.yaz
annotate plugins/icq/tcplink.h @ 1822:ca040e495bc6
[gaim-migrate @ 1832]
Some new icons for your viewing pleasure.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Mon, 07 May 2001 23:43:48 +0000 |
parents | 0ef6603d986e |
children | 8ed70631ed15 |
rev | line source |
---|---|
1152 | 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 #ifndef _TCP_LINK_H_ | |
3 #define _TCP_LINK_H_ | |
4 | |
5 #ifdef HAVE_CONFIG_H | |
6 #include <config.h> | |
7 #endif | |
8 | |
9 #ifdef _WIN32 | |
10 #include <winsock.h> | |
11 #else | |
1348 | 12 #include <sys/types.h> |
13 #include <sys/socket.h> | |
1152 | 14 #include <netinet/in.h> |
15 #endif | |
16 | |
17 #include <time.h> | |
18 | |
19 #include "icq.h" | |
20 #include "icqpacket.h" | |
1498
0ef6603d986e
[gaim-migrate @ 1508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1432
diff
changeset
|
21 #include "timeout.h" |
1152 | 22 |
23 /* link mode bitfield values */ | |
24 #define TCP_LINK_MODE_RAW 1 | |
25 #define TCP_LINK_MODE_HELLOWAIT 2 | |
26 #define TCP_LINK_MODE_LISTEN 4 | |
27 #define TCP_LINK_MODE_CONNECTING 8 | |
28 #define TCP_LINK_SOCKS_CONNECTING 16 | |
29 #define TCP_LINK_SOCKS_AUTHORIZATION 32 | |
30 #define TCP_LINK_SOCKS_AUTHSTATUS 64 | |
31 #define TCP_LINK_SOCKS_NOAUTHSTATUS 128 | |
32 #define TCP_LINK_SOCKS_CROSSCONNECT 256 | |
33 #define TCP_LINK_SOCKS_CONNSTATUS 512 | |
34 | |
35 /* link types */ | |
36 #define TCP_LINK_MESSAGE 1 | |
37 #define TCP_LINK_CHAT 2 | |
38 #define TCP_LINK_FILE 3 | |
39 | |
40 #define icq_TCPLinkBufferSize 4096 | |
41 #define TCP_LINK_CONNECT_TIMEOUT 30 | |
42 | |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1348
diff
changeset
|
43 struct icq_TCPLink_s { |
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1348
diff
changeset
|
44 |
1152 | 45 /* icq_TCPLink ICQLINK, type, mode, and session */ |
46 ICQLINK *icqlink; | |
47 int type; | |
48 int mode; | |
49 int proxy_status; | |
50 void *session; | |
51 | |
52 /* socket parameters */ | |
53 int socket; | |
54 struct sockaddr_in socket_address; | |
55 struct sockaddr_in remote_address; | |
56 | |
57 /* data buffer for receive calls */ | |
58 char buffer[icq_TCPLinkBufferSize]; | |
59 int buffer_count; | |
60 | |
61 /* packet queues */ | |
62 list *received_queue; | |
63 list *send_queue; | |
64 | |
65 /* icq specific data, initialized by hello packet */ | |
66 unsigned long id; | |
67 unsigned long remote_version; | |
68 unsigned long remote_uin; | |
69 char flags; | |
70 | |
1498
0ef6603d986e
[gaim-migrate @ 1508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1432
diff
changeset
|
71 /* timeout for connect operation */ |
0ef6603d986e
[gaim-migrate @ 1508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1432
diff
changeset
|
72 icq_Timeout *connect_timeout; |
1152 | 73 |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1348
diff
changeset
|
74 }; |
1152 | 75 |
76 icq_TCPLink *icq_TCPLinkNew(ICQLINK *link); | |
77 void icq_TCPLinkDelete(void *p); | |
78 void icq_TCPLinkClose(icq_TCPLink *p); | |
79 void icq_TCPLinkNodeDelete(list_node *p); | |
80 | |
81 int icq_TCPLinkConnect(icq_TCPLink *plink, DWORD uin, int port); | |
82 icq_TCPLink *icq_TCPLinkAccept(icq_TCPLink *plink); | |
83 int icq_TCPLinkListen(icq_TCPLink *plink); | |
84 | |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1348
diff
changeset
|
85 void icq_TCPLinkOnDataReceived(icq_TCPLink *plink); |
1152 | 86 void icq_TCPLinkOnPacketReceived(icq_TCPLink *plink, icq_Packet *p); |
87 void icq_TCPLinkOnConnect(icq_TCPLink *plink); | |
1498
0ef6603d986e
[gaim-migrate @ 1508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1432
diff
changeset
|
88 void icq_TCPLinkOnConnectTimeout(icq_TCPLink *plink); |
1152 | 89 |
90 unsigned long icq_TCPLinkSendSeq(icq_TCPLink *plink, icq_Packet *p, | |
91 unsigned long sequence); | |
92 void icq_TCPLinkSend(icq_TCPLink *plink, icq_Packet *p); | |
93 | |
94 void icq_TCPLinkProcessReceived(icq_TCPLink *plink); | |
95 | |
96 icq_TCPLink *icq_FindTCPLink(ICQLINK *link, unsigned long uin, int type); | |
97 | |
98 void icq_ChatRusConv_n(const char to[4], char *t_in, int t_len); | |
99 | |
100 #endif /* _TCP_LINK_H_ */ |