Ethereal-cvs: [ethereal-cvs] cvs commit: ethereal packet-atalk.c packet-eth.c packet-ftp.c
guy 1999/08/17 19:58:04 CDT
Modified files:
. packet-atalk.c packet-eth.c packet-ftp.c
packet-ip.c packet-nbns.c packet-nntp.c
packet-pop.c packet-smb.c packet-tcp.c
packet-telnet.c packet-udp.c packet.c
packet.h
Log:
Declare the "packet_info" structure "pi" in "packet.h", rather than in a
bunch of source files.
Replace the "payload" field of a "packet_info" structure with "len" and
"captured_len" fields, which contain the total packet length and total
captured packet length (including all headers) at the current protocol
layer (i.e., if a given layer has a length field, and that length field
says its shorter than the length we got from the capture, reduce the
"pi.len" and "pi.captured_len" values appropriately). Those fields can
be used in the future if we add checks to make sure a field we're
extracting from a packet doesn't go past the end of the packet, or past
the captured part of the packet.
Get rid of the additional payload argument to some dissection functions;
use "pi.captured_len - offset" instead.
Have the END_OF_FRAME macro use "pi.captured_len" rather than
"fd->cap_len", so that "dissect the rest of the frame" becomes "dissect
the rest of the packet", and doesn't dissect end-of-frame padding such
as padding added to make an Ethernet frame 60 or more octets long. (We
might want to rename it END_OF_PACKET; if we ever want to label the
end-of-frame padding for the benefit of people curious what that extra
gunk is, we could have a separate END_OF_FRAME macro that uses
"fd->cap_len".)
Revision Changes Path
1.10 +0 -2 ethereal/packet-atalk.c
1.15 +20 -9 ethereal/packet-eth.c
1.6 +4 -5 ethereal/packet-ftp.c
1.38 +16 -7 ethereal/packet-ip.c
1.24 +10 -8 ethereal/packet-nbns.c
1.4 +3 -4 ethereal/packet-nntp.c
1.6 +3 -4 ethereal/packet-pop.c
1.22 +1 -3 ethereal/packet-smb.c
1.30 +8 -12 ethereal/packet-tcp.c
1.5 +4 -5 ethereal/packet-telnet.c
1.23 +2 -7 ethereal/packet-udp.c
1.37 +7 -1 ethereal/packet.c
1.84 +15 -11 ethereal/packet.h