diff options
author | fenner <fenner> | 2001-09-17 21:57:50 +0000 |
---|---|---|
committer | fenner <fenner> | 2001-09-17 21:57:50 +0000 |
commit | c672f002763b3a4fc30ca229e57f50d3b2e6d766 (patch) | |
tree | ee681c42232037a77b9f4413202971bfd41bf0d9 /print-cnfp.c | |
parent | d5c621ba52626b1cc9778850bf7997cc227d230d (diff) | |
download | tcpdump-c672f002763b3a4fc30ca229e57f50d3b2e6d766.tar.gz |
Eliminate some unused parameters.
Use const more.
Use EXTRACT_* macros more.
Use TCHECK* more.
Use tok2str() to replace some home-grown workalikes.
smb:
- Get rid of private types, use tcpdump-defined types
- Rename fdata and fdata1 to smb_fdata and smb_fdata1 to avoid conflict
with IRIX library function.
Diffstat (limited to 'print-cnfp.c')
-rw-r--r-- | print-cnfp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/print-cnfp.c b/print-cnfp.c index e10e2478..5f9d1a3c 100644 --- a/print-cnfp.c +++ b/print-cnfp.c @@ -34,7 +34,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.7 2001-02-21 09:05:39 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.8 2001-09-17 21:57:58 fenner Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -92,10 +92,10 @@ cnfp_print(const u_char *cp, u_int len, const u_char *bp) int nrecs, ver; time_t t; - ip = (struct ip *)bp; - nh = (struct nfhdr *)cp; + ip = (const struct ip *)bp; + nh = (const struct nfhdr *)cp; - if ((u_char *)(nh + 1) > snapend) + if ((const u_char *)(nh + 1) > snapend) return; nrecs = ntohl(nh->ver_cnt) & 0xffff; @@ -110,16 +110,16 @@ cnfp_print(const u_char *cp, u_int len, const u_char *bp) if (ver == 5 || ver == 6) { printf("#%u, ", (unsigned)htonl(nh->sequence)); - nr = (struct nfrec *)&nh[1]; + nr = (const struct nfrec *)&nh[1]; snaplen -= 24; } else { - nr = (struct nfrec *)&nh->sequence; + nr = (const struct nfrec *)&nh->sequence; snaplen -= 16; } printf("%2u recs", nrecs); - for (; nrecs-- && (u_char *)(nr + 1) <= snapend; nr++) { + for (; nrecs-- && (const u_char *)(nr + 1) <= snapend; nr++) { char buf[20]; char asbuf[20]; |