2 * Routines for AIM Instant Messenger (OSCAR) dissection
3 * Copyright 2000, Ralf Hoelzer <ralf@well.com>
4 * Copyright 2004, Jelmer Vernooij <jelmer@samba.org>
6 * $Id: packet-aim.c,v 1.41 2004/05/05 09:30:56 guy Exp $
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@ethereal.com>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include <epan/packet.h>
39 #include <epan/strutil.h>
41 #include "packet-tcp.h"
42 #include "packet-aim.h"
45 #define TCP_PORT_AIM 5190
50 #define CHANNEL_NEW_CONN 0x01
51 #define CHANNEL_SNAC_DATA 0x02
52 #define CHANNEL_FLAP_ERR 0x03
53 #define CHANNEL_CLOSE_CONN 0x04
54 #define CHANNEL_KEEP_ALIVE 0x05
56 #define CLI_COOKIE 0x01
58 #define FAMILY_ALL_ERROR_INVALID_HEADER 0x0001
59 #define FAMILY_ALL_ERROR_SERVER_RATE_LIMIT_EXCEEDED 0x0002
60 #define FAMILY_ALL_ERROR_CLIENT_RATE_LIMIT_EXCEEDED 0x0003
61 #define FAMILY_ALL_ERROR_RECIPIENT_NOT_LOGGED_IN 0x0004
62 #define FAMILY_ALL_ERROR_REQUESTED_SERVICE_UNAVAILABLE 0x0005
63 #define FAMILY_ALL_ERROR_REQUESTED_SERVICE_NOT_DEFINED 0x0006
64 #define FAMILY_ALL_ERROR_OBSOLETE_SNAC 0x0007
65 #define FAMILY_ALL_ERROR_NOT_SUPPORTED_BY_SERVER 0x0008
66 #define FAMILY_ALL_ERROR_NOT_SUPPORTED_BY_CLIENT 0x0009
67 #define FAMILY_ALL_ERROR_REFUSED_BY_CLIENT 0x000a
68 #define FAMILY_ALL_ERROR_REPLY_TOO_BIG 0x000b
69 #define FAMILY_ALL_ERROR_RESPONSES_LOST 0x000c
70 #define FAMILY_ALL_ERROR_REQUEST_DENIED 0x000d
71 #define FAMILY_ALL_ERROR_INCORRECT_SNAC_FORMAT 0x000e
72 #define FAMILY_ALL_ERROR_INSUFFICIENT_RIGHTS 0x000f
73 #define FAMILY_ALL_ERROR_RECIPIENT_BLOCKED 0x0010
74 #define FAMILY_ALL_ERROR_SENDER_TOO_EVIL 0x0011
75 #define FAMILY_ALL_ERROR_RECEIVER_TOO_EVIL 0x0012
76 #define FAMILY_ALL_ERROR_USER_TEMP_UNAVAILABLE 0x0013
77 #define FAMILY_ALL_ERROR_NO_MATCH 0x0014
78 #define FAMILY_ALL_ERROR_LIST_OVERFLOW 0x0015
79 #define FAMILY_ALL_ERROR_REQUEST_AMBIGUOUS 0x0016
80 #define FAMILY_ALL_ERROR_SERVER_QUEUE_FULL 0x0017
81 #define FAMILY_ALL_ERROR_NOT_WHILE_ON_AOL 0x0018
83 static const value_string aim_flap_channels[] = {
84 { CHANNEL_NEW_CONN, "New Connection" },
85 { CHANNEL_SNAC_DATA, "SNAC Data" },
86 { CHANNEL_FLAP_ERR, "FLAP-Level Error" },
87 { CHANNEL_CLOSE_CONN, "Close Connection" },
88 { CHANNEL_KEEP_ALIVE, "Keep Alive" },
92 static const value_string aim_snac_errors[] = {
93 { FAMILY_ALL_ERROR_INVALID_HEADER, "Invalid SNAC Header" },
94 { FAMILY_ALL_ERROR_SERVER_RATE_LIMIT_EXCEEDED, "Server rate limit exceeded" },
95 { FAMILY_ALL_ERROR_CLIENT_RATE_LIMIT_EXCEEDED, "Client rate limit exceeded" },
96 { FAMILY_ALL_ERROR_RECIPIENT_NOT_LOGGED_IN, "Recipient not logged in" },
97 { FAMILY_ALL_ERROR_REQUESTED_SERVICE_UNAVAILABLE, "Requested service unavailable" },
98 { FAMILY_ALL_ERROR_REQUESTED_SERVICE_NOT_DEFINED, "Requested service not defined" },
99 { FAMILY_ALL_ERROR_OBSOLETE_SNAC, "Obsolete SNAC issued" },
100 { FAMILY_ALL_ERROR_NOT_SUPPORTED_BY_SERVER, "Not supported by server" },
101 { FAMILY_ALL_ERROR_NOT_SUPPORTED_BY_CLIENT, "Not supported by client" },
102 { FAMILY_ALL_ERROR_REFUSED_BY_CLIENT, "Refused by client" },
103 { FAMILY_ALL_ERROR_REPLY_TOO_BIG, "Reply too big" },
104 { FAMILY_ALL_ERROR_RESPONSES_LOST, "Responses lost" },
105 { FAMILY_ALL_ERROR_REQUEST_DENIED, "Request denied" },
106 { FAMILY_ALL_ERROR_INCORRECT_SNAC_FORMAT, "Incorrect SNAC format" },
107 { FAMILY_ALL_ERROR_INSUFFICIENT_RIGHTS, "Insufficient rights" },
108 { FAMILY_ALL_ERROR_RECIPIENT_BLOCKED, "Recipient blocked" },
109 { FAMILY_ALL_ERROR_SENDER_TOO_EVIL, "Sender too evil" },
110 { FAMILY_ALL_ERROR_RECEIVER_TOO_EVIL, "Receiver too evil" },
111 { FAMILY_ALL_ERROR_USER_TEMP_UNAVAILABLE, "User temporarily unavailable" },
112 { FAMILY_ALL_ERROR_NO_MATCH, "No match" },
113 { FAMILY_ALL_ERROR_LIST_OVERFLOW, "List overflow" },
114 { FAMILY_ALL_ERROR_REQUEST_AMBIGUOUS, "Request ambiguous" },
115 { FAMILY_ALL_ERROR_SERVER_QUEUE_FULL, "Server queue full" },
116 { FAMILY_ALL_ERROR_NOT_WHILE_ON_AOL, "Not while on AOL" },
120 #define AIM_CLIENT_TLV_SCREEN_NAME 0x0001
121 #define AIM_CLIENT_TLV_ROASTED_PASSWORD 0x0002
122 #define AIM_CLIENT_TLV_CLIENT_ID_STRING 0x0003
123 #define AIM_CLIENT_TLV_ERRORURL 0x0004
124 #define AIM_CLIENT_TLV_BOS_SERVER_STRING 0x0005
125 #define AIM_CLIENT_TLV_AUTH_COOKIE 0x0006
126 #define AIM_CLIENT_TLV_ERRORCODE 0x0008
127 #define AIM_CLIENT_TLV_GENERIC_SERVICE_ID 0x000d
128 #define AIM_CLIENT_TLV_CLIENT_COUNTRY 0x000e
129 #define AIM_CLIENT_TLV_CLIENT_LANGUAGE 0x000f
130 #define AIM_CLIENT_TLV_EMAILADDR 0x0011
131 #define AIM_CLIENT_TLV_OLD_ROASTED_PASSWORD 0x0012
132 #define AIM_CLIENT_TLV_REGSTATUS 0x0013
133 #define AIM_CLIENT_TLV_CLIENT_DISTRIBUTION_NUM 0x0014
134 #define AIM_CLIENT_TLV_INVITEMESSAGE 0x0015
135 #define AIM_CLIENT_TLV_CLIENT_ID 0x0016
136 #define AIM_CLIENT_TLV_CLIENT_MAJOR_VERSION 0x0017
137 #define AIM_CLIENT_TLV_CLIENT_MINOR_VERSION 0x0018
138 #define AIM_CLIENT_TLV_CLIENT_LESSER_VERSION 0x0019
139 #define AIM_CLIENT_TLV_CLIENT_BUILD_NUMBER 0x001a
140 #define AIM_CLIENT_TLV_PASSWORD 0x0025
141 #define AIM_CLIENT_TLV_LATESTBETABUILD 0x0040
142 #define AIM_CLIENT_TLV_LATESTBETAURL 0x0041
143 #define AIM_CLIENT_TLV_LATESTBETAINFO 0x0042
144 #define AIM_CLIENT_TLV_LATESTBETANAME 0x0043
145 #define AIM_CLIENT_TLV_LATESTRELEASEBUILD 0x0044
146 #define AIM_CLIENT_TLV_LATESTRELEASEURL 0x0045
147 #define AIM_CLIENT_TLV_LATESTRELEASEINFO 0x0046
148 #define AIM_CLIENT_TLV_LATESTRELEASENAME 0x0047
149 #define AIM_CLIENT_TLV_CLIENTUSESSI 0x004a
150 #define AIM_CLIENT_TLV_CHANGE_PASSWORD_URL 0x0054
152 const aim_tlv client_tlvs[] = {
153 { AIM_CLIENT_TLV_SCREEN_NAME, "Screen name", dissect_aim_tlv_value_string },
154 { AIM_CLIENT_TLV_ROASTED_PASSWORD, "Roasted password array", dissect_aim_tlv_value_bytes },
155 { AIM_CLIENT_TLV_OLD_ROASTED_PASSWORD, "Old roasted password array", dissect_aim_tlv_value_bytes },
156 { AIM_CLIENT_TLV_CLIENT_ID_STRING, "Client id string (name, version)", dissect_aim_tlv_value_string },
157 { AIM_CLIENT_TLV_CLIENT_ID, "Client id number", dissect_aim_tlv_value_uint16 },
158 { AIM_CLIENT_TLV_CLIENT_MAJOR_VERSION, "Client major version", dissect_aim_tlv_value_uint16 },
159 { AIM_CLIENT_TLV_CLIENT_MINOR_VERSION, "Client minor version", dissect_aim_tlv_value_uint16 },
160 { AIM_CLIENT_TLV_CLIENT_LESSER_VERSION, "Client lesser version", dissect_aim_tlv_value_uint16 },
161 { AIM_CLIENT_TLV_CLIENT_BUILD_NUMBER, "Client build number", dissect_aim_tlv_value_uint16 },
162 { AIM_CLIENT_TLV_CLIENT_DISTRIBUTION_NUM, "Client distribution number", dissect_aim_tlv_value_uint16 },
163 { AIM_CLIENT_TLV_CLIENT_LANGUAGE, "Client language", dissect_aim_tlv_value_string },
164 { AIM_CLIENT_TLV_CLIENT_COUNTRY, "Client country", dissect_aim_tlv_value_string },
165 { AIM_CLIENT_TLV_BOS_SERVER_STRING, "BOS server string", dissect_aim_tlv_value_string },
166 { AIM_CLIENT_TLV_AUTH_COOKIE, "Authorization cookie", dissect_aim_tlv_value_bytes },
167 { AIM_CLIENT_TLV_ERRORURL, "Error URL", dissect_aim_tlv_value_string },
168 { AIM_CLIENT_TLV_ERRORCODE, "Error Code", dissect_aim_tlv_value_uint16 }, /* FIXME: Decode error codes too */
169 { AIM_CLIENT_TLV_EMAILADDR, "Account Email address", dissect_aim_tlv_value_string },
170 { AIM_CLIENT_TLV_REGSTATUS, "Registration Status", dissect_aim_tlv_value_uint16 },
171 { AIM_CLIENT_TLV_LATESTBETABUILD, "Latest Beta Build", dissect_aim_tlv_value_uint32 },
172 { AIM_CLIENT_TLV_LATESTBETAURL, "Latest Beta URL", dissect_aim_tlv_value_string },
173 { AIM_CLIENT_TLV_LATESTBETAINFO, "Latest Beta Info", dissect_aim_tlv_value_string },
174 { AIM_CLIENT_TLV_LATESTBETANAME, "Latest Beta Name", dissect_aim_tlv_value_string },
175 { AIM_CLIENT_TLV_LATESTRELEASEBUILD, "Latest Release Build", dissect_aim_tlv_value_uint32 },
176 { AIM_CLIENT_TLV_LATESTRELEASEURL, "Latest Release URL", dissect_aim_tlv_value_string },
177 { AIM_CLIENT_TLV_LATESTRELEASEINFO, "Latest Release Info", dissect_aim_tlv_value_string },
178 { AIM_CLIENT_TLV_LATESTRELEASENAME, "Latest Release Name", dissect_aim_tlv_value_string },
179 { AIM_CLIENT_TLV_CLIENTUSESSI, "Use SSI", dissect_aim_tlv_value_uint8 },
180 { AIM_CLIENT_TLV_GENERIC_SERVICE_ID, "Service (Family) ID", dissect_aim_tlv_value_uint16 },
181 { AIM_CLIENT_TLV_CHANGE_PASSWORD_URL, "Change password url", dissect_aim_tlv_value_string },
182 { 0, "Unknown", NULL },
186 static int dissect_aim_tlv_value_userstatus(proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb);
187 static int dissect_aim_tlv_value_dcinfo(proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb);
189 #define AIM_ONLINEBUDDY_USERCLASS 0x0001
190 #define AIM_ONLINEBUDDY_ONSINCE 0x0003
191 #define AIM_ONLINEBUDDY_IDLETIME 0x0004
192 #define AIM_ONLINEBUDDY_MEMBERSINCE 0x0005
193 #define AIM_ONLINEBUDDY_STATUS 0x0006
194 #define AIM_ONLINEBUDDY_TIMEUPDATE 0x0011
195 #define AIM_ONLINEBUDDY_IPADDR 0x000a
196 #define AIM_ONLINEBUDDY_DCINFO 0x000c
197 #define AIM_ONLINEBUDDY_CAPINFO 0x000d
198 #define AIM_ONLINEBUDDY_UNKNOWN 0x000e
199 #define AIM_ONLINEBUDDY_SESSIONLEN 0x000f
200 #define AIM_ONLINEBUDDY_ICQSESSIONLEN 0x0010
202 const aim_tlv onlinebuddy_tlvs[] = {
203 { AIM_ONLINEBUDDY_USERCLASS, "User class", dissect_aim_tlv_value_userclass },
204 { AIM_ONLINEBUDDY_ONSINCE, "Online since", dissect_aim_tlv_value_uint32 },
205 { AIM_ONLINEBUDDY_IDLETIME, "Idle time (sec)", dissect_aim_tlv_value_uint16 },
206 { AIM_ONLINEBUDDY_STATUS, "Online status", dissect_aim_tlv_value_userstatus },
207 { AIM_ONLINEBUDDY_IPADDR, "User IP Address", dissect_aim_tlv_value_ipv4 },
208 { AIM_ONLINEBUDDY_DCINFO, "DC Info", dissect_aim_tlv_value_dcinfo},
209 { AIM_ONLINEBUDDY_CAPINFO, "Capability Info", dissect_aim_tlv_value_bytes },
210 { AIM_ONLINEBUDDY_MEMBERSINCE, "Member since", dissect_aim_tlv_value_time },
211 { AIM_ONLINEBUDDY_UNKNOWN, "Unknown", dissect_aim_tlv_value_uint16 },
212 { AIM_ONLINEBUDDY_TIMEUPDATE, "Time update", dissect_aim_tlv_value_bytes },
213 { AIM_ONLINEBUDDY_SESSIONLEN, "Session Length (sec)", dissect_aim_tlv_value_uint32 },
214 { AIM_ONLINEBUDDY_ICQSESSIONLEN, "ICQ Session Length (sec)", dissect_aim_tlv_value_uint32 },
215 { 0, "Unknown", NULL }
221 const value_string *subtypes;
224 static GList *families = NULL;
226 #define AIM_MOTD_TLV_MOTD 0x000B
228 const aim_tlv motd_tlvs[] = {
229 { AIM_MOTD_TLV_MOTD, "Message of the day message", dissect_aim_tlv_value_string },
230 { 0, "Unknown", NULL }
233 #define FAMILY_GENERIC_REDIRECT_SERVER_ADDRESS 0x0005
234 #define FAMILY_GENERIC_REDIRECT_AUTH_COOKIE 0x0006
235 #define FAMILY_GENERIC_REDIRECT_FAMILY_ID 0x000D
237 static const aim_tlv aim_fnac_family_generic_redirect_tlv[] = {
238 { FAMILY_GENERIC_REDIRECT_SERVER_ADDRESS, "Server address and (optional) port", dissect_aim_tlv_value_string },
239 { FAMILY_GENERIC_REDIRECT_AUTH_COOKIE, "Authorization cookie", dissect_aim_tlv_value_string },
240 { FAMILY_GENERIC_REDIRECT_FAMILY_ID, "Family ID", dissect_aim_tlv_value_uint16 },
241 { 0, "Unknown", NULL }
244 #define FAMILY_GENERIC_MOTD_MOTDTYPE_MDT_UPGRADE 0x0001
245 #define FAMILY_GENERIC_MOTD_MOTDTYPE_ADV_UPGRADE 0x0002
246 #define FAMILY_GENERIC_MOTD_MOTDTYPE_SYS_BULLETIN 0x0003
247 #define FAMILY_GENERIC_MOTD_MOTDTYPE_NORMAL 0x0004
248 #define FAMILY_GENERIC_MOTD_MOTDTYPE_NEWS 0x0006
250 static const value_string aim_snac_generic_motd_motdtypes[] = {
251 { FAMILY_GENERIC_MOTD_MOTDTYPE_MDT_UPGRADE, "Mandatory Upgrade Needed Notice" },
252 { FAMILY_GENERIC_MOTD_MOTDTYPE_ADV_UPGRADE, "Advisable Upgrade Notice" },
253 { FAMILY_GENERIC_MOTD_MOTDTYPE_SYS_BULLETIN, "AIM/ICQ Service System Announcements" },
254 { FAMILY_GENERIC_MOTD_MOTDTYPE_NORMAL, "Standard Notice" },
255 { FAMILY_GENERIC_MOTD_MOTDTYPE_NEWS, "News from AOL service" },
259 #define CLASS_UNCONFIRMED 0x0001
260 #define CLASS_ADMINISTRATOR 0x0002
261 #define CLASS_AOL 0x0004
262 #define CLASS_COMMERCIAL 0x0008
263 #define CLASS_FREE 0x0010
264 #define CLASS_AWAY 0x0020
265 #define CLASS_ICQ 0x0040
266 #define CLASS_WIRELESS 0x0080
267 #define CLASS_UNKNOWN100 0x0100
268 #define CLASS_UNKNOWN200 0x0200
269 #define CLASS_UNKNOWN400 0x0400
270 #define CLASS_UNKNOWN800 0x0800
272 static int dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
273 static guint get_aim_pdu_len(tvbuff_t *tvb, int offset);
274 static void dissect_aim_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
276 static void dissect_aim_newconn(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree);
277 static void dissect_aim_snac(tvbuff_t *tvb, packet_info *pinfo,
278 int offset, proto_tree *tree, proto_tree *root_tree);
279 static void dissect_aim_flap_err(tvbuff_t *tvb, packet_info *pinfo,
280 int offset, proto_tree *tree);
281 static void dissect_aim_keep_alive(tvbuff_t *tvb, packet_info *pinfo,
282 int offset, proto_tree *tree);
283 static void dissect_aim_close_conn(tvbuff_t *tvb, packet_info *pinfo,
284 int offset, proto_tree *tree);
285 static void dissect_aim_unknown_channel(tvbuff_t *tvb, packet_info *pinfo,
286 int offset, proto_tree *tree);
288 static dissector_table_t subdissector_table;
290 /* Initialize the protocol and registered fields */
291 static int proto_aim = -1;
292 static int hf_aim_cmd_start = -1;
293 static int hf_aim_channel = -1;
294 static int hf_aim_seqno = -1;
295 static int hf_aim_data = -1;
296 static int hf_aim_data_len = -1;
297 static int hf_aim_signon_challenge_len = -1;
298 static int hf_aim_signon_challenge = -1;
299 static int hf_aim_fnac_family = -1;
300 static int hf_aim_fnac_subtype = -1;
301 static int hf_aim_fnac_flags = -1;
302 static int hf_aim_fnac_id = -1;
303 static int hf_aim_infotype = -1;
304 static int hf_aim_buddyname_len = -1;
305 static int hf_aim_buddyname = -1;
306 static int hf_aim_userinfo_warninglevel = -1;
307 static int hf_aim_snac_error = -1;
308 static int hf_aim_tlvcount = -1;
309 static int hf_aim_authcookie = -1;
310 static int hf_aim_userclass_unconfirmed = -1;
311 static int hf_aim_userclass_administrator = -1;
312 static int hf_aim_userclass_aol = -1;
313 static int hf_aim_userclass_commercial = -1;
314 static int hf_aim_userclass_free = -1;
315 static int hf_aim_userclass_away = -1;
316 static int hf_aim_userclass_icq = -1;
317 static int hf_aim_userclass_wireless = -1;
318 static int hf_aim_userclass_unknown100 = -1;
319 static int hf_aim_userclass_unknown200 = -1;
320 static int hf_aim_userclass_unknown400 = -1;
321 static int hf_aim_userclass_unknown800 = -1;
323 /* Initialize the subtree pointers */
324 static gint ett_aim = -1;
325 static gint ett_aim_buddyname= -1;
326 static gint ett_aim_fnac = -1;
327 static gint ett_aim_tlv = -1;
328 static gint ett_aim_userclass = -1;
330 /* desegmentation of AIM over TCP */
331 static gboolean aim_desegment = TRUE;
333 /* Code to actually dissect the packets */
334 static int dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
336 /* check, if this is really an AIM packet, they start with 0x2a */
337 /* XXX - I've seen some stuff starting with 0x5a followed by 0x2a */
339 if(tvb_bytes_exist(tvb, 0, 1) && tvb_get_guint8(tvb, 0) != 0x2a) {
340 /* Not an instant messenger packet, just happened to use the same port */
341 /* XXX - if desegmentation disabled, this might be a continuation
342 packet, not a non-AIM packet */
346 tcp_dissect_pdus(tvb, pinfo, tree, aim_desegment, 6, get_aim_pdu_len,
348 return tvb_length(tvb);
351 static guint get_aim_pdu_len(tvbuff_t *tvb, int offset)
356 * Get the length of the AIM packet.
358 plen = tvb_get_ntohs(tvb, offset + 4);
361 * That length doesn't include the length of the header itself; add that in.
366 static void dissect_aim_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
369 unsigned char hdr_channel; /* channel ID */
370 unsigned short hdr_sequence_no; /* Internal frame sequence number, not needed */
371 unsigned short hdr_data_field_length; /* length of data within frame */
375 /* Set up structures we will need to add the protocol subtree and manage it */
377 proto_tree *aim_tree = NULL;
379 /* Make entries in Protocol column and Info column on summary display */
380 if (check_col(pinfo->cinfo, COL_PROTOCOL))
381 col_set_str(pinfo->cinfo, COL_PROTOCOL, "AIM");
383 if (check_col(pinfo->cinfo, COL_INFO))
384 col_add_str(pinfo->cinfo, COL_INFO, "AOL Instant Messenger");
386 /* get relevant header information */
387 offset += 1; /* XXX - put the identifier into the tree? */
388 hdr_channel = tvb_get_guint8(tvb, offset);
390 hdr_sequence_no = tvb_get_ntohs(tvb, offset);
392 hdr_data_field_length = tvb_get_ntohs(tvb, offset);
395 /* In the interest of speed, if "tree" is NULL, don't do any work not
396 necessary to generate protocol tree items. */
398 ti = proto_tree_add_item(tree, proto_aim, tvb, 0, -1, FALSE);
399 aim_tree = proto_item_add_subtree(ti, ett_aim);
400 proto_tree_add_uint(aim_tree, hf_aim_cmd_start, tvb, 0, 1, '*');
401 proto_tree_add_item(aim_tree, hf_aim_channel, tvb, 1, 1, FALSE);
402 proto_tree_add_uint(aim_tree, hf_aim_seqno, tvb, 2, 2, hdr_sequence_no);
403 proto_tree_add_uint(aim_tree, hf_aim_data_len, tvb, 4, 2, hdr_data_field_length);
409 case CHANNEL_NEW_CONN:
410 dissect_aim_newconn(tvb, pinfo, offset, aim_tree);
412 case CHANNEL_SNAC_DATA:
413 dissect_aim_snac(tvb, pinfo, offset, aim_tree, tree);
415 case CHANNEL_FLAP_ERR:
416 dissect_aim_flap_err(tvb, pinfo, offset, aim_tree);
418 case CHANNEL_CLOSE_CONN:
419 dissect_aim_close_conn(tvb, pinfo, offset, aim_tree);
421 case CHANNEL_KEEP_ALIVE:
422 dissect_aim_keep_alive(tvb, pinfo, offset, aim_tree);
425 dissect_aim_unknown_channel(tvb, pinfo, offset, aim_tree);
431 const char *aim_get_subtypename( guint16 famnum, guint16 subtype )
433 GList *gl = families;
435 struct aim_family *fam = gl->data;
436 if(fam->family == famnum) return match_strval(subtype, fam->subtypes);
444 const char *aim_get_familyname( guint16 famnum )
446 GList *gl = families;
448 struct aim_family *fam = gl->data;
449 if(fam->family == famnum) return fam->name;
456 int aim_get_buddyname( char *name, tvbuff_t *tvb, int len_offset, int name_offset)
458 guint8 buddyname_length;
460 buddyname_length = tvb_get_guint8(tvb, len_offset);
462 if(buddyname_length > MAX_BUDDYNAME_LENGTH ) buddyname_length = MAX_BUDDYNAME_LENGTH;
463 tvb_get_nstringz0(tvb, name_offset, buddyname_length + 1, name);
465 return buddyname_length;
469 void aim_get_message( guchar *msg, tvbuff_t *tvb, int msg_offset, int msg_length)
473 int max, tagchars = 0;
474 int new_offset = msg_offset;
475 int new_length = msg_length;
479 /* make sure nothing bigger than 1000 bytes is printed */
480 if( msg_length > 999 ) return;
482 memset( msg, '\0', 1000);
486 /* loop until HTML tag is reached - quick&dirty way to find start of message
487 * (it is nearly impossible to find the correct start offset for all client versions) */
488 while( (tagchars < 6) && (new_length > 5) )
490 j = tvb_get_guint8(tvb, new_offset);
491 if( ( (j == '<') && (tagchars == 0) ) ||
492 ( (j == 'h') && (tagchars == 1) ) ||
493 ( (j == 'H') && (tagchars == 1) ) ||
494 ( (j == 't') && (tagchars == 2) ) ||
495 ( (j == 'T') && (tagchars == 2) ) ||
496 ( (j == 'm') && (tagchars == 3) ) ||
497 ( (j == 'M') && (tagchars == 3) ) ||
498 ( (j == 'l') && (tagchars == 4) ) ||
499 ( (j == 'L') && (tagchars == 4) ) ||
500 ( (j == '>') && (tagchars == 5) ) ) tagchars++;
505 /* set offset and length of message to after the first HTML tag */
506 msg_offset = new_offset;
507 msg_length = new_length;
508 max = msg_length - 1;
511 /* find the rest of the message until either a </html> is reached or the end of the frame.
512 * All other HTML tags are stripped to display only the raw message (printable characters) */
513 while( (c < max) && (tagchars < 7) )
515 j = tvb_get_guint8(tvb, msg_offset+c);
518 /* make sure this is an HTML tag by checking the order of the chars */
519 if( ( (j == '<') && (tagchars == 0) ) ||
520 ( (j == '/') && (tagchars == 1) ) ||
521 ( (j == 'h') && (tagchars == 2) ) ||
522 ( (j == 'H') && (tagchars == 2) ) ||
523 ( (j == 't') && (tagchars == 3) ) ||
524 ( (j == 'T') && (tagchars == 3) ) ||
525 ( (j == 'm') && (tagchars == 4) ) ||
526 ( (j == 'M') && (tagchars == 4) ) ||
527 ( (j == 'l') && (tagchars == 5) ) ||
528 ( (j == 'L') && (tagchars == 5) ) ||
529 ( (j == '>') && (tagchars == 6) ) ) tagchars++;
532 if( j == '<' ) bracket = TRUE;
533 if( j == '>' ) bracket = FALSE;
534 if( (isprint(j) ) && (bracket == FALSE) && (j != '>'))
546 void aim_init_family(guint16 family, const char *name, const value_string *subtypes)
548 struct aim_family *fam = g_new(struct aim_family, 1);
549 fam->name = g_strdup(name);
550 fam->family = family;
551 fam->subtypes = subtypes;
552 families = g_list_append(families, fam);
555 static void dissect_aim_newconn(tvbuff_t *tvb, packet_info *pinfo,
556 int offset, proto_tree *tree)
558 if (check_col(pinfo->cinfo, COL_INFO))
559 col_add_fstr(pinfo->cinfo, COL_INFO, "New Connection");
561 if (tvb_length_remaining(tvb, offset) > 0) {
562 proto_tree_add_item(tree, hf_aim_authcookie, tvb, offset, 4, FALSE);
564 while(tvb_reported_length_remaining(tvb, offset) > 0) {
565 offset = dissect_aim_tlv(tvb, pinfo, offset, tree, client_tlvs);
569 if (tvb_length_remaining(tvb, offset) > 0)
570 proto_tree_add_item(tree, hf_aim_data, tvb, offset, -1, FALSE);
574 int dissect_aim_snac_error(tvbuff_t *tvb, packet_info *pinfo,
575 int offset, proto_tree *aim_tree)
578 if ((name = match_strval(tvb_get_ntohs(tvb, offset), aim_snac_errors)) != NULL) {
579 if (check_col(pinfo->cinfo, COL_INFO))
580 col_add_fstr(pinfo->cinfo, COL_INFO, name);
583 proto_tree_add_item (aim_tree, hf_aim_snac_error,
584 tvb, offset, 2, FALSE);
585 return tvb_length_remaining(tvb, 2);
588 int dissect_aim_userinfo(tvbuff_t *tvb, packet_info *pinfo,
589 int offset, proto_tree *tree)
591 offset = dissect_aim_buddyname(tvb, pinfo, offset, tree);
593 proto_tree_add_item(tree, hf_aim_userinfo_warninglevel, tvb, offset, 2, FALSE);
596 return dissect_aim_tlv_list(tvb, pinfo, offset, tree, onlinebuddy_tlvs);
599 static void dissect_aim_snac(tvbuff_t *tvb, packet_info *pinfo,
600 int offset, proto_tree *aim_tree, proto_tree *root_tree)
607 struct aiminfo aiminfo;
608 const char *fam_name, *subtype_name;
609 proto_tree *aim_tree_fnac = NULL;
613 orig_offset = offset;
614 family = tvb_get_ntohs(tvb, offset);
615 fam_name = aim_get_familyname(family);
617 subtype = tvb_get_ntohs(tvb, offset);
618 subtype_name = aim_get_subtypename(family, subtype);
620 flags = tvb_get_ntohs(tvb, offset);
622 id = tvb_get_ntohl(tvb, offset);
625 if (check_col(pinfo->cinfo, COL_INFO)) {
626 col_add_fstr(pinfo->cinfo, COL_INFO, "SNAC data");
631 offset = orig_offset;
632 ti1 = proto_tree_add_text(aim_tree, tvb, 6, 10, "FNAC");
633 aim_tree_fnac = proto_item_add_subtree(ti1, ett_aim_fnac);
635 proto_tree_add_text (aim_tree_fnac,
636 tvb, offset, 2, "Family: %s (0x%04x)", fam_name?fam_name:"Unknown", family);
639 proto_tree_add_text (aim_tree_fnac,
640 tvb, offset, 2, "Subtype: %s (0x%04x)", subtype_name?subtype_name:"Unknown", subtype);
643 proto_tree_add_uint(aim_tree_fnac, hf_aim_fnac_flags, tvb, offset,
646 proto_tree_add_uint(aim_tree_fnac, hf_aim_fnac_id, tvb, offset,
651 subtvb = tvb_new_subset(tvb, offset, -1, -1);
652 aiminfo.tcpinfo = pinfo->private_data;
653 aiminfo.family = family;
654 aiminfo.subtype = subtype;
655 pinfo->private_data = &aiminfo;
657 if (check_col(pinfo->cinfo, COL_INFO)) {
658 if(fam_name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", fam_name);
659 else col_append_fstr(pinfo->cinfo, COL_INFO, ", Family: 0x%04x", family);
660 if(subtype_name) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", subtype_name);
661 else col_append_fstr(pinfo->cinfo, COL_INFO, ", Subtype: 0x%04x", subtype);
664 if(tvb_length_remaining(tvb, offset) == 0 || !dissector_try_port(subdissector_table, family, subtvb, pinfo, root_tree)) {
665 /* Show the undissected payload */
666 if (tvb_length_remaining(tvb, offset) > 0)
667 proto_tree_add_item(aim_tree, hf_aim_data, tvb, offset, -1, FALSE);
671 static void dissect_aim_flap_err(tvbuff_t *tvb, packet_info *pinfo,
672 int offset, proto_tree *tree)
674 if (check_col(pinfo->cinfo, COL_INFO)) {
675 col_add_fstr(pinfo->cinfo, COL_INFO, "FLAP error");
678 /* Show the undissected payload */
679 if (tvb_length_remaining(tvb, offset) > 0)
680 proto_tree_add_item(tree, hf_aim_data, tvb, offset, -1, FALSE);
683 static void dissect_aim_keep_alive(tvbuff_t *tvb, packet_info *pinfo,
684 int offset, proto_tree *tree)
686 if (check_col(pinfo->cinfo, COL_INFO)) {
687 col_add_fstr(pinfo->cinfo, COL_INFO, "Keep Alive");
690 /* Show the undissected payload */
691 if (tvb_length_remaining(tvb, offset) > 0)
692 proto_tree_add_item(tree, hf_aim_data, tvb, offset, -1, FALSE);
695 static void dissect_aim_close_conn(tvbuff_t *tvb, packet_info *pinfo,
696 int offset, proto_tree *tree)
698 if (check_col(pinfo->cinfo, COL_INFO)) {
699 col_add_fstr(pinfo->cinfo, COL_INFO, "Close Connection");
702 while(tvb_reported_length_remaining(tvb, offset) > 0) {
703 offset = dissect_aim_tlv(tvb, pinfo, offset, tree, client_tlvs);
707 static void dissect_aim_unknown_channel(tvbuff_t *tvb, packet_info *pinfo,
708 int offset, proto_tree *tree)
710 if (check_col(pinfo->cinfo, COL_INFO)) {
711 col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown Channel");
714 /* Show the undissected payload */
715 if (tvb_length_remaining(tvb, offset) > 0)
716 proto_tree_add_item(tree, hf_aim_data, tvb, offset, -1, FALSE);
719 int dissect_aim_buddyname(tvbuff_t *tvb, packet_info *pinfo _U_, int offset,
722 guint8 buddyname_length = 0;
724 proto_item *ti = NULL;
725 proto_tree *buddy_tree = NULL;
727 buddyname_length = tvb_get_guint8(tvb, offset);
729 buddyname = tvb_get_string(tvb, offset, buddyname_length);
732 ti = proto_tree_add_text(tree, tvb, offset-1, 1+buddyname_length,"Buddy: %s", buddyname);
733 buddy_tree = proto_item_add_subtree(ti, ett_aim_buddyname);
736 proto_tree_add_item(buddy_tree, hf_aim_buddyname_len, tvb, offset-1, 1, FALSE);
737 proto_tree_add_item(buddy_tree, hf_aim_buddyname, tvb, offset, buddyname_length, FALSE);
738 return offset+buddyname_length;
742 int dissect_aim_tlv_value_client_capabilities(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb)
745 return tvb_length(tvb);
748 int dissect_aim_tlv_value_time(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb)
751 return tvb_length(tvb);
754 int dissect_aim_userclass(tvbuff_t *tvb, int offset, int len, proto_item *ti, guint32 flags)
758 entry = proto_item_add_subtree(ti, ett_aim_userclass);
759 proto_tree_add_boolean(entry, hf_aim_userclass_unconfirmed, tvb, offset, len, flags);
760 proto_tree_add_boolean(entry, hf_aim_userclass_administrator, tvb, offset, len, flags);
761 proto_tree_add_boolean(entry, hf_aim_userclass_aol, tvb, offset, len, flags);
762 proto_tree_add_boolean(entry, hf_aim_userclass_commercial, tvb, offset, len, flags);
763 proto_tree_add_boolean(entry, hf_aim_userclass_free, tvb, offset, len, flags);
764 proto_tree_add_boolean(entry, hf_aim_userclass_away, tvb, offset, len, flags);
765 proto_tree_add_boolean(entry, hf_aim_userclass_icq, tvb, offset, len, flags);
766 proto_tree_add_boolean(entry, hf_aim_userclass_wireless, tvb, offset, len, flags);
767 proto_tree_add_boolean(entry, hf_aim_userclass_unknown100, tvb, offset, len, flags);
768 proto_tree_add_boolean(entry, hf_aim_userclass_unknown200, tvb, offset, len, flags);
769 proto_tree_add_boolean(entry, hf_aim_userclass_unknown400, tvb, offset, len, flags);
770 proto_tree_add_boolean(entry, hf_aim_userclass_unknown800, tvb, offset, len, flags);
774 int dissect_aim_tlv_value_userclass(proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb)
776 guint16 value16 = tvb_get_ntohs(tvb, 0);
777 proto_item_set_text(ti, "Value: 0x%04x", value16);
778 return dissect_aim_userclass(tvb, 0, 2, ti, value16);
781 static int dissect_aim_tlv_value_userstatus(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb)
784 return tvb_length(tvb);
787 static int dissect_aim_tlv_value_dcinfo(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb)
790 return tvb_length(tvb);
793 int dissect_aim_tlv_value_string (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb)
796 buf = tvb_get_string(tvb, 0, tvb_length(tvb));
797 proto_item_set_text(ti, "Value: %s", buf);
799 return tvb_length(tvb);
802 int dissect_aim_tlv_value_bytes (proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb _U_)
804 return tvb_length(tvb);
807 int dissect_aim_tlv_value_uint8 (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb){
808 guint8 value8 = tvb_get_guint8(tvb, 0);
809 proto_item_set_text(ti, "Value: %d", value8);
813 int dissect_aim_tlv_value_uint16 (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb){
814 guint16 value16 = tvb_get_ntohs(tvb, 0);
815 proto_item_set_text(ti, "Value: %d", value16);
819 int dissect_aim_tlv_value_ipv4 (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb){
820 /* FIXME: Somewhat more readable format ? */
821 guint32 value32 = tvb_get_ntoh24(tvb, 0);
822 proto_item_set_text(ti, "Value: %d", value32);
826 int dissect_aim_tlv_value_uint32 (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb){
827 guint32 value32 = tvb_get_ntoh24(tvb, 0);
828 proto_item_set_text(ti, "Value: %d", value32);
832 /* Dissect a TLV value */
833 int dissect_aim_tlv(tvbuff_t *tvb, packet_info *pinfo _U_,
834 int offset, proto_tree *tree, const aim_tlv *tlv)
841 proto_tree *tlv_tree;
844 /* Record the starting offset so we can reuse it at the second pass */
845 orig_offset = offset;
847 /* Get the value ID */
848 valueid = tvb_get_ntohs(tvb, offset);
851 /* Figure out which entry applies from the tlv list */
853 while (tmp[i].valueid) {
854 if (tmp[i].valueid == valueid) {
855 /* We found a match */
861 /* At this point, we are either pointing at the correct record, or
862 we didn't find the record, and are pointing at the last item in the
865 length = tvb_get_ntohs(tvb, offset);
870 offset = orig_offset;
872 ti1 = proto_tree_add_text(tree, tvb, offset, length + 4, "TLV: %s", tmp[i].desc);
874 tlv_tree = proto_item_add_subtree(ti1, ett_aim_tlv);
876 proto_tree_add_text(tlv_tree, tvb, offset, 2,
877 "Value ID: %s (0x%04x)", tmp[i].desc, valueid);
880 proto_tree_add_text(tlv_tree, tvb, offset, 2,
881 "Length: %d", length);
884 ti1 = proto_tree_add_text(tlv_tree, tvb, offset, length,
887 if (tmp[i].dissector) {
888 tmp[i].dissector(ti1, valueid, tvb_new_subset(tvb, offset, length, length));
894 /* Return the new length */
898 int dissect_aim_tlv_list(tvbuff_t *tvb, packet_info *pinfo _U_,
899 int offset, proto_tree *tree, const aim_tlv *tlv_table)
901 guint16 i, tlv_count = tvb_get_ntohs(tvb, offset);
902 proto_tree_add_item(tree, hf_aim_tlvcount, tvb, offset, 2, FALSE);
905 for(i = 0; i < tlv_count; i++) {
906 offset = dissect_aim_tlv(tvb, pinfo, offset, tree, tlv_table);
911 /* Register the protocol with Ethereal */
913 proto_register_aim(void)
916 /* Setup list of header fields */
917 static hf_register_info hf[] = {
919 { "Command Start", "aim.cmd_start", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }
922 { "Channel ID", "aim.channel", FT_UINT8, BASE_HEX, VALS(aim_flap_channels), 0x0, "", HFILL }
925 { "Sequence Number", "aim.seqno", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }
927 { &hf_aim_authcookie,
928 { "Authentication Cookie", "aim.authcookie", FT_BYTES, BASE_DEC, NULL, 0x0, "", HFILL },
931 { "Data Field Length", "aim.datalen", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }
934 { "Data", "aim.data", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL }
936 { &hf_aim_signon_challenge_len,
937 { "Signon challenge length", "aim.signon.challengelen", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }
939 { &hf_aim_signon_challenge,
940 { "Signon challenge", "aim.signon.challenge", FT_STRING, BASE_HEX, NULL, 0x0, "", HFILL }
942 { &hf_aim_fnac_family,
943 { "FNAC Family ID", "aim.fnac.family", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }
945 { &hf_aim_fnac_subtype,
946 { "FNAC Subtype ID", "aim.fnac.subtype", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }
948 { &hf_aim_fnac_flags,
949 { "FNAC Flags", "aim.fnac.flags", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }
952 { "FNAC ID", "aim.fnac.id", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }
955 { "Infotype", "aim.infotype", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }
957 { &hf_aim_buddyname_len,
958 { "Buddyname len", "aim.buddynamelen", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }
961 { "Buddy Name", "aim.buddyname", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }
964 { "TLV Count", "aim.tlvcount", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL },
966 { &hf_aim_snac_error,
967 { "SNAC Error", "aim.snac.error", FT_UINT16,
968 BASE_HEX, VALS(aim_snac_errors), 0x0, "", HFILL },
970 { &hf_aim_userclass_unconfirmed,
971 { "AOL Unconfirmed user flag", "aim.userclass.unconfirmed", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_UNCONFIRMED, "", HFILL },
973 { &hf_aim_userclass_administrator,
974 { "AOL Administrator flag", "aim.userclass.administrator", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_ADMINISTRATOR, "", HFILL },
976 { &hf_aim_userclass_aol,
977 { "AOL Staff User Flag", "aim.userclass.staff", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_AOL, "", HFILL },
979 { &hf_aim_userclass_commercial,
980 { "AOL commercial account flag", "aim.userclass.commercial", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_COMMERCIAL, "", HFILL },
982 { &hf_aim_userclass_free,
983 { "ICQ non-commercial account flag", "aim.userclass.noncommercial", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_FREE, "", HFILL },
985 { &hf_aim_userclass_away,
986 { "AOL away status flag", "aim.userclass.away", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_AWAY, "", HFILL },
988 { &hf_aim_userclass_icq,
989 { "ICQ user sign", "aim.userclass.icq", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_ICQ, "", HFILL },
991 { &hf_aim_userclass_wireless,
992 { "AOL wireless user", "aim.userclass.wireless", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_WIRELESS, "", HFILL },
994 { &hf_aim_userclass_unknown100,
995 { "Unknown bit", "aim.userclass.unknown100", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_UNKNOWN100, "", HFILL },
997 { &hf_aim_userclass_unknown200,
998 { "Unknown bit", "aim.userclass.unknown200", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_UNKNOWN200, "", HFILL },
1000 { &hf_aim_userclass_unknown400,
1001 { "Unknown bit", "aim.userclass.unknown400", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_UNKNOWN400, "", HFILL },
1003 { &hf_aim_userclass_unknown800,
1004 { "Unknown bit", "aim.userclass.unknown800", FT_BOOLEAN, 32, TFS(&flags_set_truth), CLASS_UNKNOWN800, "", HFILL },
1006 { &hf_aim_userinfo_warninglevel,
1007 { "Warning Level", "aim.userinfo.warninglevel", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL },
1011 /* Setup protocol subtree array */
1012 static gint *ett[] = {
1019 module_t *aim_module;
1021 /* Register the protocol name and description */
1022 proto_aim = proto_register_protocol("AOL Instant Messenger", "AIM", "aim");
1024 /* Required function calls to register the header fields and subtrees used */
1025 proto_register_field_array(proto_aim, hf, array_length(hf));
1026 proto_register_subtree_array(ett, array_length(ett));
1028 aim_module = prefs_register_protocol(proto_aim, NULL);
1029 prefs_register_bool_preference(aim_module, "desegment",
1030 "Desegment all AIM messages spanning multiple TCP segments",
1031 "Whether the AIM dissector should desegment all messages spanning multiple TCP segments",
1034 subdissector_table = register_dissector_table("aim.family",
1035 "Family ID", FT_UINT16, BASE_HEX);
1039 proto_reg_handoff_aim(void)
1041 dissector_handle_t aim_handle;
1043 aim_handle = new_create_dissector_handle(dissect_aim, proto_aim);
1044 dissector_add("tcp.port", TCP_PORT_AIM, aim_handle);