/* specification: RFC 2407, RFC 2408, RFC 5996 */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
-/* The functions from print-esp.c used in this file are only defined when both
- * OpenSSL and evp.h are detected. Employ the same preprocessor device here.
- */
-#ifndef HAVE_OPENSSL_EVP_H
-#undef HAVE_LIBCRYPTO
-#endif
#include "netdissect-stdinc.h"
#include "ip.h"
#include "ip6.h"
-#include "ipproto.h"
+#include "ipproto.h" /* for netdb_protoname() */
typedef nd_byte cookie_t[8];
typedef nd_byte msgid_t[4];
#define ISAKMP_FLAG_extra 0x04
/* IKEv2 */
-#define ISAKMP_FLAG_I (1 << 3) /* (I)nitiator */
-#define ISAKMP_FLAG_V (1 << 4) /* (V)ersion */
-#define ISAKMP_FLAG_R (1 << 5) /* (R)esponse */
+#define ISAKMP_FLAG_I (1 << 3) /* Initiator */
+#define ISAKMP_FLAG_V (1 << 4) /* Version */
+#define ISAKMP_FLAG_R (1 << 5) /* Response */
/* 3.2 Payload Generic Header
Certificate Types (variable length)
-- Contains a list of the types of certificates requested,
sorted in order of preference. Each individual certificate
- type is 1 octet. This field is NOT requiredo
+ type is 1 octet. This field is NOT required.
*/
/* # Certificate Authorities (1 octet) */
/* Certificate Authorities (variable length) */
case IPSECDOI_ID_FQDN:
case IPSECDOI_ID_USER_FQDN:
{
- u_int i;
ND_PRINT(" len=%u ", len);
- for (i = 0; i < len; i++)
- fn_print_char(ndo, GET_U_1(data + i));
+ nd_printjn(ndo, data, len);
len = 0;
break;
}
ND_PRINT(" spilen=%u", spi_size);
num_spi = GET_BE_U_2(p->num_spi);
ND_PRINT(" nspi=%u", num_spi);
- ND_PRINT(" spi=");
q = (const uint8_t *)(p + 1);
- for (i = 0; i < num_spi; i++) {
- if (i != 0)
- ND_PRINT(",");
- if (!rawprint(ndo, (const uint8_t *)q, spi_size))
- goto trunc;
- q += spi_size;
+ if (spi_size) {
+ ND_PRINT(" spi=");
+ for (i = 0; i < num_spi; i++) {
+ if (i != 0)
+ ND_PRINT(",");
+ if (!rawprint(ndo, (const uint8_t *)q, spi_size))
+ goto trunc;
+ q += spi_size;
+ }
}
return q;
trunc:
uint32_t proto _U_, int depth _U_)
{
const struct ikev2_id *idp;
- u_int idtype_len, i;
+ u_int idtype_len;
unsigned int dumpascii, dumphex;
const unsigned char *typedata;
if(dumpascii) {
ND_TCHECK_LEN(typedata, idtype_len);
- for(i=0; i<idtype_len; i++) {
- if(ND_ASCII_ISPRINT(GET_U_1(typedata + i))) {
- ND_PRINT("%c", GET_U_1(typedata + i));
- } else {
- ND_PRINT(".");
- }
- }
+ nd_printjn(ndo, typedata, idtype_len);
}
if(dumphex) {
if (!rawprint(ndo, (const uint8_t *)typedata, idtype_len))
break;
case IV2_NOTIFY_TS_UNACCEPTABLE:
- notify_name = "ts_unnacceptable";
+ notify_name = "ts_unacceptable";
break;
case IV2_NOTIFY_INVALID_SELECTORS:
uint32_t proto _U_, int depth _U_)
{
const u_char *vid;
- u_int i, len;
+ u_int len;
ND_TCHECK_SIZE(ext);
ikev2_pay_print(ndo, NPSTR(tpay), GET_U_1(ext->critical));
vid = (const u_char *)(ext+1);
len = item_len - 4;
ND_TCHECK_LEN(vid, len);
- for(i=0; i<len; i++) {
- if(ND_ASCII_ISPRINT(GET_U_1(vid + i)))
- ND_PRINT("%c", GET_U_1(vid + i));
- else ND_PRINT(".");
- }
+ nd_printjn(ndo, vid, len);
if (2 < ndo->ndo_vflag && 4 < len) {
/* Print the entire payload in hex */
ND_PRINT(" ");