summaryrefslogtreecommitdiff
path: root/util.c
Commit message (Collapse)AuthorAgeFilesLines
* From Gisle Vanem: give "tok2str()" 4 static buffers it can fill in, soguy2004-04-281-4/+8
| | | | that it can be called up to 4 times in a given "printf()".
* - pass on ident string to hex_print()hannes2003-12-291-21/+3
| | | | | | | | | | | | - pass on ident string to ascii_print() - pave the way for eliminating print_unknown_data() and subsequent hex_print() replacement - clean up the default_print() related functions: - call always into print_ascii() b/c just hexdump data is uninteresting; hex-offsets plus ascii representation is what most people are looking for - remove default_print_unaligned() as it is now obsolete
* Have the configure script arrange that the Makefile define _U_guy2003-11-161-4/+4
| | | | | | | | | | 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.
* From Neil Spring:guy2003-11-151-1/+1
| | | | | | | | | | | 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".
* From Neil Spring:guy2003-11-151-4/+4
| | | | | | | | | | | 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".
* fix display of correct offset for hexdumpshannes2003-10-021-2/+2
|
* As per a comment by Alex Medvedev <alexm@pycckue.org>, start the searchguy2003-07-301-9/+9
| | | | | | | 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.
* Fix fencepost error in fn_printn() which would return a truncationfenner2003-04-211-9/+4
| | | | | indication if the last byte of the counted string was the last byte captured.
* From Gisle Vanem: use ISO 8601 date/time format in "-tttt" mode.guy2003-03-041-7/+9
|
* From Gisle Vanem <giva@bgnett.no>:guy2003-02-081-13/+21
| | | | | | | | | | | | | | | 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.
* add mask2plen function to util.channes2002-12-221-1/+32
|
* new function bittok2str()hannes2002-11-071-1/+46
| | | | | | | | | | | | | | 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;
* don't attempt to hexdump if length == 0hannes2002-10-111-1/+4
|
* Get rid of some unnecessary includes (<time.h>, <netdb.h>, and <ctype.h>guy2002-08-061-4/+1
| | | | | are included by <tcpdump-stdinc.h>, so we don't have to include them explicitly; <errno.h> isn't needed by print routines).
* From Motonori Shindo <mshindo@mshindo.net>: squelch warnings from someguy2002-08-021-2/+2
| | | | compilers.
* Added support for Win32, based on WinPcap.risso2002-08-011-6/+12
|
* yet another hexdump routine;hannes2002-07-181-1/+29
| | | | print_unknown_data{} supports identation;
* Clean up "safeputchar()" a bit.guy2002-07-161-3/+3
|
* In "safeputchar()", use the result of extracting an unsigned characterguy2002-07-161-4/+4
| | | | | | | 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()").
* whitespace cleanupitojun2002-06-111-2/+2
|
* Introduce tok2strary(), similar to tok2str() except it takes anfenner2001-10-081-1/+20
| | | | array of strings instead of a list of value/string pairs.
* Handle negative timestamps in relts_print().fenner2001-09-171-2/+6
|
* Add some const qualifiersfenner2001-09-101-6/+9
| | | | Check for malloc failure in read_infile()
* remove gnuc.h and __deadassar2000-07-111-2/+2
|
* remove non-STDC codeassar2000-07-011-28/+1
|
* fix safeputc, the if statment was completely reverseditojun2000-06-211-3/+3
|
* (ts_print): fix printing in `-tttt' style. From "Gisle Vanem"assar2000-06-101-3/+3
| | | | <gvanem@eunet.no>
* avoid possible infinite loop in relts_print().itojun2000-06-031-56/+77
| | | | | move safeputchar() and safeputs() into util.c for better code sharing. some style.
* (ts_print): add new styles of timestamps.assar2000-06-011-17/+32
| | | | From Francisco Matias Cuenca-Acuna <mcuenca@george.rutgers.edu>
* s/sprintf/snprintf/.itojun2000-01-171-2/+2
| | | | | there seem to be couple of unsafe use of strcat and strcpy - we should bring in strl{cat,cpy}.
* Get rid of unused variables in relts_print()fenner1999-12-151-3/+1
|
* Enhanced PIMv1 support.fenner1999-11-221-1/+29
| | | | Cisco Auto-RP support.
* Switch to config.h instead of passing defines in DEFS.fenner1999-11-211-1/+5
|
* (ts_print): add incremental printing. From kuznet@ms2.inr.ac.ruassar1999-11-211-4/+25
|
* Initial revisionmcr1999-10-071-0/+275