diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-11-18 10:38:33 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-11-18 10:38:33 +0000 |
commit | c8196a1d1ca5a5021388cfc1bcbb64cdda5e9dc3 (patch) | |
tree | 5e117f446c6e233d14b642596d67c985e685f328 /packet-socks.c | |
parent | 56a0c40c18271046d22bffcc5db10cfb16a2bf6c (diff) | |
download | wireshark-c8196a1d1ca5a5021388cfc1bcbb64cdda5e9dc3.tar.gz |
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
Diffstat (limited to 'packet-socks.c')
-rw-r--r-- | packet-socks.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packet-socks.c b/packet-socks.c index add97af74f..2387ac2fca 100644 --- a/packet-socks.c +++ b/packet-socks.c @@ -2,7 +2,7 @@ * Routines for socks versions 4 &5 packet dissection * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com> * - * $Id: packet-socks.c,v 1.13 2000/10/21 05:52:23 guy Exp $ + * $Id: packet-socks.c,v 1.14 2000/11/18 10:38:25 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -366,6 +366,7 @@ static void socks_udp_dissector( const u_char *pd, int offset, frame_data *fd, conversation_t *conversation; proto_tree *socks_tree; proto_item *ti; + tvbuff_t *tvb; conversation = find_conversation( &pi.src, &pi.dst, pi.ptype, pi.srcport, pi.destport, 0); @@ -420,7 +421,8 @@ static void socks_udp_dissector( const u_char *pd, int offset, frame_data *fd, *ptr = hash_info->udp_remote_port; - decode_udp_ports( pd, offset, fd, tree, pi.srcport, pi.destport); + tvb = tvb_create_from_top(0); + decode_udp_ports( tvb, offset, &pi, tree, pi.srcport, pi.destport); *ptr = hash_info->udp_port; @@ -923,6 +925,7 @@ static void call_next_dissector( const u_char *pd, int offset, frame_data *fd, /* payload, and restore the pi port after that is done. */ guint32 *ptr; + tvbuff_t *tvb; if (( hash_info->command == PING_COMMAND) || ( hash_info->command == TRACERT_COMMAND)) @@ -939,7 +942,8 @@ static void call_next_dissector( const u_char *pd, int offset, frame_data *fd, ptr = &pi.srcport; *ptr = hash_info->port; - decode_tcp_ports( pd, offset, fd, tree, pi.srcport, pi.destport); + tvb = tvb_create_from_top(0); + decode_tcp_ports( tvb, offset, &pi, tree, pi.srcport, pi.destport); *ptr = TCP_PORT_SOCKS; } } |