aboutsummaryrefslogtreecommitdiffstats
path: root/packet-aim.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-05-05 09:30:56 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-05-05 09:30:56 +0000
commita3cd78e25af355f40155c65e9533f9cd66c3d2ed (patch)
treebaeb8998fab530d98900118298a32a6a606dfc65 /packet-aim.c
parent86731c831c9b9ffe2794f1a2f394e90dbe6b333c (diff)
Use "tvb_reported_length_remaining()" in "until the end of the packet"
loops, so we mark frames as short if they've been cut short by a snapshot length. The user class in buddy list TLVs appears to be 2 bytes, in at least some captures; make "dissect_aim_userclass()" take the user class value, and the length of the user class field, as arguments, and have the caller fetch the value. Also, display the numerical value of the user class in hex, as it's a bitset. Fix the messaging dissector to put stuff under the top-level item rather than at the top level. Fix a typo. Clean up indentation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10802 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-aim.c')
-rw-r--r--packet-aim.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/packet-aim.c b/packet-aim.c
index 8086dc87f1..860dd99449 100644
--- a/packet-aim.c
+++ b/packet-aim.c
@@ -3,7 +3,7 @@
* Copyright 2000, Ralf Hoelzer <ralf@well.com>
* Copyright 2004, Jelmer Vernooij <jelmer@samba.org>
*
- * $Id: packet-aim.c,v 1.40 2004/04/26 21:11:33 obiot Exp $
+ * $Id: packet-aim.c,v 1.41 2004/05/05 09:30:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -561,7 +561,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_length_remaining(tvb, offset) > 0) {
+ while(tvb_reported_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_tlv(tvb, pinfo, offset, tree, client_tlvs);
}
}
@@ -699,7 +699,7 @@ static void dissect_aim_close_conn(tvbuff_t *tvb, packet_info *pinfo,
col_add_fstr(pinfo->cinfo, COL_INFO, "Close Connection");
}
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_reported_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_tlv(tvb, pinfo, offset, tree, client_tlvs);
}
}
@@ -751,31 +751,31 @@ int dissect_aim_tlv_value_time(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t
return tvb_length(tvb);
}
-int dissect_aim_userclass(tvbuff_t *tvb, int offset, proto_item *ti)
+int dissect_aim_userclass(tvbuff_t *tvb, int offset, int len, proto_item *ti, guint32 flags)
{
- guint32 flags = tvb_get_ntoh24(tvb, offset);
proto_tree *entry;
entry = proto_item_add_subtree(ti, ett_aim_userclass);
- proto_tree_add_boolean(entry, hf_aim_userclass_unconfirmed, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_administrator, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_aol, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_commercial, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_free, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_away, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_icq, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_wireless, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_unknown100, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_unknown200, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_unknown400, tvb, offset, 4, flags);
- proto_tree_add_boolean(entry, hf_aim_userclass_unknown800, tvb, offset, 4, flags);
- return offset+4;
+ proto_tree_add_boolean(entry, hf_aim_userclass_unconfirmed, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_administrator, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_aol, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_commercial, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_free, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_away, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_icq, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_wireless, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_unknown100, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_unknown200, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_unknown400, tvb, offset, len, flags);
+ proto_tree_add_boolean(entry, hf_aim_userclass_unknown800, tvb, offset, len, flags);
+ return offset+len;
}
-int dissect_aim_tlv_value_userclass(proto_item *ti, guint16 valueid, tvbuff_t *tvb)
+int dissect_aim_tlv_value_userclass(proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb)
{
- dissect_aim_tlv_value_uint32(ti, valueid, tvb);
- return dissect_aim_userclass(tvb, 0, ti);
+ guint16 value16 = tvb_get_ntohs(tvb, 0);
+ proto_item_set_text(ti, "Value: 0x%04x", value16);
+ return dissect_aim_userclass(tvb, 0, 2, ti, value16);
}
static int dissect_aim_tlv_value_userstatus(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb)