aboutsummaryrefslogtreecommitdiffstats
path: root/packet-aim.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-01-12 04:58:32 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-01-12 04:58:32 +0000
commit4ce2b6f54c7939a5e5f8e9376332ea3909175d5d (patch)
tree338cdef1203bbd5f30d77fb7c2593dfcaab3bc7e /packet-aim.c
parentdcffc7bc7cffe365f39e1e55282c83e4ceb8d67d (diff)
From Devin Heitmueller:
* Break up dissection into separate functions * Added families not already present (based on GAIM source code) * Added entries from the "generic" family not already present * Started to break families and subtypes into constants instead of having hardcoded values (signon and generic are done, others in progress) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6917 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-aim.c')
-rw-r--r--packet-aim.c1141
1 files changed, 804 insertions, 337 deletions
diff --git a/packet-aim.c b/packet-aim.c
index 10e373c15a..53de90b3f7 100644
--- a/packet-aim.c
+++ b/packet-aim.c
@@ -2,7 +2,7 @@
* Routines for AIM Instant Messenger (OSCAR) dissection
* Copyright 2000, Ralf Hoelzer <ralf@well.com>
*
- * $Id: packet-aim.c,v 1.18 2003/01/11 07:17:37 guy Exp $
+ * $Id: packet-aim.c,v 1.19 2003/01/12 04:58:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -63,30 +63,160 @@
#define FAMILY_TRANSLATE 0x000C
#define FAMILY_CHAT_NAV 0x000D
#define FAMILY_CHAT 0x000E
+#define FAMILY_SSI 0x0013
+#define FAMILY_ICQ 0x0015
#define FAMILY_SIGNON 0x0017
+#define FAMILY_OFT 0xfffe
+
+/* Family Signon */
+#define FAMILY_SIGNON_LOGON 0x0002
+#define FAMILY_SIGNON_LOGON_REPLY 0x0003
+#define FAMILY_SIGNON_SIGNON 0x0006
+#define FAMILY_SIGNON_SIGNON_REPLY 0x0007
+
+/* Family Signon */
+#define FAMILY_GENERIC_ERROR 0x0001
+#define FAMILY_GENERIC_CLIENTREADY 0x0002
+#define FAMILY_GENERIC_SERVERREADY 0x0003
+#define FAMILY_GENERIC_SERVICEREQ 0x0004
+#define FAMILY_GENERIC_REDIRECT 0x0005
+#define FAMILY_GENERIC_RATEINFOREQ 0x0006
+#define FAMILY_GENERIC_RATEINFO 0x0007
+#define FAMILY_GENERIC_RATEINFOACK 0x0008
+#define FAMILY_GENERIC_UNKNOWNx09 0x0009
+#define FAMILY_GENERIC_RATECHANGE 0x000a
+#define FAMILY_GENERIC_SERVERPAUSE 0x000b
+#define FAMILY_GENERIC_SERVERRESUME 0x000d
+#define FAMILY_GENERIC_REQSELFINFO 0x000e
+#define FAMILY_GENERIC_SELFINFO 0x000f
+#define FAMILY_GENERIC_EVIL 0x0010
+#define FAMILY_GENERIC_SETIDLE 0x0011
+#define FAMILY_GENERIC_MIGRATIONREQ 0x0012
+#define FAMILY_GENERIC_MOTD 0x0013
+#define FAMILY_GENERIC_SETPRIVFLAGS 0x0014
+#define FAMILY_GENERIC_WELLKNOWNURL 0x0015
+#define FAMILY_GENERIC_NOP 0x0016
+#define FAMILY_GENERIC_DEFAULT 0xffff
/* messaging */
#define MSG_TO_CLIENT 0x006
#define MSG_FROM_CLIENT 0x007
+static const value_string aim_fnac_family_ids[] = {
+ { FAMILY_GENERIC, "Generic" },
+ { FAMILY_LOCATION, "Location" },
+ { FAMILY_BUDDYLIST, "Buddy List" },
+ { FAMILY_MESSAGING, "Messaging" },
+ { FAMILY_ADVERTS, "Advertisement" },
+ { FAMILY_INVITATION, "Invitation" },
+ { FAMILY_ADMIN, "Admin" },
+ { FAMILY_POPUP, "Popup" },
+ { FAMILY_BOS, "Bos" },
+ { FAMILY_USERLOOKUP, "User Lookup" },
+ { FAMILY_STATS, "Stats" },
+ { FAMILY_TRANSLATE, "Translate" },
+ { FAMILY_CHAT_NAV, "Chat Nav" },
+ { FAMILY_CHAT, "Chat" },
+ { FAMILY_SSI, "Server Stored Info" },
+ { FAMILY_ICQ, "ICQ" },
+ { FAMILY_SIGNON, "Sign-on" },
+ { FAMILY_OFT, "OFT/Rvous" },
+ { 0, NULL }
+};
+
+static const value_string aim_fnac_family_signon[] = {
+ { FAMILY_SIGNON_LOGON, "Logon" },
+ { FAMILY_SIGNON_LOGON_REPLY, "Logon Reply" },
+ { FAMILY_SIGNON_SIGNON, "Sign-on" },
+ { FAMILY_SIGNON_SIGNON_REPLY, "Sign-on Reply" },
+ { 0, NULL }
+};
+
+static const value_string aim_fnac_family_generic[] = {
+ { FAMILY_GENERIC_ERROR, "Error" },
+ { FAMILY_GENERIC_CLIENTREADY , "Client Ready" },
+ { FAMILY_GENERIC_SERVERREADY, "Server Ready" },
+ { FAMILY_GENERIC_SERVICEREQ, "Service Req" },
+ { FAMILY_GENERIC_REDIRECT, "Redirect" },
+ { FAMILY_GENERIC_RATEINFOREQ, "Rate Info Req" },
+ { FAMILY_GENERIC_RATEINFO, "Rate Info" },
+ { FAMILY_GENERIC_RATEINFOACK, "Rate Info Ack" },
+ { FAMILY_GENERIC_UNKNOWNx09, "Unknown" },
+ { FAMILY_GENERIC_RATECHANGE, "Rate Change" },
+ { FAMILY_GENERIC_SERVERPAUSE, "Server Pause" },
+ { FAMILY_GENERIC_SERVERRESUME, "Server Resume" },
+ { FAMILY_GENERIC_REQSELFINFO, "Self Info Req" },
+ { FAMILY_GENERIC_SELFINFO, "Self Info" },
+ { FAMILY_GENERIC_EVIL, "Evil" },
+ { FAMILY_GENERIC_SETIDLE, "Set Idle" },
+ { FAMILY_GENERIC_MIGRATIONREQ, "Migration Req" },
+ { FAMILY_GENERIC_MOTD, "MOTD" },
+ { FAMILY_GENERIC_SETPRIVFLAGS, "Set Privilege Flags" },
+ { FAMILY_GENERIC_WELLKNOWNURL, "Well Known URL" },
+ { FAMILY_GENERIC_NOP, "noop" },
+ { FAMILY_GENERIC_DEFAULT, "Generic Default" },
+ { 0, NULL }
+};
+
static void dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void get_message( guchar *msg, tvbuff_t *tvb, int msg_offset, int msg_length);
static int get_buddyname( char *name, tvbuff_t *tvb, int len_offset, int name_offset);
-static void dissect_aim_signon_reply(tvbuff_t *tvb, int offset, proto_tree *tree);
-static void dissect_aim_request_user_information(tvbuff_t *tvb, int offset, proto_tree *tree);
-static void dissect_aim_user_information(tvbuff_t *tvb, int offset, proto_tree *tree);
+static void dissect_aim_newconn(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree);
+static void dissect_aim_snac(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree);
+static void dissect_aim_snac_fnac_subtype(tvbuff_t *tvb, int offset,
+ proto_tree *tree, guint16 family);
+static void dissect_aim_snac_signon(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype);
+static void dissect_aim_snac_signon_logon(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree);
+static void dissect_aim_snac_signon_logon_reply(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree);
+static void dissect_aim_snac_signon_signon(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree);
+static void dissect_aim_snac_signon_signon_reply(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree);
+static void dissect_aim_snac_generic(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype);
+static void dissect_aim_snac_buddylist(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype);
+static void dissect_aim_snac_location(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype);
+static void dissect_aim_snac_location_request_user_information(tvbuff_t *tvb, int offset, proto_tree *tree);
+static void dissect_aim_snac_location_user_information(tvbuff_t *tvb, int offset, proto_tree *tree);
+static void dissect_aim_snac_adverts(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype);
+static void dissect_aim_snac_userlookup(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype);
+static void dissect_aim_snac_chat(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype);
+static void dissect_aim_snac_messaging(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype);
+static void dissect_aim_flap_err(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree);
+static void dissect_aim_close_conn(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree);
+static void dissect_aim_unknown_channel(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree);
/* Initialize the protocol and registered fields */
static int proto_aim = -1;
static int hf_aim_cmd_start = -1;
static int hf_aim_channel = -1;
static int hf_aim_seqno = -1;
+static int hf_aim_data = -1;
static int hf_aim_data_len = -1;
static int hf_aim_signon_challenge_len = -1;
static int hf_aim_signon_challenge = -1;
static int hf_aim_fnac_family = -1;
static int hf_aim_fnac_subtype = -1;
+static int hf_aim_fnac_subtype_signon = -1;
+static int hf_aim_fnac_subtype_generic = -1;
static int hf_aim_fnac_flags = -1;
static int hf_aim_fnac_id = -1;
static int hf_aim_infotype = -1;
@@ -107,27 +237,19 @@ static void dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
unsigned short hdr_sequence_no; /* Internal frame sequence number, not needed */
unsigned short hdr_data_field_length; /* length of data within frame */
- guint16 family;
- guint16 subtype;
- guint16 flags;
- guint32 id;
- guint8 buddyname_length = 0;
- char buddyname[MAX_BUDDYNAME_LENGTH];
- guchar msg[1000];
- int offset;
+ int offset=0;
/* Set up structures we will need to add the protocol subtree and manage it */
proto_item *ti;
- proto_item *ti1;
proto_tree *aim_tree = NULL;
- proto_tree *aim_tree_fnac = NULL;
/* check, if this is really an AIM packet, they start with 0x2a */
- if(!(tvb_get_guint8(tvb, 0) == 0x2a)) {
+ if(!(tvb_get_guint8(tvb, offset) == 0x2a)) {
/* Not an instant messenger packet, just happened to use the same port */
return;
}
+ offset += 1;
/* Make entries in Protocol column and Info column on summary display */
if (check_col(pinfo->cinfo, COL_PROTOCOL))
@@ -136,11 +258,13 @@ static void dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO, "AOL Instant Messenger");
-/* get relevant header information */
-
- hdr_channel = tvb_get_guint8(tvb, 1);
- hdr_sequence_no = tvb_get_ntohs(tvb, 2);
- hdr_data_field_length = tvb_get_ntohs(tvb, 4);
+ /* get relevant header information */
+ hdr_channel = tvb_get_guint8(tvb, offset);
+ offset += 1;
+ hdr_sequence_no = tvb_get_ntohs(tvb, offset);
+ offset += 2;
+ hdr_data_field_length = tvb_get_ntohs(tvb, offset);
+ offset += 2;
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
@@ -155,334 +279,26 @@ static void dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
-
-
switch(hdr_channel)
{
/* New connection request */
case CHANNEL_NEW_CONN:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "New Connection");
+ dissect_aim_newconn(tvb, pinfo, offset, aim_tree);
break;
-
- /* SNAC channel. Most packets are of this type, such as messages or buddy list
- * management.
- */
case CHANNEL_SNAC_DATA:
- family = tvb_get_ntohs(tvb, 6);
- subtype = tvb_get_ntohs(tvb, 8);
- flags = tvb_get_ntohs(tvb, 10);
- id = tvb_get_ntohl(tvb, 12);
-
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "SNAC data");
- }
- if( tree )
- {
- ti1 = proto_tree_add_text(aim_tree, tvb, 6, 10, "FNAC");
- aim_tree_fnac = proto_item_add_subtree(ti1, ett_aim_fnac);
- proto_tree_add_uint(aim_tree_fnac, hf_aim_fnac_family, tvb, 6, 2, family);
- proto_tree_add_uint(aim_tree_fnac, hf_aim_fnac_subtype, tvb, 8, 2, subtype);
- proto_tree_add_uint(aim_tree_fnac, hf_aim_fnac_flags, tvb, 10, 2, flags);
- proto_tree_add_uint(aim_tree_fnac, hf_aim_fnac_id, tvb, 12, 4, id);
- }
-
- offset = 16;
-
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Family: 0x%04x - Subtype: 0x%04x (unknown)", family, subtype);
-
- switch(family)
- {
- case FAMILY_SIGNON:
- switch(subtype)
- {
- case 0x0002:
- buddyname_length = get_buddyname( buddyname, tvb, 19, 20 );
-
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Login");
- col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", buddyname);
- }
-
- if( tree )
- {
- proto_tree_add_text(aim_tree_fnac, tvb, 20, buddyname_length, "Screen Name: %s", buddyname);
- }
-
- break;
- case 0x0003:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Login information reply");
- break;
- case 0x0006:
- buddyname_length = get_buddyname( buddyname, tvb, 19, 20 );
-
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Sign-on");
- col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", buddyname);
- }
-
- if( tree )
- {
- proto_tree_add_text(aim_tree_fnac, tvb, 20, buddyname_length, "Screen Name: %s", buddyname);
- }
-
- break;
- case 0x0007:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Sign-on reply");
- dissect_aim_signon_reply(tvb, offset, aim_tree);
- break;
- }
- break;
-
- case FAMILY_GENERIC:
- switch(subtype)
- {
- case 0x0002:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Client is now online and ready for normal function");
- break;
- case 0x0003:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Server is now ready for normal functions");
- break;
- case 0x0004:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Request for new service (server will redirect client)");
- break;
- case 0x0005:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Redirect response");
- break;
- case 0x0006:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Request Rate Information");
- break;
- case 0x0007:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Rate information response");
- break;
- case 0x0008:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Rate Information Response Ack");
- break;
- case 0x0016:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "No-op");
- break;
- }
- break;
-
- case FAMILY_BUDDYLIST:
- switch(subtype)
- {
- case 0x0001:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Buddylist - Error");
- break;
-
- case 0x0002:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Request Rights information");
- break;
-
- case 0x0003:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Rights information");
- break;
-
- case 0x0004:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Add to Buddylist");
- break;
-
- case 0x0005:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Remove from Buddylist");
- break;
-
- case 0x000b:
- buddyname_length = get_buddyname( buddyname, tvb, 16, 17 );
-
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Oncoming Buddy");
- col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", buddyname);
- }
-
- if( tree )
- {
- proto_tree_add_text(aim_tree_fnac, tvb, 17, buddyname_length, "Screen Name: %s", buddyname);
- }
-
- break;
-
- case 0x000c:
-
- buddyname_length = get_buddyname( buddyname, tvb, 16, 17 );
-
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Offgoing Buddy");
- col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", buddyname);
- }
-
- if( tree )
- {
- proto_tree_add_text(aim_tree_fnac, tvb, 17, buddyname_length, "Screen Name: %s", buddyname);
- }
-
-
- break;
- }
- break;
-
- case FAMILY_LOCATION:
- switch(subtype)
- {
- case 0x0001:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Location - Error");
- break;
- case 0x0002:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Request Rights Information");
- break;
- case 0x0003:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Rights Information");
- break;
- case 0x0004:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Set User Information");
- break;
- case 0x0005:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Request User Information");
- dissect_aim_request_user_information(tvb, offset, aim_tree);
- break;
- case 0x0006:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "User Information");
- dissect_aim_user_information(tvb, offset, aim_tree);
- break;
- case 0x0007:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Watcher Subrequest");
- break;
- case 0x0008:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Watcher Notification");
- break;
- }
- break;
-
- case FAMILY_ADVERTS:
- switch(subtype)
- {
- case 0x0001:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Advertisements - Error");
- break;
- case 0x0002:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Advertisement Request");
- break;
- case 0x0003:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Advertisement data (GIF)");
- break;
- }
- break;
-
- case FAMILY_USERLOOKUP:
- switch(subtype)
- {
- case 0x0001:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Search - Error (could be: not found)");
- break;
- case 0x0002:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Search for Screen Name by e-mail");
- break;
- case 0x0003:
- if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "Screen Name Search Result");
- break;
- }
- break;
-
- case FAMILY_CHAT:
- switch(subtype)
- {
- case 0x005:
- /* channel message from client */
- get_message( msg, tvb, 40 + buddyname_length, tvb_length(tvb) - 40 - buddyname_length );
-
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Chat Message ");
- col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
- }
- break;
-
- case 0x006:
- /* channel message to client */
- buddyname_length = get_buddyname( buddyname, tvb, 30, 31 );
- get_message( msg, tvb, 36 + buddyname_length, tvb_length(tvb) - 36 - buddyname_length );
-
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Chat Message ");
- col_append_fstr(pinfo->cinfo, COL_INFO, "from: %s", buddyname);
- col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
- }
-
- if( tree )
- {
- proto_tree_add_text(aim_tree_fnac, tvb, 31, buddyname_length, "Screen Name: %s", buddyname);
- }
- break;
- }
- break;
-
-
- case FAMILY_MESSAGING:
- switch(subtype)
- {
- case MSG_TO_CLIENT:
- buddyname_length = get_buddyname( buddyname, tvb, 26, 27 );
-
- get_message( msg, tvb, 36 + buddyname_length, tvb_length(tvb) - 36 - buddyname_length );
-
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Message ");
- col_append_fstr(pinfo->cinfo, COL_INFO, "to: %s", buddyname);
- col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
- }
-
- if( tree )
- {
- proto_tree_add_text(aim_tree_fnac, tvb, 27, buddyname_length, "Screen Name: %s", buddyname);
- }
-
- break;
-
- case MSG_FROM_CLIENT:
- buddyname_length = get_buddyname( buddyname, tvb, 26, 27 );
-
- get_message( msg, tvb, 36 + buddyname_length, tvb_length(tvb) - 36 - buddyname_length);
-
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Message");
- col_append_fstr(pinfo->cinfo, COL_INFO, " from: %s", buddyname);
-
- col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
- }
-
- if( tree )
- {
- proto_tree_add_text(aim_tree_fnac, tvb, 27, buddyname_length, "Screen Name: %s", buddyname);
- }
- break;
- }
-
- break;
- }
-
-
-
+ dissect_aim_snac(tvb, pinfo, offset, aim_tree);
break;
-
case CHANNEL_FLAP_ERR:
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "FLAP error");
- }
+ dissect_aim_flap_err(tvb, pinfo, offset, aim_tree);
break;
-
case CHANNEL_CLOSE_CONN:
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Close Connection");
- }
+ dissect_aim_close_conn(tvb, pinfo, offset, aim_tree);
break;
-
default:
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown Channel: %d", hdr_channel );
- }
+ dissect_aim_unknown_channel(tvb, pinfo, offset, aim_tree);
break;
}
-
-
}
@@ -577,10 +393,193 @@ static void get_message( guchar *msg, tvbuff_t *tvb, int msg_offset, int msg_len
}
}
-static void dissect_aim_signon_reply(tvbuff_t *tvb, int offset, proto_tree *tree)
+static void dissect_aim_newconn(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree)
+{
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "New Connection");
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
+}
+
+static void dissect_aim_snac(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *aim_tree)
+{
+ guint16 family;
+ guint16 subtype;
+ guint16 flags;
+ guint32 id;
+ proto_item *ti1;
+ proto_tree *aim_tree_fnac = NULL;
+ int orig_offset;
+
+ orig_offset = offset;
+ family = tvb_get_ntohs(tvb, offset);
+ offset += 2;
+ subtype = tvb_get_ntohs(tvb, offset);
+ offset += 2;
+ flags = tvb_get_ntohs(tvb, offset);
+ offset += 2;
+ id = tvb_get_ntohl(tvb, offset);
+ offset += 4;
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "SNAC data");
+ }
+ if( aim_tree )
+ {
+ offset = orig_offset;
+ ti1 = proto_tree_add_text(aim_tree, tvb, 6, 10, "FNAC");
+ aim_tree_fnac = proto_item_add_subtree(ti1, ett_aim_fnac);
+
+ proto_tree_add_item (aim_tree_fnac, hf_aim_fnac_family,
+ tvb, offset, 2, FALSE);
+ offset += 2;
+
+ /* Dissect the subtype based on the family */
+ dissect_aim_snac_fnac_subtype(tvb, offset, aim_tree_fnac, family);
+ offset += 2;
+
+ proto_tree_add_uint(aim_tree_fnac, hf_aim_fnac_flags, tvb, offset,
+ 2, flags);
+ offset += 2;
+ proto_tree_add_uint(aim_tree_fnac, hf_aim_fnac_id, tvb, offset,
+ 4, id);
+ offset += 4;
+ }
+
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Family: %s",
+ val_to_str(family, aim_fnac_family_ids,
+ "Unknown Family ID"));
+
+ switch(family)
+ {
+ case FAMILY_SIGNON:
+ dissect_aim_snac_signon(tvb, pinfo, offset, aim_tree, subtype);
+ break;
+ case FAMILY_GENERIC:
+ dissect_aim_snac_generic(tvb, pinfo, offset, aim_tree, subtype);
+ break;
+ case FAMILY_BUDDYLIST:
+ dissect_aim_snac_buddylist(tvb, pinfo, offset, aim_tree, subtype);
+ break;
+ case FAMILY_LOCATION:
+ dissect_aim_snac_location(tvb, pinfo, offset, aim_tree, subtype);
+ break;
+ case FAMILY_ADVERTS:
+ dissect_aim_snac_adverts(tvb, pinfo, offset, aim_tree, subtype);
+ break;
+ case FAMILY_USERLOOKUP:
+ dissect_aim_snac_userlookup(tvb, pinfo, offset, aim_tree, subtype);
+ break;
+ case FAMILY_CHAT:
+ dissect_aim_snac_chat(tvb, pinfo, offset, aim_tree, subtype);
+ break;
+ case FAMILY_MESSAGING:
+ dissect_aim_snac_messaging(tvb, pinfo, offset, aim_tree, subtype);
+ break;
+ }
+}
+
+static void dissect_aim_snac_signon(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype)
+{
+ switch(subtype)
+ {
+ case FAMILY_SIGNON_LOGON:
+ dissect_aim_snac_signon_logon(tvb, pinfo, offset, tree);
+ break;
+ case FAMILY_SIGNON_LOGON_REPLY:
+ dissect_aim_snac_signon_logon_reply(tvb, pinfo, offset, tree);
+ break;
+ case FAMILY_SIGNON_SIGNON:
+ dissect_aim_snac_signon_signon(tvb, pinfo, offset, tree);
+ break;
+ case FAMILY_SIGNON_SIGNON_REPLY:
+ dissect_aim_snac_signon_signon_reply(tvb, pinfo, offset, tree);
+ break;
+ }
+}
+
+static void dissect_aim_snac_signon_logon(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree)
+{
+ guint8 buddyname_length = 0;
+ char buddyname[MAX_BUDDYNAME_LENGTH];
+
+ /* Info Type */
+ proto_tree_add_item(tree, hf_aim_infotype, tvb, offset, 2, FALSE);
+ offset += 2;
+
+ /* Unknown */
+ offset += 1;
+
+ /* Buddy Name */
+ buddyname_length = get_buddyname( buddyname, tvb, offset, offset + 1 );
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Logon, Username: %s",
+ buddyname);
+ }
+
+ if(tree) {
+ proto_tree_add_text(tree, tvb, offset + 1, buddyname_length,
+ "Screen Name: %s", buddyname);
+ }
+ offset += buddyname_length + 1;
+}
+
+static void dissect_aim_snac_signon_logon_reply(tvbuff_t *tvb,
+ packet_info *pinfo,
+ int offset, proto_tree *tree)
+{
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Login information reply");
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
+}
+
+static void dissect_aim_snac_signon_signon(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree)
+{
+ guint8 buddyname_length = 0;
+ char buddyname[MAX_BUDDYNAME_LENGTH];
+
+ /* Info Type */
+ proto_tree_add_item(tree, hf_aim_infotype, tvb, offset, 2, FALSE);
+ offset += 2;
+
+ /* Unknown */
+ offset += 1;
+
+ /* Buddy Name */
+ buddyname_length = get_buddyname( buddyname, tvb, offset, offset + 1 );
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Username: %s", buddyname);
+ }
+
+ if(tree) {
+ proto_tree_add_text(tree, tvb, offset + 1, buddyname_length,
+ "Screen Name: %s", buddyname);
+ }
+
+ offset += buddyname_length + 1;
+}
+
+static void dissect_aim_snac_signon_signon_reply(tvbuff_t *tvb,
+ packet_info *pinfo,
+ int offset, proto_tree *tree)
{
guint16 challenge_length = 0;
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Sign-on reply");
+
/* Logon Challenge Length */
challenge_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_aim_signon_challenge_len, tvb, offset, 2, FALSE);
@@ -591,7 +590,222 @@ static void dissect_aim_signon_reply(tvbuff_t *tvb, int offset, proto_tree *tree
offset += challenge_length;
}
-static void dissect_aim_request_user_information(tvbuff_t *tvb, int offset, proto_tree *tree)
+static void dissect_aim_snac_generic(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype)
+{
+ switch(subtype)
+ {
+ case 0x0001:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Generic Error");
+ break;
+ case 0x0002:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "Client is now online and ready for normal function");
+ break;
+ case 0x0003:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "Server is now ready for normal functions");
+ break;
+ case 0x0004:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "Request for new service (server will redirect client)");
+ break;
+ case 0x0005:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Redirect response");
+ break;
+ case 0x0006:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Request Rate Information");
+ break;
+ case 0x0007:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Rate information response");
+ break;
+ case 0x0008:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Rate Information Response Ack");
+ break;
+ case 0x000a:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Rate Change");
+ break;
+ case 0x000b:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Server Pause");
+ break;
+ case 0x000d:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Server Resume");
+ break;
+ case 0x000e:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Request Self Info");
+ break;
+ case 0x000f:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Self Info");
+ break;
+ case 0x0010:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Evil");
+ break;
+ case 0x0011:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Set Idle");
+ break;
+ case 0x0012:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Request Migration");
+ break;
+ case 0x0013:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "MOTD");
+ break;
+ case 0x0014:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Set Privilege Flags");
+ break;
+ case 0x0015:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Well Known URL");
+ break;
+ case 0x0016:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "No-op");
+ break;
+ case 0xffff:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Generic Default");
+ break;
+ }
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
+}
+
+static void dissect_aim_snac_buddylist(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype)
+{
+ guint8 buddyname_length = 0;
+ char buddyname[MAX_BUDDYNAME_LENGTH];
+
+ switch(subtype)
+ {
+ case 0x0001:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Buddylist - Error");
+ break;
+
+ case 0x0002:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Request Rights information");
+ break;
+
+ case 0x0003:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Rights information");
+ break;
+
+ case 0x0004:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Add to Buddylist");
+ break;
+
+ case 0x0005:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Remove from Buddylist");
+ break;
+
+ case 0x000b:
+ buddyname_length = get_buddyname( buddyname, tvb, offset, offset + 1 );
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Oncoming Buddy");
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", buddyname);
+ }
+
+ if (tree) {
+ proto_tree_add_text(tree, tvb, offset + 1, buddyname_length,
+ "Screen Name: %s", buddyname);
+ }
+ offset += buddyname_length + 1;
+ break;
+
+ case 0x000c:
+ buddyname_length = get_buddyname( buddyname, tvb, offset, offset + 1 );
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Offgoing Buddy");
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", buddyname);
+ }
+
+ if (tree) {
+ proto_tree_add_text(tree, tvb, offset + 1, buddyname_length,
+ "Screen Name: %s", buddyname);
+ }
+ offset += buddyname_length + 1;
+ break;
+ }
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
+}
+
+static void dissect_aim_snac_location(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype)
+{
+ switch(subtype)
+ {
+ case 0x0001:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Location - Error");
+ break;
+ case 0x0002:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Request Rights Information");
+ break;
+ case 0x0003:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Rights Information");
+ break;
+ case 0x0004:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Set User Information");
+ break;
+ case 0x0005:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Request User Information");
+ dissect_aim_snac_location_request_user_information(tvb, offset, tree);
+ break;
+ case 0x0006:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "User Information");
+ dissect_aim_snac_location_user_information(tvb, offset, tree);
+ break;
+ case 0x0007:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Watcher Subrequest");
+ break;
+ case 0x0008:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Watcher Notification");
+ break;
+ }
+}
+
+static void dissect_aim_snac_location_request_user_information(tvbuff_t *tvb,
+ int offset,
+ proto_tree *tree)
{
guint8 buddyname_length = 0;
@@ -607,9 +821,14 @@ static void dissect_aim_request_user_information(tvbuff_t *tvb, int offset, prot
/* Buddy name */
proto_tree_add_item(tree, hf_aim_buddyname, tvb, offset, buddyname_length, FALSE);
offset += buddyname_length;
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
}
-static void dissect_aim_user_information(tvbuff_t *tvb, int offset, proto_tree *tree)
+static void dissect_aim_snac_location_user_information(tvbuff_t *tvb,
+ int offset, proto_tree *tree)
{
guint8 buddyname_length = 0;
guint16 tlv_count = 0;
@@ -631,6 +850,245 @@ static void dissect_aim_user_information(tvbuff_t *tvb, int offset, proto_tree *
tlv_count = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_aim_userinfo_tlvcount, tvb, offset, 2, FALSE);
offset += 2;
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
+}
+
+static void dissect_aim_snac_adverts(tvbuff_t *tvb _U_,
+ packet_info *pinfo _U_,
+ int offset _U_, proto_tree *tree _U_,
+ guint16 subtype)
+{
+ switch(subtype)
+ {
+ case 0x0001:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Advertisements - Error");
+ break;
+ case 0x0002:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Advertisement Request");
+ break;
+ case 0x0003:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Advertisement data (GIF)");
+ break;
+ }
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
+}
+
+static void dissect_aim_snac_userlookup(tvbuff_t *tvb _U_, packet_info *pinfo,
+ int offset _U_, proto_tree *tree _U_,
+ guint16 subtype)
+{
+ switch(subtype)
+ {
+ case 0x0001:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "Search - Error (could be: not found)");
+ break;
+ case 0x0002:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "Search for Screen Name by e-mail");
+ break;
+ case 0x0003:
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Screen Name Search Result");
+ break;
+ }
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
+}
+
+static void dissect_aim_snac_chat(tvbuff_t *tvb, packet_info *pinfo,
+ int offset _U_, proto_tree *tree,
+ guint16 subtype)
+{
+ guint8 buddyname_length = 0;
+ char buddyname[MAX_BUDDYNAME_LENGTH];
+ guchar msg[1000];
+
+ switch(subtype)
+ {
+ case 0x005:
+ /* channel message from client */
+ get_message( msg, tvb, 40 + buddyname_length, tvb_length(tvb)
+ - 40 - buddyname_length );
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Chat Message ");
+ col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
+ }
+ break;
+
+ case 0x006:
+ /* channel message to client */
+ buddyname_length = get_buddyname( buddyname, tvb, 30, 31 );
+ get_message( msg, tvb, 36 + buddyname_length, tvb_length(tvb)
+ - 36 - buddyname_length );
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Chat Message ");
+ col_append_fstr(pinfo->cinfo, COL_INFO, "from: %s", buddyname);
+ col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
+ }
+
+ if(tree) {
+ proto_tree_add_text(tree, tvb, 31, buddyname_length,
+ "Screen Name: %s", buddyname);
+ }
+ break;
+ }
+}
+
+static void dissect_aim_snac_messaging(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree,
+ guint16 subtype)
+{
+ guint8 buddyname_length = 0;
+ char buddyname[MAX_BUDDYNAME_LENGTH];
+ guchar msg[1000];
+
+ switch(subtype)
+ {
+ case MSG_TO_CLIENT:
+
+ /* Unknown */
+ offset += 10;
+
+ buddyname_length = get_buddyname( buddyname, tvb, offset, offset + 1 );
+
+ /* djh - My test suggest that this is broken. Need to give this a
+ closer look @@@@@@@@@ */
+ get_message( msg, tvb, 36 + buddyname_length, tvb_length(tvb) - 36
+ - buddyname_length );
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Message ");
+ col_append_fstr(pinfo->cinfo, COL_INFO, "to: %s", buddyname);
+ col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
+ }
+
+ if(tree) {
+ proto_tree_add_text(tree, tvb, 27, buddyname_length,
+ "Screen Name: %s", buddyname);
+ }
+
+ break;
+
+ case MSG_FROM_CLIENT:
+
+ /* Unknown */
+ offset += 10;
+
+ buddyname_length = get_buddyname( buddyname, tvb, offset, offset + 1 );
+
+ /* djh - My test suggest that this is broken. Need to give this a
+ closer look @@@@@@@@@ */
+ get_message( msg, tvb, 36 + buddyname_length, tvb_length(tvb) - 36
+ - buddyname_length);
+
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Message");
+ col_append_fstr(pinfo->cinfo, COL_INFO, " from: %s", buddyname);
+
+ col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
+ }
+
+ if(tree) {
+ proto_tree_add_text(tree, tvb, 27, buddyname_length,
+ "Screen Name: %s", buddyname);
+ }
+ break;
+ }
+}
+
+static void dissect_aim_snac_fnac_subtype(tvbuff_t *tvb, int offset,
+ proto_tree *tree, guint16 family)
+{
+ /* Since the subtypes differ by family, we need to display the correct
+ subtype based on the family. If we don't know the family, or we do
+ not have the subtypes enumerated for a known family, we just dump the
+ subtype as-is */
+
+ switch (family)
+ {
+ case FAMILY_GENERIC:
+ proto_tree_add_item (tree, hf_aim_fnac_subtype_generic,
+ tvb, offset, 2, FALSE);
+ break;
+ case FAMILY_LOCATION:
+ case FAMILY_BUDDYLIST:
+ case FAMILY_MESSAGING:
+ case FAMILY_ADVERTS:
+ case FAMILY_INVITATION:
+ case FAMILY_ADMIN:
+ case FAMILY_POPUP:
+ case FAMILY_BOS:
+ case FAMILY_USERLOOKUP:
+ case FAMILY_STATS:
+ case FAMILY_TRANSLATE:
+ case FAMILY_CHAT_NAV:
+ case FAMILY_CHAT:
+ case FAMILY_SSI:
+ case FAMILY_ICQ:
+ proto_tree_add_item(tree, hf_aim_fnac_subtype, tvb, offset, 2, FALSE);
+ break;
+ case FAMILY_SIGNON:
+ proto_tree_add_item (tree, hf_aim_fnac_subtype_signon,
+ tvb, offset, 2, FALSE);
+ break;
+ case FAMILY_OFT:
+ default:
+ proto_tree_add_item(tree, hf_aim_fnac_subtype, tvb, offset, 2, FALSE);
+ break;
+
+ }
+}
+
+static void dissect_aim_flap_err(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree)
+{
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "FLAP error");
+ }
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
+}
+
+static void dissect_aim_close_conn(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree)
+{
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Close Connection");
+ }
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
+}
+
+static void dissect_aim_unknown_channel(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree)
+{
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown Channel");
+ }
+
+ /* Show the undissected payload */
+ proto_tree_add_item(tree, hf_aim_data, tvb, offset,
+ tvb_length_remaining (tvb, offset), FALSE);
}
/* Register the protocol with Ethereal */
@@ -652,6 +1110,9 @@ proto_register_aim(void)
{ &hf_aim_data_len,
{ "Data Field Length", "aim.datalen", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }
},
+ { &hf_aim_data,
+ { "Data", "aim.data", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL }
+ },
{ &hf_aim_signon_challenge_len,
{ "Signon challenge length", "aim.signon.challengelen", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }
},
@@ -659,11 +1120,17 @@ proto_register_aim(void)
{ "Signon challenge", "aim.signon.challenge", FT_STRING, BASE_HEX, NULL, 0x0, "", HFILL }
},
{ &hf_aim_fnac_family,
- { "FNAC Family ID", "aim.fnac.family", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }
+ { "FNAC Family ID", "aim.fnac.family", FT_UINT16, BASE_HEX, VALS(aim_fnac_family_ids), 0x0, "", HFILL }
},
{ &hf_aim_fnac_subtype,
{ "FNAC Subtype ID", "aim.fnac.subtype", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }
},
+ { &hf_aim_fnac_subtype_signon,
+ { "FNAC Subtype ID", "aim.fnac.subtype", FT_UINT16, BASE_HEX, VALS(aim_fnac_family_signon), 0x0, "", HFILL }
+ },
+ { &hf_aim_fnac_subtype_generic,
+ { "FNAC Subtype ID", "aim.fnac.subtype", FT_UINT16, BASE_HEX, VALS(aim_fnac_family_generic), 0x0, "", HFILL }
+ },
{ &hf_aim_fnac_flags,
{ "FNAC Flags", "aim.fnac.flags", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }
},