Tue, 13 Mar 2001 10:05:45 +0000
[gaim-migrate @ 1575]
http proxy for libyay. yay.
| 1546 | 1 | /* |
| 2 | * libyay | |
| 3 | * | |
| 4 | * Copyright (C) 2001 Eric Warmenhoven <warmenhoven@yahoo.com> | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation; either version 2 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 19 | * | |
| 20 | */ | |
| 21 | ||
| 22 | #ifndef _LIBYAY_INTERNAL_H | |
| 23 | #define _LIBYAY_INTERNAL_H | |
| 24 | ||
| 25 | #include "yay.h" | |
| 26 | ||
| 27 | #define YAHOO_CONN_STATUS_RESOLVERR 0x0040 | |
| 28 | #define YAHOO_CONN_STATUS_INPROGRESS 0x0100 | |
| 29 | ||
| 30 | #define YAHOO_USER_AGENT "Mozilla/4.6 (libyay/1.0)" | |
| 31 | ||
| 32 | #define YAHOO_PRINT(x, y, z) if (yahoo_print) (*yahoo_print)(x, y, z) | |
| 33 | #define CALLBACK(x, y, ...) if (x->callbacks[y].function) (*x->callbacks[y].function)(x, ##__VA_ARGS__) | |
| 34 | ||
| 35 | struct yahoo_conn { | |
| 36 | int type; | |
| 37 | int socket; | |
| 38 | int magic_id; | |
| 39 | char *txqueue; | |
| 40 | }; | |
| 41 | ||
|
1565
95f2c94c708d
[gaim-migrate @ 1575]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1562
diff
changeset
|
42 | #define YAHOO_CONN_TYPE_AUTH 1 |
|
95f2c94c708d
[gaim-migrate @ 1575]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1562
diff
changeset
|
43 | #define YAHOO_CONN_TYPE_MAIN 2 |
|
95f2c94c708d
[gaim-migrate @ 1575]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1562
diff
changeset
|
44 | #define YAHOO_CONN_TYPE_DUMB 3 |
|
95f2c94c708d
[gaim-migrate @ 1575]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1562
diff
changeset
|
45 | #define YAHOO_CONN_TYPE_PROXY 4 |
|
95f2c94c708d
[gaim-migrate @ 1575]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1562
diff
changeset
|
46 | |
|
95f2c94c708d
[gaim-migrate @ 1575]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1562
diff
changeset
|
47 | #define HTTP_GOODSTRING1 "HTTP/1.0 200 Connection established" |
|
95f2c94c708d
[gaim-migrate @ 1575]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1562
diff
changeset
|
48 | #define HTTP_GOODSTRING2 "HTTP/1.1 200 Connection established" |
| 1546 | 49 | |
| 50 | char *yahoo_urlencode(const char *); | |
| 51 | struct yahoo_conn *yahoo_new_conn(struct yahoo_session *, int, const char *, int); | |
| 52 | struct yahoo_conn *yahoo_getconn_type(struct yahoo_session *, int); | |
| 53 | struct yahoo_conn *yahoo_find_conn(struct yahoo_session *, int); | |
| 54 | int yahoo_write(struct yahoo_session *, struct yahoo_conn *, void *, int); | |
| 55 | int yahoo_write_cmd(struct yahoo_session *, struct yahoo_conn *, int, const char *, void *, guint); | |
| 56 | void yahoo_close(struct yahoo_session *, struct yahoo_conn *); | |
| 57 | ||
| 58 | #define YAHOO_SERVICE_LOGON 1 | |
| 59 | #define YAHOO_SERVICE_LOGOFF 2 | |
| 60 | #define YAHOO_SERVICE_ISAWAY 3 | |
| 61 | #define YAHOO_SERVICE_ISBACK 4 | |
| 62 | #define YAHOO_SERVICE_IDLE 5 | |
| 63 | #define YAHOO_SERVICE_MESSAGE 6 | |
| 64 | #define YAHOO_SERVICE_IDACT 7 | |
| 65 | #define YAHOO_SERVICE_IDDEACT 8 | |
| 66 | #define YAHOO_SERVICE_NEWMAIL 11 | |
| 67 | #define YAHOO_SERVICE_NEWPERSONALMAIL 14 | |
|
1557
190572c52915
[gaim-migrate @ 1567]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1552
diff
changeset
|
68 | #define YAHOO_SERVICE_NEWCONTACT 15 |
| 1546 | 69 | #define YAHOO_SERVICE_PING 18 |
| 70 | ||
| 71 | #define YAHOO_MESSAGE_NORMAL 1 | |
|
1562
18522055495a
[gaim-migrate @ 1572]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1557
diff
changeset
|
72 | #define YAHOO_MESSAGE_BOUNCE 2 |
| 1546 | 73 | |
|
1552
20713b652219
[gaim-migrate @ 1562]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1546
diff
changeset
|
74 | void yahoo_storeint(guchar *, guint); |
|
20713b652219
[gaim-migrate @ 1562]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1546
diff
changeset
|
75 | int yahoo_makeint(guchar *); |
| 1546 | 76 | |
| 77 | struct yahoo_packet { | |
| 78 | char version[8]; | |
| 79 | guchar len[4]; | |
| 80 | guchar service[4]; | |
| 81 | ||
| 82 | guchar conn_id[4]; | |
| 83 | guchar magic_id[4]; | |
| 84 | guchar address[4]; | |
| 85 | guchar msgtype[4]; | |
| 86 | ||
| 87 | char nick1[36]; | |
| 88 | char nick2[36]; | |
| 89 | ||
| 90 | char content[1024]; | |
| 91 | }; | |
| 92 | ||
| 93 | #endif |