#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.51 2004-04-10 08:41:22 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.56 2005-04-21 06:44:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "ip6.h"
#endif
-#if defined(__MINGW32__) || defined(__WATCOMC__)
-extern char *strsep(char **stringp, const char *delim); /* Missing/strsep.c */
-#endif
-
#include "netdissect.h"
#include "addrtoname.h"
#include "extract.h"
const EVP_CIPHER *evp;
int ivlen;
int authlen;
- char secret[256]; /* is that big enough for all secrets? */
+ u_char secret[256]; /* is that big enough for all secrets? */
int secretlen;
};
}
-static int hexdigit(netdissect_options *ndo, char hex)
+static u_int hexdigit(netdissect_options *ndo, char hex)
{
if (hex >= '0' && hex <= '9')
return (hex - '0');
}
}
-static int hex2byte(netdissect_options *ndo, char *hexstring)
+static u_int hex2byte(netdissect_options *ndo, char *hexstring)
{
- int byte;
+ u_int byte;
byte = (hexdigit(ndo, hexstring[0]) << 4) + hexdigit(ndo, hexstring[1]);
return byte;
if (decode) {
char *colon, *p;
- char espsecret_key[256];
+ u_char espsecret_key[256];
int len;
size_t i;
const EVP_CIPHER *evp;
int
esp_print(netdissect_options *ndo,
- const u_char *bp, const u_char *bp2
+ const u_char *bp, const int length, const u_char *bp2
#ifndef HAVE_LIBCRYPTO
_U_
#endif
#endif
int advance;
int len;
- char *secret;
+ u_char *secret;
int ivlen = 0;
u_char *ivoff;
u_char *p;
}
(*ndo->ndo_printf)(ndo, "ESP(spi=0x%08x", EXTRACT_32BITS(&esp->esp_spi));
(*ndo->ndo_printf)(ndo, ",seq=0x%x)", EXTRACT_32BITS(&esp->esp_seq));
+ (*ndo->ndo_printf)(ndo, ", length %u", length);
#ifndef HAVE_LIBCRYPTO
goto fail;