aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-09-22 08:04:40 +0000
committerGuy Harris <guy@alum.mit.edu>2004-09-22 08:04:40 +0000
commit8dedbeed1cd700846478d9de90e0d3b2e364d684 (patch)
treeb7eea02b640b90ba06f02d8699f52480ce810446
parentcc6754d659239dc7a1265351be5ee5c4a30171a2 (diff)
From Jelmer Vernooij:
- Dissect the DC (Direct Connection) info structure - Dissect the complete buddy icon family (you can now save buddy icons as .JPG's/.PNG's directly from the capture using the "Export selected bytes..." option!) - Add a function that dissects a sequence of TLV's instead of having while() loops all over the place. svn path=/trunk/; revision=12063
-rw-r--r--epan/dissectors/packet-aim-admin.c11
-rw-r--r--epan/dissectors/packet-aim-bos.c12
-rw-r--r--epan/dissectors/packet-aim-buddylist.c6
-rw-r--r--epan/dissectors/packet-aim-generic.c23
-rw-r--r--epan/dissectors/packet-aim-invitation.c6
-rw-r--r--epan/dissectors/packet-aim-location.c18
-rw-r--r--epan/dissectors/packet-aim-messaging.c6
-rw-r--r--epan/dissectors/packet-aim-ssi.c6
-rw-r--r--epan/dissectors/packet-aim-sst.c120
-rw-r--r--epan/dissectors/packet-aim-userlookup.c6
-rw-r--r--epan/dissectors/packet-aim.c119
-rw-r--r--epan/dissectors/packet-aim.h1
12 files changed, 241 insertions, 93 deletions
diff --git a/epan/dissectors/packet-aim-admin.c b/epan/dissectors/packet-aim-admin.c
index eb36b8afe0..774868d6e4 100644
--- a/epan/dissectors/packet-aim-admin.c
+++ b/epan/dissectors/packet-aim-admin.c
@@ -77,21 +77,14 @@ static int dissect_aim_admin_accnt_info_repl(tvbuff_t *tvb, packet_info *pinfo,
static int dissect_aim_admin_info_change_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *admin_tree)
{
- int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, admin_tree, client_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, admin_tree, client_tlvs);
}
static int dissect_aim_admin_cfrm_repl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *admin_tree)
{
int offset = 0;
proto_tree_add_uint(admin_tree, hf_admin_confirm_status, tvb, offset, 2, tvb_get_ntohs(tvb, offset)); offset+=2;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, admin_tree, client_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, offset, admin_tree, client_tlvs);
}
static const aim_subtype aim_fnac_family_admin[] = {
diff --git a/epan/dissectors/packet-aim-bos.c b/epan/dissectors/packet-aim-bos.c
index 35391546f8..bab1b54300 100644
--- a/epan/dissectors/packet-aim-bos.c
+++ b/epan/dissectors/packet-aim-bos.c
@@ -81,15 +81,13 @@ static int dissect_aim_bos_set_group_perm(tvbuff_t *tvb, packet_info *pinfo _U_,
return dissect_aim_userclass(tvb, offset, 4, ti, userclass);
}
-static int dissect_aim_bos_rights(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bos_tree) {
- int offset = 0;
- while(tvb_reported_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, bos_tree, privacy_tlvs);
- }
- return offset;
+static int dissect_aim_bos_rights(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bos_tree)
+{
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, bos_tree, privacy_tlvs);
}
-static int dissect_aim_bos_buddyname(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bos_tree) {
+static int dissect_aim_bos_buddyname(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bos_tree)
+{
int offset = 0;
while(tvb_reported_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_buddyname(tvb, pinfo, offset, bos_tree);
diff --git a/epan/dissectors/packet-aim-buddylist.c b/epan/dissectors/packet-aim-buddylist.c
index e7b5f49a5b..0d3437f6c9 100644
--- a/epan/dissectors/packet-aim-buddylist.c
+++ b/epan/dissectors/packet-aim-buddylist.c
@@ -73,11 +73,7 @@ static int dissect_aim_buddylist_buddylist(tvbuff_t *tvb, packet_info *pinfo, pr
static int dissect_aim_buddylist_rights_repl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree)
{
- int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv( tvb, pinfo, offset, buddy_tree, buddylist_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, buddy_tree, buddylist_tlvs);
}
static int dissect_aim_buddylist_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree)
diff --git a/epan/dissectors/packet-aim-generic.c b/epan/dissectors/packet-aim-generic.c
index 766abffdb2..c3b990fbc7 100644
--- a/epan/dissectors/packet-aim-generic.c
+++ b/epan/dissectors/packet-aim-generic.c
@@ -272,11 +272,7 @@ static int dissect_aim_generic_service_req(tvbuff_t *tvb, packet_info *pinfo _U_
static int dissect_aim_generic_redirect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gen_tree)
{
- int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, gen_tree, client_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, gen_tree, client_tlvs);
}
static int dissect_aim_generic_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
@@ -315,10 +311,7 @@ static int dissect_aim_generic_motd(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(gen_tree, hf_generic_motd_motdtype, tvb, offset,
2, tvb_get_ntohs(tvb, offset));
offset+=2;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, gen_tree, motd_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, offset, gen_tree, motd_tlvs);
}
static int dissect_aim_generic_rateinfoack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
@@ -371,11 +364,7 @@ static int dissect_aim_generic_migration_req(tvbuff_t *tvb, packet_info *pinfo,
offset += 2;
}
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, gen_tree, client_tlvs);
- }
-
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, offset, gen_tree, client_tlvs);
}
static int dissect_aim_generic_setprivflags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
@@ -416,11 +405,7 @@ static int dissect_aim_generic_setidle(tvbuff_t *tvb, packet_info *pinfo _U_, pr
static int dissect_aim_generic_ext_status_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gen_tree)
{
- int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, gen_tree, onlinebuddy_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, gen_tree, onlinebuddy_tlvs);
}
static int dissect_aim_generic_clientver_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
diff --git a/epan/dissectors/packet-aim-invitation.c b/epan/dissectors/packet-aim-invitation.c
index 2fd2dc363f..6d6134f329 100644
--- a/epan/dissectors/packet-aim-invitation.c
+++ b/epan/dissectors/packet-aim-invitation.c
@@ -48,11 +48,7 @@ static int ett_aim_invitation = -1;
static int dissect_aim_invitation_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *invite_tree)
{
- int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, invite_tree, onlinebuddy_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, invite_tree, onlinebuddy_tlvs);
}
static const aim_subtype aim_fnac_family_invitation[] = {
diff --git a/epan/dissectors/packet-aim-location.c b/epan/dissectors/packet-aim-location.c
index 1291d72987..7bd8f60835 100644
--- a/epan/dissectors/packet-aim-location.c
+++ b/epan/dissectors/packet-aim-location.c
@@ -100,20 +100,12 @@ static gint ett_aim_location = -1;
static int dissect_aim_location_rightsinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *loc_tree)
{
- int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, loc_tree, location_rights_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, loc_tree, location_rights_tlvs);
}
static int dissect_aim_location_setuserinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *loc_tree)
{
- int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, loc_tree, location_userinfo_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, loc_tree, location_userinfo_tlvs);
}
static int dissect_aim_location_watcher_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *loc_tree)
@@ -176,11 +168,7 @@ static int dissect_aim_snac_location_user_information(tvbuff_t *tvb,
offset = dissect_aim_tlv_list(tvb, pinfo, offset, tree, onlinebuddy_tlvs);
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, tree, msg_tlv);
- }
-
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, offset, tree, msg_tlv);
}
static const aim_subtype aim_fnac_family_location[] = {
diff --git a/epan/dissectors/packet-aim-messaging.c b/epan/dissectors/packet-aim-messaging.c
index 5640123ac1..b531889a4d 100644
--- a/epan/dissectors/packet-aim-messaging.c
+++ b/epan/dissectors/packet-aim-messaging.c
@@ -153,12 +153,8 @@ static int dissect_aim_msg_incoming(tvbuff_t *tvb, packet_info *pinfo, proto_tre
offset = dissect_aim_userinfo(tvb, pinfo, offset, msg_tree);
- while(tvb_reported_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, msg_tree,
+ return dissect_aim_tlv_sequence(tvb, pinfo, offset, msg_tree,
messaging_incoming_ch1_tlvs);
- }
-
- return offset;
}
static int dissect_aim_msg_params(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *msg_tree)
diff --git a/epan/dissectors/packet-aim-ssi.c b/epan/dissectors/packet-aim-ssi.c
index adbee47bf7..39b8fcd3db 100644
--- a/epan/dissectors/packet-aim-ssi.c
+++ b/epan/dissectors/packet-aim-ssi.c
@@ -146,11 +146,7 @@ static int dissect_ssi_ssi_item(tvbuff_t *tvb, packet_info *pinfo,
static int dissect_aim_ssi_rightsinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ssi_tree)
{
- int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, ssi_tree, ssi_rightsinfo_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, ssi_tree, ssi_rightsinfo_tlvs);
}
static int dissect_aim_ssi_was_added(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ssi_tree)
diff --git a/epan/dissectors/packet-aim-sst.c b/epan/dissectors/packet-aim-sst.c
index 2c0b6abd89..6d83dbefa7 100644
--- a/epan/dissectors/packet-aim-sst.c
+++ b/epan/dissectors/packet-aim-sst.c
@@ -44,16 +44,104 @@
/* Initialize the protocol and registered fields */
static int proto_aim_sst = -1;
+static int hf_aim_sst_unknown = -1;
+static int hf_aim_sst_md5_hash = -1;
+static int hf_aim_sst_md5_hash_size = -1;
+static int hf_aim_sst_ref_num = -1;
+static int hf_aim_sst_icon_size = -1;
+static int hf_aim_sst_icon = -1;
/* Initialize the subtree pointers */
static gint ett_aim_sst = -1;
+static int dissect_aim_sst_buddy_down_req (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
+{
+ int offset = dissect_aim_buddyname(tvb, pinfo, 0, tree);
+ guint8 md5_size;
+
+ proto_tree_add_item(tree, hf_aim_sst_unknown, tvb, offset, 4, FALSE);
+ offset+=4;
+
+ proto_tree_add_item(tree, hf_aim_sst_md5_hash_size, tvb, offset, 1, FALSE);
+ md5_size = tvb_get_guint8(tvb, offset);
+ offset++;
+
+ proto_tree_add_item(tree, hf_aim_sst_md5_hash, tvb, offset, md5_size, FALSE);
+
+ offset+=md5_size;
+ return offset;
+}
+
+static int dissect_aim_sst_buddy_down_repl (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
+{
+ int offset = dissect_aim_buddyname(tvb, pinfo, 0, tree);
+ guint8 md5_size;
+ guint16 icon_size;
+
+ proto_tree_add_item(tree, hf_aim_sst_unknown, tvb, offset, 3, FALSE);
+ offset+=3;
+
+ proto_tree_add_item(tree, hf_aim_sst_md5_hash_size, tvb, offset, 1, FALSE);
+ md5_size = tvb_get_guint8(tvb, offset);
+ offset++;
+
+ proto_tree_add_item(tree, hf_aim_sst_md5_hash, tvb, offset, md5_size, FALSE);
+
+ offset+=md5_size;
+
+ proto_tree_add_item(tree, hf_aim_sst_icon_size, tvb, offset, 2, FALSE);
+ icon_size = tvb_get_ntohs(tvb, offset);
+ offset+=2;
+
+ proto_tree_add_item(tree, hf_aim_sst_icon, tvb, offset, icon_size, FALSE);
+
+ offset+=icon_size;
+
+ return offset;
+}
+
+static int dissect_aim_sst_buddy_up_repl (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
+{
+ int offset = 0;
+ guint8 md5_size;
+
+ proto_tree_add_item(tree, hf_aim_sst_unknown, tvb, offset, 4, FALSE);
+ offset+=4;
+
+ proto_tree_add_item(tree, hf_aim_sst_md5_hash_size, tvb, offset, 1, FALSE);
+ md5_size = tvb_get_guint8(tvb, offset);
+ offset++;
+
+ proto_tree_add_item(tree, hf_aim_sst_md5_hash, tvb, offset, md5_size, FALSE);
+
+ offset+=md5_size;
+ return offset;
+}
+
+static int dissect_aim_sst_buddy_up_req (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
+{
+ int offset = 0;
+ guint16 icon_size;
+
+ proto_tree_add_item(tree, hf_aim_sst_ref_num, tvb, offset, 2, FALSE);
+ offset+=2;
+
+ proto_tree_add_item(tree, hf_aim_sst_icon_size, tvb, offset, 2, FALSE);
+ icon_size = tvb_get_ntohs(tvb, offset);
+ offset+=2;
+
+ proto_tree_add_item(tree, hf_aim_sst_icon, tvb, offset, icon_size, FALSE);
+
+ offset+=icon_size;
+ return offset;
+}
+
static const aim_subtype aim_fnac_family_sst[] = {
{ 0x0001, "Error", dissect_aim_snac_error },
- { 0x0002, "Upload Buddy Icon Request", NULL },
- { 0x0003, "Upload Buddy Icon Reply", NULL },
- { 0x0004, "Download Buddy Icon Request", NULL },
- { 0x0005, "Download Buddy Icon Reply", NULL },
+ { 0x0002, "Upload Buddy Icon Request", dissect_aim_sst_buddy_up_req },
+ { 0x0003, "Upload Buddy Icon Reply", dissect_aim_sst_buddy_up_repl },
+ { 0x0004, "Download Buddy Icon Request", dissect_aim_sst_buddy_down_req },
+ { 0x0005, "Download Buddy Icon Reply", dissect_aim_sst_buddy_down_repl },
{ 0, NULL, NULL }
};
@@ -64,9 +152,26 @@ proto_register_aim_sst(void)
{
/* Setup list of header fields */
-/*FIXME
static hf_register_info hf[] = {
- };*/
+ { &hf_aim_sst_md5_hash,
+ { "MD5 Hash", "aim.sst.md5", FT_BYTES, BASE_NONE, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_sst_md5_hash_size,
+ { "MD5 Hash Size", "aim.sst.md5.size", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_sst_unknown,
+ { "Unknown Data", "aim.sst.unknown", FT_BYTES, BASE_NONE, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_sst_ref_num,
+ { "Reference Number", "aim.sst.ref_num", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_sst_icon_size,
+ { "Icon Size", "aim.sst.icon_size", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_sst_icon,
+ { "Icon", "aim.sst.icon", FT_BYTES, BASE_NONE, NULL, 0x0, "", HFILL },
+ },
+ };
/* Setup protocol subtree array */
static gint *ett[] = {
@@ -77,8 +182,7 @@ proto_register_aim_sst(void)
proto_aim_sst = proto_register_protocol("AIM Server Side Themes", "AIM SST", "aim_sst");
/* Required function calls to register the header fields and subtrees used */
-/*FIXME
- proto_register_field_array(proto_aim_sst, hf, array_length(hf));*/
+ proto_register_field_array(proto_aim_sst, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
diff --git a/epan/dissectors/packet-aim-userlookup.c b/epan/dissectors/packet-aim-userlookup.c
index a0f3f3e88f..6d7385716d 100644
--- a/epan/dissectors/packet-aim-userlookup.c
+++ b/epan/dissectors/packet-aim-userlookup.c
@@ -57,11 +57,7 @@ static int dissect_aim_userlookup_search(tvbuff_t *tvb, packet_info *pinfo _U_,
static int dissect_aim_userlookup_result(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lookup_tree)
{
- int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, lookup_tree, client_tlvs);
- }
- return offset;
+ return dissect_aim_tlv_sequence(tvb, pinfo, 0, lookup_tree, client_tlvs);
}
static const aim_subtype aim_fnac_family_userlookup[] = {
diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c
index da4903325e..41b911f6f0 100644
--- a/epan/dissectors/packet-aim.c
+++ b/epan/dissectors/packet-aim.c
@@ -265,6 +265,38 @@ const aim_tlv onlinebuddy_tlvs[] = {
{ 0, "Unknown", NULL }
};
+#define DC_DISABLED 0x0000
+#define DC_HTTPS 0x0001
+#define DC_SOCKS 0x0002
+#define DC_NORMAL 0x0003
+#define DC_IMPOSSIBLE 0x0004
+
+static const value_string dc_types[] = {
+ { DC_DISABLED, "DC disabled" },
+ { DC_HTTPS, "DC thru firewall or HTTPS proxy" },
+ { DC_SOCKS, "DC thru SOCKS proxy" },
+ { DC_NORMAL, "Regular connection" },
+ { DC_IMPOSSIBLE, "DC not possible " },
+ { 0, "Unknown" },
+};
+
+#define PROTO_VERSION_ICQ98 0x0004
+#define PROTO_VERSION_ICQ99 0x0006
+#define PROTO_VERSION_ICQ2K 0x0007
+#define PROTO_VERSION_ICQ2K1 0x0008
+#define PROTO_VERSION_ICQLITE 0x0009
+#define PROTO_VERSION_ICQ2K3B 0x000A
+
+static const value_string protocol_versions[] = {
+ { PROTO_VERSION_ICQ98, "ICQ '98" },
+ { PROTO_VERSION_ICQ99, "ICQ '99" },
+ { PROTO_VERSION_ICQ2K, "ICQ 2000" },
+ { PROTO_VERSION_ICQ2K1, "ICQ 2001" },
+ { PROTO_VERSION_ICQLITE, "ICQ Lite" },
+ { PROTO_VERSION_ICQ2K3B, "ICQ 2003B" },
+ { 0, "Unknown" },
+};
+
static GList *families = NULL;
#define AIM_MOTD_TLV_MOTD 0x000B
@@ -358,9 +390,21 @@ static int hf_aim_messageblock_charset = -1;
static int hf_aim_messageblock_charsubset = -1;
static int hf_aim_messageblock_message = -1;
+static int hf_aim_dcinfo_ip = -1;
+static int hf_aim_dcinfo_tcpport = -1;
+static int hf_aim_dcinfo_type = -1;
+static int hf_aim_dcinfo_proto_version = -1;
+static int hf_aim_dcinfo_auth_cookie = -1;
+static int hf_aim_dcinfo_webport = -1;
+static int hf_aim_dcinfo_client_future = -1;
+static int hf_aim_dcinfo_last_info_update = -1;
+static int hf_aim_dcinfo_last_ext_info_update = -1;
+static int hf_aim_dcinfo_last_ext_status_update = -1;
+static int hf_aim_dcinfo_unknown = -1;
/* Initialize the subtree pointers */
static gint ett_aim = -1;
+static gint ett_aim_dcinfo = -1;
static gint ett_aim_buddyname= -1;
static gint ett_aim_fnac = -1;
static gint ett_aim_fnac_flags = -1;
@@ -611,9 +655,7 @@ static void dissect_aim_newconn(tvbuff_t *tvb, packet_info *pinfo,
if (tvb_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(tree, hf_aim_authcookie, tvb, offset, 4, FALSE);
offset+=4;
- while(tvb_reported_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, tree, client_tlvs);
- }
+ offset = dissect_aim_tlv_sequence(tvb, pinfo, offset, tree, client_tlvs);
}
if (tvb_length_remaining(tvb, offset) > 0)
@@ -785,9 +827,7 @@ static void dissect_aim_close_conn(tvbuff_t *tvb, packet_info *pinfo,
col_add_fstr(pinfo->cinfo, COL_INFO, "Close Connection");
}
- while(tvb_reported_length_remaining(tvb, offset) > 0) {
- offset = dissect_aim_tlv(tvb, pinfo, offset, tree, client_tlvs);
- }
+ offset = dissect_aim_tlv_sequence(tvb, pinfo, offset, tree, client_tlvs);
}
static void dissect_aim_unknown_channel(tvbuff_t *tvb, packet_info *pinfo,
@@ -1040,10 +1080,25 @@ static int dissect_aim_tlv_value_userstatus(proto_item *ti _U_, guint16 valueid
return tvb_length(tvb);
}
-static int dissect_aim_tlv_value_dcinfo(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb)
+static int dissect_aim_tlv_value_dcinfo(proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb)
{
- /* FIXME */
- return tvb_length(tvb);
+ int offset = 0;
+
+ proto_tree *dctree = proto_item_add_subtree(ti, ett_aim_dcinfo);
+
+ proto_tree_add_item(dctree, hf_aim_dcinfo_ip , tvb, offset, 4, FALSE); offset+=4;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_tcpport, tvb, offset, 4, FALSE); offset+=4;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_type, tvb, offset, 1, FALSE); offset+=1;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_proto_version, tvb, offset, 2, FALSE); offset+=2;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_auth_cookie, tvb, offset, 4, FALSE); offset+=2;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_webport, tvb, offset, 4, FALSE); offset+=4;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_client_future, tvb, offset, 4, FALSE); offset+=4;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_last_info_update, tvb, offset, 4, FALSE); offset+=4;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_last_ext_info_update, tvb, offset, 4, FALSE); offset+=4;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_last_ext_status_update, tvb, offset, 4, FALSE); offset+=4;
+ proto_tree_add_item(dctree, hf_aim_dcinfo_unknown, tvb, offset, 2, FALSE); offset+=2;
+
+ return offset;
}
int dissect_aim_tlv_value_string (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb)
@@ -1217,7 +1272,16 @@ int dissect_aim_tlv(tvbuff_t *tvb, packet_info *pinfo _U_,
return offset;
}
-int dissect_aim_tlv_list(tvbuff_t *tvb, packet_info *pinfo _U_,
+int dissect_aim_tlv_sequence(tvbuff_t *tvb, packet_info *pinfo,
+ int offset, proto_tree *tree, const aim_tlv *tlv_table)
+{
+ while (tvb_length_remaining(tvb, offset) > 0) {
+ offset = dissect_aim_tlv(tvb, pinfo, offset, tree, tlv_table);
+ }
+ return offset;
+}
+
+int dissect_aim_tlv_list(tvbuff_t *tvb, packet_info *pinfo,
int offset, proto_tree *tree, const aim_tlv *tlv_table)
{
guint16 i, tlv_count = tvb_get_ntohs(tvb, offset);
@@ -1359,11 +1423,46 @@ proto_register_aim(void)
{ &hf_aim_messageblock_message,
{ "Message", "aim.messageblock.message", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL },
},
+ { &hf_aim_dcinfo_ip,
+ { "Internal IP address", "aim.dcinfo.addr", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_tcpport,
+ { "TCP Port", "aim.dcinfo.tcpport", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_type,
+ { "Type", "aim.dcinfo.type", FT_UINT8, BASE_HEX, VALS(dc_types), 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_proto_version,
+ { "Protocol Version", "aim.dcinfo.proto_version", FT_UINT16, BASE_DEC, VALS(protocol_versions), 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_auth_cookie,
+ { "Authorization Cookie", "aim.dcinfo.auth_cookie", FT_BYTES, BASE_NONE, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_webport,
+ { "Web Front Port", "aim.dcinfo.webport", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_client_future,
+ { "Client Futures", "aim.dcinfo.client_futures", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_last_info_update,
+ { "Last Info Update", "aim.dcinfo.last_info_update", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_last_ext_info_update,
+ { "Last Extended Info Update", "aim.dcinfo.last_ext_info_update", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_last_ext_status_update,
+ { "Last Extended Status Update", "aim.dcinfo.last_ext_status_update", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL },
+ },
+ { &hf_aim_dcinfo_unknown,
+ { "Unknown", "aim.dcinfo.unknown", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL },
+ },
+
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_aim,
+ &ett_aim_dcinfo,
&ett_aim_fnac,
&ett_aim_fnac_flags,
&ett_aim_tlv,
diff --git a/epan/dissectors/packet-aim.h b/epan/dissectors/packet-aim.h
index 42f519dab6..efacdd05d1 100644
--- a/epan/dissectors/packet-aim.h
+++ b/epan/dissectors/packet-aim.h
@@ -66,6 +66,7 @@ int dissect_aim_snac_error(tvbuff_t *tvb, packet_info *pinfo,
int dissect_aim_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, const aim_tlv *);
int dissect_aim_tlv_list(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, const aim_tlv *);
+int dissect_aim_tlv_sequence(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, const aim_tlv *);
const aim_family *aim_get_family( guint16 family );
const aim_subtype *aim_get_subtype( guint16 family, guint16 subtype);