On Tue, Dec 17, 2002 at 08:21:39AM -0500, Andrew Brown wrote: > actually, it oughta be simpler than you think. provided that all the > functions that may end up being returned from lookup_printer() set > packetp and snapend (as it seems they do), then one could simply > change default_print_unaligned as follows:
Unfortunately, "default_print()" is used for other purposes - if neither "-x" nor "-q" is specified, the payload of the packet is often printed in hex if it wasn't printed by any dissector, and in that case I suspect the intent is to have it print only the payload, not the link-layer header. (BTW, as per another recent discussioin, that means multi-line output even if "-v" isn't specified....) It also struck me as a bit ugly to make "default_print_unaligned()" ignore its arguments, and use a global variable, if "-e" was specified - and, besides, that global variable no longer exists (I just checked in a change to get rid of "packetp"). So I checked in a change to add a new "default_print_packet()" routine, which takes a pointer to the beginning of the raw packet data (*not* skipping the link-layer header), the number of bytes of raw packet data captured, and the size of the link-layer header; if "-e" is specified, it prints the raw packet data, and if it's not specified, it prints the part of the raw packet data past the link-layer header, if there is any. I also changed the "xxx_if_print()" routines to call that routine if "xflag" is set. - This is the TCPDUMP workers list. It is archived at http://www.tcpdump.org/lists/workers/index.html To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe
