aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ymsg.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-10-22 21:21:05 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-10-22 21:21:05 +0000
commitaf918dacab167aa6714380e53de9d2bd02cf6849 (patch)
tree6eed4dc771e002442d9a2cb9e33d5e45d25589eb /packet-ymsg.c
parent61874ffd3306aac0b0bc29e295e66ab1c4b7b323 (diff)
From Yaniv Kaul:
remove the check on 3 ports only - since Yahoo! Messenger can stream on any port; remove the check that will not dissect if the packet is not big enough - as partial dissection is also helpful sometimes; the version is 2 bytes, not 4 bytes. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8752 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-ymsg.c')
-rw-r--r--packet-ymsg.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/packet-ymsg.c b/packet-ymsg.c
index 12c357d410..693c16a1ec 100644
--- a/packet-ymsg.c
+++ b/packet-ymsg.c
@@ -3,7 +3,7 @@
* Copyright 2003, Wayne Parrott <wayne_p@pacific.net.au>
* Copied from packet-yhoo.c and updated
*
- * $Id: packet-ymsg.c,v 1.2 2003/03/01 04:12:06 guy Exp $
+ * $Id: packet-ymsg.c,v 1.3 2003/10/22 21:21:05 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -268,22 +268,7 @@ dissect_ymsg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int offset = 0;
int content_len = 0;
- if ((pinfo->srcport != TCP_PORT_YMSG && pinfo->destport != TCP_PORT_YMSG) &&
- (pinfo->srcport != TCP_PORT_YMSG_2 && pinfo->destport != TCP_PORT_YMSG_2) &&
- (pinfo->srcport != TCP_PORT_YMSG_3 && pinfo->destport != TCP_PORT_YMSG_3)) {
- /* Not the Yahoo port - not a Yahoo Messenger packet. */
- return FALSE;
- }
-
- /* get at least a full packet structure */
- if ( !tvb_bytes_exist(tvb, 0, headersize) ) {
- /* Not enough data captured; maybe it is a Yahoo
- Messenger packet, but it contains too little data to
- tell. */
- return FALSE;
- }
-
- if (memcmp(tvb_get_ptr(tvb, offset, 4), "YMSG", 4) != 0) {
+ if (tvb_memeql(tvb, offset, "YMSG", 4) == -1) {
/* Not a Yahoo Messenger packet. */
return FALSE;
}
@@ -310,8 +295,10 @@ dissect_ymsg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 4; /* skip the YMSG string */
proto_tree_add_item(ymsg_tree, hf_ymsg_version, tvb,
- offset, 4, TRUE);
- offset += 4;
+ offset, 2, FALSE);
+ offset += 2;
+
+ offset += 2; /* XXX - padding? */
content_len = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(ymsg_tree, hf_ymsg_len, tvb,
@@ -356,7 +343,7 @@ proto_register_ymsg(void)
{
static hf_register_info hf[] = {
{ &hf_ymsg_version, {
- "Version", "ymsg.version", FT_UINT32, BASE_DEC,
+ "Version", "ymsg.version", FT_UINT16, BASE_DEC,
NULL, 0, "Packet version identifier", HFILL }},
{ &hf_ymsg_len, {
"Packet Length", "ymsg.len", FT_UINT16, BASE_DEC,