#include <config.h>
-/* 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 <string.h>
#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;
}
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))
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(" ");