/* record initiator */
static void
-cookie_record(const cookie_t *in, const u_char *bp2)
+cookie_record(netdissect_options *ndo, const cookie_t *in, const u_char *bp2)
{
int i;
const struct ip *ip;
ninitiator = (ninitiator + 1) % MAXINITIATORS;
}
-#define cookie_isinitiator(x, y) cookie_sidecheck((x), (y), 1)
-#define cookie_isresponder(x, y) cookie_sidecheck((x), (y), 0)
+#define cookie_isinitiator(ndo, x, y) cookie_sidecheck(ndo, (x), (y), 1)
+#define cookie_isresponder(ndo, x, y) cookie_sidecheck(ndo, (x), (y), 0)
static int
-cookie_sidecheck(int i, const u_char *bp2, int initiator)
+cookie_sidecheck(netdissect_options *ndo, int i, const u_char *bp2, int initiator)
{
const struct ip *ip;
const struct ip6_hdr *ip6;
};
static const struct attrmap encr_t_map[] = {
- { NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 0, 1 */
+ { NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 0, 1 */
{ NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 2, 3 */
{ NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 4, 5 */
{ NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 6, 7 */
static const struct attrmap oakley_t_map[] = {
{ NULL, 0, { NULL } },
{ "enc", 8, { NULL, "1des", "idea", "blowfish", "rc5",
- "3des", "cast", "aes", }, },
+ "3des", "cast", "aes", }, },
{ "hash", 7, { NULL, "md5", "sha1", "tiger",
"sha2-256", "sha2-384", "sha2-512", }, },
{ "auth", 6, { NULL, "preshared", "dss", "rsa sig", "rsa enc",
u_int i;
ND_PRINT(" len=%u ", len);
for (i = 0; i < len; i++)
- safeputchar(ndo, EXTRACT_U_1(data + i));
+ fn_print_char(ndo, EXTRACT_U_1(data + i));
len = 0;
break;
}
int depth)
{
const u_char *dat;
- volatile u_int dlen;
+ u_int dlen;
#ifdef HAVE_LIBCRYPTO
uint8_t np;
#endif
return cp;
trunc:
- ND_PRINT(" [|isakmp]");
+ nd_print_trunc(ndo);
return NULL;
}
/* the first packet */
ND_PRINT(" I");
if (bp2)
- cookie_record(&base->i_ck, bp2);
+ cookie_record(ndo, &base->i_ck, bp2);
} else
ND_PRINT(" ?");
} else {
- if (bp2 && cookie_isinitiator(i, bp2))
+ if (bp2 && cookie_isinitiator(ndo, i, bp2))
ND_PRINT(" I");
- else if (bp2 && cookie_isresponder(i, bp2))
+ else if (bp2 && cookie_isresponder(ndo, i, bp2))
ND_PRINT(" R");
else
ND_PRINT(" ?");
return cp;
trunc:
- ND_PRINT(" [|isakmp]");
+ nd_print_trunc(ndo);
return NULL;
}
const u_char *ep;
u_int major, minor;
+ ndo->ndo_protocol = "isakmp";
#ifdef HAVE_LIBCRYPTO
/* initialize SAs */
if (ndo->ndo_sa_list_head == NULL) {
ep = ndo->ndo_snapend;
if ((const struct isakmp *)ep < p + 1) {
- ND_PRINT("[|isakmp]");
+ nd_print_trunc(ndo);
return;
}
const u_char *bp, u_int length,
const u_char *bp2)
{
+ ndo->ndo_protocol = "isakmp_rfc3948";
ND_TCHECK_1(bp);
if(length == 1 && EXTRACT_U_1(bp)==0xff) {
ND_PRINT("isakmp-nat-keep-alive");
/*
* see if this is an IKE packet
*/
- if (EXTRACT_U_1(bp) == 0 && EXTRACT_U_1(bp + 1) == 0 &&
- EXTRACT_U_1(bp + 2) == 0 && EXTRACT_U_1(bp + 3) == 0) {
+ if (EXTRACT_BE_U_4(bp) == 0) {
ND_PRINT("NONESP-encap: ");
isakmp_print(ndo, bp+4, length-4, bp2);
return;
}
trunc:
- ND_PRINT("[|isakmp]");
+ nd_print_trunc(ndo);
return;
}
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 8
- * End:
- */