summaryrefslogtreecommitdiff
path: root/print-ah.c
diff options
context:
space:
mode:
authorfenner <fenner>2001-09-17 21:57:50 +0000
committerfenner <fenner>2001-09-17 21:57:50 +0000
commitc672f002763b3a4fc30ca229e57f50d3b2e6d766 (patch)
treeee681c42232037a77b9f4413202971bfd41bf0d9 /print-ah.c
parentd5c621ba52626b1cc9778850bf7997cc227d230d (diff)
downloadtcpdump-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-ah.c')
-rw-r--r--print-ah.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/print-ah.c b/print-ah.c
index b2441aaa..6450295b 100644
--- a/print-ah.c
+++ b/print-ah.c
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.14 2000-12-12 09:58:40 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.15 2001-09-17 21:57:54 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -52,11 +52,10 @@ ah_print(register const u_char *bp, register const u_char *bp2)
int sumlen;
u_int32_t spi;
- ah = (struct ah *)bp;
+ ah = (const struct ah *)bp;
ep = snapend; /* 'ep' points to the end of available data. */
- if ((u_char *)(ah + 1) >= ep - sizeof(struct ah))
- goto trunc;
+ TCHECK(*ah);
sumlen = ah->ah_len << 2;
spi = (u_int32_t)ntohl(ah->ah_spi);
@@ -64,7 +63,7 @@ ah_print(register const u_char *bp, register const u_char *bp2)
printf("AH(spi=0x%08x", spi);
if (vflag)
printf(",sumlen=%d", sumlen);
- printf(",seq=0x%x", (u_int32_t)ntohl(*(u_int32_t *)(ah + 1)));
+ printf(",seq=0x%x", (u_int32_t)ntohl(*(const u_int32_t *)(ah + 1)));
if (bp + sizeof(struct ah) + sumlen > ep)
fputs("[truncated]", stdout);
fputs("): ", stdout);