libpurple/protocols/myspace/myspace.h

Wed, 13 Jun 2007 22:57:54 +0000

author
Jeff Connelly <jeff2@soc.pidgin.im>
date
Wed, 13 Jun 2007 22:57:54 +0000
branch
soc.2007.msimprpl
changeset 17963
07e61fbc0abe
parent 17961
16c5545a0a95
child 17965
cf703dbaa48b
permissions
-rw-r--r--

Make msim_remove_buddy() functional. It now sends the delbuddy, persist,
and blocklist commands, each using msim_postprocess_outgoing().

Tested by removing a buddy, restarting Pidgin, and ensuring it did not reappear.

msim_postprocess_outgoing() and msim_postprocess_outgoing_cb() now both use msim_do_postprocessing() to do the actual postprocessing -- insertion of the
uid into the message. msim_postprocess_outgoing() calls msim_do_postprocessing()
if the uid is immediately available (for example, from the buddy list), while
msim_postprocess_outgoing_cb() calls it when the uid was looked up from the
server.

The new function avoids code duplication, which is important now because of the
additional feature of having "<uid>" within a string replaced with the uid, i
instead of adding a new integer field of the uid. msim_remove_buddy uses
this to insert the uid into the "body" field.

17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17924
diff changeset
1 /* MySpaceIM Protocol Plugin, header file
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
2 *
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
3 * Copyright (C) 2007, Jeff Connelly <jeff2@homing.pidgin.im>
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
4 *
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
8 * (at your option) any later version.
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
9 *
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
13 * GNU General Public License for more details.
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
14 *
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
18 */
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
19
17902
8e0b1d066efb Add partial implementation of MsimMessage (not used anywhere yet).
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17901
diff changeset
20 #ifndef _MYSPACE_MYSPACE_H
8e0b1d066efb Add partial implementation of MsimMessage (not used anywhere yet).
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17901
diff changeset
21 #define _MYSPACE_MYSPACE_H
8e0b1d066efb Add partial implementation of MsimMessage (not used anywhere yet).
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17901
diff changeset
22
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
23 /* Other includes */
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
24 #include <string.h>
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
25 #include <errno.h> /* for EAGAIN */
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
26 #include <stdarg.h>
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
27
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
28 #include <glib.h>
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
29
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
30 #ifdef _WIN32
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
31 #include "win32dep.h"
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
32 #else
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
33 /* For recv() and send(); needed to match Win32 */
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
34 #include <sys/types.h>
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
35 #include <sys/socket.h>
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
36 #endif
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
37
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
38 #include "internal.h"
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
39
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
40 #include "notify.h"
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
41 #include "plugin.h"
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
42 #include "accountopt.h"
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
43 #include "version.h"
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
44 #include "cipher.h" /* for SHA-1 */
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
45 #include "util.h" /* for base64 */
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
46 #include "debug.h" /* for purple_debug_info */
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
47
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
48
17910
9bbfa75ba90b (Incomplete - plugin does not load) Begin migrating protocol message receiving to MsimMessage.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17906
diff changeset
49 /* MySpaceIM includes */
9bbfa75ba90b (Incomplete - plugin does not load) Begin migrating protocol message receiving to MsimMessage.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17906
diff changeset
50 #include "message.h"
9bbfa75ba90b (Incomplete - plugin does not load) Begin migrating protocol message receiving to MsimMessage.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17906
diff changeset
51
17892
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
52 /* Conditional compilation options */
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
53
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
54 /* Debugging options */
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
55 #define MSIM_DEBUG_MSG
16335
0c2b32acc27a Replace printf() in MySpaceIM prpl with purple_debug_info().
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 16333
diff changeset
56 /* Low-level and rarely needed */
17892
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
57 /*#define MSIM_DEBUG_PARSE */
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
58 /*#define MSIM_DEBUG_LOGIN_CHALLENGE */
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
59 /*#define MSIM_DEBUG_RXBUF */
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
60
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
61 /* RC4 didn't make it into Libpurple 2.0.0's cipher suite, so we have
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
62 * to use our own RC4 code (from Samba) by not defining this. */
17905
6d461a66be3f Enable usage of RC4 in libpurple, now that it is in 2.0.1.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17903
diff changeset
63 /* RC4 is in Libpurple 2.0.1, so define this. */
6d461a66be3f Enable usage of RC4 in libpurple, now that it is in 2.0.1.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17903
diff changeset
64 #define MSIM_USE_PURPLE_RC4
17892
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
65
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
66 /* TODO: when RC4 makes it into libpurple, use the PURPLE_VERSION_CHECK
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
67 * macro to conditionally compile. And then later, get rid of our own
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
68 * RC4 code and only support libpurple with RC4. */
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
69
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
70 /* Constants */
16335
0c2b32acc27a Replace printf() in MySpaceIM prpl with purple_debug_info().
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 16333
diff changeset
71
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
72 /* Build version of MySpaceIM to report to servers (1.0.xxx.0) */
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
73 #define MSIM_CLIENT_VERSION 673
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
74
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
75 /* Server */
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
76 #define MSIM_SERVER "im.myspace.akadns.net"
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
77 //#define MSIM_SERVER "localhost"
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
78 #define MSIM_PORT 1863 /* TODO: alternate ports and automatic */
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
79
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
80 /* Constants */
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
81 #define HASH_SIZE 0x14 /**< Size of SHA-1 hash for login */
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
82 #define NONCE_SIZE 0x20 /**< Half of decoded 'nc' field */
17919
ae521ade39f1 Parenthesize 5 * 1024, in case the macro expansion occurs within a complex
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17911
diff changeset
83 #define MSIM_READ_BUF_SIZE (5 * 1024) /**< Receive buffer size */
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
84 #define MSIM_FINAL_STRING "\\final\\" /**< Message end marker */
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
85
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
86 /* Messages */
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
87 #define MSIM_BM_INSTANT 1
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
88 #define MSIM_BM_STATUS 100
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
89 #define MSIM_BM_ACTION 121
17906
f87472f223aa Stylistic improvements - use type *name instead of type* name for pointers
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17905
diff changeset
90 /* #define MSIM_BM_UNKNOWN1 122 */
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
91
17901
ecaeb5f6e531 Replacement magic numbers by symbolic constants.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17899
diff changeset
92 /* Authentication algorithm for login2 */
ecaeb5f6e531 Replacement magic numbers by symbolic constants.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17899
diff changeset
93 #define MSIM_AUTH_ALGORITHM 196610
ecaeb5f6e531 Replacement magic numbers by symbolic constants.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17899
diff changeset
94
17933
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
95 /* Indexes into status string (0|1|2|3|..., but 0 always empty) */
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
96 #define MSIM_STATUS_ORDINAL_EMPTY 0
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
97 #define MSIM_STATUS_ORDINAL_UNKNOWNs 1
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
98 #define MSIM_STATUS_ORDINAL_ONLINE 2
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
99 #define MSIM_STATUS_ORDINAL_UNKNOWNss 3
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
100 #define MSIM_STATUS_ORDINAL_HEADLINE 4
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
101 #define MSIM_STATUS_ORDINAL_UNKNOWNls 5
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
102 #define MSIM_STATUS_ORDINAL_UNKNOWN 6
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
103 #define MSIM_STATUS_ORDINAL_UNKNOWN1 7
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
104 #define MSIM_STATUS_ORDINAL_UNKNOWNp 8
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
105 #define MSIM_STATUS_ORDINAL_UNKNOWN2 9
03228b5c78b5 Show online buddies on buddy list as online.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
106
17911
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
107 /* Random number in every MsimSession, to ensure it is valid. */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
108 #define MSIM_SESSION_STRUCT_MAGIC 0xe4a6752b
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
109
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
110 /* Everything needed to keep track of a session. */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
111 typedef struct _MsimSession
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
112 {
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
113 guint magic; /**< MSIM_SESSION_STRUCT_MAGIC */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
114 PurpleAccount *account;
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
115 PurpleConnection *gc;
17941
cdc104d92cdf Change MsimSession.sesskey to an integer (used to be a string), now that
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17940
diff changeset
116 guint sesskey; /**< Session key from server */
17960
0c7d41bbf8d7 Several small changes to work towards a working msim_remove_buddy():
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17959
diff changeset
117 guint userid; /**< This user's numeric user ID */
17911
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
118 gint fd; /**< File descriptor to/from server */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
119
17957
bc5874ed7a09 Add msim_uid2username_from_blist() to lookup a username by userid, by
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17953
diff changeset
120 /* TODO: Remove. */
17911
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
121 GHashTable *user_lookup_cb; /**< Username -> userid lookup callback */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
122 GHashTable *user_lookup_cb_data; /**< Username -> userid lookup callback data */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
123 GHashTable *user_lookup_cache; /**< Cached information on users */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
124
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
125 gchar *rxbuf; /**< Receive buffer */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
126 guint rxoff; /**< Receive buffer offset */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
127 guint next_rid; /**< Next request/response ID */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
128 } MsimSession;
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
129
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
130 /* Check if an MsimSession is valid */
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
131 #define MSIM_SESSION_VALID(s) (session != NULL && \
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
132 session->magic == MSIM_SESSION_STRUCT_MAGIC)
8c54f28e3067 (Plugin loads, but cannot do anything useful)
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17910
diff changeset
133
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
134 /* Callback function pointer type for when a user's information is received,
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
135 * initiated from a user lookup. */
17924
191c78db42ae Use MsimMessage for receiving messages everywhere, instead of GHashTable.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17919
diff changeset
136 typedef void (*MSIM_USER_LOOKUP_CB)(MsimSession *session, MsimMessage *userinfo,
17944
62750b952935 Remove 'flags' from send_im_cb_struct - it was never needed.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17941
diff changeset
137 gpointer data);
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
138
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
139 /* Functions */
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
140 gboolean msim_load(PurplePlugin *plugin);
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
141 GList *msim_status_types(PurpleAccount *acct);
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
142 const gchar *msim_list_icon(PurpleAccount *acct, PurpleBuddy *buddy);
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
143
17902
8e0b1d066efb Add partial implementation of MsimMessage (not used anywhere yet).
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17901
diff changeset
144 /* TODO: move these three functions to message.c/h */
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
145 gchar *msim_unescape(const gchar *msg);
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
146 gchar *msim_escape(const gchar *msg);
17906
f87472f223aa Stylistic improvements - use type *name instead of type* name for pointers
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17905
diff changeset
147 gchar *str_replace(const gchar *str, const gchar *old, const gchar *new);
17902
8e0b1d066efb Add partial implementation of MsimMessage (not used anywhere yet).
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17901
diff changeset
148
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
149 void print_hash_item(gpointer key, gpointer value, gpointer user_data);
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
150 gboolean msim_send_raw(MsimSession *session, const gchar *msg);
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
151
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
152 void msim_login(PurpleAccount *acct);
17935
a6a70c7213ab Previously, the return value of the processing function and msim_process() told
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17934
diff changeset
153 gboolean msim_login_challenge(MsimSession *session, MsimMessage *msg);
17924
191c78db42ae Use MsimMessage for receiving messages everywhere, instead of GHashTable.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17919
diff changeset
154 gchar *msim_compute_login_response(gchar nonce[2 * NONCE_SIZE],
17906
f87472f223aa Stylistic improvements - use type *name instead of type* name for pointers
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17905
diff changeset
155 gchar *email, gchar *password, guint *response_len);
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
156
17934
d163dde3aff1 Add, but do not use, incomplete functions for using typing notifications.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17933
diff changeset
157
17944
62750b952935 Remove 'flags' from send_im_cb_struct - it was never needed.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17941
diff changeset
158 int msim_send_im(PurpleConnection *gc, const char *who, const char *message,
62750b952935 Remove 'flags' from send_im_cb_struct - it was never needed.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17941
diff changeset
159 PurpleMessageFlags flags);
17959
cfbe7f9e5200 Send typing notifications (tested).
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17957
diff changeset
160 gboolean msim_send_bm(MsimSession *session, gchar *who, gchar *text, int type);
17947
a423b14fda56 Change msim_send_im_by_userid_cb() to msim_send_im_cb(), and remove
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17944
diff changeset
161 void msim_send_im_cb(MsimSession *session, MsimMessage *userinfo, gpointer data);
17944
62750b952935 Remove 'flags' from send_im_cb_struct - it was never needed.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17941
diff changeset
162
17924
191c78db42ae Use MsimMessage for receiving messages everywhere, instead of GHashTable.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17919
diff changeset
163 int msim_incoming_im(MsimSession *session, MsimMessage *msg);
17934
d163dde3aff1 Add, but do not use, incomplete functions for using typing notifications.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17933
diff changeset
164 int msim_incoming_action(MsimSession *session, MsimMessage *msg);
d163dde3aff1 Add, but do not use, incomplete functions for using typing notifications.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17933
diff changeset
165
d163dde3aff1 Add, but do not use, incomplete functions for using typing notifications.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17933
diff changeset
166 unsigned int msim_send_typing(PurpleConnection *gc, const char *name, PurpleTypingState state);
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
167
17935
a6a70c7213ab Previously, the return value of the processing function and msim_process() told
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17934
diff changeset
168 gboolean msim_process_reply(MsimSession *session, MsimMessage *msg);
17950
c146721d0ca7 Add message preprocessing in msim_preprocess_incoming(), to resolve
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17947
diff changeset
169
c146721d0ca7 Add message preprocessing in msim_preprocess_incoming(), to resolve
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17947
diff changeset
170 gboolean msim_preprocess_incoming(MsimSession *session, MsimMessage *msg);
17953
c76e16c7cf0a Add, but do not use, two new functions to postprocess outgoing messages
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17951
diff changeset
171
17950
c146721d0ca7 Add message preprocessing in msim_preprocess_incoming(), to resolve
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17947
diff changeset
172 gboolean msim_process(MsimSession *session, MsimMessage *msg);
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
173
17963
07e61fbc0abe Make msim_remove_buddy() functional. It now sends the delbuddy, persist,
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17961
diff changeset
174 MsimMessage *msim_do_postprocessing(MsimMessage *msg, gchar *uid_field_name, gchar *uid_before, guint uid);
17953
c76e16c7cf0a Add, but do not use, two new functions to postprocess outgoing messages
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17951
diff changeset
175 void msim_postprocess_outgoing_cb(MsimSession *session, MsimMessage *userinfo, gpointer data);
c76e16c7cf0a Add, but do not use, two new functions to postprocess outgoing messages
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17951
diff changeset
176 gboolean msim_postprocess_outgoing(MsimSession *session, MsimMessage *msg, gchar *username,
c76e16c7cf0a Add, but do not use, two new functions to postprocess outgoing messages
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17951
diff changeset
177 gchar *uid_field_name, gchar *uid_before);
c76e16c7cf0a Add, but do not use, two new functions to postprocess outgoing messages
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17951
diff changeset
178
c76e16c7cf0a Add, but do not use, two new functions to postprocess outgoing messages
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17951
diff changeset
179
17935
a6a70c7213ab Previously, the return value of the processing function and msim_process() told
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17934
diff changeset
180 gboolean msim_error(MsimSession *session, MsimMessage *msg);
a6a70c7213ab Previously, the return value of the processing function and msim_process() told
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17934
diff changeset
181 gboolean msim_status(MsimSession *session, MsimMessage *msg);
17937
0f30d74fcd9c Add incomplete msim_add_buddy() implementation.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17935
diff changeset
182
0f30d74fcd9c Add incomplete msim_add_buddy() implementation.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17935
diff changeset
183 void msim_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group);
17940
46246b04b219 Add (incomplete) msim_remove_buddy().
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17937
diff changeset
184 void msim_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group);
17937
0f30d74fcd9c Add incomplete msim_add_buddy() implementation.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17935
diff changeset
185
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
186 void msim_input_cb(gpointer gc_uncasted, gint source,
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
187 PurpleInputCondition cond);
17960
0c7d41bbf8d7 Several small changes to work towards a working msim_remove_buddy():
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17959
diff changeset
188
0c7d41bbf8d7 Several small changes to work towards a working msim_remove_buddy():
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17959
diff changeset
189 guint msim_new_reply_callback(MsimSession *session, MSIM_USER_LOOKUP_CB cb, gpointer data);
0c7d41bbf8d7 Several small changes to work towards a working msim_remove_buddy():
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17959
diff changeset
190
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
191 void msim_connect_cb(gpointer data, gint source,
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
192 const gchar *error_message);
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
193
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
194 MsimSession *msim_session_new(PurpleAccount *acct);
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
195 void msim_session_destroy(MsimSession *session);
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
196
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
197 void msim_close(PurpleConnection *gc);
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
198
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
199 gboolean msim_is_userid(const gchar *user);
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
200 gboolean msim_is_email(const gchar *user);
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
201
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
202 void msim_lookup_user(MsimSession *session, const gchar *user,
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
203 MSIM_USER_LOOKUP_CB cb, gpointer data);
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
204
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
205 char *msim_status_text(PurpleBuddy *buddy);
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
206 void msim_tooltip_text(PurpleBuddy *buddy,
16333
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
207 PurpleNotifyUserInfo *user_info, gboolean full);
0fdea8ad21cb Add MySpaceIM header file and reorganize functions.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
208
17903
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
209 void init_plugin(PurplePlugin *plugin);
1c344d9266b8 Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17902
diff changeset
210
17892
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
211 #ifndef MSIM_USE_PURPLE_RC4
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
212 /*
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
213 Unix SMB/CIFS implementation.
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
214
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
215 a partial implementation of RC4 designed for use in the
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
216 SMB authentication protocol
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
217
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
218 Copyright (C) Andrew Tridgell 1998
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
219
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
220 $Id: crypt-rc4.h 12116 2004-09-27 23:29:22Z guy $
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
221
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
222 This program is free software; you can redistribute it and/or modify
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
223 it under the terms of the GNU General Public License as published by
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
224 the Free Software Foundation; either version 2 of the License, or
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
225 (at your option) any later version.
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
226
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
227 This program is distributed in the hope that it will be useful,
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
228 but WITHOUT ANY WARRANTY; without even the implied warranty of
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
229 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
230 GNU General Public License for more details.
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
231
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
232 You should have received a copy of the GNU General Public License
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
233 along with this program; if not, write to the Free Software
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
234 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
235 */
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
236
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
237 typedef struct _rc4_state_struct {
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
238 unsigned char s_box[256];
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
239 unsigned char index_i;
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
240 unsigned char index_j;
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
241 } rc4_state_struct;
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
242
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
243 void crypt_rc4_init(rc4_state_struct *rc4_state,
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
244 const unsigned char *key, int key_len);
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
245
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
246 void crypt_rc4(rc4_state_struct *rc4_state, unsigned char *data, int data_len);
66984c1aac79 Re-add RC4 code from Samba, whose use is enabled by not defining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17890
diff changeset
247 #endif /* !MSIM_USE_PURPLE_RC4 */
17902
8e0b1d066efb Add partial implementation of MsimMessage (not used anywhere yet).
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17901
diff changeset
248
8e0b1d066efb Add partial implementation of MsimMessage (not used anywhere yet).
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17901
diff changeset
249 #endif /* !_MYSPACE_MYSPACE_H */

mercurial