support of the enum printf_hook
This commit is contained in:
@@ -59,6 +59,7 @@ libstrongswan_la_LIBADD = -lpthread -ldl
|
||||
libstrongswan_lite_la_SOURCES = \
|
||||
chunk.c chunk.h \
|
||||
debug.c debug.h \
|
||||
enum.c enum.h \
|
||||
printf_hook.c printf_hook.h \
|
||||
settings.c settings.h \
|
||||
utils.c utils.h \
|
||||
|
||||
@@ -4056,11 +4056,11 @@ show_connections_status(bool all, const char *name)
|
||||
|
||||
if (c->dpd_action != DPD_ACTION_NONE)
|
||||
whack_log(RC_COMMENT
|
||||
, "\"%s\"%s: dpd_action: %s;"
|
||||
, "\"%s\"%s: dpd_action: %N;"
|
||||
" dpd_delay: %lus; dpd_timeout: %lus;"
|
||||
, c->name
|
||||
, instance
|
||||
, enum_show(&dpd_action_names, c->dpd_action)
|
||||
, dpd_action_names, c->dpd_action
|
||||
, (unsigned long) c->dpd_delay
|
||||
, (unsigned long) c->dpd_timeout);
|
||||
|
||||
|
||||
+66
-73
@@ -71,7 +71,7 @@ enum_names version_names =
|
||||
|
||||
/* RFC 2459 CRL reason codes */
|
||||
|
||||
static const char *const crl_reason_name[] = {
|
||||
ENUM(crl_reason_names, REASON_UNSPECIFIED, REASON_REMOVE_FROM_CRL,
|
||||
"unspecified",
|
||||
"key compromise",
|
||||
"ca compromise",
|
||||
@@ -81,26 +81,20 @@ static const char *const crl_reason_name[] = {
|
||||
"certificate hold",
|
||||
"reason #7",
|
||||
"remove from crl"
|
||||
};
|
||||
|
||||
enum_names crl_reason_names =
|
||||
{ REASON_UNSPECIFIED, REASON_REMOVE_FROM_CRL, crl_reason_name, NULL};
|
||||
);
|
||||
|
||||
/* RFC 3706 Dead Peer Detection */
|
||||
|
||||
static const char *const dpd_action_name[] = {
|
||||
ENUM(dpd_action_names, DPD_ACTION_NONE, DPD_ACTION_RESTART,
|
||||
"none",
|
||||
"clear",
|
||||
"hold",
|
||||
"restart"
|
||||
};
|
||||
|
||||
enum_names dpd_action_names =
|
||||
{ DPD_ACTION_NONE, DPD_ACTION_RESTART, dpd_action_name, NULL};
|
||||
);
|
||||
|
||||
/* Timer events */
|
||||
|
||||
static const char *const timer_event_name[] = {
|
||||
ENUM(timer_event_names, EVENT_NULL, EVENT_LOG_DAILY,
|
||||
"EVENT_NULL",
|
||||
"EVENT_REINIT_SECRET",
|
||||
"EVENT_SHUNT_SCAN",
|
||||
@@ -113,10 +107,7 @@ static const char *const timer_event_name[] = {
|
||||
"EVENT_DPD",
|
||||
"EVENT_DPD_TIMEOUT",
|
||||
"EVENT_LOG_DAILY"
|
||||
};
|
||||
|
||||
enum_names timer_event_names =
|
||||
{ EVENT_NULL, EVENT_LOG_DAILY, timer_event_name, NULL };
|
||||
);
|
||||
|
||||
/* Domain of Interpretation */
|
||||
|
||||
@@ -155,7 +146,7 @@ const char *const debug_bit_names[] = {
|
||||
"impair-bust-mr2",
|
||||
|
||||
NULL
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
/* State of exchanges */
|
||||
@@ -197,7 +188,7 @@ static const char *const state_name[] = {
|
||||
"STATE_MODE_CFG_R4",
|
||||
|
||||
"STATE_IKE_ROOF"
|
||||
};
|
||||
};
|
||||
|
||||
enum_names state_names =
|
||||
{ STATE_MAIN_R0, STATE_IKE_ROOF-1, state_name, NULL };
|
||||
@@ -239,7 +230,7 @@ const char *const state_story[] = {
|
||||
"sent ModeCfg set, expecting ack", /* STATE_MODE_CFG_R3 */
|
||||
"sent ModeCfg ack, established", /* STATE_MODE_CFG_I3 */
|
||||
"received ModeCfg ack, established", /* STATE_MODE_CFG_R4 */
|
||||
};
|
||||
};
|
||||
|
||||
/* kind of struct connection */
|
||||
|
||||
@@ -265,7 +256,7 @@ static const char *const routing_story_strings[] = {
|
||||
"fail erouted", /* RT_ROUTED_FAILURE: routed, and failure-context shunt eroute installed */
|
||||
"erouted", /* RT_ROUTED_TUNNEL: routed, and erouted to an IPSEC SA group */
|
||||
"keyed, unrouted", /* RT_UNROUTED_KEYED: was routed+keyed, but it got turned into an outer policy */
|
||||
};
|
||||
};
|
||||
|
||||
enum_names routing_story =
|
||||
{ RT_UNROUTED, RT_ROUTED_TUNNEL, routing_story_strings, NULL};
|
||||
@@ -296,10 +287,12 @@ const char *const payload_name[] = {
|
||||
"ISAKMP_NEXT_NAT-D",
|
||||
"ISAKMP_NEXT_NAT-OA",
|
||||
NULL
|
||||
};
|
||||
};
|
||||
|
||||
const char *const payload_name_nat_d[] = { "ISAKMP_NEXT_NAT-D",
|
||||
"ISAKMP_NEXT_NAT-OA", NULL };
|
||||
const char *const payload_name_nat_d[] = {
|
||||
"ISAKMP_NEXT_NAT-D",
|
||||
"ISAKMP_NEXT_NAT-OA", NULL
|
||||
};
|
||||
|
||||
static enum_names payload_names_nat_d =
|
||||
{ ISAKMP_NEXT_NATD_DRAFTS, ISAKMP_NEXT_NATOA_DRAFTS, payload_name_nat_d, NULL };
|
||||
@@ -317,13 +310,13 @@ static const char *const exchange_name[] = {
|
||||
"ISAKMP_XCHG_AGGR",
|
||||
"ISAKMP_XCHG_INFO",
|
||||
"ISAKMP_XCHG_MODE_CFG",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const exchange_name2[] = {
|
||||
"ISAKMP_XCHG_QUICK",
|
||||
"ISAKMP_XCHG_NGRP",
|
||||
"ISAKMP_XCHG_ACK_INFO",
|
||||
};
|
||||
};
|
||||
|
||||
static enum_names exchange_desc2 =
|
||||
{ ISAKMP_XCHG_QUICK, ISAKMP_XCHG_ACK_INFO, exchange_name2, NULL };
|
||||
@@ -336,7 +329,7 @@ const char *const flag_bit_names[] = {
|
||||
"ISAKMP_FLAG_ENCRYPTION",
|
||||
"ISAKMP_FLAG_COMMIT",
|
||||
NULL
|
||||
};
|
||||
};
|
||||
|
||||
/* Situation BITS definition for IPsec DOI */
|
||||
|
||||
@@ -345,7 +338,7 @@ const char *const sit_bit_names[] = {
|
||||
"SIT_SECRECY",
|
||||
"SIT_INTEGRITY",
|
||||
NULL
|
||||
};
|
||||
};
|
||||
|
||||
/* Protocol IDs (RFC 2407 "IPsec DOI" section 4.4.1) */
|
||||
|
||||
@@ -354,7 +347,7 @@ static const char *const protocol_name[] = {
|
||||
"PROTO_IPSEC_AH",
|
||||
"PROTO_IPSEC_ESP",
|
||||
"PROTO_IPCOMP",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names protocol_names =
|
||||
{ PROTO_ISAKMP, PROTO_IPCOMP, protocol_name, NULL };
|
||||
@@ -363,7 +356,7 @@ enum_names protocol_names =
|
||||
|
||||
static const char *const isakmp_transform_name[] = {
|
||||
"KEY_IKE",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names isakmp_transformid_names =
|
||||
{ KEY_IKE, KEY_IKE, isakmp_transform_name, NULL };
|
||||
@@ -380,7 +373,7 @@ static const char *const ah_transform_name[] = {
|
||||
"AH_RIPEMD",
|
||||
"AH_AES_XCBC_MAC",
|
||||
"AH_RSA"
|
||||
};
|
||||
};
|
||||
|
||||
enum_names ah_transformid_names =
|
||||
{ AH_MD5, AH_RSA, ah_transform_name, NULL };
|
||||
@@ -410,7 +403,7 @@ static const char *const esp_transform_name[] = {
|
||||
"ESP_AES_GCM_16",
|
||||
"ESP_SEED_CBC",
|
||||
"ESP_CAMELLIA"
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* ipsec drafts suggest "high" ESP ids values for testing,
|
||||
@@ -419,7 +412,7 @@ static const char *const esp_transform_name[] = {
|
||||
static const char *const esp_transform_name_high[] = {
|
||||
"ESP_SERPENT",
|
||||
"ESP_TWOFISH"
|
||||
};
|
||||
};
|
||||
|
||||
enum_names esp_transformid_names_high =
|
||||
{ ESP_SERPENT, ESP_TWOFISH, esp_transform_name_high, NULL };
|
||||
@@ -434,7 +427,7 @@ static const char *const ipcomp_transform_name[] = {
|
||||
"IPCOMP_DEFLAT",
|
||||
"IPCOMP_LZS",
|
||||
"IPCOMP_LZJH",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names ipcomp_transformid_names =
|
||||
{ IPCOMP_OUI, IPCOMP_LZJH, ipcomp_transform_name, NULL };
|
||||
@@ -453,7 +446,7 @@ static const char *const ident_name[] = {
|
||||
"ID_DER_ASN1_DN",
|
||||
"ID_DER_ASN1_GN",
|
||||
"ID_KEY_ID",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names ident_names =
|
||||
{ ID_IPV4_ADDR, ID_KEY_ID, ident_name, NULL };
|
||||
@@ -472,21 +465,18 @@ static const char *const cert_type_name[] = {
|
||||
"CERT_ARL",
|
||||
"CERT_SPKI",
|
||||
"CERT_X509_ATTRIBUTE",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names cert_type_names =
|
||||
{ CERT_NONE, CERT_X509_ATTRIBUTE, cert_type_name, NULL };
|
||||
|
||||
/* Certificate policy names */
|
||||
|
||||
static const char *const cert_policy_name[] = {
|
||||
ENUM(cert_policy_names, CERT_ALWAYS_SEND, CERT_NEVER_SEND,
|
||||
"ALWAYS_SEND",
|
||||
"SEND_IF_ASKED",
|
||||
"NEVER_SEND",
|
||||
};
|
||||
|
||||
enum_names cert_policy_names =
|
||||
{ CERT_ALWAYS_SEND, CERT_NEVER_SEND, cert_policy_name, NULL };
|
||||
);
|
||||
|
||||
/* Goal BITs for establishing an SA
|
||||
* Note: we drop the POLICY_ prefix so that logs are more concise.
|
||||
@@ -520,21 +510,21 @@ const char *const sa_policy_bit_names[] = {
|
||||
"ECDSA",
|
||||
"PROXY",
|
||||
NULL
|
||||
};
|
||||
};
|
||||
|
||||
const char *const policy_shunt_names[4] = {
|
||||
"TRAP",
|
||||
"PASS",
|
||||
"DROP",
|
||||
"REJECT",
|
||||
};
|
||||
};
|
||||
|
||||
const char *const policy_fail_names[4] = {
|
||||
"NONE",
|
||||
"PASS",
|
||||
"DROP",
|
||||
"REJECT",
|
||||
};
|
||||
};
|
||||
|
||||
/* Oakley transform attributes
|
||||
* oakley_attr_bit_names does double duty: it is used for enum names
|
||||
@@ -560,7 +550,7 @@ const char *const oakley_attr_bit_names[] = {
|
||||
"OAKLEY_GROUP_ORDER",
|
||||
"OAKLEY_BLOCK_SIZE",
|
||||
NULL
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const oakley_var_attr_name[] = {
|
||||
"OAKLEY_GROUP_PRIME (variable length)",
|
||||
@@ -574,7 +564,7 @@ static const char *const oakley_var_attr_name[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
"OAKLEY_GROUP_ORDER (variable length)",
|
||||
};
|
||||
};
|
||||
|
||||
static enum_names oakley_attr_desc_tv = {
|
||||
OAKLEY_ENCRYPTION_ALGORITHM + ISAKMP_ATTR_AF_TV,
|
||||
@@ -603,7 +593,7 @@ enum_names *oakley_attr_val_descs[] = {
|
||||
NULL, /* OAKLEY_KEY_LENGTH */
|
||||
NULL, /* OAKLEY_FIELD_SIZE */
|
||||
NULL, /* OAKLEY_GROUP_ORDER */
|
||||
};
|
||||
};
|
||||
|
||||
/* IPsec DOI attributes (RFC 2407 "IPsec DOI" section 4.5) */
|
||||
|
||||
@@ -617,7 +607,7 @@ static const char *const ipsec_attr_name[] = {
|
||||
"KEY_ROUNDS",
|
||||
"COMPRESS_DICT_SIZE",
|
||||
"COMPRESS_PRIVATE_ALG",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const ipsec_var_attr_name[] = {
|
||||
"SA_LIFE_DURATION (variable length)",
|
||||
@@ -628,7 +618,7 @@ static const char *const ipsec_var_attr_name[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
"COMPRESS_PRIVATE_ALG (variable length)",
|
||||
};
|
||||
};
|
||||
|
||||
static enum_names ipsec_attr_desc_tv = {
|
||||
SA_LIFE_TYPE + ISAKMP_ATTR_AF_TV,
|
||||
@@ -651,14 +641,14 @@ enum_names *ipsec_attr_val_descs[] = {
|
||||
NULL, /* KEY_ROUNDS */
|
||||
NULL, /* COMPRESS_DICT_SIZE */
|
||||
NULL, /* COMPRESS_PRIVATE_ALG */
|
||||
};
|
||||
};
|
||||
|
||||
/* SA Lifetime Type attribute */
|
||||
|
||||
static const char *const sa_lifetime_name[] = {
|
||||
"SA_LIFE_TYPE_SECONDS",
|
||||
"SA_LIFE_TYPE_KBYTES",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names sa_lifetime_names =
|
||||
{ SA_LIFE_TYPE_SECONDS, SA_LIFE_TYPE_KBYTES, sa_lifetime_name, NULL };
|
||||
@@ -670,7 +660,7 @@ static const char *const enc_mode_name[] = {
|
||||
"ENCAPSULATION_MODE_TRANSPORT",
|
||||
"ENCAPSULATION_MODE_UDP_TUNNEL",
|
||||
"ENCAPSULATION_MODE_UDP_TRANSPORT",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const enc_udp_mode_name[] = {
|
||||
"ENCAPSULATION_MODE_UDP_TUNNEL",
|
||||
@@ -696,7 +686,7 @@ static const char *const auth_alg_name[] = {
|
||||
"AUTH_ALGORITHM_HMAC_RIPEMD",
|
||||
"AUTH_ALGORITHM_AES_XCBC_MAC",
|
||||
"AUTH_ALGORITHM_SIG_RSA"
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const extended_auth_alg_name[] = {
|
||||
"AUTH_ALGORITHM_NULL"
|
||||
@@ -730,7 +720,7 @@ static const char *const xauth_attr_tv_name[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
"XAUTH_STATUS",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names xauth_attr_tv_names = {
|
||||
XAUTH_TYPE + ISAKMP_ATTR_AF_TV,
|
||||
@@ -771,7 +761,7 @@ static const char *const xauth_attr_name[] = {
|
||||
"XAUTH_STATUS (wrong TLV syntax, should be TV)",
|
||||
"XAUTH_NEXT_PIN",
|
||||
"XAUTH_ANSWER",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names xauth_attr_names =
|
||||
{ XAUTH_USER_NAME , XAUTH_ANSWER, xauth_attr_name , µsoft_attr_names };
|
||||
@@ -792,7 +782,7 @@ static const char *const modecfg_attr_name[] = {
|
||||
"INTERNAL_IP4_SUBNET",
|
||||
"SUPPORTED_ATTRIBUTES",
|
||||
"INTERNAL_IP6_SUBNET",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names modecfg_attr_names =
|
||||
{ INTERNAL_IP4_ADDRESS, INTERNAL_IP6_SUBNET, modecfg_attr_name , &xauth_attr_names };
|
||||
@@ -802,7 +792,7 @@ enum_names modecfg_attr_names =
|
||||
static const char *const oakley_lifetime_name[] = {
|
||||
"OAKLEY_LIFE_SECONDS",
|
||||
"OAKLEY_LIFE_KILOBYTES",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names oakley_lifetime_names =
|
||||
{ OAKLEY_LIFE_SECONDS, OAKLEY_LIFE_KILOBYTES, oakley_lifetime_name, NULL };
|
||||
@@ -822,7 +812,7 @@ static const char *const oakley_enc_name[] = {
|
||||
"OAKLEY_3DES_CBC",
|
||||
"OAKLEY_CAST_CBC",
|
||||
"OAKLEY_AES_CBC",
|
||||
};
|
||||
};
|
||||
|
||||
#ifdef NO_EXTRA_IKE
|
||||
enum_names oakley_enc_names =
|
||||
@@ -835,9 +825,11 @@ static const char *const oakley_enc_name_draft_aes_cbc_02[] = {
|
||||
"OAKLEY_SERPENT_CBC" /* 65004 */,
|
||||
"OAKLEY_TWOFISH_CBC" /* 65005 */,
|
||||
};
|
||||
|
||||
static const char *const oakley_enc_name_ssh[] = {
|
||||
"OAKLEY_TWOFISH_CBC_SSH",
|
||||
};
|
||||
|
||||
enum_names oakley_enc_names_ssh =
|
||||
{ OAKLEY_TWOFISH_CBC_SSH, OAKLEY_TWOFISH_CBC_SSH, oakley_enc_name_ssh
|
||||
, NULL };
|
||||
@@ -860,7 +852,7 @@ static const char *const oakley_hash_name[] = {
|
||||
"OAKLEY_SHA2_256",
|
||||
"OAKLEY_SHA2_384",
|
||||
"OAKLEY_SHA2_512",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names oakley_hash_names =
|
||||
{ OAKLEY_MD5, OAKLEY_SHA2_512, oakley_hash_name, NULL };
|
||||
@@ -875,14 +867,14 @@ static const char *const oakley_auth_name1[] = {
|
||||
"OAKLEY_RSA_ENC_REV",
|
||||
"OAKLEY_ELGAMAL_ENC",
|
||||
"OAKLEY_ELGAMAL_ENC_REV",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const oakley_auth_name2[] = {
|
||||
"HybridInitRSA",
|
||||
"HybridRespRSA",
|
||||
"HybridInitDSS",
|
||||
"HybridRespDSS",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const oakley_auth_name3[] = {
|
||||
"XAUTHInitPreShared",
|
||||
@@ -895,7 +887,7 @@ static const char *const oakley_auth_name3[] = {
|
||||
"XAUTHRespRSAEncryption",
|
||||
"XAUTHInitRSARevisedEncryption",
|
||||
"XAUTHRespRSARevisedEncryption",
|
||||
};
|
||||
};
|
||||
|
||||
static enum_names oakley_auth_names1 =
|
||||
{ OAKLEY_PRESHARED_KEY, OAKLEY_ELGAMAL_ENC_REV
|
||||
@@ -917,7 +909,7 @@ static const char *const oakley_group_name[] = {
|
||||
"OAKLEY_GROUP_GP155",
|
||||
"OAKLEY_GROUP_GP185",
|
||||
"OAKLEY_GROUP_MODP1536",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const oakley_group_name_rfc3526[] = {
|
||||
"OAKLEY_GROUP_MODP2048",
|
||||
@@ -926,6 +918,7 @@ static const char *const oakley_group_name_rfc3526[] = {
|
||||
"OAKLEY_GROUP_MODP6144",
|
||||
"OAKLEY_GROUP_MODP8192"
|
||||
};
|
||||
|
||||
enum_names oakley_group_names_rfc3526 =
|
||||
{ OAKLEY_GROUP_MODP2048, OAKLEY_GROUP_MODP8192,
|
||||
oakley_group_name_rfc3526, NULL };
|
||||
@@ -940,7 +933,7 @@ static const char *const oakley_group_type_name[] = {
|
||||
"OAKLEY_GROUP_TYPE_MODP",
|
||||
"OAKLEY_GROUP_TYPE_ECP",
|
||||
"OAKLEY_GROUP_TYPE_EC2N",
|
||||
};
|
||||
};
|
||||
|
||||
enum_names oakley_group_type_names =
|
||||
{ OAKLEY_GROUP_TYPE_MODP, OAKLEY_GROUP_TYPE_EC2N, oakley_group_type_name, NULL };
|
||||
@@ -978,17 +971,17 @@ static const char *const notification_name[] = {
|
||||
"CERTIFICATE_UNAVAILABLE",
|
||||
"UNSUPPORTED_EXCHANGE_TYPE",
|
||||
"UNEQUAL_PAYLOAD_LENGTHS",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const notification_status_name[] = {
|
||||
"CONNECTED",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const ipsec_notification_name[] = {
|
||||
"IPSEC_RESPONDER_LIFETIME",
|
||||
"IPSEC_REPLAY_STATUS",
|
||||
"IPSEC_INITIAL_CONTACT",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const notification_dpd_name[] = {
|
||||
"R_U_THERE",
|
||||
@@ -1021,7 +1014,7 @@ const char *const attr_msg_type_name[] = {
|
||||
"ISAKMP_CFG_SET",
|
||||
"ISAKMP_CFG_ACK",
|
||||
NULL
|
||||
};
|
||||
};
|
||||
|
||||
enum_names attr_msg_type_names =
|
||||
{ 0 , ISAKMP_CFG_ACK, attr_msg_type_name , NULL };
|
||||
@@ -1030,11 +1023,11 @@ enum_names attr_msg_type_names =
|
||||
|
||||
static const char *const af_inet_name[] = {
|
||||
"AF_INET",
|
||||
};
|
||||
};
|
||||
|
||||
static const char *const af_inet6_name[] = {
|
||||
"AF_INET6",
|
||||
};
|
||||
};
|
||||
|
||||
static enum_names af_names6 = { AF_INET6, AF_INET6, af_inet6_name, NULL };
|
||||
|
||||
@@ -1052,7 +1045,7 @@ const struct af_info af_inet4_info = {
|
||||
32,
|
||||
ID_IPV4_ADDR, ID_IPV4_ADDR_SUBNET, ID_IPV4_ADDR_RANGE,
|
||||
&ipv4_any, &ipv4_wildcard, &ipv4_all,
|
||||
};
|
||||
};
|
||||
|
||||
const struct af_info af_inet6_info = {
|
||||
AF_INET6,
|
||||
@@ -1062,7 +1055,7 @@ const struct af_info af_inet6_info = {
|
||||
128,
|
||||
ID_IPV6_ADDR, ID_IPV6_ADDR_SUBNET, ID_IPV6_ADDR_RANGE,
|
||||
&ipv6_any, &ipv6_wildcard, &ipv6_all,
|
||||
};
|
||||
};
|
||||
|
||||
const struct af_info *
|
||||
aftoinfo(int af)
|
||||
@@ -1128,7 +1121,7 @@ static const char *const rr_type_name[] = {
|
||||
"T_ATMA", /* 34 ATM Address */
|
||||
"T_NAPTR", /* 35 Naming Authority PoinTeR */
|
||||
NULL
|
||||
};
|
||||
};
|
||||
|
||||
enum_names rr_type_names = { T_A, T_NAPTR, rr_type_name, NULL };
|
||||
|
||||
@@ -1140,14 +1133,14 @@ static const char *const rr_qtype_name[] = {
|
||||
"T_MAILA", /* 254 transfer mail agent records */
|
||||
"T_ANY", /* 255 wildcard match */
|
||||
NULL
|
||||
};
|
||||
};
|
||||
|
||||
enum_names rr_qtype_names = { T_IXFR, T_ANY, rr_qtype_name, &rr_type_names };
|
||||
|
||||
static const char *const rr_class_name[] = {
|
||||
"C_IN", /* 1 the arpa internet */
|
||||
NULL
|
||||
};
|
||||
};
|
||||
|
||||
enum_names rr_class_names = { C_IN, C_IN, rr_class_name, NULL };
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ typedef enum {
|
||||
|
||||
/* RFC 2459 CRL reason codes */
|
||||
|
||||
extern enum_names crl_reason_names;
|
||||
extern enum_name_t *crl_reason_names;
|
||||
|
||||
typedef enum {
|
||||
REASON_UNSPECIFIED = 0,
|
||||
@@ -335,7 +335,7 @@ typedef enum {
|
||||
|
||||
/* RFC 3706 Dead Peer Detection */
|
||||
|
||||
extern enum_names dpd_action_names;
|
||||
extern enum_name_t *dpd_action_names;
|
||||
|
||||
typedef enum {
|
||||
DPD_ACTION_NONE = 0,
|
||||
@@ -347,7 +347,7 @@ typedef enum {
|
||||
|
||||
/* Timer events */
|
||||
|
||||
extern enum_names timer_event_names;
|
||||
extern enum_name_t *timer_event_names;
|
||||
|
||||
enum event_type {
|
||||
EVENT_NULL, /* non-event */
|
||||
@@ -798,7 +798,8 @@ typedef u_int16_t cpi_t;
|
||||
|
||||
extern enum_names ident_names;
|
||||
extern enum_names cert_type_names;
|
||||
extern enum_names cert_policy_names;
|
||||
|
||||
extern enum_name_t *cert_policy_names;
|
||||
|
||||
typedef enum certpolicy {
|
||||
CERT_ALWAYS_SEND = 0, /* the default */
|
||||
|
||||
+1
-1
@@ -391,7 +391,7 @@ parse_crl_reasonCode(chunk_t object)
|
||||
}
|
||||
|
||||
DBG(DBG_PARSING,
|
||||
DBG_log(" '%s'", enum_name(&crl_reason_names, reason))
|
||||
DBG_log(" '%N'", crl_reason_names, reason)
|
||||
)
|
||||
return reason;
|
||||
}
|
||||
|
||||
@@ -3573,8 +3573,7 @@ main_inR2_outI3(struct msg_digest *md)
|
||||
if (RSA_auth)
|
||||
{
|
||||
DBG(DBG_CONTROL,
|
||||
DBG_log("our certificate policy is %s"
|
||||
, enum_name(&cert_policy_names, cert_policy))
|
||||
DBG_log("our certificate policy is %N", cert_policy_names, cert_policy)
|
||||
)
|
||||
if (mycert.type != CERT_NONE)
|
||||
{
|
||||
@@ -3988,8 +3987,7 @@ main_inI3_outR3_tail(struct msg_digest *md
|
||||
if (RSA_auth)
|
||||
{
|
||||
DBG(DBG_CONTROL,
|
||||
DBG_log("our certificate policy is %s"
|
||||
, enum_name(&cert_policy_names, cert_policy))
|
||||
DBG_log("our certificate policy is %N", cert_policy_names, cert_policy)
|
||||
)
|
||||
if (mycert.type != CERT_NONE)
|
||||
{
|
||||
|
||||
@@ -94,6 +94,9 @@ void library_init(char *settings)
|
||||
PRINTF_HOOK_ARGTYPE_END);
|
||||
pfh->add_handler(pfh, 'B', chunk_printf_hook,
|
||||
PRINTF_HOOK_ARGTYPE_POINTER, PRINTF_HOOK_ARGTYPE_END);
|
||||
pfh->add_handler(pfh, 'N', enum_printf_hook,
|
||||
PRINTF_HOOK_ARGTYPE_POINTER, PRINTF_HOOK_ARGTYPE_INT,
|
||||
PRINTF_HOOK_ARGTYPE_END);
|
||||
pfh->add_handler(pfh, 'T', time_printf_hook,
|
||||
PRINTF_HOOK_ARGTYPE_POINTER, PRINTF_HOOK_ARGTYPE_INT,
|
||||
PRINTF_HOOK_ARGTYPE_END);
|
||||
|
||||
+2
-2
@@ -746,12 +746,12 @@ void fmt_state(bool all, struct state *st, time_t n
|
||||
fmt_conn_instance(c, inst);
|
||||
|
||||
snprintf(state_buf, state_buf_len
|
||||
, "#%lu: \"%s\"%s %s (%s); %s in %lds%s%s%s%s"
|
||||
, "#%lu: \"%s\"%s %s (%s); %N in %lds%s%s%s%s"
|
||||
, st->st_serialno
|
||||
, c->name, inst
|
||||
, enum_name(&state_names, st->st_state)
|
||||
, state_story[st->st_state - STATE_MAIN_R0]
|
||||
, enum_name(&timer_event_names, st->st_event->ev_type)
|
||||
, timer_event_names, st->st_event->ev_type
|
||||
, delta
|
||||
, np1, np2, eo, dpd);
|
||||
|
||||
|
||||
+22
-22
@@ -98,11 +98,11 @@ event_schedule(enum event_type type, time_t tm, struct state *st)
|
||||
|
||||
DBG(DBG_CONTROL,
|
||||
if (st == NULL)
|
||||
DBG_log("inserting event %s, timeout in %lu seconds"
|
||||
, enum_show(&timer_event_names, type), (unsigned long)tm);
|
||||
DBG_log("inserting event %N, timeout in %lu seconds"
|
||||
, timer_event_names, type, (unsigned long)tm);
|
||||
else
|
||||
DBG_log("inserting event %s, timeout in %lu seconds for #%lu"
|
||||
, enum_show(&timer_event_names, type), (unsigned long)tm
|
||||
DBG_log("inserting event %N, timeout in %lu seconds for #%lu"
|
||||
, timer_event_names, type, (unsigned long)tm
|
||||
, ev->ev_state->st_serialno));
|
||||
|
||||
if (evlist == (struct event *) NULL
|
||||
@@ -122,11 +122,11 @@ event_schedule(enum event_type type, time_t tm, struct state *st)
|
||||
#ifdef NEVER /* this seems to be overkill */
|
||||
DBG(DBG_CONTROL,
|
||||
if (evt->ev_state == NULL)
|
||||
DBG_log("event added after event %s"
|
||||
, enum_show(&timer_event_names, evt->ev_type));
|
||||
DBG_log("event added after event %N"
|
||||
, timer_event_names, evt->ev_type);
|
||||
else
|
||||
DBG_log("event added after event %s for #%lu"
|
||||
, enum_show(&timer_event_names, evt->ev_type)
|
||||
DBG_log("event added after event %N for #%lu"
|
||||
, timer_event_names, evt->ev_type,
|
||||
, evt->ev_state->st_serialno));
|
||||
#endif /* NEVER */
|
||||
|
||||
@@ -161,9 +161,9 @@ handle_timer_event(void)
|
||||
|
||||
if (tm < ev->ev_time)
|
||||
{
|
||||
DBG(DBG_CONTROL, DBG_log("called while no event expired (%lu/%lu, %s)"
|
||||
DBG(DBG_CONTROL, DBG_log("called while no event expired (%lu/%lu, %N)"
|
||||
, (unsigned long)tm, (unsigned long)ev->ev_time
|
||||
, enum_show(&timer_event_names, type)));
|
||||
, timer_event_names, type));
|
||||
|
||||
/* This will happen if the most close-to-expire event was
|
||||
* a retransmission or cleanup, and we received a packet
|
||||
@@ -178,8 +178,8 @@ handle_timer_event(void)
|
||||
|
||||
DBG(DBG_CONTROL,
|
||||
if (evlist != (struct event *) NULL)
|
||||
DBG_log("event after this is %s in %ld seconds"
|
||||
, enum_show(&timer_event_names, evlist->ev_type)
|
||||
DBG_log("event after this is %N in %ld seconds"
|
||||
, timer_event_names, evlist->ev_type
|
||||
, (long) (evlist->ev_time - tm)));
|
||||
|
||||
/* for state-associated events, pick up the state pointer
|
||||
@@ -428,8 +428,8 @@ handle_timer_event(void)
|
||||
nat_traversal_ka_event();
|
||||
break;
|
||||
default:
|
||||
loglog(RC_LOG_SERIOUS, "INTERNAL ERROR: ignoring unknown expiring event %s"
|
||||
, enum_show(&timer_event_names, type));
|
||||
loglog(RC_LOG_SERIOUS, "INTERNAL ERROR: ignoring unknown expiring event %N"
|
||||
, timer_event_names, type);
|
||||
}
|
||||
|
||||
free(ev);
|
||||
@@ -452,12 +452,12 @@ next_event(void)
|
||||
|
||||
DBG(DBG_CONTROL,
|
||||
if (evlist->ev_state == NULL)
|
||||
DBG_log("next event %s in %ld seconds"
|
||||
, enum_show(&timer_event_names, evlist->ev_type)
|
||||
DBG_log("next event %N in %ld seconds"
|
||||
, timer_event_names, evlist->ev_type
|
||||
, (long)evlist->ev_time - (long)tm);
|
||||
else
|
||||
DBG_log("next event %s in %ld seconds for #%lu"
|
||||
, enum_show(&timer_event_names, evlist->ev_type)
|
||||
DBG_log("next event %N in %ld seconds for #%lu"
|
||||
, timer_event_names, evlist->ev_type
|
||||
, (long)evlist->ev_time - (long)tm
|
||||
, evlist->ev_state->st_serialno));
|
||||
|
||||
@@ -481,8 +481,8 @@ delete_event(struct state *st)
|
||||
{
|
||||
if (*ev == NULL)
|
||||
{
|
||||
DBG(DBG_CONTROL, DBG_log("event %s to be deleted not found",
|
||||
enum_show(&timer_event_names, st->st_event->ev_type)));
|
||||
DBG(DBG_CONTROL, DBG_log("event %N to be deleted not found",
|
||||
timer_event_names, st->st_event->ev_type));
|
||||
break;
|
||||
}
|
||||
if ((*ev) == st->st_event)
|
||||
@@ -516,8 +516,8 @@ delete_dpd_event(struct state *st)
|
||||
{
|
||||
if (*ev == NULL)
|
||||
{
|
||||
DBG(DBG_CONTROL, DBG_log("event %s to be deleted not found",
|
||||
enum_show(&timer_event_names, st->st_dpd_event->ev_type)));
|
||||
DBG(DBG_CONTROL, DBG_log("event %N to be deleted not found",
|
||||
timer_event_names, st->st_dpd_event->ev_type));
|
||||
break;
|
||||
}
|
||||
if ((*ev) == st->st_dpd_event)
|
||||
|
||||
+2
-2
@@ -2245,9 +2245,9 @@ verify_x509cert(const x509cert_t *cert, bool strict, time_t *until)
|
||||
}
|
||||
break;
|
||||
case CERT_REVOKED:
|
||||
plog("certificate was revoked on %T, reason: %s"
|
||||
plog("certificate was revoked on %T, reason: %N"
|
||||
, &revocationDate, TRUE
|
||||
, enum_name(&crl_reason_names, revocationReason));
|
||||
, crl_reason_names, revocationReason);
|
||||
remove_x509_public_key(cert);
|
||||
return FALSE;
|
||||
case CERT_UNKNOWN:
|
||||
|
||||
Reference in New Issue
Block a user