- seperate fields by comma
- use [] for flags and options sets
- print a trailing length field
make use of tok2str() and bitttok2str()
move port definitions into tcp.h
with a maximum length, where a string shorter than that length is padded
with NULs), as "fn_print()" won't handle the maximum length *and* the
snapshot length and "fn_printn()" won't stop on a null string. Use it
where appropriate.
Always pass "snapend" to "fn_print()" and "fn_printn()" if they're
passed a pointer into the packet data; only pass NULL if they're being
handed a pointer into a buffer that's not part of the packet data.
Always check the return value of "fn_print()", "fn_printn()", and
"fn_printzp()" if they're passed "snapend", and do the appropriate
string termination and "packet truncated" indication if they return 1.
-harden tok2str() and bittok2str() to catch NULL refs
-don't attempt to print a frame-relay IE if there is not enough bytes on the wire
to print at least a full TLV
tflag values correspond to what output formats (e.g., 4 means "-tttt").
Switch on the tflag value to determine whether to call "gmt2local()" to
set "thiszone", just as we switch on it to determine the format for time
stamps, to make it more obvious in what cases we call it.
appropriately, and that GNUmakefile and the MSVC++ project file define
it apppriately, as we do with libpcap, rather than defining it in
"interface.h".
Undo the rcsid-shuffling and addition of extra #includes, as we no
longer need to arrange that "interface.h" be included before using _U_
in an RCS ID or copyright.
use "_U_" in the definitions of "rcsid[]", to eliminate
complaints about those variables being unused;
move the definitions after the include of "interface.h", or add
an include of "interface.h", so that "_U_" is defined.
Include "config.h" before including "tcpdump-stdinc.h" in
"missing/datalinks.c".
for prefixes at bitmasks[32] (the last element of a 33-element array),
not bitmasks[33] (one past the last element of that array).
Clean up white space.
open the file containing a filter expression in binary mode, so
that we get all the characters that "fstat()" claims are there,
rather than having CRs stripped out (causing us to report an
error because the "read()" call gives us less data than
"fstat()" claims was in the file);
close the file descriptor once we're finished reading the file;
strip out everything on a line starting with "#", so that "#"
can be used for to-end-of-line comments in the file.
Update his address in the CREDITS file.
this is useful for scanning bitfields
the input is a tokenlist and a testvalue
the function will parse the tokenlist for each single bitmatch
of the testvalue;
if it finds a a match it will write teh tokenstring into a buffer
and place a comma to seperate the values
if there is no match it will format the buffer according to the format string;
i saw many private instances of similar bitscanning functions;
lets use bittok2str() from now on;
from the argument, rather than the argument itself, when testing whether
it should be printed or not (the argument might well be a sign-extended
version of an 8-bit character, in which case it's < 0x80 as it's
negative, but it can't be safely handed to "isprint()").