payload: Use common prefixes for all payload type identifiers
authorMartin Willi <martin@revosec.ch>
Tue, 29 Oct 2013 09:09:39 +0000 (10:09 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:03 +0000 (15:53 +0200)
The old identifiers did not use a proper namespace and often clashed with
other defines.

104 files changed:
src/charon-tkm/src/tkm/tkm_listener.c
src/conftest/hooks/add_notify.c
src/conftest/hooks/custom_proposal.c
src/conftest/hooks/force_cookie.c
src/conftest/hooks/ike_auth_fill.c
src/conftest/hooks/log_id.c
src/conftest/hooks/log_ke.c
src/conftest/hooks/log_proposals.c
src/conftest/hooks/log_ts.c
src/conftest/hooks/pretend_auth.c
src/conftest/hooks/rebuild_auth.c
src/conftest/hooks/set_proposal_number.c
src/conftest/hooks/set_reserved.c
src/conftest/hooks/unencrypted_notify.c
src/libcharon/encoding/generator.c
src/libcharon/encoding/message.c
src/libcharon/encoding/parser.c
src/libcharon/encoding/payloads/auth_payload.c
src/libcharon/encoding/payloads/cert_payload.c
src/libcharon/encoding/payloads/certreq_payload.c
src/libcharon/encoding/payloads/configuration_attribute.c
src/libcharon/encoding/payloads/configuration_attribute.h
src/libcharon/encoding/payloads/cp_payload.c
src/libcharon/encoding/payloads/cp_payload.h
src/libcharon/encoding/payloads/delete_payload.c
src/libcharon/encoding/payloads/delete_payload.h
src/libcharon/encoding/payloads/eap_payload.c
src/libcharon/encoding/payloads/encryption_payload.c
src/libcharon/encoding/payloads/encryption_payload.h
src/libcharon/encoding/payloads/endpoint_notify.c
src/libcharon/encoding/payloads/fragment_payload.c
src/libcharon/encoding/payloads/hash_payload.c
src/libcharon/encoding/payloads/hash_payload.h
src/libcharon/encoding/payloads/id_payload.c
src/libcharon/encoding/payloads/id_payload.h
src/libcharon/encoding/payloads/ike_header.c
src/libcharon/encoding/payloads/ke_payload.c
src/libcharon/encoding/payloads/ke_payload.h
src/libcharon/encoding/payloads/nonce_payload.c
src/libcharon/encoding/payloads/nonce_payload.h
src/libcharon/encoding/payloads/notify_payload.c
src/libcharon/encoding/payloads/notify_payload.h
src/libcharon/encoding/payloads/payload.c
src/libcharon/encoding/payloads/payload.h
src/libcharon/encoding/payloads/proposal_substructure.c
src/libcharon/encoding/payloads/proposal_substructure.h
src/libcharon/encoding/payloads/sa_payload.c
src/libcharon/encoding/payloads/sa_payload.h
src/libcharon/encoding/payloads/traffic_selector_substructure.c
src/libcharon/encoding/payloads/transform_attribute.c
src/libcharon/encoding/payloads/transform_attribute.h
src/libcharon/encoding/payloads/transform_substructure.c
src/libcharon/encoding/payloads/transform_substructure.h
src/libcharon/encoding/payloads/ts_payload.c
src/libcharon/encoding/payloads/unknown_payload.c
src/libcharon/encoding/payloads/vendor_id_payload.c
src/libcharon/encoding/payloads/vendor_id_payload.h
src/libcharon/network/receiver.c
src/libcharon/plugins/eap_gtc/eap_gtc.c
src/libcharon/plugins/eap_radius/eap_radius_forward.c
src/libcharon/plugins/eap_radius/eap_radius_xauth.c
src/libcharon/plugins/radattr/radattr_listener.c
src/libcharon/plugins/xauth_eap/xauth_eap.c
src/libcharon/plugins/xauth_generic/xauth_generic.c
src/libcharon/plugins/xauth_pam/xauth_pam.c
src/libcharon/processing/jobs/process_message_job.c
src/libcharon/sa/authenticator.c
src/libcharon/sa/ike_sa_manager.c
src/libcharon/sa/ikev1/authenticators/psk_v1_authenticator.c
src/libcharon/sa/ikev1/authenticators/pubkey_v1_authenticator.c
src/libcharon/sa/ikev1/keymat_v1.c
src/libcharon/sa/ikev1/phase1.c
src/libcharon/sa/ikev1/task_manager_v1.c
src/libcharon/sa/ikev1/tasks/aggressive_mode.c
src/libcharon/sa/ikev1/tasks/informational.c
src/libcharon/sa/ikev1/tasks/isakmp_cert_post.c
src/libcharon/sa/ikev1/tasks/isakmp_cert_pre.c
src/libcharon/sa/ikev1/tasks/isakmp_delete.c
src/libcharon/sa/ikev1/tasks/isakmp_dpd.c
src/libcharon/sa/ikev1/tasks/isakmp_natd.c
src/libcharon/sa/ikev1/tasks/isakmp_vendor.c
src/libcharon/sa/ikev1/tasks/main_mode.c
src/libcharon/sa/ikev1/tasks/mode_config.c
src/libcharon/sa/ikev1/tasks/quick_delete.c
src/libcharon/sa/ikev1/tasks/quick_mode.c
src/libcharon/sa/ikev1/tasks/xauth.c
src/libcharon/sa/ikev2/authenticators/eap_authenticator.c
src/libcharon/sa/ikev2/authenticators/psk_authenticator.c
src/libcharon/sa/ikev2/authenticators/pubkey_authenticator.c
src/libcharon/sa/ikev2/connect_manager.c
src/libcharon/sa/ikev2/task_manager_v2.c
src/libcharon/sa/ikev2/tasks/child_create.c
src/libcharon/sa/ikev2/tasks/child_delete.c
src/libcharon/sa/ikev2/tasks/child_rekey.c
src/libcharon/sa/ikev2/tasks/ike_auth.c
src/libcharon/sa/ikev2/tasks/ike_cert_post.c
src/libcharon/sa/ikev2/tasks/ike_cert_pre.c
src/libcharon/sa/ikev2/tasks/ike_config.c
src/libcharon/sa/ikev2/tasks/ike_delete.c
src/libcharon/sa/ikev2/tasks/ike_init.c
src/libcharon/sa/ikev2/tasks/ike_me.c
src/libcharon/sa/ikev2/tasks/ike_mobike.c
src/libcharon/sa/ikev2/tasks/ike_natd.c
src/libcharon/sa/ikev2/tasks/ike_vendor.c

index 0505864..b2692a5 100644 (file)
@@ -310,7 +310,7 @@ METHOD(listener_t, message, bool,
             " (ISA context %llu)", isa_id);
 
        auth_payload = (auth_payload_t*)message->get_payload(message,
-                                                                                                                AUTHENTICATION);
+                                                                                                                PLV2_AUTH);
        if (auth_payload)
        {
                chunk_t auth_data;
index 504b02a..73a9b1a 100644 (file)
@@ -88,7 +88,7 @@ METHOD(listener_t, message, bool,
                {
                        data = chunk_clone(chunk_create(this->data, strlen(this->data)));
                }
-               notify = notify_payload_create_from_protocol_and_type(NOTIFY,
+               notify = notify_payload_create_from_protocol_and_type(PLV2_NOTIFY,
                                                                        this->esp ? PROTO_ESP : PROTO_IKE, type);
                notify->set_spi(notify, this->spi);
                if (data.len)
index 6086d13..ee44045 100644 (file)
@@ -124,7 +124,7 @@ METHOD(listener_t, message, bool,
                enumerator = message->create_payload_enumerator(message);
                while (enumerator->enumerate(enumerator, &payload))
                {
-                       if (payload->get_type(payload) == SECURITY_ASSOCIATION)
+                       if (payload->get_type(payload) == PLV2_SECURITY_ASSOCIATION)
                        {
                                old = (sa_payload_t*)payload;
                                message->remove_payload_at(message, enumerator);
index 1b044db..6be516c 100644 (file)
@@ -44,7 +44,7 @@ METHOD(listener_t, message, bool,
                enumerator = message->create_payload_enumerator(message);
                while (enumerator->enumerate(enumerator, &payload))
                {
-                       if (payload->get_type(payload) == NOTIFY)
+                       if (payload->get_type(payload) == PLV2_NOTIFY)
                        {
                                notify_payload_t *notify = (notify_payload_t*)payload;
                                chunk_t data;
index 09590d4..5cdd5be 100644 (file)
@@ -108,7 +108,7 @@ METHOD(listener_t, message, bool,
                        diff = this->bytes - size - CERT_PAYLOAD_HEADER_LENGTH;
                        data = chunk_alloc(diff);
                        memset(data.ptr, 0x12, data.len);
-                       pld = cert_payload_create_custom(CERTIFICATE, 201, data);
+                       pld = cert_payload_create_custom(PLV2_CERTIFICATE, 201, data);
                        message->add_payload(message, &pld->payload_interface);
                        DBG1(DBG_CFG, "inserting %d dummy bytes certificate payload", diff);
                }
index 07dd6a4..f47372f 100644 (file)
@@ -45,8 +45,8 @@ METHOD(listener_t, message, bool,
                enumerator = message->create_payload_enumerator(message);
                while (enumerator->enumerate(enumerator, &payload))
                {
-                       if (payload->get_type(payload) == ID_INITIATOR ||
-                               payload->get_type(payload) == ID_RESPONDER)
+                       if (payload->get_type(payload) == PLV2_ID_INITIATOR ||
+                               payload->get_type(payload) == PLV2_ID_RESPONDER)
                        {
                                id_payload = (id_payload_t*)payload;
                                id = id_payload->get_identification(id_payload);
index 7104823..66aa4a6 100644 (file)
@@ -43,7 +43,7 @@ METHOD(listener_t, message, bool,
                enumerator = message->create_payload_enumerator(message);
                while (enumerator->enumerate(enumerator, &payload))
                {
-                       if (payload->get_type(payload) == KEY_EXCHANGE)
+                       if (payload->get_type(payload) == PLV2_KEY_EXCHANGE)
                        {
                                ke = (ke_payload_t*)payload;
                                DBG1(DBG_CFG, "received DH group %N",
index 347b832..c0d458e 100644 (file)
@@ -45,7 +45,7 @@ METHOD(listener_t, message, bool,
                enumerator = message->create_payload_enumerator(message);
                while (enumerator->enumerate(enumerator, &payload))
                {
-                       if (payload->get_type(payload) == SECURITY_ASSOCIATION)
+                       if (payload->get_type(payload) == PLV2_SECURITY_ASSOCIATION)
                        {
                                sa = (sa_payload_t*)payload;
                                list = sa->get_proposals(sa);
index f212efa..79c59b8 100644 (file)
@@ -43,8 +43,8 @@ METHOD(listener_t, message, bool,
                enumerator = message->create_payload_enumerator(message);
                while (enumerator->enumerate(enumerator, &payload))
                {
-                       if (payload->get_type(payload) == TRAFFIC_SELECTOR_INITIATOR ||
-                               payload->get_type(payload) == TRAFFIC_SELECTOR_RESPONDER)
+                       if (payload->get_type(payload) == PLV2_TS_INITIATOR ||
+                               payload->get_type(payload) == PLV2_TS_RESPONDER)
                        {
                                ts = (ts_payload_t*)payload;
                                host_t *from, *to;
index 4166afc..54957b0 100644 (file)
@@ -79,7 +79,7 @@ static void process_init_request(private_pretend_auth_t *this,
 {
        nonce_payload_t *nonce;
 
-       nonce = (nonce_payload_t*)message->get_payload(message, NONCE);
+       nonce = (nonce_payload_t*)message->get_payload(message, PLV2_NONCE);
        if (nonce)
        {
                free(this->nonce.ptr);
@@ -98,13 +98,13 @@ static void process_auth_request(private_pretend_auth_t *this,
        ts_payload_t *tsi, *tsr;
        linked_list_t *proposals;
 
-       id = (id_payload_t*)message->get_payload(message, ID_RESPONDER);
+       id = (id_payload_t*)message->get_payload(message, PLV2_ID_RESPONDER);
        if (id)
        {
                this->id->destroy(this->id);
                this->id = id->get_identification(id);
        }
-       sa = (sa_payload_t*)message->get_payload(message, SECURITY_ASSOCIATION);
+       sa = (sa_payload_t*)message->get_payload(message, PLV2_SECURITY_ASSOCIATION);
        if (sa)
        {
                proposals = sa->get_proposals(sa);
@@ -116,13 +116,13 @@ static void process_auth_request(private_pretend_auth_t *this,
                proposals->destroy_offset(proposals, offsetof(proposal_t, destroy));
        }
        tsi = (ts_payload_t*)message->get_payload(message,
-                                                                                         TRAFFIC_SELECTOR_INITIATOR);
+                                                                                         PLV2_TS_INITIATOR);
        if (tsi)
        {
                this->tsi = tsi->get_traffic_selectors(tsi);
        }
        tsr = (ts_payload_t*)message->get_payload(message,
-                                                                                         TRAFFIC_SELECTOR_RESPONDER);
+                                                                                         PLV2_TS_RESPONDER);
        if (tsr)
        {
                this->tsr = tsr->get_traffic_selectors(tsr);
@@ -154,7 +154,7 @@ static void build_certs(private_pretend_auth_t *this,
        cert = auth->get(auth, AUTH_RULE_SUBJECT_CERT);
        if (cert)
        {
-               payload = cert_payload_create_from_cert(CERTIFICATE, cert);
+               payload = cert_payload_create_from_cert(PLV2_CERTIFICATE, cert);
                if (payload)
                {
                        DBG1(DBG_IKE, "pretending end entity cert \"%Y\"",
@@ -167,7 +167,7 @@ static void build_certs(private_pretend_auth_t *this,
        {
                if (type == AUTH_RULE_IM_CERT)
                {
-                       payload = cert_payload_create_from_cert(CERTIFICATE, cert);
+                       payload = cert_payload_create_from_cert(PLV2_CERTIFICATE, cert);
                        if (payload)
                        {
                                DBG1(DBG_IKE, "pretending issuer cert \"%Y\"",
@@ -276,7 +276,7 @@ static void process_auth_response(private_pretend_auth_t *this,
        {
                notify_payload_t *notify = (notify_payload_t*)payload;
 
-               if (payload->get_type(payload) != NOTIFY ||
+               if (payload->get_type(payload) != PLV2_NOTIFY ||
                        notify->get_notify_type(notify) != AUTHENTICATION_FAILED)
                {
                        DBG1(DBG_CFG, "no %N notify found, disabling AUTH pretending",
@@ -295,7 +295,7 @@ static void process_auth_response(private_pretend_auth_t *this,
                return;
        }
        message->add_payload(message, (payload_t*)
-                               id_payload_create_from_identification(ID_RESPONDER, this->id));
+                               id_payload_create_from_identification(PLV2_ID_RESPONDER, this->id));
        if (this->proposal)
        {
                message->add_payload(message, (payload_t*)
index b7e6f22..bc2f000 100644 (file)
@@ -70,7 +70,7 @@ static bool rebuild_auth(private_rebuild_auth_t *this, ike_sa_t *ike_sa,
        u_int32_t *lenpos;
 
        payload = message->get_payload(message,
-                                       message->get_request(message) ? ID_INITIATOR : ID_RESPONDER);
+                                       message->get_request(message) ? PLV2_ID_INITIATOR : PLV2_ID_RESPONDER);
        if (!payload)
        {
                DBG1(DBG_CFG, "ID payload not found to rebuild AUTH");
@@ -160,7 +160,7 @@ static bool rebuild_auth(private_rebuild_auth_t *this, ike_sa_t *ike_sa,
        enumerator = message->create_payload_enumerator(message);
        while (enumerator->enumerate(enumerator, &payload))
        {
-               if (payload->get_type(payload) == AUTHENTICATION)
+               if (payload->get_type(payload) == PLV2_AUTH)
                {
                        message->remove_payload_at(message, enumerator);
                        payload->destroy(payload);
@@ -191,7 +191,7 @@ METHOD(listener_t, message, bool,
                        {
                                nonce_payload_t *nonce;
 
-                               nonce = (nonce_payload_t*)message->get_payload(message, NONCE);
+                               nonce = (nonce_payload_t*)message->get_payload(message, PLV2_NONCE);
                                if (nonce)
                                {
                                        free(this->nonce.ptr);
index 0cc3cfc..4e572d6 100644 (file)
@@ -85,7 +85,7 @@ METHOD(listener_t, message, bool,
                enumerator = message->create_payload_enumerator(message);
                while (enumerator->enumerate(enumerator, &payload))
                {
-                       if (payload->get_type(payload) == SECURITY_ASSOCIATION)
+                       if (payload->get_type(payload) == PLV2_SECURITY_ASSOCIATION)
                        {
                                sa = (sa_payload_t*)payload;
                                list = sa->get_proposals(sa);
index 5961aeb..488e8df 100644 (file)
@@ -55,7 +55,7 @@ static void set_bit(private_set_reserved_t *this, message_t *message,
        payload_t *payload;
        bool *bit;
 
-       if (type == HEADER)
+       if (type == PL_HEADER)
        {
                message->set_reserved_header_bit(message, nr);
                DBG1(DBG_CFG, "setting reserved bit %d of %N",
@@ -91,7 +91,7 @@ static void set_byte(private_set_reserved_t *this, message_t *message,
        payload_t *payload;
        u_int8_t *byte;
 
-       if (type == TRANSFORM_SUBSTRUCTURE || type == PROPOSAL_SUBSTRUCTURE)
+       if (type == PLV2_TRANSFORM_SUBSTRUCTURE || type == PLV2_PROPOSAL_SUBSTRUCTURE)
        {
                enumerator_t *transforms, *proposals;
                transform_substructure_t *transform;
@@ -101,13 +101,13 @@ static void set_byte(private_set_reserved_t *this, message_t *message,
                payloads = message->create_payload_enumerator(message);
                while (payloads->enumerate(payloads, &payload))
                {
-                       if (payload->get_type(payload) == SECURITY_ASSOCIATION)
+                       if (payload->get_type(payload) == PLV2_SECURITY_ASSOCIATION)
                        {
                                sa = (sa_payload_t*)payload;
                                proposals = sa->create_substructure_enumerator(sa);
                                while (proposals->enumerate(proposals, &proposal))
                                {
-                                       if (type == PROPOSAL_SUBSTRUCTURE)
+                                       if (type == PLV2_PROPOSAL_SUBSTRUCTURE)
                                        {
                                                byte = payload_get_field(&proposal->payload_interface,
                                                                                                 RESERVED_BYTE, nr);
@@ -118,7 +118,7 @@ static void set_byte(private_set_reserved_t *this, message_t *message,
                                                        *byte = byteval;
                                                }
                                        }
-                                       else if (type == TRANSFORM_SUBSTRUCTURE)
+                                       else if (type == PLV2_TRANSFORM_SUBSTRUCTURE)
                                        {
                                                transforms = proposal->create_substructure_enumerator(
                                                                                                                                        proposal);
index dae76fa..2a74985 100644 (file)
@@ -83,7 +83,7 @@ METHOD(listener_t, ike_updown, bool,
                {
                        data = chunk_clone(chunk_create(this->data, strlen(this->data)));
                }
-               notify = notify_payload_create_from_protocol_and_type(NOTIFY,
+               notify = notify_payload_create_from_protocol_and_type(PLV2_NOTIFY,
                                                                        this->esp ? PROTO_ESP : PROTO_IKE, type);
                notify->set_spi(notify, this->spi);
                if (data.len)
index 2b6825c..d4ca5b5 100644 (file)
@@ -498,15 +498,15 @@ METHOD(generator_t, generate_payload, void,
                        case ENCRYPTED_DATA:
                                generate_from_chunk(this, rules[i].offset);
                                break;
-                       case PAYLOAD_LIST + PROPOSAL_SUBSTRUCTURE:
-                       case PAYLOAD_LIST + PROPOSAL_SUBSTRUCTURE_V1:
-                       case PAYLOAD_LIST + TRANSFORM_SUBSTRUCTURE:
-                       case PAYLOAD_LIST + TRANSFORM_SUBSTRUCTURE_V1:
-                       case PAYLOAD_LIST + TRANSFORM_ATTRIBUTE:
-                       case PAYLOAD_LIST + TRANSFORM_ATTRIBUTE_V1:
-                       case PAYLOAD_LIST + CONFIGURATION_ATTRIBUTE:
-                       case PAYLOAD_LIST + CONFIGURATION_ATTRIBUTE_V1:
-                       case PAYLOAD_LIST + TRAFFIC_SELECTOR_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV2_PROPOSAL_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV1_PROPOSAL_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV2_TRANSFORM_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV1_TRANSFORM_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV2_TRANSFORM_ATTRIBUTE:
+                       case PAYLOAD_LIST + PLV1_TRANSFORM_ATTRIBUTE:
+                       case PAYLOAD_LIST + PLV2_CONFIGURATION_ATTRIBUTE:
+                       case PAYLOAD_LIST + PLV1_CONFIGURATION_ATTRIBUTE:
+                       case PAYLOAD_LIST + PLV2_TRAFFIC_SELECTOR_SUBSTRUCTURE:
                        {
                                linked_list_t *proposals;
                                enumerator_t *enumerator;
index 3a1014e..0f5f40a 100644 (file)
@@ -89,7 +89,7 @@ typedef struct {
 typedef struct {
        /** payload type */
        payload_type_t type;
-       /** notify type, if payload == NOTIFY */
+       /** notify type, if payload == PLV2_NOTIFY */
        notify_type_t notify;
 } payload_order_t;
 
@@ -120,11 +120,11 @@ typedef struct {
  */
 static payload_rule_t ike_sa_init_i_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
-       {SECURITY_ASSOCIATION,                  1,      1,                                              FALSE,  FALSE},
-       {KEY_EXCHANGE,                                  1,      1,                                              FALSE,  FALSE},
-       {NONCE,                                                 1,      1,                                              FALSE,  FALSE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
+       {PLV2_SECURITY_ASSOCIATION,             1,      1,                                              FALSE,  FALSE},
+       {PLV2_KEY_EXCHANGE,                             1,      1,                                              FALSE,  FALSE},
+       {PLV2_NONCE,                                    1,      1,                                              FALSE,  FALSE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
 };
 
 /**
@@ -132,14 +132,14 @@ static payload_rule_t ike_sa_init_i_rules[] = {
  */
 static payload_order_t ike_sa_init_i_order[] = {
 /*     payload type                                    notify type */
-       {NOTIFY,                                                COOKIE},
-       {SECURITY_ASSOCIATION,                  0},
-       {KEY_EXCHANGE,                                  0},
-       {NONCE,                                                 0},
-       {NOTIFY,                                                NAT_DETECTION_SOURCE_IP},
-       {NOTIFY,                                                NAT_DETECTION_DESTINATION_IP},
-       {NOTIFY,                                                0},
-       {VENDOR_ID,                                             0},
+       {PLV2_NOTIFY,                                   COOKIE},
+       {PLV2_SECURITY_ASSOCIATION,             0},
+       {PLV2_KEY_EXCHANGE,                             0},
+       {PLV2_NONCE,                                    0},
+       {PLV2_NOTIFY,                                   NAT_DETECTION_SOURCE_IP},
+       {PLV2_NOTIFY,                                   NAT_DETECTION_DESTINATION_IP},
+       {PLV2_NOTIFY,                                   0},
+       {PLV2_VENDOR_ID,                                0},
 };
 
 /**
@@ -147,12 +147,12 @@ static payload_order_t ike_sa_init_i_order[] = {
  */
 static payload_rule_t ike_sa_init_r_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    FALSE,  TRUE},
-       {SECURITY_ASSOCIATION,                  1,      1,                                              FALSE,  FALSE},
-       {KEY_EXCHANGE,                                  1,      1,                                              FALSE,  FALSE},
-       {NONCE,                                                 1,      1,                                              FALSE,  FALSE},
-       {CERTIFICATE_REQUEST,                   0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    FALSE,  TRUE},
+       {PLV2_SECURITY_ASSOCIATION,             1,      1,                                              FALSE,  FALSE},
+       {PLV2_KEY_EXCHANGE,                             1,      1,                                              FALSE,  FALSE},
+       {PLV2_NONCE,                                    1,      1,                                              FALSE,  FALSE},
+       {PLV2_CERTREQ,                                  0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
 };
 
 /**
@@ -160,15 +160,15 @@ static payload_rule_t ike_sa_init_r_rules[] = {
  */
 static payload_order_t ike_sa_init_r_order[] = {
 /*     payload type                                    notify type */
-       {SECURITY_ASSOCIATION,                  0},
-       {KEY_EXCHANGE,                                  0},
-       {NONCE,                                                 0},
-       {NOTIFY,                                                NAT_DETECTION_SOURCE_IP},
-       {NOTIFY,                                                NAT_DETECTION_DESTINATION_IP},
-       {NOTIFY,                                                HTTP_CERT_LOOKUP_SUPPORTED},
-       {CERTIFICATE_REQUEST,                   0},
-       {NOTIFY,                                                0},
-       {VENDOR_ID,                                             0},
+       {PLV2_SECURITY_ASSOCIATION,             0},
+       {PLV2_KEY_EXCHANGE,                             0},
+       {PLV2_NONCE,                                    0},
+       {PLV2_NOTIFY,                                   NAT_DETECTION_SOURCE_IP},
+       {PLV2_NOTIFY,                                   NAT_DETECTION_DESTINATION_IP},
+       {PLV2_NOTIFY,                                   HTTP_CERT_LOOKUP_SUPPORTED},
+       {PLV2_CERTREQ,                                  0},
+       {PLV2_NOTIFY,                                   0},
+       {PLV2_VENDOR_ID,                                0},
 };
 
 /**
@@ -176,24 +176,24 @@ static payload_order_t ike_sa_init_r_order[] = {
  */
 static payload_rule_t ike_auth_i_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
-       {EXTENSIBLE_AUTHENTICATION,             0,      1,                                              TRUE,   TRUE},
-       {AUTHENTICATION,                                0,      1,                                              TRUE,   TRUE},
-       {ID_INITIATOR,                                  0,      1,                                              TRUE,   FALSE},
-       {CERTIFICATE,                                   0,      MAX_CERT_PAYLOADS,              TRUE,   FALSE},
-       {CERTIFICATE_REQUEST,                   0,      MAX_CERTREQ_PAYLOADS,   TRUE,   FALSE},
-       {ID_RESPONDER,                                  0,      1,                                              TRUE,   FALSE},
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
+       {PLV2_EAP,                                              0,      1,                                              TRUE,   TRUE},
+       {PLV2_AUTH,                                             0,      1,                                              TRUE,   TRUE},
+       {PLV2_ID_INITIATOR,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_CERTIFICATE,                              0,      MAX_CERT_PAYLOADS,              TRUE,   FALSE},
+       {PLV2_CERTREQ,                                  0,      MAX_CERTREQ_PAYLOADS,   TRUE,   FALSE},
+       {PLV2_ID_RESPONDER,                             0,      1,                                              TRUE,   FALSE},
 #ifdef ME
-       {SECURITY_ASSOCIATION,                  0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_INITIATOR,    0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_RESPONDER,    0,      1,                                              TRUE,   FALSE},
+       {PLV2_SECURITY_ASSOCIATION,             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_INITIATOR,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_RESPONDER,                             0,      1,                                              TRUE,   FALSE},
 #else
-       {SECURITY_ASSOCIATION,                  0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_INITIATOR,    0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_RESPONDER,    0,      1,                                              TRUE,   FALSE},
+       {PLV2_SECURITY_ASSOCIATION,             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_INITIATOR,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_RESPONDER,                             0,      1,                                              TRUE,   FALSE},
 #endif /* ME */
-       {CONFIGURATION,                                 0,      1,                                              TRUE,   FALSE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+       {PLV2_CONFIGURATION,                    0,      1,                                              TRUE,   FALSE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
 };
 
 /**
@@ -201,28 +201,28 @@ static payload_rule_t ike_auth_i_rules[] = {
  */
 static payload_order_t ike_auth_i_order[] = {
 /*     payload type                                    notify type */
-       {ID_INITIATOR,                                  0},
-       {CERTIFICATE,                                   0},
-       {NOTIFY,                                                INITIAL_CONTACT},
-       {NOTIFY,                                                HTTP_CERT_LOOKUP_SUPPORTED},
-       {CERTIFICATE_REQUEST,                   0},
-       {ID_RESPONDER,                                  0},
-       {AUTHENTICATION,                                0},
-       {EXTENSIBLE_AUTHENTICATION,             0},
-       {CONFIGURATION,                                 0},
-       {NOTIFY,                                                IPCOMP_SUPPORTED},
-       {NOTIFY,                                                USE_TRANSPORT_MODE},
-       {NOTIFY,                                                ESP_TFC_PADDING_NOT_SUPPORTED},
-       {NOTIFY,                                                NON_FIRST_FRAGMENTS_ALSO},
-       {SECURITY_ASSOCIATION,                  0},
-       {TRAFFIC_SELECTOR_INITIATOR,    0},
-       {TRAFFIC_SELECTOR_RESPONDER,    0},
-       {NOTIFY,                                                MOBIKE_SUPPORTED},
-       {NOTIFY,                                                ADDITIONAL_IP4_ADDRESS},
-       {NOTIFY,                                                ADDITIONAL_IP6_ADDRESS},
-       {NOTIFY,                                                NO_ADDITIONAL_ADDRESSES},
-       {NOTIFY,                                                0},
-       {VENDOR_ID,                                             0},
+       {PLV2_ID_INITIATOR,                             0},
+       {PLV2_CERTIFICATE,                              0},
+       {PLV2_NOTIFY,                                   INITIAL_CONTACT},
+       {PLV2_NOTIFY,                                   HTTP_CERT_LOOKUP_SUPPORTED},
+       {PLV2_CERTREQ,                                  0},
+       {PLV2_ID_RESPONDER,                             0},
+       {PLV2_AUTH,                                             0},
+       {PLV2_EAP,                                              0},
+       {PLV2_CONFIGURATION,                    0},
+       {PLV2_NOTIFY,                                   IPCOMP_SUPPORTED},
+       {PLV2_NOTIFY,                                   USE_TRANSPORT_MODE},
+       {PLV2_NOTIFY,                                   ESP_TFC_PADDING_NOT_SUPPORTED},
+       {PLV2_NOTIFY,                                   NON_FIRST_FRAGMENTS_ALSO},
+       {PLV2_SECURITY_ASSOCIATION,             0},
+       {PLV2_TS_INITIATOR,                             0},
+       {PLV2_TS_RESPONDER,                             0},
+       {PLV2_NOTIFY,                                   MOBIKE_SUPPORTED},
+       {PLV2_NOTIFY,                                   ADDITIONAL_IP4_ADDRESS},
+       {PLV2_NOTIFY,                                   ADDITIONAL_IP6_ADDRESS},
+       {PLV2_NOTIFY,                                   NO_ADDITIONAL_ADDRESSES},
+       {PLV2_NOTIFY,                                   0},
+       {PLV2_VENDOR_ID,                                0},
 };
 
 /**
@@ -230,16 +230,16 @@ static payload_order_t ike_auth_i_order[] = {
  */
 static payload_rule_t ike_auth_r_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    TRUE,   TRUE},
-       {EXTENSIBLE_AUTHENTICATION,             0,      1,                                              TRUE,   TRUE},
-       {AUTHENTICATION,                                0,      1,                                              TRUE,   TRUE},
-       {CERTIFICATE,                                   0,      MAX_CERT_PAYLOADS,              TRUE,   FALSE},
-       {ID_RESPONDER,                                  0,      1,                                              TRUE,   FALSE},
-       {SECURITY_ASSOCIATION,                  0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_INITIATOR,    0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_RESPONDER,    0,      1,                                              TRUE,   FALSE},
-       {CONFIGURATION,                                 0,      1,                                              TRUE,   FALSE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   TRUE},
+       {PLV2_EAP,                                              0,      1,                                              TRUE,   TRUE},
+       {PLV2_AUTH,                                             0,      1,                                              TRUE,   TRUE},
+       {PLV2_CERTIFICATE,                              0,      MAX_CERT_PAYLOADS,              TRUE,   FALSE},
+       {PLV2_ID_RESPONDER,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_SECURITY_ASSOCIATION,             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_INITIATOR,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_RESPONDER,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_CONFIGURATION,                    0,      1,                                              TRUE,   FALSE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
 };
 
 /**
@@ -247,25 +247,25 @@ static payload_rule_t ike_auth_r_rules[] = {
  */
 static payload_order_t ike_auth_r_order[] = {
 /*     payload type                                    notify type */
-       {ID_RESPONDER,                                  0},
-       {CERTIFICATE,                                   0},
-       {AUTHENTICATION,                                0},
-       {EXTENSIBLE_AUTHENTICATION,             0},
-       {CONFIGURATION,                                 0},
-       {NOTIFY,                                                IPCOMP_SUPPORTED},
-       {NOTIFY,                                                USE_TRANSPORT_MODE},
-       {NOTIFY,                                                ESP_TFC_PADDING_NOT_SUPPORTED},
-       {NOTIFY,                                                NON_FIRST_FRAGMENTS_ALSO},
-       {SECURITY_ASSOCIATION,                  0},
-       {TRAFFIC_SELECTOR_INITIATOR,    0},
-       {TRAFFIC_SELECTOR_RESPONDER,    0},
-       {NOTIFY,                                                AUTH_LIFETIME},
-       {NOTIFY,                                                MOBIKE_SUPPORTED},
-       {NOTIFY,                                                ADDITIONAL_IP4_ADDRESS},
-       {NOTIFY,                                                ADDITIONAL_IP6_ADDRESS},
-       {NOTIFY,                                                NO_ADDITIONAL_ADDRESSES},
-       {NOTIFY,                                                0},
-       {VENDOR_ID,                                             0},
+       {PLV2_ID_RESPONDER,                             0},
+       {PLV2_CERTIFICATE,                              0},
+       {PLV2_AUTH,                                             0},
+       {PLV2_EAP,                                              0},
+       {PLV2_CONFIGURATION,                    0},
+       {PLV2_NOTIFY,                                   IPCOMP_SUPPORTED},
+       {PLV2_NOTIFY,                                   USE_TRANSPORT_MODE},
+       {PLV2_NOTIFY,                                   ESP_TFC_PADDING_NOT_SUPPORTED},
+       {PLV2_NOTIFY,                                   NON_FIRST_FRAGMENTS_ALSO},
+       {PLV2_SECURITY_ASSOCIATION,             0},
+       {PLV2_TS_INITIATOR,                             0},
+       {PLV2_TS_RESPONDER,                             0},
+       {PLV2_NOTIFY,                                   AUTH_LIFETIME},
+       {PLV2_NOTIFY,                                   MOBIKE_SUPPORTED},
+       {PLV2_NOTIFY,                                   ADDITIONAL_IP4_ADDRESS},
+       {PLV2_NOTIFY,                                   ADDITIONAL_IP6_ADDRESS},
+       {PLV2_NOTIFY,                                   NO_ADDITIONAL_ADDRESSES},
+       {PLV2_NOTIFY,                                   0},
+       {PLV2_VENDOR_ID,                                0},
 };
 
 /**
@@ -273,10 +273,10 @@ static payload_order_t ike_auth_r_order[] = {
  */
 static payload_rule_t informational_i_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
-       {CONFIGURATION,                                 0,      1,                                              TRUE,   FALSE},
-       {DELETE,                                                0,      MAX_DELETE_PAYLOADS,    TRUE,   FALSE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
+       {PLV2_CONFIGURATION,                    0,      1,                                              TRUE,   FALSE},
+       {PLV2_DELETE,                                   0,      MAX_DELETE_PAYLOADS,    TRUE,   FALSE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
 };
 
 /**
@@ -284,13 +284,13 @@ static payload_rule_t informational_i_rules[] = {
  */
 static payload_order_t informational_i_order[] = {
 /*     payload type                                    notify type */
-       {NOTIFY,                                                UPDATE_SA_ADDRESSES},
-       {NOTIFY,                                                NAT_DETECTION_SOURCE_IP},
-       {NOTIFY,                                                NAT_DETECTION_DESTINATION_IP},
-       {NOTIFY,                                                COOKIE2},
-       {NOTIFY,                                                0},
-       {DELETE,                                                0},
-       {CONFIGURATION,                                 0},
+       {PLV2_NOTIFY,                                   UPDATE_SA_ADDRESSES},
+       {PLV2_NOTIFY,                                   NAT_DETECTION_SOURCE_IP},
+       {PLV2_NOTIFY,                                   NAT_DETECTION_DESTINATION_IP},
+       {PLV2_NOTIFY,                                   COOKIE2},
+       {PLV2_NOTIFY,                                   0},
+       {PLV2_DELETE,                                   0},
+       {PLV2_CONFIGURATION,                    0},
 };
 
 /**
@@ -298,10 +298,10 @@ static payload_order_t informational_i_order[] = {
  */
 static payload_rule_t informational_r_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
-       {CONFIGURATION,                                 0,      1,                                              TRUE,   FALSE},
-       {DELETE,                                                0,      MAX_DELETE_PAYLOADS,    TRUE,   FALSE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
+       {PLV2_CONFIGURATION,                    0,      1,                                              TRUE,   FALSE},
+       {PLV2_DELETE,                                   0,      MAX_DELETE_PAYLOADS,    TRUE,   FALSE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
 };
 
 /**
@@ -309,13 +309,13 @@ static payload_rule_t informational_r_rules[] = {
  */
 static payload_order_t informational_r_order[] = {
 /*     payload type                                    notify type */
-       {NOTIFY,                                                UPDATE_SA_ADDRESSES},
-       {NOTIFY,                                                NAT_DETECTION_SOURCE_IP},
-       {NOTIFY,                                                NAT_DETECTION_DESTINATION_IP},
-       {NOTIFY,                                                COOKIE2},
-       {NOTIFY,                                                0},
-       {DELETE,                                                0},
-       {CONFIGURATION,                                 0},
+       {PLV2_NOTIFY,                                   UPDATE_SA_ADDRESSES},
+       {PLV2_NOTIFY,                                   NAT_DETECTION_SOURCE_IP},
+       {PLV2_NOTIFY,                                   NAT_DETECTION_DESTINATION_IP},
+       {PLV2_NOTIFY,                                   COOKIE2},
+       {PLV2_NOTIFY,                                   0},
+       {PLV2_DELETE,                                   0},
+       {PLV2_CONFIGURATION,                    0},
 };
 
 /**
@@ -323,14 +323,14 @@ static payload_order_t informational_r_order[] = {
  */
 static payload_rule_t create_child_sa_i_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
-       {SECURITY_ASSOCIATION,                  1,      1,                                              TRUE,   FALSE},
-       {NONCE,                                                 1,      1,                                              TRUE,   FALSE},
-       {KEY_EXCHANGE,                                  0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_INITIATOR,    0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_RESPONDER,    0,      1,                                              TRUE,   FALSE},
-       {CONFIGURATION,                                 0,      1,                                              TRUE,   FALSE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
+       {PLV2_SECURITY_ASSOCIATION,             1,      1,                                              TRUE,   FALSE},
+       {PLV2_NONCE,                                    1,      1,                                              TRUE,   FALSE},
+       {PLV2_KEY_EXCHANGE,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_INITIATOR,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_RESPONDER,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_CONFIGURATION,                    0,      1,                                              TRUE,   FALSE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
 };
 
 /**
@@ -338,17 +338,17 @@ static payload_rule_t create_child_sa_i_rules[] = {
  */
 static payload_order_t create_child_sa_i_order[] = {
 /*     payload type                                    notify type */
-       {NOTIFY,                                                REKEY_SA},
-       {NOTIFY,                                                IPCOMP_SUPPORTED},
-       {NOTIFY,                                                USE_TRANSPORT_MODE},
-       {NOTIFY,                                                ESP_TFC_PADDING_NOT_SUPPORTED},
-       {NOTIFY,                                                NON_FIRST_FRAGMENTS_ALSO},
-       {SECURITY_ASSOCIATION,                  0},
-       {NONCE,                                                 0},
-       {KEY_EXCHANGE,                                  0},
-       {TRAFFIC_SELECTOR_INITIATOR,    0},
-       {TRAFFIC_SELECTOR_RESPONDER,    0},
-       {NOTIFY,                                                0},
+       {PLV2_NOTIFY,                                   REKEY_SA},
+       {PLV2_NOTIFY,                                   IPCOMP_SUPPORTED},
+       {PLV2_NOTIFY,                                   USE_TRANSPORT_MODE},
+       {PLV2_NOTIFY,                                   ESP_TFC_PADDING_NOT_SUPPORTED},
+       {PLV2_NOTIFY,                                   NON_FIRST_FRAGMENTS_ALSO},
+       {PLV2_SECURITY_ASSOCIATION,             0},
+       {PLV2_NONCE,                                    0},
+       {PLV2_KEY_EXCHANGE,                             0},
+       {PLV2_TS_INITIATOR,                             0},
+       {PLV2_TS_RESPONDER,                             0},
+       {PLV2_NOTIFY,                                   0},
 };
 
 /**
@@ -356,14 +356,14 @@ static payload_order_t create_child_sa_i_order[] = {
  */
 static payload_rule_t create_child_sa_r_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    TRUE,   TRUE},
-       {SECURITY_ASSOCIATION,                  1,      1,                                              TRUE,   FALSE},
-       {NONCE,                                                 1,      1,                                              TRUE,   FALSE},
-       {KEY_EXCHANGE,                                  0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_INITIATOR,    0,      1,                                              TRUE,   FALSE},
-       {TRAFFIC_SELECTOR_RESPONDER,    0,      1,                                              TRUE,   FALSE},
-       {CONFIGURATION,                                 0,      1,                                              TRUE,   FALSE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   TRUE},
+       {PLV2_SECURITY_ASSOCIATION,             1,      1,                                              TRUE,   FALSE},
+       {PLV2_NONCE,                                    1,      1,                                              TRUE,   FALSE},
+       {PLV2_KEY_EXCHANGE,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_INITIATOR,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_TS_RESPONDER,                             0,      1,                                              TRUE,   FALSE},
+       {PLV2_CONFIGURATION,                    0,      1,                                              TRUE,   FALSE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
 };
 
 /**
@@ -371,17 +371,17 @@ static payload_rule_t create_child_sa_r_rules[] = {
  */
 static payload_order_t create_child_sa_r_order[] = {
 /*     payload type                                    notify type */
-       {NOTIFY,                                                IPCOMP_SUPPORTED},
-       {NOTIFY,                                                USE_TRANSPORT_MODE},
-       {NOTIFY,                                                ESP_TFC_PADDING_NOT_SUPPORTED},
-       {NOTIFY,                                                NON_FIRST_FRAGMENTS_ALSO},
-       {SECURITY_ASSOCIATION,                  0},
-       {NONCE,                                                 0},
-       {KEY_EXCHANGE,                                  0},
-       {TRAFFIC_SELECTOR_INITIATOR,    0},
-       {TRAFFIC_SELECTOR_RESPONDER,    0},
-       {NOTIFY,                                                ADDITIONAL_TS_POSSIBLE},
-       {NOTIFY,                                                0},
+       {PLV2_NOTIFY,                                   IPCOMP_SUPPORTED},
+       {PLV2_NOTIFY,                                   USE_TRANSPORT_MODE},
+       {PLV2_NOTIFY,                                   ESP_TFC_PADDING_NOT_SUPPORTED},
+       {PLV2_NOTIFY,                                   NON_FIRST_FRAGMENTS_ALSO},
+       {PLV2_SECURITY_ASSOCIATION,             0},
+       {PLV2_NONCE,                                    0},
+       {PLV2_KEY_EXCHANGE,                             0},
+       {PLV2_TS_INITIATOR,                             0},
+       {PLV2_TS_RESPONDER,                             0},
+       {PLV2_NOTIFY,                                   ADDITIONAL_TS_POSSIBLE},
+       {PLV2_NOTIFY,                                   0},
 };
 
 #ifdef ME
@@ -390,9 +390,9 @@ static payload_order_t create_child_sa_r_order[] = {
  */
 static payload_rule_t me_connect_i_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    TRUE,   TRUE},
-       {ID_PEER,                                               1,      1,                                              TRUE,   FALSE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               TRUE,   FALSE}
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   TRUE},
+       {PLV2_ID_PEER,                                  1,      1,                                              TRUE,   FALSE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE}
 };
 
 /**
@@ -400,9 +400,9 @@ static payload_rule_t me_connect_i_rules[] = {
  */
 static payload_order_t me_connect_i_order[] = {
 /*     payload type                                    notify type */
-       {NOTIFY,                                                0},
-       {ID_PEER,                                               0},
-       {VENDOR_ID,                                             0},
+       {PLV2_NOTIFY,                                   0},
+       {PLV2_ID_PEER,                                  0},
+       {PLV2_VENDOR_ID,                                0},
 };
 
 /**
@@ -410,8 +410,8 @@ static payload_order_t me_connect_i_order[] = {
  */
 static payload_rule_t me_connect_r_rules[] = {
 /*     payload type                                    min     max                                             encr    suff */
-       {NOTIFY,                                                0,      MAX_NOTIFY_PAYLOADS,    TRUE,   TRUE},
-       {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               TRUE,   FALSE}
+       {PLV2_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   TRUE},
+       {PLV2_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE}
 };
 
 /**
@@ -419,8 +419,8 @@ static payload_rule_t me_connect_r_rules[] = {
  */
 static payload_order_t me_connect_r_order[] = {
 /*     payload type                                    notify type */
-       {NOTIFY,                                                0},
-       {VENDOR_ID,                                             0},
+       {PLV2_NOTIFY,                                   0},
+       {PLV2_VENDOR_ID,                                0},
 };
 #endif /* ME */
 
@@ -429,284 +429,284 @@ static payload_order_t me_connect_r_order[] = {
  * Message rule for ID_PROT from initiator.
  */
 static payload_rule_t id_prot_i_rules[] = {
-/*     payload type                            min     max                                             encr    suff */
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
-       {SECURITY_ASSOCIATION_V1,       0,      1,                                              FALSE,  FALSE},
-       {KEY_EXCHANGE_V1,                       0,      1,                                              FALSE,  FALSE},
-       {NONCE_V1,                                      0,      1,                                              FALSE,  FALSE},
-       {VENDOR_ID_V1,                          0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
-       {CERTIFICATE_REQUEST_V1,        0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
-       {NAT_D_V1,                                      0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
-       {NAT_D_DRAFT_00_03_V1,          0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
-       {ID_V1,                                         0,      1,                                              TRUE,   FALSE},
-       {CERTIFICATE_V1,                        0,      MAX_CERT_PAYLOADS,              TRUE,   FALSE},
-       {SIGNATURE_V1,                          0,      1,                                              TRUE,   FALSE},
-       {HASH_V1,                                       0,      1,                                              TRUE,   FALSE},
-       {FRAGMENT_V1,                           0,      1,                                              FALSE,  TRUE},
+/*     payload type                                    min     max                                             encr    suff */
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
+       {PLV1_SECURITY_ASSOCIATION,             0,      1,                                              FALSE,  FALSE},
+       {PLV1_KEY_EXCHANGE,                             0,      1,                                              FALSE,  FALSE},
+       {PLV1_NONCE,                                    0,      1,                                              FALSE,  FALSE},
+       {PLV1_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
+       {PLV1_CERTREQ,                                  0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
+       {PLV1_NAT_D,                                    0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
+       {PLV1_NAT_D_DRAFT_00_03,                0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
+       {PLV1_ID,                                               0,      1,                                              TRUE,   FALSE},
+       {PLV1_CERTIFICATE,                              0,      MAX_CERT_PAYLOADS,              TRUE,   FALSE},
+       {PLV1_SIGNATURE,                                0,      1,                                              TRUE,   FALSE},
+       {PLV1_HASH,                                             0,      1,                                              TRUE,   FALSE},
+       {PLV1_FRAGMENT,                                 0,      1,                                              FALSE,  TRUE},
 };
 
 /**
  * payload order for ID_PROT from initiator.
  */
 static payload_order_t id_prot_i_order[] = {
-/*     payload type                            notify type */
-       {SECURITY_ASSOCIATION_V1,       0},
-       {KEY_EXCHANGE_V1,                       0},
-       {NONCE_V1,                                      0},
-       {ID_V1,                                         0},
-       {CERTIFICATE_V1,                        0},
-       {SIGNATURE_V1,                          0},
-       {HASH_V1,                                       0},
-       {CERTIFICATE_REQUEST_V1,        0},
-       {NOTIFY_V1,                                     0},
-       {VENDOR_ID_V1,                          0},
-       {NAT_D_V1,                                      0},
-       {NAT_D_DRAFT_00_03_V1,          0},
-       {FRAGMENT_V1,                           0},
+/*     payload type                                    notify type */
+       {PLV1_SECURITY_ASSOCIATION,             0},
+       {PLV1_KEY_EXCHANGE,                             0},
+       {PLV1_NONCE,                                    0},
+       {PLV1_ID,                                               0},
+       {PLV1_CERTIFICATE,                              0},
+       {PLV1_SIGNATURE,                                0},
+       {PLV1_HASH,                                             0},
+       {PLV1_CERTREQ,                                  0},
+       {PLV1_NOTIFY,                                   0},
+       {PLV1_VENDOR_ID,                                0},
+       {PLV1_NAT_D,                                    0},
+       {PLV1_NAT_D_DRAFT_00_03,                0},
+       {PLV1_FRAGMENT,                                 0},
 };
 
 /**
  * Message rule for ID_PROT from responder.
  */
 static payload_rule_t id_prot_r_rules[] = {
-/*     payload type                            min     max                                             encr    suff */
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
-       {SECURITY_ASSOCIATION_V1,       0,      1,                                              FALSE,  FALSE},
-       {KEY_EXCHANGE_V1,                       0,      1,                                              FALSE,  FALSE},
-       {NONCE_V1,                                      0,      1,                                              FALSE,  FALSE},
-       {VENDOR_ID_V1,                          0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
-       {CERTIFICATE_REQUEST_V1,        0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
-       {NAT_D_V1,                                      0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
-       {NAT_D_DRAFT_00_03_V1,          0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
-       {ID_V1,                                         0,      1,                                              TRUE,   FALSE},
-       {CERTIFICATE_V1,                        0,      MAX_CERT_PAYLOADS,              TRUE,   FALSE},
-       {SIGNATURE_V1,                          0,      1,                                              TRUE,   FALSE},
-       {HASH_V1,                                       0,      1,                                              TRUE,   FALSE},
-       {FRAGMENT_V1,                           0,      1,                                              FALSE,  TRUE},
+/*     payload type                                    min     max                                             encr    suff */
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
+       {PLV1_SECURITY_ASSOCIATION,             0,      1,                                              FALSE,  FALSE},
+       {PLV1_KEY_EXCHANGE,                             0,      1,                                              FALSE,  FALSE},
+       {PLV1_NONCE,                                    0,      1,                                              FALSE,  FALSE},
+       {PLV1_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
+       {PLV1_CERTREQ,                                  0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
+       {PLV1_NAT_D,                                    0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
+       {PLV1_NAT_D_DRAFT_00_03,                0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
+       {PLV1_ID,                                               0,      1,                                              TRUE,   FALSE},
+       {PLV1_CERTIFICATE,                              0,      MAX_CERT_PAYLOADS,              TRUE,   FALSE},
+       {PLV1_SIGNATURE,                                0,      1,                                              TRUE,   FALSE},
+       {PLV1_HASH,                                             0,      1,                                              TRUE,   FALSE},
+       {PLV1_FRAGMENT,                                 0,      1,                                              FALSE,  TRUE},
 };
 
 /**
  * payload order for ID_PROT from responder.
  */
 static payload_order_t id_prot_r_order[] = {
-/*     payload type                            notify type */
-       {SECURITY_ASSOCIATION_V1,       0},
-       {KEY_EXCHANGE_V1,                       0},
-       {NONCE_V1,                                      0},
-       {ID_V1,                                         0},
-       {CERTIFICATE_V1,                        0},
-       {SIGNATURE_V1,                          0},
-       {HASH_V1,                                       0},
-       {CERTIFICATE_REQUEST_V1,        0},
-       {NOTIFY_V1,                                     0},
-       {VENDOR_ID_V1,                          0},
-       {NAT_D_V1,                                      0},
-       {NAT_D_DRAFT_00_03_V1,          0},
-       {FRAGMENT_V1,                           0},
+/*     payload type                                    notify type */
+       {PLV1_SECURITY_ASSOCIATION,             0},
+       {PLV1_KEY_EXCHANGE,                             0},
+       {PLV1_NONCE,                                    0},
+       {PLV1_ID,                                               0},
+       {PLV1_CERTIFICATE,                              0},
+       {PLV1_SIGNATURE,                                0},
+       {PLV1_HASH,                                             0},
+       {PLV1_CERTREQ,                                  0},
+       {PLV1_NOTIFY,                                   0},
+       {PLV1_VENDOR_ID,                                0},
+       {PLV1_NAT_D,                                    0},
+       {PLV1_NAT_D_DRAFT_00_03,                0},
+       {PLV1_FRAGMENT,                                 0},
 };
 
 /**
  * Message rule for AGGRESSIVE from initiator.
  */
 static payload_rule_t aggressive_i_rules[] = {
-/*     payload type                            min     max                                             encr    suff */
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
-       {SECURITY_ASSOCIATION_V1,       0,      1,                                              FALSE,  FALSE},
-       {KEY_EXCHANGE_V1,                       0,      1,                                              FALSE,  FALSE},
-       {NONCE_V1,                                      0,      1,                                              FALSE,  FALSE},
-       {VENDOR_ID_V1,                          0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
-       {CERTIFICATE_REQUEST_V1,        0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
-       {NAT_D_V1,                                      0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
-       {NAT_D_DRAFT_00_03_V1,          0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
-       {ID_V1,                                         0,      1,                                              FALSE,  FALSE},
-       {CERTIFICATE_V1,                        0,      1,                                              TRUE,   FALSE},
-       {SIGNATURE_V1,                          0,      1,                                              TRUE,   FALSE},
-       {HASH_V1,                                       0,      1,                                              TRUE,   FALSE},
-       {FRAGMENT_V1,                           0,      1,                                              FALSE,  TRUE},
+/*     payload type                                    min     max                                             encr    suff */
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
+       {PLV1_SECURITY_ASSOCIATION,             0,      1,                                              FALSE,  FALSE},
+       {PLV1_KEY_EXCHANGE,                             0,      1,                                              FALSE,  FALSE},
+       {PLV1_NONCE,                                    0,      1,                                              FALSE,  FALSE},
+       {PLV1_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
+       {PLV1_CERTREQ,                                  0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
+       {PLV1_NAT_D,                                    0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
+       {PLV1_NAT_D_DRAFT_00_03,                0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
+       {PLV1_ID,                                               0,      1,                                              FALSE,  FALSE},
+       {PLV1_CERTIFICATE,                              0,      1,                                              TRUE,   FALSE},
+       {PLV1_SIGNATURE,                                0,      1,                                              TRUE,   FALSE},
+       {PLV1_HASH,                                             0,      1,                                              TRUE,   FALSE},
+       {PLV1_FRAGMENT,                                 0,      1,                                              FALSE,  TRUE},
 };
 
 /**
  * payload order for AGGRESSIVE from initiator.
  */
 static payload_order_t aggressive_i_order[] = {
-/*     payload type                            notify type */
-       {SECURITY_ASSOCIATION_V1,       0},
-       {KEY_EXCHANGE_V1,                       0},
-       {NONCE_V1,                                      0},
-       {ID_V1,                                         0},
-       {CERTIFICATE_V1,                        0},
-       {NAT_D_V1,                                      0},
-       {NAT_D_DRAFT_00_03_V1,          0},
-       {SIGNATURE_V1,                          0},
-       {HASH_V1,                                       0},
-       {CERTIFICATE_REQUEST_V1,        0},
-       {NOTIFY_V1,                                     0},
-       {VENDOR_ID_V1,                          0},
-       {FRAGMENT_V1,                           0},
+/*     payload type                                    notify type */
+       {PLV1_SECURITY_ASSOCIATION,             0},
+       {PLV1_KEY_EXCHANGE,                             0},
+       {PLV1_NONCE,                                    0},
+       {PLV1_ID,                                               0},
+       {PLV1_CERTIFICATE,                              0},
+       {PLV1_NAT_D,                                    0},
+       {PLV1_NAT_D_DRAFT_00_03,                0},
+       {PLV1_SIGNATURE,                                0},
+       {PLV1_HASH,                                             0},
+       {PLV1_CERTREQ,                                  0},
+       {PLV1_NOTIFY,                                   0},
+       {PLV1_VENDOR_ID,                                0},
+       {PLV1_FRAGMENT,                                 0},
 };
 
 /**
  * Message rule for AGGRESSIVE from responder.
  */
 static payload_rule_t aggressive_r_rules[] = {
-/*     payload type                            min     max                                             encr    suff */
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
-       {SECURITY_ASSOCIATION_V1,       0,      1,                                              FALSE,  FALSE},
-       {KEY_EXCHANGE_V1,                       0,      1,                                              FALSE,  FALSE},
-       {NONCE_V1,                                      0,      1,                                              FALSE,  FALSE},
-       {VENDOR_ID_V1,                          0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
-       {CERTIFICATE_REQUEST_V1,        0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
-       {NAT_D_V1,                                      0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
-       {NAT_D_DRAFT_00_03_V1,          0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
-       {ID_V1,                                         0,      1,                                              FALSE,  FALSE},
-       {CERTIFICATE_V1,                        0,      1,                                              FALSE,  FALSE},
-       {SIGNATURE_V1,                          0,      1,                                              FALSE,  FALSE},
-       {HASH_V1,                                       0,      1,                                              FALSE,  FALSE},
-       {FRAGMENT_V1,                           0,      1,                                              FALSE,  TRUE},
+/*     payload type                                    min     max                                             encr    suff */
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
+       {PLV1_SECURITY_ASSOCIATION,             0,      1,                                              FALSE,  FALSE},
+       {PLV1_KEY_EXCHANGE,                             0,      1,                                              FALSE,  FALSE},
+       {PLV1_NONCE,                                    0,      1,                                              FALSE,  FALSE},
+       {PLV1_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
+       {PLV1_CERTREQ,                                  0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
+       {PLV1_NAT_D,                                    0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
+       {PLV1_NAT_D_DRAFT_00_03,                0,      MAX_NAT_D_PAYLOADS,             FALSE,  FALSE},
+       {PLV1_ID,                                               0,      1,                                              FALSE,  FALSE},
+       {PLV1_CERTIFICATE,                              0,      1,                                              FALSE,  FALSE},
+       {PLV1_SIGNATURE,                                0,      1,                                              FALSE,  FALSE},
+       {PLV1_HASH,                                             0,      1,                                              FALSE,  FALSE},
+       {PLV1_FRAGMENT,                                 0,      1,                                              FALSE,  TRUE},
 };
 
 /**
  * payload order for AGGRESSIVE from responder.
  */
 static payload_order_t aggressive_r_order[] = {
-/*     payload type                            notify type */
-       {SECURITY_ASSOCIATION_V1,       0},
-       {KEY_EXCHANGE_V1,                       0},
-       {NONCE_V1,                                      0},
-       {ID_V1,                                         0},
-       {CERTIFICATE_V1,                        0},
-       {NAT_D_V1,                                      0},
-       {NAT_D_DRAFT_00_03_V1,          0},
-       {SIGNATURE_V1,                          0},
-       {HASH_V1,                                       0},
-       {CERTIFICATE_REQUEST_V1,        0},
-       {NOTIFY_V1,                                     0},
-       {VENDOR_ID_V1,                          0},
-       {FRAGMENT_V1,                           0},
+/*     payload type                                    notify type */
+       {PLV1_SECURITY_ASSOCIATION,             0},
+       {PLV1_KEY_EXCHANGE,                             0},
+       {PLV1_NONCE,                                    0},
+       {PLV1_ID,                                               0},
+       {PLV1_CERTIFICATE,                              0},
+       {PLV1_NAT_D,                                    0},
+       {PLV1_NAT_D_DRAFT_00_03,                0},
+       {PLV1_SIGNATURE,                                0},
+       {PLV1_HASH,                                             0},
+       {PLV1_CERTREQ,                                  0},
+       {PLV1_NOTIFY,                                   0},
+       {PLV1_VENDOR_ID,                                0},
+       {PLV1_FRAGMENT,                                 0},
 };
 
 /**
  * Message rule for INFORMATIONAL_V1 from initiator.
  */
 static payload_rule_t informational_i_rules_v1[] = {
-/*     payload type                            min     max                                             encr    suff */
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
-       {DELETE_V1,                                     0,      MAX_DELETE_PAYLOADS,    TRUE,   FALSE},
-       {VENDOR_ID_V1,                          0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+/*     payload type                                    min     max                                             encr    suff */
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
+       {PLV1_DELETE,                                   0,      MAX_DELETE_PAYLOADS,    TRUE,   FALSE},
+       {PLV1_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
 };
 
 /**
  * payload order for INFORMATIONAL_V1 from initiator.
  */
 static payload_order_t informational_i_order_v1[] = {
-/*     payload type                            notify type */
-       {NOTIFY_V1,                                     0},
-       {DELETE_V1,                                     0},
-       {VENDOR_ID_V1,                          0},
+/*     payload type                                    notify type */
+       {PLV1_NOTIFY,                                   0},
+       {PLV1_DELETE,                                   0},
+       {PLV1_VENDOR_ID,                                0},
 };
 
 /**
  * Message rule for INFORMATIONAL_V1 from responder.
  */
 static payload_rule_t informational_r_rules_v1[] = {
-/*     payload type                            min     max                                             encr    suff */
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
-       {DELETE_V1,                                     0,      MAX_DELETE_PAYLOADS,    TRUE,   FALSE},
-       {VENDOR_ID_V1,                          0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+/*     payload type                                    min     max                                             encr    suff */
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    FALSE,  FALSE},
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
+       {PLV1_DELETE,                                   0,      MAX_DELETE_PAYLOADS,    TRUE,   FALSE},
+       {PLV1_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
 };
 
 /**
  * payload order for INFORMATIONAL_V1 from responder.
  */
 static payload_order_t informational_r_order_v1[] = {
-/*     payload type                            notify type */
-       {NOTIFY_V1,                                     0},
-       {DELETE_V1,                                     0},
-       {VENDOR_ID_V1,                          0},
+/*     payload type                                    notify type */
+       {PLV1_NOTIFY,                                   0},
+       {PLV1_DELETE,                                   0},
+       {PLV1_VENDOR_ID,                                0},
 };
 
 /**
  * Message rule for QUICK_MODE from initiator.
  */
 static payload_rule_t quick_mode_i_rules[] = {
-/*     payload type                            min     max                                             encr    suff */
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
-       {VENDOR_ID_V1,                          0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
-       {HASH_V1,                                       0,      1,                                              TRUE,   FALSE},
-       {SECURITY_ASSOCIATION_V1,       0,      2,                                              TRUE,   FALSE},
-       {NONCE_V1,                                      0,      1,                                              TRUE,   FALSE},
-       {KEY_EXCHANGE_V1,                       0,      1,                                              TRUE,   FALSE},
-       {ID_V1,                                         0,      2,                                              TRUE,   FALSE},
-       {NAT_OA_V1,                                     0,      2,                                              TRUE,   FALSE},
-       {NAT_OA_DRAFT_00_03_V1,         0,      2,                                              TRUE,   FALSE},
+/*     payload type                                    min     max                                             encr    suff */
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
+       {PLV1_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+       {PLV1_HASH,                                             0,      1,                                              TRUE,   FALSE},
+       {PLV1_SECURITY_ASSOCIATION,             0,      2,                                              TRUE,   FALSE},
+       {PLV1_NONCE,                                    0,      1,                                              TRUE,   FALSE},
+       {PLV1_KEY_EXCHANGE,                             0,      1,                                              TRUE,   FALSE},
+       {PLV1_ID,                                               0,      2,                                              TRUE,   FALSE},
+       {PLV1_NAT_OA,                                   0,      2,                                              TRUE,   FALSE},
+       {PLV1_NAT_OA_DRAFT_00_03,               0,      2,                                              TRUE,   FALSE},
 };
 
 /**
  * payload order for QUICK_MODE from initiator.
  */
 static payload_order_t quick_mode_i_order[] = {
-/*     payload type                            notify type */
-       {NOTIFY_V1,                                     0},
-       {VENDOR_ID_V1,                          0},
-       {HASH_V1,                                       0},
-       {SECURITY_ASSOCIATION_V1,       0},
-       {NONCE_V1,                                      0},
-       {KEY_EXCHANGE_V1,                       0},
-       {ID_V1,                                         0},
-       {NAT_OA_V1,                                     0},
-       {NAT_OA_DRAFT_00_03_V1,         0},
+/*     payload type                                    notify type */
+       {PLV1_NOTIFY,                                   0},
+       {PLV1_VENDOR_ID,                                0},
+       {PLV1_HASH,                                             0},
+       {PLV1_SECURITY_ASSOCIATION,             0},
+       {PLV1_NONCE,                                    0},
+       {PLV1_KEY_EXCHANGE,                             0},
+       {PLV1_ID,                                               0},
+       {PLV1_NAT_OA,                                   0},
+       {PLV1_NAT_OA_DRAFT_00_03,               0},
 };
 
 /**
  * Message rule for QUICK_MODE from responder.
  */
 static payload_rule_t quick_mode_r_rules[] = {
-/*     payload type                            min     max                                             encr    suff */
-       {NOTIFY_V1,                                     0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
-       {VENDOR_ID_V1,                          0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
-       {HASH_V1,                                       0,      1,                                              TRUE,   FALSE},
-       {SECURITY_ASSOCIATION_V1,       0,      2,                                              TRUE,   FALSE},
-       {NONCE_V1,                                      0,      1,                                              TRUE,   FALSE},
-       {KEY_EXCHANGE_V1,                       0,      1,                                              TRUE,   FALSE},
-       {ID_V1,                                         0,      2,                                              TRUE,   FALSE},
-       {NAT_OA_V1,                                     0,      2,                                              TRUE,   FALSE},
-       {NAT_OA_DRAFT_00_03_V1,         0,      2,                                              TRUE,   FALSE},
+/*     payload type                                    min     max                                             encr    suff */
+       {PLV1_NOTIFY,                                   0,      MAX_NOTIFY_PAYLOADS,    TRUE,   FALSE},
+       {PLV1_VENDOR_ID,                                0,      MAX_VID_PAYLOADS,               TRUE,   FALSE},
+       {PLV1_HASH,                                             0,      1,                                              TRUE,   FALSE},
+       {PLV1_SECURITY_ASSOCIATION,             0,      2,                                              TRUE,   FALSE},
+       {PLV1_NONCE,                                    0,      1,                                              TRUE,   FALSE},
+       {PLV1_KEY_EXCHANGE,                             0,      1,                                              TRUE,   FALSE},
+       {PLV1_ID,                                               0,      2,                                              TRUE,   FALSE},
+       {PLV1_NAT_OA,                                   0,      2,                                              TRUE,   FALSE},
+       {PLV1_NAT_OA_DRAFT_00_03,               0,      2,                                              TRUE,   FALSE},
 };
 
 /**
  * payload order for QUICK_MODE from responder.
  */
 static payload_order_t quick_mode_r_order[] = {
-/*     payload type                            notify type */
-       {NOTIFY_V1,                                     0},
-       {VENDOR_ID_V1,                          0},
-       {HASH_V1,                                       0},
-       {SECURITY_ASSOCIATION_V1,       0},
-       {NONCE_V1,                                      0},
-       {KEY_EXCHANGE_V1,                       0},
-       {ID_V1,                                         0},
-       {NAT_OA_V1,                                     0},
-       {NAT_OA_DRAFT_00_03_V1,         0},
+/*     payload type                                    notify type */
+       {PLV1_NOTIFY,                                   0},
+       {PLV1_VENDOR_ID,                                0},
+       {PLV1_HASH,                                             0},
+       {PLV1_SECURITY_ASSOCIATION,             0},
+       {PLV1_NONCE,                                    0},
+       {PLV1_KEY_EXCHANGE,                             0},
+       {PLV1_ID,                                               0},
+       {PLV1_NAT_OA,                                   0},
+       {PLV1_NAT_OA_DRAFT_00_03,               0},
 };
 
 /**
  * Message rule for TRANSACTION.
  */
 static payload_rule_t transaction_payload_rules_v1[] = {
-/*     payload type                            min     max     encr    suff */
-       {HASH_V1,                                       0,      1,      TRUE,   FALSE},
-       {CONFIGURATION_V1,                      1,      1,      FALSE,  FALSE},
+/*     payload type                                    min     max     encr    suff */
+       {PLV1_HASH,                                             0,      1,      TRUE,   FALSE},
+       {PLV1_CONFIGURATION,                    1,      1,      FALSE,  FALSE},
 };
 
 /**
  * Payload order for TRANSACTION.
  */
 static payload_order_t transaction_payload_order_v1[] = {
-/*     payload type                    notify type */
-       {HASH_V1,                                       0},
-       {CONFIGURATION_V1,                      0},
+/*     payload type                                    notify type */
+       {PLV1_HASH,                                             0},
+       {PLV1_CONFIGURATION,                    0},
 };
 
 #endif /* USE_IKEV1 */
@@ -1063,7 +1063,7 @@ METHOD(message_t, add_payload, void,
        {
                this->first_payload = payload->get_type(payload);
        }
-       payload->set_next_type(payload, NO_PAYLOAD);
+       payload->set_next_type(payload, PL_NONE);
        this->payloads->insert_last(this->payloads, payload);
 
        DBG2(DBG_ENC ,"added payload of type %N to message",
@@ -1086,11 +1086,11 @@ METHOD(message_t, add_notify, void,
        }
        if (this->major_version == IKEV2_MAJOR_VERSION)
        {
-               notify = notify_payload_create(NOTIFY);
+               notify = notify_payload_create(PLV2_NOTIFY);
        }
        else
        {
-               notify = notify_payload_create(NOTIFY_V1);
+               notify = notify_payload_create(PLV1_NOTIFY);
        }
        notify->set_notify_type(notify, type);
        notify->set_notification_data(notify, data);
@@ -1162,8 +1162,8 @@ METHOD(message_t, get_notify, notify_payload_t*,
        enumerator = create_payload_enumerator(this);
        while (enumerator->enumerate(enumerator, &payload))
        {
-               if (payload->get_type(payload) == NOTIFY ||
-                       payload->get_type(payload) == NOTIFY_V1)
+               if (payload->get_type(payload) == PLV2_NOTIFY ||
+                       payload->get_type(payload) == PLV1_NOTIFY)
                {
                        notify = (notify_payload_t*)payload;
                        if (notify->get_notify_type(notify) == type)
@@ -1212,8 +1212,8 @@ static char* get_string(private_message_t *this, char *buf, int len)
                }
                pos += written;
                len -= written;
-               if (payload->get_type(payload) == NOTIFY ||
-                       payload->get_type(payload) == NOTIFY_V1)
+               if (payload->get_type(payload) == PLV2_NOTIFY ||
+                       payload->get_type(payload) == PLV1_NOTIFY)
                {
                        notify_payload_t *notify;
                        notify_type_t type;
@@ -1239,7 +1239,7 @@ static char* get_string(private_message_t *this, char *buf, int len)
                        pos += written;
                        len -= written;
                }
-               if (payload->get_type(payload) == EXTENSIBLE_AUTHENTICATION)
+               if (payload->get_type(payload) == PLV2_EAP)
                {
                        eap_payload_t *eap = (eap_payload_t*)payload;
                        u_int32_t vendor;
@@ -1268,8 +1268,8 @@ static char* get_string(private_message_t *this, char *buf, int len)
                        pos += written;
                        len -= written;
                }
-               if (payload->get_type(payload) == CONFIGURATION ||
-                       payload->get_type(payload) == CONFIGURATION_V1)
+               if (payload->get_type(payload) == PLV2_CONFIGURATION ||
+                       payload->get_type(payload) == PLV1_CONFIGURATION)
                {
                        cp_payload_t *cp = (cp_payload_t*)payload;
                        enumerator_t *attributes;
@@ -1365,7 +1365,7 @@ static void order_payloads(private_message_t *this)
                                notify = (notify_payload_t*)payload;
 
                                /**... and check notify for type. */
-                               if (order.type != NOTIFY || order.notify == 0 ||
+                               if (order.type != PLV2_NOTIFY || order.notify == 0 ||
                                        order.notify == notify->get_notify_type(notify))
                                {
                                        list->remove_at(list, enumerator);
@@ -1410,11 +1410,11 @@ static encryption_payload_t* wrap_payloads(private_message_t *this)
 
        if (this->is_encrypted)
        {
-               encryption = encryption_payload_create(ENCRYPTED_V1);
+               encryption = encryption_payload_create(PLV1_ENCRYPTED);
        }
        else
        {
-               encryption = encryption_payload_create(ENCRYPTED);
+               encryption = encryption_payload_create(PLV2_ENCRYPTED);
        }
        while (payloads->remove_first(payloads, (void**)&current) == SUCCESS)
        {
@@ -1500,7 +1500,7 @@ METHOD(message_t, generate, status_t,
                {       /* insert a HASH payload as first payload */
                        hash_payload_t *hash_payload;
 
-                       hash_payload = hash_payload_create(HASH_V1);
+                       hash_payload = hash_payload_create(PLV1_HASH);
                        hash_payload->set_hash(hash_payload, hash);
                        this->payloads->insert_first(this->payloads, hash_payload);
                        if (this->exchange_type == INFORMATIONAL_V1)
@@ -1598,7 +1598,7 @@ METHOD(message_t, generate, status_t,
        }
        else
        {
-               next_type = encryption ? ENCRYPTED : NO_PAYLOAD;
+               next_type = encryption ? PLV2_ENCRYPTED : PL_NONE;
        }
        payload->set_next_type(payload, next_type);
        generator->generate_payload(generator, payload);
@@ -1683,7 +1683,7 @@ METHOD(message_t, parse_header, status_t,
        DBG2(DBG_ENC, "parsing header of message");
 
        this->parser->reset_context(this->parser);
-       status = this->parser->parse_payload(this->parser, HEADER,
+       status = this->parser->parse_payload(this->parser, PL_HEADER,
                                                                                 (payload_t**)&ike_header);
        if (status != SUCCESS)
        {
@@ -1722,7 +1722,7 @@ METHOD(message_t, parse_header, status_t,
        }
        this->first_payload = ike_header->payload_interface.get_next_type(
                                                                                                &ike_header->payload_interface);
-       if (this->first_payload == FRAGMENT_V1 && this->is_encrypted)
+       if (this->first_payload == PLV1_FRAGMENT && this->is_encrypted)
        {       /* racoon sets the encryted bit when sending a fragment, but these
                 * messages are really not encrypted */
                this->is_encrypted = FALSE;
@@ -1752,7 +1752,7 @@ static bool is_connectivity_check(private_message_t *this, payload_t *payload)
 {
 #ifdef ME
        if (this->exchange_type == INFORMATIONAL &&
-               payload->get_type(payload) == NOTIFY)
+               payload->get_type(payload) == PLV2_NOTIFY)
        {
                notify_payload_t *notify = (notify_payload_t*)payload;
 
@@ -1784,7 +1784,7 @@ static status_t parse_payloads(private_message_t *this)
                 * payload which is then handled just like a regular payload */
                encryption_payload_t *encryption;
 
-               status = this->parser->parse_payload(this->parser, ENCRYPTED_V1,
+               status = this->parser->parse_payload(this->parser, PLV1_ENCRYPTED,
                                                                                         (payload_t**)&encryption);
                if (status != SUCCESS)
                {
@@ -1797,7 +1797,7 @@ static status_t parse_payloads(private_message_t *this)
                return SUCCESS;
        }
 
-       while (type != NO_PAYLOAD)
+       while (type != PL_NONE)
        {
                DBG2(DBG_ENC, "starting parsing a %N payload",
                         payload_type_names, type);
@@ -1826,7 +1826,7 @@ static status_t parse_payloads(private_message_t *this)
 
                /* an encrypted payload is the last one, so STOP here. decryption is
                 * done later */
-               if (type == ENCRYPTED)
+               if (type == PLV2_ENCRYPTED)
                {
                        DBG2(DBG_ENC, "%N payload found, stop parsing",
                                 payload_type_names, type);
@@ -1930,7 +1930,7 @@ static bool accept_unencrypted_mm(private_message_t *this, payload_type_t type)
 {
        if (this->exchange_type == ID_PROT)
        {
-               if (type == ID_V1 || type == HASH_V1)
+               if (type == PLV1_ID || type == PLV1_HASH)
                {
                        return lib->settings->get_bool(lib->settings,
                                                                        "%s.accept_unencrypted_mainmode_messages",
@@ -1959,7 +1959,7 @@ static status_t decrypt_payloads(private_message_t *this, keymat_t *keymat)
 
                DBG2(DBG_ENC, "process payload of type %N", payload_type_names, type);
 
-               if (type == ENCRYPTED || type == ENCRYPTED_V1)
+               if (type == PLV2_ENCRYPTED || type == PLV1_ENCRYPTED)
                {
                        encryption_payload_t *encryption;
 
@@ -2116,7 +2116,7 @@ METHOD(message_t, parse_body, status_t,
                        hash_payload_t *hash_payload;
                        chunk_t other_hash;
 
-                       if (this->first_payload != HASH_V1)
+                       if (this->first_payload != PLV1_HASH)
                        {
                                if (this->exchange_type == INFORMATIONAL_V1)
                                {
@@ -2130,7 +2130,7 @@ METHOD(message_t, parse_body, status_t,
                                chunk_free(&hash);
                                return VERIFY_ERROR;
                        }
-                       hash_payload = (hash_payload_t*)get_payload(this, HASH_V1);
+                       hash_payload = (hash_payload_t*)get_payload(this, PLV1_HASH);
                        other_hash = hash_payload->get_hash(hash_payload);
                        DBG3(DBG_ENC, "HASH received %B\nHASH expected %B",
                                 &other_hash, &hash);
@@ -2211,7 +2211,7 @@ message_t *message_create_from_packet(packet_t *packet)
                },
                .exchange_type = EXCHANGE_TYPE_UNDEFINED,
                .is_request = TRUE,
-               .first_payload = NO_PAYLOAD,
+               .first_payload = PL_NONE,
                .packet = packet,
                .payloads = linked_list_create(),
                .parser = parser_create(packet->get_data(packet)),
index 9e7f831..588b8af 100644 (file)
@@ -486,15 +486,15 @@ METHOD(parser_t, parse_payload, status_t,
                                }
                                break;
                        }
-                       case PAYLOAD_LIST + PROPOSAL_SUBSTRUCTURE:
-                       case PAYLOAD_LIST + PROPOSAL_SUBSTRUCTURE_V1:
-                       case PAYLOAD_LIST + TRANSFORM_SUBSTRUCTURE:
-                       case PAYLOAD_LIST + TRANSFORM_SUBSTRUCTURE_V1:
-                       case PAYLOAD_LIST + TRANSFORM_ATTRIBUTE:
-                       case PAYLOAD_LIST + TRANSFORM_ATTRIBUTE_V1:
-                       case PAYLOAD_LIST + CONFIGURATION_ATTRIBUTE:
-                       case PAYLOAD_LIST + CONFIGURATION_ATTRIBUTE_V1:
-                       case PAYLOAD_LIST + TRAFFIC_SELECTOR_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV2_PROPOSAL_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV1_PROPOSAL_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV2_TRANSFORM_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV1_TRANSFORM_SUBSTRUCTURE:
+                       case PAYLOAD_LIST + PLV2_TRANSFORM_ATTRIBUTE:
+                       case PAYLOAD_LIST + PLV1_TRANSFORM_ATTRIBUTE:
+                       case PAYLOAD_LIST + PLV2_CONFIGURATION_ATTRIBUTE:
+                       case PAYLOAD_LIST + PLV1_CONFIGURATION_ATTRIBUTE:
+                       case PAYLOAD_LIST + PLV2_TRAFFIC_SELECTOR_SUBSTRUCTURE:
                        {
                                if (payload_length < header_length ||
                                        !parse_list(this, rule_number, output + rule->offset,
index 2410a1a..ee3ed54 100644 (file)
@@ -135,7 +135,7 @@ METHOD(payload_t, get_header_length, int,
 METHOD(payload_t, get_type, payload_type_t,
        private_auth_payload_t *this)
 {
-       return AUTHENTICATION;
+       return PLV2_AUTH;
 }
 
 METHOD(payload_t, get_next_type, payload_type_t,
@@ -214,7 +214,7 @@ auth_payload_t *auth_payload_create()
                        .get_data = _get_data,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
        );
        return &this->public;
index 05d4105..43993ae 100644 (file)
@@ -315,7 +315,7 @@ cert_payload_t *cert_payload_create(payload_type_t type)
                        .get_url = _get_url,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
                .type = type,
        );
@@ -363,7 +363,7 @@ cert_payload_t *cert_payload_create_from_hash_and_url(chunk_t hash, char *url)
 {
        private_cert_payload_t *this;
 
-       this = (private_cert_payload_t*)cert_payload_create(CERTIFICATE);
+       this = (private_cert_payload_t*)cert_payload_create(PLV2_CERTIFICATE);
        this->encoding = ENC_X509_HASH_AND_URL;
        this->data = chunk_cat("cc", hash, chunk_create(url, strlen(url)));
        this->payload_length = get_header_length(this) + this->data.len;
index df5e73b..6ac90a2 100644 (file)
@@ -66,7 +66,7 @@ struct private_certreq_payload_t {
        chunk_t data;
 
        /**
-        * Payload type CERTIFICATE_REQUEST or CERTIFICATE_REQUEST_V1
+        * Payload type PLV2_CERTREQ or PLV1_CERTREQ
         */
        payload_type_t type;
 };
@@ -111,7 +111,7 @@ static encoding_rule_t encodings[] = {
 METHOD(payload_t, verify, status_t,
        private_certreq_payload_t *this)
 {
-       if (this->type == CERTIFICATE_REQUEST &&
+       if (this->type == PLV2_CERTREQ &&
                this->encoding == ENC_X509_SIGNATURE)
        {
                if (this->data.len % HASH_SIZE_SHA1)
@@ -218,7 +218,7 @@ METHOD(certreq_payload_t, create_keyid_enumerator, enumerator_t*,
 {
        keyid_enumerator_t *enumerator;
 
-       if (this->type == CERTIFICATE_REQUEST_V1)
+       if (this->type == PLV1_CERTREQ)
        {
                return enumerator_create_empty();
        }
@@ -276,7 +276,7 @@ certreq_payload_t *certreq_payload_create(payload_type_t type)
                        .destroy = _destroy,
                        .get_dn = _get_dn,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
                .type = type,
        );
@@ -291,7 +291,7 @@ certreq_payload_t *certreq_payload_create_type(certificate_type_t type)
        private_certreq_payload_t *this;
 
        this = (private_certreq_payload_t*)
-                                       certreq_payload_create(CERTIFICATE_REQUEST);
+                                       certreq_payload_create(PLV2_CERTREQ);
        switch (type)
        {
                case CERT_X509:
@@ -314,7 +314,7 @@ certreq_payload_t *certreq_payload_create_dn(identification_t *id)
        private_certreq_payload_t *this;
 
        this = (private_certreq_payload_t*)
-                                       certreq_payload_create(CERTIFICATE_REQUEST_V1);
+                                       certreq_payload_create(PLV1_CERTREQ);
 
        this->encoding = ENC_X509_SIGNATURE;
        this->data = chunk_clone(id->get_encoding(id));
index 482eca8..481bb7b 100644 (file)
@@ -61,7 +61,7 @@ struct private_configuration_attribute_t {
        chunk_t value;
 
        /**
-        * Payload type, CONFIGURATION_ATTRIBUTE or DATA_ATTRIBUTE_V1
+        * Payload type, PLV2_CONFIGURATION_ATTRIBUTE or DATA_ATTRIBUTE_V1
         */
        payload_type_t type;
 };
@@ -209,7 +209,7 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_configuration_attribute_t *this, encoding_rule_t **rules)
 {
-       if (this->type == CONFIGURATION_ATTRIBUTE)
+       if (this->type == PLV2_CONFIGURATION_ATTRIBUTE)
        {
                *rules = encodings_v2;
                return countof(encodings_v2);
@@ -233,7 +233,7 @@ METHOD(payload_t, get_type, payload_type_t,
 METHOD(payload_t, get_next_type, payload_type_t,
        private_configuration_attribute_t *this)
 {
-       return NO_PAYLOAD;
+       return PL_NONE;
 }
 
 METHOD(payload_t, set_next_type, void,
@@ -335,7 +335,7 @@ configuration_attribute_t *configuration_attribute_create_value(
        private_configuration_attribute_t *this;
 
        this = (private_configuration_attribute_t*)
-                                       configuration_attribute_create(CONFIGURATION_ATTRIBUTE_V1);
+                                       configuration_attribute_create(PLV1_CONFIGURATION_ATTRIBUTE);
        this->attr_type = ((u_int16_t)attr_type) & 0x7FFF;
        this->length_or_value = value;
        this->af_flag = TRUE;
index ecc0f9c..946c1b5 100644 (file)
@@ -68,7 +68,7 @@ struct configuration_attribute_t {
 /**
  * Creates an empty configuration attribute.
  *
- * @param type         CONFIGURATION_ATTRIBUTE or CONFIGURATION_ATTRIBUTE_V1
+ * @param type         PLV2_CONFIGURATION_ATTRIBUTE or PLV1_CONFIGURATION_ATTRIBUTE
  * @return                     created configuration attribute
  */
 configuration_attribute_t *configuration_attribute_create(payload_type_t type);
@@ -76,7 +76,7 @@ configuration_attribute_t *configuration_attribute_create(payload_type_t type);
 /**
  * Creates a configuration attribute with type and value.
  *
- * @param type         CONFIGURATION_ATTRIBUTE or CONFIGURATION_ATTRIBUTE_V1
+ * @param type         PLV2_CONFIGURATION_ATTRIBUTE or PLV1_CONFIGURATION_ATTRIBUTE
  * @param attr_type    type of configuration attribute
  * @param chunk                attribute value, gets cloned
  * @return                     created configuration attribute
@@ -89,7 +89,7 @@ configuration_attribute_t *configuration_attribute_create_chunk(
  *
  * @param attr_type    type of configuration attribute
  * @param value                attribute value, gets cloned
- * @return                     created CONFIGURATION_ATTRIBUTE_V1 configuration attribute
+ * @return                     created PLV1_CONFIGURATION_ATTRIBUTE configuration attribute
  */
 configuration_attribute_t *configuration_attribute_create_value(
                                        configuration_attribute_type_t attr_type, u_int16_t value);
index f6f373f..ef9df84 100644 (file)
@@ -82,7 +82,7 @@ struct private_cp_payload_t {
        u_int8_t cfg_type;
 
        /**
-        * CONFIGURATION or CONFIGURATION_V1
+        * PLV2_CONFIGURATION or PLV1_CONFIGURATION
         */
        payload_type_t type;
 };
@@ -111,7 +111,7 @@ static encoding_rule_t encodings_v2[] = {
        { RESERVED_BYTE,        offsetof(private_cp_payload_t, reserved_byte[1])},
        { RESERVED_BYTE,        offsetof(private_cp_payload_t, reserved_byte[2])},
        /* list of configuration attributes in a list */
-       { PAYLOAD_LIST + CONFIGURATION_ATTRIBUTE,
+       { PAYLOAD_LIST + PLV2_CONFIGURATION_ATTRIBUTE,
                                                offsetof(private_cp_payload_t, attributes)              },
 };
 
@@ -152,7 +152,7 @@ static encoding_rule_t encodings_v1[] = {
        { RESERVED_BYTE,        offsetof(private_cp_payload_t, reserved_byte[0])},
        { U_INT_16,                     offsetof(private_cp_payload_t, identifier)},
        /* list of configuration attributes in a list */
-       { PAYLOAD_LIST + CONFIGURATION_ATTRIBUTE_V1,
+       { PAYLOAD_LIST + PLV1_CONFIGURATION_ATTRIBUTE,
                                                offsetof(private_cp_payload_t, attributes)              },
 };
 
@@ -193,7 +193,7 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_cp_payload_t *this, encoding_rule_t **rules)
 {
-       if (this->type == CONFIGURATION)
+       if (this->type == PLV2_CONFIGURATION)
        {
                *rules = encodings_v2;
                return countof(encodings_v2);
@@ -314,7 +314,7 @@ cp_payload_t *cp_payload_create_type(payload_type_t type, config_type_t cfg_type
                        .set_identifier = _set_identifier,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
                .attributes = linked_list_create(),
                .cfg_type = cfg_type,
index c23bc0b..d466989 100644 (file)
@@ -100,7 +100,7 @@ struct cp_payload_t {
 /**
  * Creates an empty configuration payload
  *
- * @param type         payload type, CONFIGURATION or CONFIGURATION_V1
+ * @param type         payload type, PLV2_CONFIGURATION or PLV1_CONFIGURATION
  * @return                     empty configuration payload
  */
 cp_payload_t *cp_payload_create(payload_type_t type);
@@ -108,7 +108,7 @@ cp_payload_t *cp_payload_create(payload_type_t type);
 /**
  * Creates an cp_payload_t with type and value
  *
- * @param type         payload type, CONFIGURATION or CONFIGURATION_V1
+ * @param type         payload type, PLV2_CONFIGURATION or PLV1_CONFIGURATION
  * @param cfg_type     type of configuration payload to create
  * @return                     created configuration payload
  */
index 007411f..c2ab3b9 100644 (file)
@@ -78,7 +78,7 @@ struct private_delete_payload_t {
        chunk_t spis;
 
        /**
-        * Payload type, DELETE or DELETE_V1
+        * Payload type, PLV2_DELETE or PLV1_DELETE
         */
        payload_type_t type;
 };
@@ -178,7 +178,7 @@ METHOD(payload_t, verify, status_t,
                        break;
                case PROTO_IKE:
                case 0:
-                       if (this->type == DELETE)
+                       if (this->type == PLV2_DELETE)
                        {       /* IKEv2 deletion has no spi assigned! */
                                if (this->spi_size != 0)
                                {
@@ -206,7 +206,7 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_delete_payload_t *this, encoding_rule_t **rules)
 {
-       if (this->type == DELETE)
+       if (this->type == PLV2_DELETE)
        {
                *rules = encodings_v2;
                return countof(encodings_v2);
@@ -218,7 +218,7 @@ METHOD(payload_t, get_encoding_rules, int,
 METHOD(payload_t, get_header_length, int,
        private_delete_payload_t *this)
 {
-       if (this->type == DELETE)
+       if (this->type == PLV2_DELETE)
        {
                return 8;
        }
@@ -355,7 +355,7 @@ delete_payload_t *delete_payload_create(payload_type_t type,
                        .create_spi_enumerator = _create_spi_enumerator,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .protocol_id = protocol_id,
                .doi = IKEV1_DOI_IPSEC,
                .type = type,
@@ -364,7 +364,7 @@ delete_payload_t *delete_payload_create(payload_type_t type,
 
        if (protocol_id == PROTO_IKE)
        {
-               if (type == DELETE_V1)
+               if (type == PLV1_DELETE)
                {
                        this->spi_size = 16;
                }
index afce1ec..46a89ea 100644 (file)
@@ -76,7 +76,7 @@ struct delete_payload_t {
 /**
  * Creates an empty delete_payload_t object.
  *
- * @param type                 DELETE or DELETE_V1
+ * @param type                 PLV2_DELETE or PLV1_DELETE
  * @param protocol_id  protocol, such as AH|ESP
  * @return                             delete_payload_t object
  */
index f2f35aa..ebdf8a3 100644 (file)
@@ -162,7 +162,7 @@ METHOD(payload_t, get_header_length, int,
 METHOD(payload_t, get_payload_type, payload_type_t,
        private_eap_payload_t *this)
 {
-       return EXTENSIBLE_AUTHENTICATION;
+       return PLV2_EAP;
 }
 
 METHOD(payload_t, get_next_type, payload_type_t,
@@ -341,7 +341,7 @@ eap_payload_t *eap_payload_create()
                        .is_expanded = _is_expanded,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
        );
        return &this->public;
index 6a9f9c3..5784562 100644 (file)
@@ -74,7 +74,7 @@ struct private_encryption_payload_t {
        linked_list_t *payloads;
 
        /**
-        * Type of payload, ENCRYPTED or ENCRYPTED_V1
+        * Type of payload, PLV2_ENCRYPTED or PLV1_ENCRYPTED
         */
        payload_type_t type;
 };
@@ -145,7 +145,7 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_encryption_payload_t *this, encoding_rule_t **rules)
 {
-       if (this->type == ENCRYPTED)
+       if (this->type == PLV2_ENCRYPTED)
        {
                *rules = encodings_v2;
                return countof(encodings_v2);
@@ -157,7 +157,7 @@ METHOD(payload_t, get_encoding_rules, int,
 METHOD(payload_t, get_header_length, int,
        private_encryption_payload_t *this)
 {
-       if (this->type == ENCRYPTED)
+       if (this->type == PLV2_ENCRYPTED)
        {
                return 4;
        }
@@ -241,7 +241,7 @@ METHOD(encryption_payload_t, add_payload, void,
        {
                this->next_payload = payload->get_type(payload);
        }
-       payload->set_next_type(payload, NO_PAYLOAD);
+       payload->set_next_type(payload, PL_NONE);
        this->payloads->insert_last(this->payloads, payload);
        compute_length(this);
 }
@@ -281,7 +281,7 @@ static chunk_t generate(private_encryption_payload_t *this,
                        generator->generate_payload(generator, current);
                        current = next;
                }
-               current->set_next_type(current, NO_PAYLOAD);
+               current->set_next_type(current, PL_NONE);
                generator->generate_payload(generator, current);
 
                chunk = generator->get_chunk(generator, &lenpos);
@@ -447,7 +447,7 @@ static status_t parse(private_encryption_payload_t *this, chunk_t plain)
 
        parser = parser_create(plain);
        type = this->next_payload;
-       while (type != NO_PAYLOAD)
+       while (type != PL_NONE)
        {
                payload_t *payload;
 
@@ -618,13 +618,13 @@ encryption_payload_t *encryption_payload_create(payload_type_t type)
                        .decrypt = _decrypt,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payloads = linked_list_create(),
                .type = type,
        );
        this->payload_length = get_header_length(this);
 
-       if (type == ENCRYPTED_V1)
+       if (type == PLV1_ENCRYPTED)
        {
                this->public.encrypt = _encrypt_v1;
                this->public.decrypt = _decrypt_v1;
index f4fc7d6..ee44c2d 100644 (file)
@@ -103,7 +103,7 @@ struct encryption_payload_t {
 /**
  * Creates an empty encryption_payload_t object.
  *
- * @param type         ENCRYPTED or ENCRYPTED_V1
+ * @param type         PLV2_ENCRYPTED or PLV1_ENCRYPTED
  * @return                     encryption_payload_t object
  */
 encryption_payload_t *encryption_payload_create(payload_type_t type);
index 25fb42a..ebe5f32 100644 (file)
@@ -227,7 +227,7 @@ METHOD(endpoint_notify_t, build_notify, notify_payload_t*,
        chunk_t data;
        notify_payload_t *notify;
 
-       notify = notify_payload_create(NOTIFY);
+       notify = notify_payload_create(PLV2_NOTIFY);
        notify->set_notify_type(notify, ME_ENDPOINT);
        data = build_notification_data(this);
        notify->set_notification_data(notify, data);
index 1a6b323..b861fcc 100644 (file)
@@ -124,7 +124,7 @@ METHOD(payload_t, get_header_length, int,
 METHOD(payload_t, get_type, payload_type_t,
        private_fragment_payload_t *this)
 {
-       return FRAGMENT_V1;
+       return PLV1_FRAGMENT;
 }
 
 METHOD(payload_t, get_next_type, payload_type_t,
@@ -201,7 +201,7 @@ fragment_payload_t *fragment_payload_create()
                        .get_data = _get_data,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
        );
        this->payload_length = get_header_length(this);
        return &this->public;
index 0cf63ba..a12b018 100644 (file)
@@ -52,7 +52,7 @@ struct private_hash_payload_t {
        chunk_t hash;
 
        /**
-        * either HASH_V1 or NAT_D_V1
+        * either PLV1_HASH or PLV1_NAT_D
         */
        payload_type_t type;
 };
@@ -169,7 +169,7 @@ hash_payload_t *hash_payload_create(payload_type_t type)
                        .get_hash = _get_hash,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
                .type = type,
        );
index cfe2846..604de48 100644 (file)
@@ -59,7 +59,7 @@ struct hash_payload_t {
 /**
  * Creates an empty hash_payload_t object.
  *
- * @param type         either HASH_V1 or NAT_D_V1
+ * @param type         either PLV1_HASH or PLV1_NAT_D
  * @return                     hash_payload_t object
  */
 hash_payload_t *hash_payload_create(payload_type_t type);
index 7470bb3..a002a8f 100644 (file)
@@ -81,7 +81,7 @@ struct private_id_payload_t {
        u_int16_t port;
 
        /**
-        * one of ID_INITIATOR, ID_RESPONDER, IDv1 and NAT_OA_V1
+        * one of PLV2_ID_INITIATOR, PLV2_ID_RESPONDER, IDv1 and PLV1_NAT_OA
         */
        payload_type_t type;
 };
@@ -165,7 +165,7 @@ METHOD(payload_t, verify, status_t,
 {
        bool bad_length = FALSE;
 
-       if ((this->type == NAT_OA_V1 || this->type == NAT_OA_DRAFT_00_03_V1) &&
+       if ((this->type == PLV1_NAT_OA || this->type == PLV1_NAT_OA_DRAFT_00_03) &&
                this->id_type != ID_IPV4_ADDR && this->id_type != ID_IPV6_ADDR)
        {
                DBG1(DBG_ENC, "invalid ID type %N for %N payload", id_type_names,
@@ -195,8 +195,8 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_id_payload_t *this, encoding_rule_t **rules)
 {
-       if (this->type == ID_V1 ||
-               this->type == NAT_OA_V1 || this->type == NAT_OA_DRAFT_00_03_V1)
+       if (this->type == PLV1_ID ||
+               this->type == PLV1_NAT_OA || this->type == PLV1_NAT_OA_DRAFT_00_03)
        {
                *rules = encodings_v1;
                return countof(encodings_v1);
@@ -368,7 +368,7 @@ id_payload_t *id_payload_create(payload_type_t type)
                        .get_ts = _get_ts,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
                .type = type,
        );
@@ -400,7 +400,7 @@ id_payload_t *id_payload_create_from_ts(traffic_selector_t *ts)
        u_int8_t mask;
        host_t *net;
 
-       this = (private_id_payload_t*)id_payload_create(ID_V1);
+       this = (private_id_payload_t*)id_payload_create(PLV1_ID);
 
        if (ts->is_host(ts, NULL))
        {
index 9a62494..df1d075 100644 (file)
@@ -70,7 +70,7 @@ struct id_payload_t {
 /**
  * Creates an empty id_payload_t object.
  *
- * @param type         one of ID_INITIATOR, ID_RESPONDER, ID_V1 and NAT_OA_V1
+ * @param type         one of PLV2_ID_INITIATOR, PLV2_ID_RESPONDER, PLV1_ID and PLV1_NAT_OA
  * @return                     id_payload_t object
  */
 id_payload_t *id_payload_create(payload_type_t type);
@@ -78,7 +78,7 @@ id_payload_t *id_payload_create(payload_type_t type);
 /**
  * Creates an id_payload_t from an existing identification_t object.
  *
- * @param type         one of ID_INITIATOR, ID_RESPONDER, ID_V1 and NAT_OA_V1
+ * @param type         one of PLV2_ID_INITIATOR, PLV2_ID_RESPONDER, PLV1_ID and PLV1_NAT_OA
  * @param id           identification_t object
  * @return                     id_payload_t object
  */
@@ -89,7 +89,7 @@ id_payload_t *id_payload_create_from_identification(payload_type_t type,
  * Create an IKEv1 ID_ADDR_SUBNET/RANGE identity from a traffic selector.
  *
  * @param ts           traffic selector
- * @return                     ID_V1 id_paylad_t object.
+ * @return                     PLV1_ID id_paylad_t object.
  */
 id_payload_t *id_payload_create_from_ts(traffic_selector_t *ts);
 
index 58b6241..7015667 100644 (file)
@@ -262,7 +262,7 @@ METHOD(payload_t, get_header_length, int,
 METHOD(payload_t, get_type, payload_type_t,
        private_ike_header_t *this)
 {
-       return HEADER;
+       return PL_HEADER;
 }
 
 METHOD(payload_t, get_next_type, payload_type_t,
index 438ea46..4f552d6 100644 (file)
@@ -69,7 +69,7 @@ struct private_ke_payload_t {
        chunk_t key_exchange_data;
 
        /**
-        * Payload type, KEY_EXCHANGE or KEY_EXCHANGE_V1
+        * Payload type, PLV2_KEY_EXCHANGE or PLV1_KEY_EXCHANGE
         */
        payload_type_t type;
 };
@@ -148,7 +148,7 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_ke_payload_t *this, encoding_rule_t **rules)
 {
-       if (this->type == KEY_EXCHANGE)
+       if (this->type == PLV2_KEY_EXCHANGE)
        {
                *rules = encodings_v2;
                return countof(encodings_v2);
@@ -160,7 +160,7 @@ METHOD(payload_t, get_encoding_rules, int,
 METHOD(payload_t, get_header_length, int,
        private_ke_payload_t *this)
 {
-       if (this->type == KEY_EXCHANGE)
+       if (this->type == PLV2_KEY_EXCHANGE)
        {
                return 8;
        }
@@ -233,7 +233,7 @@ ke_payload_t *ke_payload_create(payload_type_t type)
                        .get_dh_group_number = _get_dh_group_number,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .dh_group_number = MODP_NONE,
                .type = type,
        );
index d3aa184..dfc6308 100644 (file)
@@ -63,7 +63,7 @@ struct ke_payload_t {
 /**
  * Creates an empty ke_payload_t object.
  *
- * @param type         KEY_EXCHANGE or KEY_EXCHANGE_V1
+ * @param type         PLV2_KEY_EXCHANGE or PLV1_KEY_EXCHANGE
  * @return                     ke_payload_t object
  */
 ke_payload_t *ke_payload_create(payload_type_t type);
@@ -71,7 +71,7 @@ ke_payload_t *ke_payload_create(payload_type_t type);
 /**
  * Creates a ke_payload_t from a diffie_hellman_t.
  *
- * @param type         KEY_EXCHANGE or KEY_EXCHANGE_V1
+ * @param type         PLV2_KEY_EXCHANGE or PLV1_KEY_EXCHANGE
  * @param dh           diffie hellman object containing group and key
  * @return                     ke_payload_t object
  */
index 3c5eeb5..b0d1c60 100644 (file)
@@ -60,7 +60,7 @@ struct private_nonce_payload_t {
        chunk_t nonce;
 
        /**
-        * Payload type, NONCE or NONCE_V1
+        * Payload type, PLV2_NONCE or PLV1_NONCE
         */
        payload_type_t type;
 };
@@ -110,12 +110,12 @@ METHOD(payload_t, verify, status_t,
        {
                bad_length = TRUE;
        }
-       if (this->type == NONCE &&
+       if (this->type == PLV2_NONCE &&
                this->nonce.len < 16)
        {
                bad_length = TRUE;
        }
-       if (this->type == NONCE_V1 &&
+       if (this->type == PLV1_NONCE &&
                this->nonce.len < 8)
        {
                bad_length = TRUE;
@@ -209,7 +209,7 @@ nonce_payload_t *nonce_payload_create(payload_type_t type)
                        .get_nonce = _get_nonce,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
                .type = type,
        );
index 5c47f5f..ee8ad17 100644 (file)
@@ -64,7 +64,7 @@ struct nonce_payload_t {
 /**
  * Creates an empty nonce_payload_t object
  *
- * @param type         NONCE or NONCE_V1
+ * @param type         PLV2_NONCE or PLV1_NONCE
  * @return                     nonce_payload_t object
  */
 nonce_payload_t *nonce_payload_create(payload_type_t type);
index 889ad63..dd92e42 100644 (file)
@@ -302,7 +302,7 @@ struct private_notify_payload_t {
        chunk_t notify_data;
 
        /**
-        * Type of payload, NOTIFY or NOTIFY_V1
+        * Type of payload, PLV2_NOTIFY or PLV1_NOTIFY
         */
        payload_type_t type;
 };
@@ -427,7 +427,7 @@ METHOD(payload_t, verify, status_t,
        {
                case INVALID_KE_PAYLOAD:
                {
-                       if (this->type == NOTIFY && this->notify_data.len != 2)
+                       if (this->type == PLV2_NOTIFY && this->notify_data.len != 2)
                        {
                                bad_length = TRUE;
                        }
@@ -447,7 +447,7 @@ METHOD(payload_t, verify, status_t,
                case INVALID_MAJOR_VERSION:
                case NO_PROPOSAL_CHOSEN:
                {
-                       if (this->type == NOTIFY && this->notify_data.len != 0)
+                       if (this->type == PLV2_NOTIFY && this->notify_data.len != 0)
                        {
                                bad_length = TRUE;
                        }
@@ -531,7 +531,7 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_notify_payload_t *this, encoding_rule_t **rules)
 {
-       if (this->type == NOTIFY)
+       if (this->type == PLV2_NOTIFY)
        {
                *rules = encodings_v2;
                return countof(encodings_v2);
@@ -543,7 +543,7 @@ METHOD(payload_t, get_encoding_rules, int,
 METHOD(payload_t, get_header_length, int,
        private_notify_payload_t *this)
 {
-       if (this->type == NOTIFY)
+       if (this->type == PLV2_NOTIFY)
        {
                return 8 + this->spi_size;
        }
@@ -726,7 +726,7 @@ notify_payload_t *notify_payload_create(payload_type_t type)
                        .destroy = _destroy,
                },
                .doi = IKEV1_DOI_IPSEC,
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .type = type,
        );
        compute_length(this);
index c67644a..3c56f06 100644 (file)
@@ -281,7 +281,7 @@ struct notify_payload_t {
 /**
  * Creates an empty notify_payload_t object
  *
- * @param type         payload type, NOTIFY or NOTIFY_V1
+ * @param type         payload type, PLV2_NOTIFY or PLV1_NOTIFY
  * @return                     created notify_payload_t object
  */
 notify_payload_t *notify_payload_create(payload_type_t type);
@@ -289,7 +289,7 @@ notify_payload_t *notify_payload_create(payload_type_t type);
 /**
  * Creates an notify_payload_t object of specific type for specific protocol id.
  *
- * @param type                                 payload type, NOTIFY or NOTIFY_V1
+ * @param type                                 payload type, PLV2_NOTIFY or PLV1_NOTIFY
  * @param protocol                             protocol id (IKE, AH or ESP)
  * @param notify                               type of notify
  * @return                                             notify_payload_t object
index f9dd33e..fd61662 100644 (file)
 #include <encoding/payloads/fragment_payload.h>
 #include <encoding/payloads/unknown_payload.h>
 
-ENUM_BEGIN(payload_type_names, NO_PAYLOAD, NO_PAYLOAD,
-       "NO_PAYLOAD");
-ENUM_NEXT(payload_type_names, SECURITY_ASSOCIATION_V1, CONFIGURATION_V1, NO_PAYLOAD,
+ENUM_BEGIN(payload_type_names, PL_NONE, PL_NONE,
+       "PL_NONE");
+ENUM_NEXT(payload_type_names, PLV1_SECURITY_ASSOCIATION, PLV1_CONFIGURATION, PL_NONE,
        "SECURITY_ASSOCIATION_V1",
        "PROPOSAL_V1",
        "TRANSFORM_V1",
        "KEY_EXCHANGE_V1",
        "ID_V1",
        "CERTIFICATE_V1",
-       "CERTIFICATE_REQUEST_V1",
+       "CERTREQ_V1",
        "HASH_V1",
        "SIGNATURE_V1",
        "NONCE_V1",
@@ -56,41 +56,41 @@ ENUM_NEXT(payload_type_names, SECURITY_ASSOCIATION_V1, CONFIGURATION_V1, NO_PAYL
        "DELETE_V1",
        "VENDOR_ID_V1",
        "CONFIGURATION_V1");
-ENUM_NEXT(payload_type_names, NAT_D_V1, NAT_OA_V1, CONFIGURATION_V1,
+ENUM_NEXT(payload_type_names, PLV1_NAT_D, PLV1_NAT_OA, PLV1_CONFIGURATION,
        "NAT_D_V1",
        "NAT_OA_V1");
-ENUM_NEXT(payload_type_names, SECURITY_ASSOCIATION, GENERIC_SECURE_PASSWORD_METHOD, NAT_OA_V1,
+ENUM_NEXT(payload_type_names, PLV2_SECURITY_ASSOCIATION, PLV2_GSPM, PLV1_NAT_OA,
        "SECURITY_ASSOCIATION",
        "KEY_EXCHANGE",
        "ID_INITIATOR",
        "ID_RESPONDER",
        "CERTIFICATE",
-       "CERTIFICATE_REQUEST",
-       "AUTHENTICATION",
+       "CERTREQ",
+       "AUTH",
        "NONCE",
        "NOTIFY",
        "DELETE",
        "VENDOR_ID",
-       "TRAFFIC_SELECTOR_INITIATOR",
-       "TRAFFIC_SELECTOR_RESPONDER",
+       "TS_INITIATOR",
+       "TS_RESPONDER",
        "ENCRYPTED",
        "CONFIGURATION",
-       "EXTENSIBLE_AUTHENTICATION",
-       "GENERIC_SECURE_PASSWORD_METHOD");
+       "EAP",
+       "GSPM");
 #ifdef ME
-ENUM_NEXT(payload_type_names, ID_PEER, ID_PEER, GENERIC_SECURE_PASSWORD_METHOD,
+ENUM_NEXT(payload_type_names, PLV2_ID_PEER, PLV2_ID_PEER, PLV2_GSPM,
        "ID_PEER");
-ENUM_NEXT(payload_type_names, NAT_D_DRAFT_00_03_V1, FRAGMENT_V1, ID_PEER,
+ENUM_NEXT(payload_type_names, PLV1_NAT_D_DRAFT_00_03, PLV1_FRAGMENT, PLV2_ID_PEER,
        "NAT_D_DRAFT_V1",
        "NAT_OA_DRAFT_V1",
        "FRAGMENT");
 #else
-ENUM_NEXT(payload_type_names, NAT_D_DRAFT_00_03_V1, FRAGMENT_V1, GENERIC_SECURE_PASSWORD_METHOD,
+ENUM_NEXT(payload_type_names, PLV1_NAT_D_DRAFT_00_03, PLV1_FRAGMENT, PLV2_GSPM,
        "NAT_D_DRAFT_V1",
        "NAT_OA_DRAFT_V1",
        "FRAGMENT");
 #endif /* ME */
-ENUM_NEXT(payload_type_names, HEADER, ENCRYPTED_V1, FRAGMENT_V1,
+ENUM_NEXT(payload_type_names, PL_HEADER, PLV1_ENCRYPTED, PLV1_FRAGMENT,
        "HEADER",
        "PROPOSAL_SUBSTRUCTURE",
        "PROPOSAL_SUBSTRUCTURE_V1",
@@ -102,12 +102,12 @@ ENUM_NEXT(payload_type_names, HEADER, ENCRYPTED_V1, FRAGMENT_V1,
        "CONFIGURATION_ATTRIBUTE",
        "CONFIGURATION_ATTRIBUTE_V1",
        "ENCRYPTED_V1");
-ENUM_END(payload_type_names, ENCRYPTED_V1);
+ENUM_END(payload_type_names, PLV1_ENCRYPTED);
 
 /* short forms of payload names */
-ENUM_BEGIN(payload_type_short_names, NO_PAYLOAD, NO_PAYLOAD,
+ENUM_BEGIN(payload_type_short_names, PL_NONE, PL_NONE,
        "--");
-ENUM_NEXT(payload_type_short_names, SECURITY_ASSOCIATION_V1, CONFIGURATION_V1, NO_PAYLOAD,
+ENUM_NEXT(payload_type_short_names, PLV1_SECURITY_ASSOCIATION, PLV1_CONFIGURATION, PL_NONE,
        "SA",
        "PROP",
        "TRANS",
@@ -122,10 +122,10 @@ ENUM_NEXT(payload_type_short_names, SECURITY_ASSOCIATION_V1, CONFIGURATION_V1, N
        "D",
        "V",
        "CP");
-ENUM_NEXT(payload_type_short_names, NAT_D_V1, NAT_OA_V1, CONFIGURATION_V1,
+ENUM_NEXT(payload_type_short_names, PLV1_NAT_D, PLV1_NAT_OA, PLV1_CONFIGURATION,
        "NAT-D",
        "NAT-OA");
-ENUM_NEXT(payload_type_short_names, SECURITY_ASSOCIATION, GENERIC_SECURE_PASSWORD_METHOD, NAT_OA_V1,
+ENUM_NEXT(payload_type_short_names, PLV2_SECURITY_ASSOCIATION, PLV2_GSPM, PLV1_NAT_OA,
        "SA",
        "KE",
        "IDi",
@@ -144,19 +144,19 @@ ENUM_NEXT(payload_type_short_names, SECURITY_ASSOCIATION, GENERIC_SECURE_PASSWOR
        "EAP",
        "GSPM");
 #ifdef ME
-ENUM_NEXT(payload_type_short_names, ID_PEER, ID_PEER, GENERIC_SECURE_PASSWORD_METHOD,
+ENUM_NEXT(payload_type_short_names, PLV2_ID_PEER, PLV2_ID_PEER, PLV2_GSPM,
        "IDp");
-ENUM_NEXT(payload_type_short_names, NAT_D_DRAFT_00_03_V1, FRAGMENT_V1, ID_PEER,
+ENUM_NEXT(payload_type_short_names, PLV1_NAT_D_DRAFT_00_03, PLV1_FRAGMENT, PLV2_ID_PEER,
        "NAT-D",
        "NAT-OA",
        "FRAG");
 #else
-ENUM_NEXT(payload_type_short_names, NAT_D_DRAFT_00_03_V1, FRAGMENT_V1, GENERIC_SECURE_PASSWORD_METHOD,
+ENUM_NEXT(payload_type_short_names, PLV1_NAT_D_DRAFT_00_03, PLV1_FRAGMENT, PLV2_GSPM,
        "NAT-D",
        "NAT-OA",
        "FRAG");
 #endif /* ME */
-ENUM_NEXT(payload_type_short_names, HEADER, ENCRYPTED_V1, FRAGMENT_V1,
+ENUM_NEXT(payload_type_short_names, PL_HEADER, PLV1_ENCRYPTED, PLV1_FRAGMENT,
        "HDR",
        "PROP",
        "PROP",
@@ -168,7 +168,7 @@ ENUM_NEXT(payload_type_short_names, HEADER, ENCRYPTED_V1, FRAGMENT_V1,
        "CATTR",
        "CATTR",
        "E");
-ENUM_END(payload_type_short_names, ENCRYPTED_V1);
+ENUM_END(payload_type_short_names, PLV1_ENCRYPTED);
 
 /*
  * see header
@@ -177,75 +177,75 @@ payload_t *payload_create(payload_type_t type)
 {
        switch (type)
        {
-               case HEADER:
+               case PL_HEADER:
                        return (payload_t*)ike_header_create();
-               case SECURITY_ASSOCIATION:
-               case SECURITY_ASSOCIATION_V1:
+               case PLV2_SECURITY_ASSOCIATION:
+               case PLV1_SECURITY_ASSOCIATION:
                        return (payload_t*)sa_payload_create(type);
-               case PROPOSAL_SUBSTRUCTURE:
-               case PROPOSAL_SUBSTRUCTURE_V1:
+               case PLV2_PROPOSAL_SUBSTRUCTURE:
+               case PLV1_PROPOSAL_SUBSTRUCTURE:
                        return (payload_t*)proposal_substructure_create(type);
-               case TRANSFORM_SUBSTRUCTURE:
-               case TRANSFORM_SUBSTRUCTURE_V1:
+               case PLV2_TRANSFORM_SUBSTRUCTURE:
+               case PLV1_TRANSFORM_SUBSTRUCTURE:
                        return (payload_t*)transform_substructure_create(type);
-               case TRANSFORM_ATTRIBUTE:
-               case TRANSFORM_ATTRIBUTE_V1:
+               case PLV2_TRANSFORM_ATTRIBUTE:
+               case PLV1_TRANSFORM_ATTRIBUTE:
                        return (payload_t*)transform_attribute_create(type);
-               case NONCE:
-               case NONCE_V1:
+               case PLV2_NONCE:
+               case PLV1_NONCE:
                        return (payload_t*)nonce_payload_create(type);
-               case ID_INITIATOR:
-               case ID_RESPONDER:
-               case ID_V1:
-               case NAT_OA_V1:
-               case NAT_OA_DRAFT_00_03_V1:
+               case PLV2_ID_INITIATOR:
+               case PLV2_ID_RESPONDER:
+               case PLV1_ID:
+               case PLV1_NAT_OA:
+               case PLV1_NAT_OA_DRAFT_00_03:
 #ifdef ME
-               case ID_PEER:
+               case PLV2_ID_PEER:
 #endif /* ME */
                        return (payload_t*)id_payload_create(type);
-               case AUTHENTICATION:
+               case PLV2_AUTH:
                        return (payload_t*)auth_payload_create();
-               case CERTIFICATE:
-               case CERTIFICATE_V1:
+               case PLV2_CERTIFICATE:
+               case PLV1_CERTIFICATE:
                        return (payload_t*)cert_payload_create(type);
-               case CERTIFICATE_REQUEST:
-               case CERTIFICATE_REQUEST_V1:
+               case PLV2_CERTREQ:
+               case PLV1_CERTREQ:
                        return (payload_t*)certreq_payload_create(type);
-               case TRAFFIC_SELECTOR_SUBSTRUCTURE:
+               case PLV2_TRAFFIC_SELECTOR_SUBSTRUCTURE:
                        return (payload_t*)traffic_selector_substructure_create();
-               case TRAFFIC_SELECTOR_INITIATOR:
+               case PLV2_TS_INITIATOR:
                        return (payload_t*)ts_payload_create(TRUE);
-               case TRAFFIC_SELECTOR_RESPONDER:
+               case PLV2_TS_RESPONDER:
                        return (payload_t*)ts_payload_create(FALSE);
-               case KEY_EXCHANGE:
-               case KEY_EXCHANGE_V1:
+               case PLV2_KEY_EXCHANGE:
+               case PLV1_KEY_EXCHANGE:
                        return (payload_t*)ke_payload_create(type);
-               case NOTIFY:
-               case NOTIFY_V1:
+               case PLV2_NOTIFY:
+               case PLV1_NOTIFY:
                        return (payload_t*)notify_payload_create(type);
-               case DELETE:
-               case DELETE_V1:
+               case PLV2_DELETE:
+               case PLV1_DELETE:
                        return (payload_t*)delete_payload_create(type, 0);
-               case VENDOR_ID:
-               case VENDOR_ID_V1:
+               case PLV2_VENDOR_ID:
+               case PLV1_VENDOR_ID:
                        return (payload_t*)vendor_id_payload_create(type);
-               case HASH_V1:
-               case SIGNATURE_V1:
-               case NAT_D_V1:
-               case NAT_D_DRAFT_00_03_V1:
+               case PLV1_HASH:
+               case PLV1_SIGNATURE:
+               case PLV1_NAT_D:
+               case PLV1_NAT_D_DRAFT_00_03:
                        return (payload_t*)hash_payload_create(type);
-               case CONFIGURATION:
-               case CONFIGURATION_V1:
+               case PLV2_CONFIGURATION:
+               case PLV1_CONFIGURATION:
                        return (payload_t*)cp_payload_create(type);
-               case CONFIGURATION_ATTRIBUTE:
-               case CONFIGURATION_ATTRIBUTE_V1:
+               case PLV2_CONFIGURATION_ATTRIBUTE:
+               case PLV1_CONFIGURATION_ATTRIBUTE:
                        return (payload_t*)configuration_attribute_create(type);
-               case EXTENSIBLE_AUTHENTICATION:
+               case PLV2_EAP:
                        return (payload_t*)eap_payload_create();
-               case ENCRYPTED:
-               case ENCRYPTED_V1:
+               case PLV2_ENCRYPTED:
+               case PLV1_ENCRYPTED:
                        return (payload_t*)encryption_payload_create(type);
-               case FRAGMENT_V1:
+               case PLV1_FRAGMENT:
                        return (payload_t*)fragment_payload_create();
                default:
                        return (payload_t*)unknown_payload_create(type);
@@ -257,29 +257,29 @@ payload_t *payload_create(payload_type_t type)
  */
 bool payload_is_known(payload_type_t type)
 {
-       if (type == HEADER)
+       if (type == PL_HEADER)
        {
                return TRUE;
        }
-       if (type >= SECURITY_ASSOCIATION && type <= EXTENSIBLE_AUTHENTICATION)
+       if (type >= PLV2_SECURITY_ASSOCIATION && type <= PLV2_EAP)
        {
                return TRUE;
        }
-       if (type >= SECURITY_ASSOCIATION_V1 && type <= CONFIGURATION_V1)
+       if (type >= PLV1_SECURITY_ASSOCIATION && type <= PLV1_CONFIGURATION)
        {
                return TRUE;
        }
-       if (type >= NAT_D_V1 && type <= NAT_OA_V1)
+       if (type >= PLV1_NAT_D && type <= PLV1_NAT_OA)
        {
                return TRUE;
        }
 #ifdef ME
-       if (type == ID_PEER)
+       if (type == PLV2_ID_PEER)
        {
                return TRUE;
        }
 #endif
-       if (type >= NAT_D_DRAFT_00_03_V1 && type <= FRAGMENT_V1)
+       if (type >= PLV1_NAT_D_DRAFT_00_03 && type <= PLV1_FRAGMENT)
        {
                return TRUE;
        }
index 0e8a926..d9dd619 100644 (file)
@@ -45,195 +45,195 @@ enum payload_type_t {
        /**
         * End of payload list in next_payload
         */
-       NO_PAYLOAD = 0,
+       PL_NONE = 0,
 
        /**
         * The security association (SA) payload containing proposals.
         */
-       SECURITY_ASSOCIATION_V1 = 1,
+       PLV1_SECURITY_ASSOCIATION = 1,
 
        /**
         * The proposal payload, containing transforms.
         */
-       PROPOSAL_V1 = 2,
+       PLV1_PROPOSAL = 2,
 
        /**
         * The transform payload.
         */
-       TRANSFORM_V1 = 3,
+       PLV1_TRANSFORM = 3,
 
        /**
         * The key exchange (KE) payload containing diffie-hellman values.
         */
-       KEY_EXCHANGE_V1 = 4,
+       PLV1_KEY_EXCHANGE = 4,
 
        /**
         * ID payload.
         */
-       ID_V1 = 5,
+       PLV1_ID = 5,
 
        /**
         * Certificate payload with certificates (CERT).
         */
-       CERTIFICATE_V1 = 6,
+       PLV1_CERTIFICATE = 6,
 
        /**
         * Certificate request payload.
         */
-       CERTIFICATE_REQUEST_V1 = 7,
+       PLV1_CERTREQ = 7,
 
        /**
         * Hash payload.
         */
-       HASH_V1 = 8,
+       PLV1_HASH = 8,
 
        /**
         * Signature payload
         */
-       SIGNATURE_V1 = 9,
+       PLV1_SIGNATURE = 9,
 
        /**
         * Nonce payload.
         */
-       NONCE_V1 = 10,
+       PLV1_NONCE = 10,
 
        /**
         * Notification payload.
         */
-       NOTIFY_V1 = 11,
+       PLV1_NOTIFY = 11,
 
        /**
         * Delete payload.
         */
-       DELETE_V1 = 12,
+       PLV1_DELETE = 12,
 
        /**
         * Vendor id payload.
         */
-       VENDOR_ID_V1 = 13,
+       PLV1_VENDOR_ID = 13,
 
        /**
         * Attribute payload (ISAKMP Mode Config, aka configuration payload.
         */
-       CONFIGURATION_V1 = 14,
+       PLV1_CONFIGURATION = 14,
 
        /**
         * NAT discovery payload (NAT-D).
         */
-       NAT_D_V1 = 20,
+       PLV1_NAT_D = 20,
 
        /**
         * NAT original address payload (NAT-OA).
         */
-       NAT_OA_V1 = 21,
+       PLV1_NAT_OA = 21,
 
        /**
         * The security association (SA) payload containing proposals.
         */
-       SECURITY_ASSOCIATION = 33,
+       PLV2_SECURITY_ASSOCIATION = 33,
 
        /**
         * The key exchange (KE) payload containing diffie-hellman values.
         */
-       KEY_EXCHANGE = 34,
+       PLV2_KEY_EXCHANGE = 34,
 
        /**
         * Identification for the original initiator (IDi).
         */
-       ID_INITIATOR = 35,
+       PLV2_ID_INITIATOR = 35,
 
        /**
         * Identification for the original responder (IDr).
         */
-       ID_RESPONDER = 36,
+       PLV2_ID_RESPONDER = 36,
 
        /**
         * Certificate payload with certificates (CERT).
         */
-       CERTIFICATE = 37,
+       PLV2_CERTIFICATE = 37,
 
        /**
         * Certificate request payload (CERTREQ).
         */
-       CERTIFICATE_REQUEST = 38,
+       PLV2_CERTREQ = 38,
 
        /**
         * Authentication payload contains auth data (AUTH).
         */
-       AUTHENTICATION = 39,
+       PLV2_AUTH = 39,
 
        /**
         * Nonces, for initiator and responder (Ni, Nr, N)
         */
-       NONCE = 40,
+       PLV2_NONCE = 40,
 
        /**
         * Notify paylaod (N).
         */
-       NOTIFY = 41,
+       PLV2_NOTIFY = 41,
 
        /**
         * Delete payload (D)
         */
-       DELETE = 42,
+       PLV2_DELETE = 42,
 
        /**
         * Vendor id paylpoad (V).
         */
-       VENDOR_ID = 43,
+       PLV2_VENDOR_ID = 43,
 
        /**
         * Traffic selector for the original initiator (TSi).
         */
-       TRAFFIC_SELECTOR_INITIATOR = 44,
+       PLV2_TS_INITIATOR = 44,
 
        /**
         * Traffic selector for the original responser (TSr).
         */
-       TRAFFIC_SELECTOR_RESPONDER = 45,
+       PLV2_TS_RESPONDER = 45,
 
        /**
         * Encryption payload, contains other payloads (E).
         */
-       ENCRYPTED = 46,
+       PLV2_ENCRYPTED = 46,
 
        /**
         * Configuration payload (CP).
         */
-       CONFIGURATION = 47,
+       PLV2_CONFIGURATION = 47,
 
        /**
         * Extensible authentication payload (EAP).
         */
-       EXTENSIBLE_AUTHENTICATION = 48,
+       PLV2_EAP = 48,
 
        /**
         * Generic Secure Password Method (GSPM).
         */
-       GENERIC_SECURE_PASSWORD_METHOD = 49,
+       PLV2_GSPM = 49,
 
 #ifdef ME
        /**
         * Identification payload for peers has a value from
         * the PRIVATE USE space.
         */
-       ID_PEER = 128,
+       PLV2_ID_PEER = 128,
 #endif /* ME */
 
        /**
         * NAT discovery payload (NAT-D) (drafts).
         */
-       NAT_D_DRAFT_00_03_V1 = 130,
+       PLV1_NAT_D_DRAFT_00_03 = 130,
 
        /**
         * NAT original address payload (NAT-OA) (drafts).
         */
-       NAT_OA_DRAFT_00_03_V1 = 131,
+       PLV1_NAT_OA_DRAFT_00_03 = 131,
 
        /**
         * IKE fragment (proprietary IKEv1 extension)
         */
-       FRAGMENT_V1 = 132,
+       PLV1_FRAGMENT = 132,
 
        /**
         * Header has a value of PRIVATE USE space.
@@ -241,57 +241,57 @@ enum payload_type_t {
         * This type and all the following are never sent over wire and are
         * used internally only.
         */
-       HEADER = 256,
+       PL_HEADER = 256,
 
        /**
-        * PROPOSAL_SUBSTRUCTURE, IKEv2 proposals in a SA payload.
+        * PLV2_PROPOSAL_SUBSTRUCTURE, IKEv2 proposals in a SA payload.
         */
-       PROPOSAL_SUBSTRUCTURE,
+       PLV2_PROPOSAL_SUBSTRUCTURE,
 
        /**
-        * PROPOSAL_SUBSTRUCTURE_V1, IKEv1 proposals in a SA payload.
+        * PLV1_PROPOSAL_SUBSTRUCTURE, IKEv1 proposals in a SA payload.
         */
-       PROPOSAL_SUBSTRUCTURE_V1,
+       PLV1_PROPOSAL_SUBSTRUCTURE,
 
        /**
-        * TRANSFORM_SUBSTRUCTURE, IKEv2 transforms in a proposal substructure.
+        * PLV2_TRANSFORM_SUBSTRUCTURE, IKEv2 transforms in a proposal substructure.
         */
-       TRANSFORM_SUBSTRUCTURE,
+       PLV2_TRANSFORM_SUBSTRUCTURE,
 
        /**
-        * TRANSFORM_SUBSTRUCTURE_V1, IKEv1 transforms in a proposal substructure.
+        * PLV1_TRANSFORM_SUBSTRUCTURE, IKEv1 transforms in a proposal substructure.
         */
-       TRANSFORM_SUBSTRUCTURE_V1,
+       PLV1_TRANSFORM_SUBSTRUCTURE,
 
        /**
-        * TRANSFORM_ATTRIBUTE, IKEv2 attribute in a transform.
+        * PLV2_TRANSFORM_ATTRIBUTE, IKEv2 attribute in a transform.
         */
-       TRANSFORM_ATTRIBUTE,
+       PLV2_TRANSFORM_ATTRIBUTE,
 
        /**
-        * TRANSFORM_ATTRIBUTE_V1, IKEv1 attribute in a transform.
+        * PLV1_TRANSFORM_ATTRIBUTE, IKEv1 attribute in a transform.
         */
-       TRANSFORM_ATTRIBUTE_V1,
+       PLV1_TRANSFORM_ATTRIBUTE,
 
        /**
-        * TRAFFIC_SELECTOR_SUBSTRUCTURE, traffic selector in a TS payload.
+        * PLV2_TRAFFIC_SELECTOR_SUBSTRUCTURE, traffic selector in a TS payload.
         */
-       TRAFFIC_SELECTOR_SUBSTRUCTURE,
+       PLV2_TRAFFIC_SELECTOR_SUBSTRUCTURE,
 
        /**
-        * CONFIGURATION_ATTRIBUTE, IKEv2 attribute in a configuration payload.
+        * PLV2_CONFIGURATION_ATTRIBUTE, IKEv2 attribute in a configuration payload.
         */
-       CONFIGURATION_ATTRIBUTE,
+       PLV2_CONFIGURATION_ATTRIBUTE,
 
        /**
-        * CONFIGURATION_ATTRIBUTE_V1, IKEv1 attribute in a configuration payload.
+        * PLV1_CONFIGURATION_ATTRIBUTE, IKEv1 attribute in a configuration payload.
         */
-       CONFIGURATION_ATTRIBUTE_V1,
+       PLV1_CONFIGURATION_ATTRIBUTE,
 
        /**
         * This is not really a payload, but rather the complete IKEv1 message.
         */
-       ENCRYPTED_V1,
+       PLV1_ENCRYPTED,
 };
 
 /**
@@ -336,7 +336,7 @@ struct payload_t {
        payload_type_t (*get_type) (payload_t *this);
 
        /**
-        * Get type of next payload or NO_PAYLOAD (0) if this is the last one.
+        * Get type of next payload or PL_NONE (0) if this is the last one.
         *
         * @return                              type of next payload
         */
index 3e35b75..53e8cf3 100644 (file)
@@ -88,7 +88,7 @@ struct private_proposal_substructure_t {
        linked_list_t *transforms;
 
        /**
-        * Type of this payload, PROPOSAL_SUBSTRUCTURE or PROPOSAL_SUBSTRUCTURE_V1
+        * Type of this payload, PLV2_PROPOSAL_SUBSTRUCTURE or PLV1_PROPOSAL_SUBSTRUCTURE
         */
        payload_type_t type;
 };
@@ -114,7 +114,7 @@ static encoding_rule_t encodings_v1[] = {
        /* SPI is a chunk of variable size*/
        { SPI,                          offsetof(private_proposal_substructure_t, spi)                          },
        /* Transforms are stored in a transform substructure list */
-       { PAYLOAD_LIST + TRANSFORM_SUBSTRUCTURE_V1,
+       { PAYLOAD_LIST + PLV1_TRANSFORM_SUBSTRUCTURE,
                                                offsetof(private_proposal_substructure_t, transforms)           },
 };
 
@@ -139,7 +139,7 @@ static encoding_rule_t encodings_v2[] = {
        /* SPI is a chunk of variable size*/
        { SPI,                          offsetof(private_proposal_substructure_t, spi)                          },
        /* Transforms are stored in a transform substructure list */
-       { PAYLOAD_LIST + TRANSFORM_SUBSTRUCTURE,
+       { PAYLOAD_LIST + PLV2_TRANSFORM_SUBSTRUCTURE,
                                                offsetof(private_proposal_substructure_t, transforms)           },
 };
 
@@ -329,7 +329,7 @@ METHOD(payload_t, verify, status_t,
        enumerator_t *enumerator;
        payload_t *current;
 
-       if (this->next_payload != NO_PAYLOAD && this->next_payload != 2)
+       if (this->next_payload != PL_NONE && this->next_payload != 2)
        {
                /* must be 0 or 2 */
                DBG1(DBG_ENC, "inconsistent next payload");
@@ -361,7 +361,7 @@ METHOD(payload_t, verify, status_t,
                        }
                        break;
                case PROTO_IKE:
-                       if (this->type == PROPOSAL_SUBSTRUCTURE_V1)
+                       if (this->type == PLV1_PROPOSAL_SUBSTRUCTURE)
                        {
                                if (this->spi.len <= 16)
                                {       /* according to RFC 2409, section 3.5 anything between
@@ -397,7 +397,7 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_proposal_substructure_t *this, encoding_rule_t **rules)
 {
-       if (this->type == PROPOSAL_SUBSTRUCTURE)
+       if (this->type == PLV2_PROPOSAL_SUBSTRUCTURE)
        {
                *rules = encodings_v2;
                return countof(encodings_v2);
@@ -1028,7 +1028,7 @@ METHOD(proposal_substructure_t, get_proposals, void,
                        proposal->set_spi(proposal, spi);
                        proposals->insert_last(proposals, proposal);
                }
-               if (this->type == PROPOSAL_SUBSTRUCTURE)
+               if (this->type == PLV2_PROPOSAL_SUBSTRUCTURE)
                {
                        add_to_proposal_v2(proposal, transform);
                }
@@ -1266,7 +1266,7 @@ proposal_substructure_t *proposal_substructure_create(payload_type_t type)
                        .get_encap_mode = _get_encap_mode,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .transforms = linked_list_create(),
                .type = type,
        );
@@ -1286,7 +1286,7 @@ static void set_from_proposal_v1_ike(private_proposal_substructure_t *this,
        u_int16_t alg, key_size;
        enumerator_t *enumerator;
 
-       transform = transform_substructure_create_type(TRANSFORM_SUBSTRUCTURE_V1,
+       transform = transform_substructure_create_type(PLV1_TRANSFORM_SUBSTRUCTURE,
                                                                                                number, IKEV1_TRANSID_KEY_IKE);
 
        enumerator = proposal->create_enumerator(proposal, ENCRYPTION_ALGORITHM);
@@ -1296,12 +1296,12 @@ static void set_from_proposal_v1_ike(private_proposal_substructure_t *this,
                if (alg)
                {
                        transform->add_transform_attribute(transform,
-                               transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                               transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                                        TATTR_PH1_ENCRYPTION_ALGORITHM, alg));
                        if (key_size)
                        {
                                transform->add_transform_attribute(transform,
-                                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                                                TATTR_PH1_KEY_LENGTH, key_size));
                        }
                        break;
@@ -1317,7 +1317,7 @@ static void set_from_proposal_v1_ike(private_proposal_substructure_t *this,
                if (alg)
                {
                        transform->add_transform_attribute(transform,
-                               transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                               transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                                        TATTR_PH1_HASH_ALGORITHM, alg));
                        break;
                }
@@ -1328,19 +1328,19 @@ static void set_from_proposal_v1_ike(private_proposal_substructure_t *this,
        if (enumerator->enumerate(enumerator, &alg, &key_size))
        {
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                                TATTR_PH1_GROUP, alg));
        }
        enumerator->destroy(enumerator);
 
        transform->add_transform_attribute(transform,
-               transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+               transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH1_AUTH_METHOD, get_ikev1_auth(method)));
        transform->add_transform_attribute(transform,
-               transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+               transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH1_LIFE_TYPE, IKEV1_LIFE_TYPE_SECONDS));
        transform->add_transform_attribute(transform,
-               transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+               transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH1_LIFE_DURATION, lifetime));
 
        add_transform_substructure(this, transform);
@@ -1366,11 +1366,11 @@ static void set_from_proposal_v1(private_proposal_substructure_t *this,
                if (alg)
                {
                        transform = transform_substructure_create_type(
-                                                                       TRANSFORM_SUBSTRUCTURE_V1, number, alg);
+                                                                       PLV1_TRANSFORM_SUBSTRUCTURE, number, alg);
                        if (key_size)
                        {
                                transform->add_transform_attribute(transform,
-                                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                                                        TATTR_PH2_KEY_LENGTH, key_size));
                        }
                }
@@ -1386,10 +1386,10 @@ static void set_from_proposal_v1(private_proposal_substructure_t *this,
                        if (!transform)
                        {
                                transform = transform_substructure_create_type(
-                                                                       TRANSFORM_SUBSTRUCTURE_V1, number, alg);
+                                                                       PLV1_TRANSFORM_SUBSTRUCTURE, number, alg);
                        }
                        transform->add_transform_attribute(transform,
-                               transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                               transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                                        TATTR_PH2_AUTH_ALGORITHM, alg));
                }
        }
@@ -1404,30 +1404,30 @@ static void set_from_proposal_v1(private_proposal_substructure_t *this,
        if (enumerator->enumerate(enumerator, &alg, &key_size))
        {
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                                        TATTR_PH2_GROUP, alg));
        }
        enumerator->destroy(enumerator);
 
        transform->add_transform_attribute(transform,
-               transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+               transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_ENCAP_MODE, get_ikev1_mode(mode, udp)));
        if (lifetime)
        {
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_SA_LIFE_TYPE, IKEV1_LIFE_TYPE_SECONDS));
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_SA_LIFE_DURATION, lifetime));
        }
        if (lifebytes)
        {
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_SA_LIFE_TYPE, IKEV1_LIFE_TYPE_KILOBYTES));
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_SA_LIFE_DURATION, lifebytes / 1000));
        }
 
@@ -1448,12 +1448,12 @@ static void set_from_proposal_v2(private_proposal_substructure_t *this,
        enumerator = proposal->create_enumerator(proposal, ENCRYPTION_ALGORITHM);
        while (enumerator->enumerate(enumerator, &alg, &key_size))
        {
-               transform = transform_substructure_create_type(TRANSFORM_SUBSTRUCTURE,
+               transform = transform_substructure_create_type(PLV2_TRANSFORM_SUBSTRUCTURE,
                                                                                                ENCRYPTION_ALGORITHM, alg);
                if (key_size)
                {
                        transform->add_transform_attribute(transform,
-                               transform_attribute_create_value(TRANSFORM_ATTRIBUTE,
+                               transform_attribute_create_value(PLV2_TRANSFORM_ATTRIBUTE,
                                                                                        TATTR_IKEV2_KEY_LENGTH, key_size));
                }
                add_transform_substructure(this, transform);
@@ -1464,7 +1464,7 @@ static void set_from_proposal_v2(private_proposal_substructure_t *this,
        enumerator = proposal->create_enumerator(proposal, INTEGRITY_ALGORITHM);
        while (enumerator->enumerate(enumerator, &alg, &key_size))
        {
-               transform = transform_substructure_create_type(TRANSFORM_SUBSTRUCTURE,
+               transform = transform_substructure_create_type(PLV2_TRANSFORM_SUBSTRUCTURE,
                                                                                                INTEGRITY_ALGORITHM, alg);
                add_transform_substructure(this, transform);
        }
@@ -1474,7 +1474,7 @@ static void set_from_proposal_v2(private_proposal_substructure_t *this,
        enumerator = proposal->create_enumerator(proposal, PSEUDO_RANDOM_FUNCTION);
        while (enumerator->enumerate(enumerator, &alg, &key_size))
        {
-               transform = transform_substructure_create_type(TRANSFORM_SUBSTRUCTURE,
+               transform = transform_substructure_create_type(PLV2_TRANSFORM_SUBSTRUCTURE,
                                                                                                PSEUDO_RANDOM_FUNCTION, alg);
                add_transform_substructure(this, transform);
        }
@@ -1484,7 +1484,7 @@ static void set_from_proposal_v2(private_proposal_substructure_t *this,
        enumerator = proposal->create_enumerator(proposal, DIFFIE_HELLMAN_GROUP);
        while (enumerator->enumerate(enumerator, &alg, NULL))
        {
-               transform = transform_substructure_create_type(TRANSFORM_SUBSTRUCTURE,
+               transform = transform_substructure_create_type(PLV2_TRANSFORM_SUBSTRUCTURE,
                                                                                                DIFFIE_HELLMAN_GROUP, alg);
                add_transform_substructure(this, transform);
        }
@@ -1494,7 +1494,7 @@ static void set_from_proposal_v2(private_proposal_substructure_t *this,
        enumerator = proposal->create_enumerator(proposal, EXTENDED_SEQUENCE_NUMBERS);
        while (enumerator->enumerate(enumerator, &alg, NULL))
        {
-               transform = transform_substructure_create_type(TRANSFORM_SUBSTRUCTURE,
+               transform = transform_substructure_create_type(PLV2_TRANSFORM_SUBSTRUCTURE,
                                                                                                EXTENDED_SEQUENCE_NUMBERS, alg);
                add_transform_substructure(this, transform);
        }
@@ -1543,7 +1543,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposal_v2(
        private_proposal_substructure_t *this;
 
        this = (private_proposal_substructure_t*)
-                                                       proposal_substructure_create(SECURITY_ASSOCIATION);
+                                                       proposal_substructure_create(PLV2_SECURITY_ASSOCIATION);
        set_from_proposal_v2(this, proposal);
        set_data(this, proposal);
 
@@ -1560,7 +1560,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposal_v1(
        private_proposal_substructure_t *this;
 
        this = (private_proposal_substructure_t*)
-                                               proposal_substructure_create(PROPOSAL_SUBSTRUCTURE_V1);
+                                               proposal_substructure_create(PLV1_PROPOSAL_SUBSTRUCTURE);
        switch (proposal->get_protocol(proposal))
        {
                case PROTO_IKE:
@@ -1636,31 +1636,31 @@ proposal_substructure_t *proposal_substructure_create_for_ipcomp_v1(
 
 
        this = (private_proposal_substructure_t*)
-                                               proposal_substructure_create(PROPOSAL_SUBSTRUCTURE_V1);
+                                               proposal_substructure_create(PLV1_PROPOSAL_SUBSTRUCTURE);
 
        /* we currently support DEFLATE only */
-       transform = transform_substructure_create_type(TRANSFORM_SUBSTRUCTURE_V1,
+       transform = transform_substructure_create_type(PLV1_TRANSFORM_SUBSTRUCTURE,
                                                                                                   1, IKEV1_IPCOMP_DEFLATE);
 
        transform->add_transform_attribute(transform,
-               transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+               transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_ENCAP_MODE, get_ikev1_mode(mode, udp)));
        if (lifetime)
        {
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_SA_LIFE_TYPE, IKEV1_LIFE_TYPE_SECONDS));
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_SA_LIFE_DURATION, lifetime));
        }
        if (lifebytes)
        {
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_SA_LIFE_TYPE, IKEV1_LIFE_TYPE_KILOBYTES));
                transform->add_transform_attribute(transform,
-                       transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+                       transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
                                                        TATTR_PH2_SA_LIFE_DURATION, lifebytes / 1000));
        }
 
index c8e7adf..c4614b8 100644 (file)
@@ -168,7 +168,7 @@ struct proposal_substructure_t {
 /**
  * Creates an empty proposal_substructure_t object
  *
- * @param type         PROPOSAL_SUBSTRUCTURE or PROPOSAL_SUBSTRUCTURE_V1
+ * @param type         PLV2_PROPOSAL_SUBSTRUCTURE or PLV1_PROPOSAL_SUBSTRUCTURE
  * @return                     proposal_substructure_t object
  */
 proposal_substructure_t *proposal_substructure_create(payload_type_t type);
@@ -177,7 +177,7 @@ proposal_substructure_t *proposal_substructure_create(payload_type_t type);
  * Creates an IKEv2 proposal_substructure_t from a proposal_t.
  *
  * @param proposal     proposal to build a substruct out of it
- * @return                     proposal_substructure_t PROPOSAL_SUBSTRUCTURE
+ * @return                     proposal_substructure_t PLV2_PROPOSAL_SUBSTRUCTURE
  */
 proposal_substructure_t *proposal_substructure_create_from_proposal_v2(
                                                                                                                proposal_t *proposal);
@@ -190,7 +190,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposal_v2(
  * @param auth         authentication method to use, or AUTH_NONE
  * @param mode         IPsec encapsulation mode, TRANSPORT or TUNNEL
  * @param udp          ENCAP_UDP to use UDP encapsulation
- * @return                     proposal_substructure_t object PROPOSAL_SUBSTRUCTURE_V1
+ * @return                     proposal_substructure_t object PLV1_PROPOSAL_SUBSTRUCTURE
  */
 proposal_substructure_t *proposal_substructure_create_from_proposal_v1(
                        proposal_t *proposal,  u_int32_t lifetime, u_int64_t lifebytes,
@@ -205,7 +205,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposal_v1(
  * @param auth         authentication method to use, or AUTH_NONE
  * @param mode         IPsec encapsulation mode, TRANSPORT or TUNNEL
  * @param udp          ENCAP_UDP to use UDP encapsulation
- * @return                     IKEv1 proposal_substructure_t PROPOSAL_SUBSTRUCTURE_V1
+ * @return                     IKEv1 proposal_substructure_t PLV1_PROPOSAL_SUBSTRUCTURE
  */
 proposal_substructure_t *proposal_substructure_create_from_proposals_v1(
                        linked_list_t *proposals, u_int32_t lifetime, u_int64_t lifebytes,
@@ -221,7 +221,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposals_v1(
  * @param mode                         IPsec encapsulation mode, TRANSPORT or TUNNEL
  * @param udp                          ENCAP_UDP to use UDP encapsulation
  * @param proposal_number      the proposal number of the proposal to be linked
- * @return                                     IKEv1 proposal_substructure_t PROPOSAL_SUBSTRUCTURE_V1
+ * @return                                     IKEv1 proposal_substructure_t PLV1_PROPOSAL_SUBSTRUCTURE
  */
 proposal_substructure_t *proposal_substructure_create_for_ipcomp_v1(
                        u_int32_t lifetime, u_int64_t lifebytes, u_int16_t cpi,
index 3a5bb43..8e3a012 100644 (file)
@@ -101,7 +101,7 @@ static encoding_rule_t encodings_v1[] = {
        /* Situation*/
        { U_INT_32,                     offsetof(private_sa_payload_t, situation)               },
        /* Proposals are stored in a proposal substructure list */
-       { PAYLOAD_LIST + PROPOSAL_SUBSTRUCTURE_V1,
+       { PAYLOAD_LIST + PLV1_PROPOSAL_SUBSTRUCTURE,
                                                offsetof(private_sa_payload_t, proposals)               },
 };
 
@@ -140,7 +140,7 @@ static encoding_rule_t encodings_v2[] = {
        /* Length of the whole SA payload*/
        { PAYLOAD_LENGTH,       offsetof(private_sa_payload_t, payload_length)          },
        /* Proposals are stored in a proposal substructure list */
-       { PAYLOAD_LIST + PROPOSAL_SUBSTRUCTURE,
+       { PAYLOAD_LIST + PLV2_PROPOSAL_SUBSTRUCTURE,
                                                offsetof(private_sa_payload_t, proposals)                       },
 };
 
@@ -164,7 +164,7 @@ METHOD(payload_t, verify, status_t,
        enumerator_t *enumerator;
        proposal_substructure_t *substruct;
 
-       if (this->type == SECURITY_ASSOCIATION)
+       if (this->type == PLV2_SECURITY_ASSOCIATION)
        {
                expected_number = 1;
        }
@@ -196,7 +196,7 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_sa_payload_t *this, encoding_rule_t **rules)
 {
-       if (this->type == SECURITY_ASSOCIATION_V1)
+       if (this->type == PLV1_SECURITY_ASSOCIATION)
        {
                *rules = encodings_v1;
                return countof(encodings_v1);
@@ -208,7 +208,7 @@ METHOD(payload_t, get_encoding_rules, int,
 METHOD(payload_t, get_header_length, int,
        private_sa_payload_t *this)
 {
-       if (this->type == SECURITY_ASSOCIATION_V1)
+       if (this->type == PLV1_SECURITY_ASSOCIATION)
        {
                return 12;
        }
@@ -295,7 +295,7 @@ METHOD(sa_payload_t, get_proposals, linked_list_t*,
        proposal_substructure_t *substruct;
        linked_list_t *substructs, *list;
 
-       if (this->type == SECURITY_ASSOCIATION_V1)
+       if (this->type == PLV1_SECURITY_ASSOCIATION)
        {       /* IKEv1 proposals start with 0 */
                struct_number = ignore_struct_number = -1;
        }
@@ -502,7 +502,7 @@ sa_payload_t *sa_payload_create(payload_type_t type)
                        .get_encap_mode = _get_encap_mode,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .proposals = linked_list_create(),
                .type = type,
                /* for IKEv1 only */
@@ -524,7 +524,7 @@ sa_payload_t *sa_payload_create_from_proposals_v2(linked_list_t *proposals)
        enumerator_t *enumerator;
        proposal_t *proposal;
 
-       this = (private_sa_payload_t*)sa_payload_create(SECURITY_ASSOCIATION);
+       this = (private_sa_payload_t*)sa_payload_create(PLV2_SECURITY_ASSOCIATION);
        enumerator = proposals->create_enumerator(proposals);
        while (enumerator->enumerate(enumerator, &proposal))
        {
@@ -542,7 +542,7 @@ sa_payload_t *sa_payload_create_from_proposal_v2(proposal_t *proposal)
 {
        private_sa_payload_t *this;
 
-       this = (private_sa_payload_t*)sa_payload_create(SECURITY_ASSOCIATION);
+       this = (private_sa_payload_t*)sa_payload_create(PLV2_SECURITY_ASSOCIATION);
        add_proposal_v2(this, proposal);
 
        return &this->public;
@@ -560,7 +560,7 @@ sa_payload_t *sa_payload_create_from_proposals_v1(linked_list_t *proposals,
        proposal_substructure_t *substruct;
        private_sa_payload_t *this;
 
-       this = (private_sa_payload_t*)sa_payload_create(SECURITY_ASSOCIATION_V1);
+       this = (private_sa_payload_t*)sa_payload_create(PLV1_SECURITY_ASSOCIATION);
 
        if (!proposals || !proposals->get_count(proposals))
        {
index b62a341..0ddf361 100644 (file)
@@ -104,7 +104,7 @@ struct sa_payload_t {
 /**
  * Creates an empty sa_payload_t object
  *
- * @param type                         SECURITY_ASSOCIATION or SECURITY_ASSOCIATION_V1
+ * @param type                         PLV2_SECURITY_ASSOCIATION or PLV1_SECURITY_ASSOCIATION
  * @return                                     created sa_payload_t object
  */
 sa_payload_t *sa_payload_create(payload_type_t type);
index 334823d..83618ff 100644 (file)
@@ -168,13 +168,13 @@ METHOD(payload_t, get_header_length, int,
 METHOD(payload_t, get_type, payload_type_t,
        private_traffic_selector_substructure_t *this)
 {
-       return TRAFFIC_SELECTOR_SUBSTRUCTURE;
+       return PLV2_TRAFFIC_SELECTOR_SUBSTRUCTURE;
 }
 
 METHOD(payload_t, get_next_type, payload_type_t,
        private_traffic_selector_substructure_t *this)
 {
-       return NO_PAYLOAD;
+       return PL_NONE;
 }
 
 METHOD(payload_t, set_next_type, void,
index d20f77c..4a5b52d 100644 (file)
@@ -98,7 +98,7 @@ struct private_transform_attribute_t {
        chunk_t attribute_value;
 
        /**
-        * Payload type, TRANSFORM_ATTRIBUTE or TRANSFORM_ATTRIBUTE_V1
+        * Payload type, PLV2_TRANSFORM_ATTRIBUTE or PLV1_TRANSFORM_ATTRIBUTE
         */
        payload_type_t type;
 };
@@ -157,7 +157,7 @@ METHOD(payload_t, get_type, payload_type_t,
 METHOD(payload_t, get_next_type, payload_type_t,
        private_transform_attribute_t *this)
 {
-       return NO_PAYLOAD;
+       return PL_NONE;
 }
 
 METHOD(payload_t, set_next_type, void,
index 23897a5..87e283b 100644 (file)
@@ -127,7 +127,7 @@ struct transform_attribute_t {
 /**
  * Creates an empty transform_attribute_t object.
  *
- * @param type                 TRANSFORM_ATTRIBUTE or TRANSFORM_ATTRIBUTE_V1
+ * @param type                 PLV2_TRANSFORM_ATTRIBUTE or PLV1_TRANSFORM_ATTRIBUTE
  * @return                             transform_attribute_t object
  */
 transform_attribute_t *transform_attribute_create(payload_type_t type);
@@ -135,7 +135,7 @@ transform_attribute_t *transform_attribute_create(payload_type_t type);
 /**
  * Creates a two byte value or a larger attribute for a given attribute kind.
  *
- * @param type                 TRANSFORM_ATTRIBUTE or TRANSFORM_ATTRIBUTE_V1
+ * @param type                 PLV2_TRANSFORM_ATTRIBUTE or PLV1_TRANSFORM_ATTRIBUTE
  * @param kind                 attribute kind
  * @param value                        fixed two byte value
  * @return                             transform_attribute_t object
index a850275..6885d61 100644 (file)
@@ -73,13 +73,13 @@ struct private_transform_substructure_t {
        linked_list_t *attributes;
 
        /**
-        * Payload type, TRANSFORM_SUBSTRUCTURE or TRANSFORM_SUBSTRUCTURE_V1
+        * Payload type, PLV2_TRANSFORM_SUBSTRUCTURE or PLV1_TRANSFORM_SUBSTRUCTURE
         */
        payload_type_t type;
 };
 
 /**
- * Encoding rules for TRANSFORM_SUBSTRUCTURE
+ * Encoding rules for PLV2_TRANSFORM_SUBSTRUCTURE
  */
 static encoding_rule_t encodings_v2[] = {
        /* 1 Byte next payload type, stored in the field next_payload */
@@ -95,12 +95,12 @@ static encoding_rule_t encodings_v2[] = {
        /* transform identifier, as used by IKEv2 */
        { U_INT_16,                     offsetof(private_transform_substructure_t, transform_id_v2)     },
        /* Attributes in a transform attribute list */
-       { PAYLOAD_LIST + TRANSFORM_ATTRIBUTE,
+       { PAYLOAD_LIST + PLV2_TRANSFORM_ATTRIBUTE,
                                                offsetof(private_transform_substructure_t, attributes)          }
 };
 
 /**
- * Encoding rules for TRANSFORM_SUBSTRUCTURE_V1
+ * Encoding rules for PLV1_TRANSFORM_SUBSTRUCTURE
  */
 static encoding_rule_t encodings_v1[] = {
        /* 1 Byte next payload type, stored in the field next_payload */
@@ -117,7 +117,7 @@ static encoding_rule_t encodings_v1[] = {
        { RESERVED_BYTE,        offsetof(private_transform_substructure_t, reserved[1])         },
        { RESERVED_BYTE,        offsetof(private_transform_substructure_t, reserved[2])         },
        /* Attributes in a transform attribute list */
-       { PAYLOAD_LIST + TRANSFORM_ATTRIBUTE_V1,
+       { PAYLOAD_LIST + PLV1_TRANSFORM_ATTRIBUTE,
                                                offsetof(private_transform_substructure_t, attributes)          }
 };
 
@@ -142,7 +142,7 @@ METHOD(payload_t, verify, status_t,
        enumerator_t *enumerator;
        payload_t *attribute;
 
-       if (this->next_payload != NO_PAYLOAD && this->next_payload != 3)
+       if (this->next_payload != PL_NONE && this->next_payload != 3)
        {
                DBG1(DBG_ENC, "inconsistent next payload");
                return FAILED;
@@ -167,7 +167,7 @@ METHOD(payload_t, verify, status_t,
 METHOD(payload_t, get_encoding_rules, int,
        private_transform_substructure_t *this, encoding_rule_t **rules)
 {
-       if (this->type == TRANSFORM_SUBSTRUCTURE)
+       if (this->type == PLV2_TRANSFORM_SUBSTRUCTURE)
        {
                *rules = encodings_v2;
                return countof(encodings_v2);
@@ -244,7 +244,7 @@ METHOD(transform_substructure_t, get_transform_type_or_number, u_int8_t,
 METHOD(transform_substructure_t, get_transform_id, u_int16_t,
        private_transform_substructure_t *this)
 {
-       if (this->type == TRANSFORM_SUBSTRUCTURE)
+       if (this->type == PLV2_TRANSFORM_SUBSTRUCTURE)
        {
                return this->transform_id_v2;
        }
@@ -291,7 +291,7 @@ transform_substructure_t *transform_substructure_create(payload_type_t type)
                        .create_attribute_enumerator = _create_attribute_enumerator,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .transform_length = get_header_length(this),
                .attributes = linked_list_create(),
                .type = type,
@@ -310,7 +310,7 @@ transform_substructure_t *transform_substructure_create_type(payload_type_t type
        this = (private_transform_substructure_t*)transform_substructure_create(type);
 
        this->transform_ton = type_or_number;
-       if (type == TRANSFORM_SUBSTRUCTURE)
+       if (type == PLV2_TRANSFORM_SUBSTRUCTURE)
        {
                this->transform_id_v2 = id;
        }
index 97717e6..ba821d3 100644 (file)
@@ -97,7 +97,7 @@ struct transform_substructure_t {
 /**
  * Creates an empty transform_substructure_t object.
  *
- * @param type                 TRANSFORM_SUBSTRUCTURE or TRANSFORM_SUBSTRUCTURE_V1
+ * @param type                 PLV2_TRANSFORM_SUBSTRUCTURE or PLV1_TRANSFORM_SUBSTRUCTURE
  * @return                             created transform_substructure_t object
  */
 transform_substructure_t *transform_substructure_create(payload_type_t type);
@@ -105,7 +105,7 @@ transform_substructure_t *transform_substructure_create(payload_type_t type);
 /**
  * Creates an empty transform_substructure_t object.
  *
- * @param type                         TRANSFORM_SUBSTRUCTURE or TRANSFORM_SUBSTRUCTURE_V1
+ * @param type                         PLV2_TRANSFORM_SUBSTRUCTURE or PLV1_TRANSFORM_SUBSTRUCTURE
  * @param type_or_number       Type (IKEv2) or number (IKEv1) of transform
  * @param id                           transform id specifc for the transform type
  * @return                                     transform_substructure_t object
index 8dfa47b..e74b9ae 100644 (file)
@@ -103,7 +103,7 @@ static encoding_rule_t encodings[] = {
        { RESERVED_BYTE,        offsetof(private_ts_payload_t, reserved_byte[1])},
        { RESERVED_BYTE,        offsetof(private_ts_payload_t, reserved_byte[2])},
        /* wrapped list of traffic selectors substructures */
-       { PAYLOAD_LIST + TRAFFIC_SELECTOR_SUBSTRUCTURE,
+       { PAYLOAD_LIST + PLV2_TRAFFIC_SELECTOR_SUBSTRUCTURE,
                                                offsetof(private_ts_payload_t, substrs)                 },
 };
 
@@ -164,9 +164,9 @@ METHOD(payload_t, get_type, payload_type_t,
 {
        if (this->is_initiator)
        {
-               return TRAFFIC_SELECTOR_INITIATOR;
+               return PLV2_TS_INITIATOR;
        }
-       return TRAFFIC_SELECTOR_RESPONDER;
+       return PLV2_TS_RESPONDER;
 }
 
 METHOD(payload_t, get_next_type, payload_type_t,
@@ -269,7 +269,7 @@ ts_payload_t *ts_payload_create(bool is_initiator)
                        .get_traffic_selectors = _get_traffic_selectors,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
                .is_initiator = is_initiator,
                .substrs = linked_list_create(),
index fe7ced2..45b91fd 100644 (file)
@@ -184,7 +184,7 @@ unknown_payload_t *unknown_payload_create(payload_type_t type)
                        .get_data = _get_data,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this),
                .type = type,
        );
index 0c1df56..400e064 100644 (file)
@@ -178,7 +178,7 @@ vendor_id_payload_t *vendor_id_payload_create_data(payload_type_t type,
                        .get_data = _get_data,
                        .destroy = _destroy,
                },
-               .next_payload = NO_PAYLOAD,
+               .next_payload = PL_NONE,
                .payload_length = get_header_length(this) + data.len,
                .data = data,
                .type = type,
index 9a81477..42c31f9 100644 (file)
@@ -55,7 +55,7 @@ struct vendor_id_payload_t {
 /**
  * Creates an empty Vendor ID payload for IKEv1 or IKEv2.
  *
- * @@param type                VENDOR_ID or VENDOR_ID_V1
+ * @@param type                PLV2_VENDOR_ID or PLV1_VENDOR_ID
  * @return                     vendor ID payload
  */
 vendor_id_payload_t *vendor_id_payload_create(payload_type_t type);
@@ -63,7 +63,7 @@ vendor_id_payload_t *vendor_id_payload_create(payload_type_t type);
 /**
  * Creates a vendor ID payload using a chunk of data
  *
- * @param type         VENDOR_ID or VENDOR_ID_V1
+ * @param type         PLV2_VENDOR_ID or PLV1_VENDOR_ID
  * @param data         data to use in vendor ID payload, gets owned by payload
  * @return                     vendor ID payload
  */
index 8dfb47b..a2a3b1f 100644 (file)
@@ -271,7 +271,7 @@ static bool check_cookie(private_receiver_t *this, message_t *message)
        if (data.len <
                 IKE_HEADER_LENGTH + NOTIFY_PAYLOAD_HEADER_LENGTH +
                 sizeof(u_int32_t) + this->hasher->get_hash_size(this->hasher) ||
-               *(data.ptr + 16) != NOTIFY ||
+               *(data.ptr + 16) != PLV2_NOTIFY ||
                *(u_int16_t*)(data.ptr + IKE_HEADER_LENGTH + 6) != htons(COOKIE))
        {
                /* no cookie found */
index e751b51..5fcd9eb 100644 (file)
@@ -161,11 +161,11 @@ METHOD(eap_method_t, process_server, status_t,
        {
                /* assume that "out" contains username/password attributes */
                co->destroy(co);
-               ci = cp_payload_create_type(CONFIGURATION_V1, CFG_REPLY);
+               ci = cp_payload_create_type(PLV1_CONFIGURATION, CFG_REPLY);
                ci->add_attribute(ci, configuration_attribute_create_chunk(
-                                       CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_NAME, user));
+                                       PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_NAME, user));
                ci->add_attribute(ci, configuration_attribute_create_chunk(
-                                       CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_PASSWORD, pass));
+                                       PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_PASSWORD, pass));
                switch (xauth->process(xauth, ci, &co))
                {
                        case SUCCESS:
index a41d520..52ea840 100644 (file)
@@ -232,8 +232,8 @@ static void ike2queue(message_t *message, linked_list_t *queue,
        enumerator = message->create_payload_enumerator(message);
        while (enumerator->enumerate(enumerator, &payload))
        {
-               if (payload->get_type(payload) == NOTIFY ||
-                       payload->get_type(payload) == NOTIFY_V1)
+               if (payload->get_type(payload) == PLV2_NOTIFY ||
+                       payload->get_type(payload) == PLV1_NOTIFY)
                {
                        notify = (notify_payload_t*)payload;
                        if (notify->get_notify_type(notify) == RADIUS_ATTRIBUTE)
index d00f6bb..0fea509 100644 (file)
@@ -87,12 +87,12 @@ static bool build_round(private_eap_radius_xauth_t *this, cp_payload_t *cp)
                return FALSE;
        }
        cp->add_attribute(cp, configuration_attribute_create_chunk(
-                                       CONFIGURATION_ATTRIBUTE_V1, this->round.type, chunk_empty));
+                                       PLV1_CONFIGURATION_ATTRIBUTE, this->round.type, chunk_empty));
 
        if (this->round.message && strlen(this->round.message))
        {
                cp->add_attribute(cp, configuration_attribute_create_chunk(
-                                       CONFIGURATION_ATTRIBUTE_V1, XAUTH_MESSAGE,
+                                       PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_MESSAGE,
                                        chunk_from_str(this->round.message)));
        }
        return TRUE;
@@ -103,10 +103,10 @@ METHOD(xauth_method_t, initiate, status_t,
 {
        cp_payload_t *cp;
 
-       cp = cp_payload_create_type(CONFIGURATION_V1, CFG_REQUEST);
+       cp = cp_payload_create_type(PLV1_CONFIGURATION, CFG_REQUEST);
        /* first message always comes with username */
        cp->add_attribute(cp, configuration_attribute_create_chunk(
-                               CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_NAME, chunk_empty));
+                               PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_NAME, chunk_empty));
 
        if (build_round(this, cp))
        {
@@ -211,7 +211,7 @@ METHOD(xauth_method_t, process, status_t,
        {
                return verify_radius(this);
        }
-       cp = cp_payload_create_type(CONFIGURATION_V1, CFG_REQUEST);
+       cp = cp_payload_create_type(PLV1_CONFIGURATION, CFG_REQUEST);
        if (build_round(this, cp))
        {
                *out = cp;
index aca83aa..1d30460 100644 (file)
@@ -68,7 +68,7 @@ static void print_radius_attributes(private_radattr_listener_t *this,
        enumerator = message->create_payload_enumerator(message);
        while (enumerator->enumerate(enumerator, &payload))
        {
-               if (payload->get_type(payload) == NOTIFY)
+               if (payload->get_type(payload) == PLV2_NOTIFY)
                {
                        notify = (notify_payload_t*)payload;
                        if (notify->get_notify_type(notify) == RADIUS_ATTRIBUTE)
@@ -144,7 +144,7 @@ METHOD(listener_t, message, bool,
 {
        if (plain && ike_sa->supports_extension(ike_sa, EXT_STRONGSWAN) &&
                message->get_exchange_type(message) == IKE_AUTH &&
-               message->get_payload(message, EXTENSIBLE_AUTHENTICATION))
+               message->get_payload(message, PLV2_EAP))
        {
                if (incoming)
                {
index f597bb7..f21d026 100644 (file)
@@ -163,11 +163,11 @@ METHOD(xauth_method_t, initiate, status_t,
 {
        cp_payload_t *cp;
 
-       cp = cp_payload_create_type(CONFIGURATION_V1, CFG_REQUEST);
+       cp = cp_payload_create_type(PLV1_CONFIGURATION, CFG_REQUEST);
        cp->add_attribute(cp, configuration_attribute_create_chunk(
-                               CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_NAME, chunk_empty));
+                               PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_NAME, chunk_empty));
        cp->add_attribute(cp, configuration_attribute_create_chunk(
-                               CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_PASSWORD, chunk_empty));
+                               PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_PASSWORD, chunk_empty));
        *out = cp;
        return NEED_MORE;
 }
index 5df8aad..c37da0c 100644 (file)
@@ -69,7 +69,7 @@ METHOD(xauth_method_t, process_peer, status_t,
        }
        enumerator->destroy(enumerator);
 
-       cp = cp_payload_create_type(CONFIGURATION_V1, CFG_REPLY);
+       cp = cp_payload_create_type(PLV1_CONFIGURATION, CFG_REPLY);
 
        enumerator = in->create_attribute_enumerator(in);
        while (enumerator->enumerate(enumerator, &attr))
@@ -80,7 +80,7 @@ METHOD(xauth_method_t, process_peer, status_t,
                {
                        case XAUTH_USER_NAME:
                                cp->add_attribute(cp, configuration_attribute_create_chunk(
-                                                       CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_NAME,
+                                                       PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_NAME,
                                                        this->peer->get_encoding(this->peer)));
                                break;
                        case XAUTH_NEXT_PIN:
@@ -99,7 +99,7 @@ METHOD(xauth_method_t, process_peer, status_t,
                                        return FAILED;
                                }
                                cp->add_attribute(cp, configuration_attribute_create_chunk(
-                                                       CONFIGURATION_ATTRIBUTE_V1, attr->get_type(attr),
+                                                       PLV1_CONFIGURATION_ATTRIBUTE, attr->get_type(attr),
                                                        shared->get_key(shared)));
                                shared->destroy(shared);
                                break;
@@ -118,11 +118,11 @@ METHOD(xauth_method_t, initiate_server, status_t,
 {
        cp_payload_t *cp;
 
-       cp = cp_payload_create_type(CONFIGURATION_V1, CFG_REQUEST);
+       cp = cp_payload_create_type(PLV1_CONFIGURATION, CFG_REQUEST);
        cp->add_attribute(cp, configuration_attribute_create_chunk(
-                               CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_NAME, chunk_empty));
+                               PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_NAME, chunk_empty));
        cp->add_attribute(cp, configuration_attribute_create_chunk(
-                               CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_PASSWORD, chunk_empty));
+                               PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_PASSWORD, chunk_empty));
        *out = cp;
        return NEED_MORE;
 }
index 71c79ec..1970146 100644 (file)
@@ -43,11 +43,11 @@ METHOD(xauth_method_t, initiate, status_t,
 {
        cp_payload_t *cp;
 
-       cp = cp_payload_create_type(CONFIGURATION_V1, CFG_REQUEST);
+       cp = cp_payload_create_type(PLV1_CONFIGURATION, CFG_REQUEST);
        cp->add_attribute(cp, configuration_attribute_create_chunk(
-                               CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_NAME, chunk_empty));
+                               PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_NAME, chunk_empty));
        cp->add_attribute(cp, configuration_attribute_create_chunk(
-                               CONFIGURATION_ATTRIBUTE_V1, XAUTH_USER_PASSWORD, chunk_empty));
+                               PLV1_CONFIGURATION_ATTRIBUTE, XAUTH_USER_PASSWORD, chunk_empty));
        *out = cp;
        return NEED_MORE;
 }
index 606135b..a6795e7 100644 (file)
@@ -51,7 +51,7 @@ METHOD(job_t, execute, job_requeue_t,
        /* if this is an unencrypted INFORMATIONAL exchange it is likely a
         * connectivity check. */
        if (this->message->get_exchange_type(this->message) == INFORMATIONAL &&
-               this->message->get_first_payload_type(this->message) != ENCRYPTED)
+               this->message->get_first_payload_type(this->message) != PLV2_ENCRYPTED)
        {
                /* theoretically this could also be an error message
                 * see RFC 4306, section 1.5. */
index a32b6ab..8571274 100644 (file)
@@ -86,7 +86,7 @@ authenticator_t *authenticator_create_verifier(
 {
        auth_payload_t *auth_payload;
 
-       auth_payload = (auth_payload_t*)message->get_payload(message, AUTHENTICATION);
+       auth_payload = (auth_payload_t*)message->get_payload(message, PLV2_AUTH);
        if (auth_payload == NULL)
        {
                return (authenticator_t*)eap_authenticator_create_verifier(ike_sa,
index 525117f..8e68e7b 100644 (file)
@@ -971,7 +971,7 @@ static bool get_init_hash(private_ike_sa_manager_t *this, message_t *message,
        {       /* this might be the case when flush() has been called */
                return FALSE;
        }
-       if (message->get_first_payload_type(message) == FRAGMENT_V1)
+       if (message->get_first_payload_type(message) == PLV1_FRAGMENT)
        {       /* only hash the source IP, port and SPI for fragmented init messages */
                u_int16_t port;
                u_int64_t spi;
@@ -1313,7 +1313,7 @@ METHOD(ike_sa_manager_t, checkout_by_message, ike_sa_t*,
 
                        ike_id = entry->ike_sa->get_id(entry->ike_sa);
                        entry->checked_out = TRUE;
-                       if (message->get_first_payload_type(message) != FRAGMENT_V1)
+                       if (message->get_first_payload_type(message) != PLV1_FRAGMENT)
                        {
                                entry->processing = get_message_id_or_hash(message);
                        }
index ee15408..aa966cd 100644 (file)
@@ -85,7 +85,7 @@ METHOD(authenticator_t, build, status_t,
        }
        free(dh.ptr);
 
-       hash_payload = hash_payload_create(HASH_V1);
+       hash_payload = hash_payload_create(PLV1_HASH);
        hash_payload->set_hash(hash_payload, hash);
        message->add_payload(message, &hash_payload->payload_interface);
        free(hash.ptr);
@@ -101,7 +101,7 @@ METHOD(authenticator_t, process, status_t,
        chunk_t hash, dh;
        auth_cfg_t *auth;
 
-       hash_payload = (hash_payload_t*)message->get_payload(message, HASH_V1);
+       hash_payload = (hash_payload_t*)message->get_payload(message, PLV1_HASH);
        if (!hash_payload)
        {
                DBG1(DBG_IKE, "HASH payload missing in message");
index d81c77f..bfe5ff4 100644 (file)
@@ -108,7 +108,7 @@ METHOD(authenticator_t, build, status_t,
 
        if (private->sign(private, scheme, hash, &sig))
        {
-               sig_payload = hash_payload_create(SIGNATURE_V1);
+               sig_payload = hash_payload_create(PLV1_SIGNATURE);
                sig_payload->set_hash(sig_payload, sig);
                free(sig.ptr);
                message->add_payload(message, &sig_payload->payload_interface);
@@ -144,7 +144,7 @@ METHOD(authenticator_t, process, status_t,
                scheme = SIGN_ECDSA_WITH_NULL;
        }
 
-       sig_payload = (hash_payload_t*)message->get_payload(message, SIGNATURE_V1);
+       sig_payload = (hash_payload_t*)message->get_payload(message, PLV1_SIGNATURE);
        if (!sig_payload)
        {
                DBG1(DBG_IKE, "SIG payload missing in message");
index bf1b004..619d197 100644 (file)
@@ -791,7 +791,7 @@ METHOD(keymat_v1_t, get_hash, bool,
 static bool get_nonce(message_t *message, chunk_t *n)
 {
        nonce_payload_t *nonce;
-       nonce = (nonce_payload_t*)message->get_payload(message, NONCE_V1);
+       nonce = (nonce_payload_t*)message->get_payload(message, PLV1_NONCE);
        if (nonce)
        {
                *n = nonce->get_nonce(nonce);
@@ -815,7 +815,7 @@ static chunk_t get_message_data(message_t *message, generator_t *generator)
                enumerator = message->create_payload_enumerator(message);
                while (enumerator->enumerate(enumerator, &payload))
                {
-                       if (payload->get_type(payload) == HASH_V1)
+                       if (payload->get_type(payload) == PLV1_HASH)
                        {
                                continue;
                        }
@@ -835,7 +835,7 @@ static chunk_t get_message_data(message_t *message, generator_t *generator)
                                generator->generate_payload(generator, payload);
                                payload = next;
                        }
-                       payload->set_next_type(payload, NO_PAYLOAD);
+                       payload->set_next_type(payload, PL_NONE);
                        generator->generate_payload(generator, payload);
                }
                enumerator->destroy(enumerator);
index 1189d3c..114b8a3 100644 (file)
@@ -648,7 +648,7 @@ METHOD(phase1_t, save_sa_payload, bool,
        enumerator = message->create_payload_enumerator(message);
        while (enumerator->enumerate(enumerator, &payload))
        {
-               if (payload->get_type(payload) == SECURITY_ASSOCIATION_V1)
+               if (payload->get_type(payload) == PLV1_SECURITY_ASSOCIATION)
                {
                        sa = payload;
                        break;
@@ -682,7 +682,7 @@ METHOD(phase1_t, add_nonce_ke, bool,
        nonce_gen_t *nonceg;
        chunk_t nonce;
 
-       ke_payload = ke_payload_create_from_diffie_hellman(KEY_EXCHANGE_V1, this->dh);
+       ke_payload = ke_payload_create_from_diffie_hellman(PLV1_KEY_EXCHANGE, this->dh);
        message->add_payload(message, &ke_payload->payload_interface);
 
        nonceg = this->keymat->keymat.create_nonce_gen(&this->keymat->keymat);
@@ -699,7 +699,7 @@ METHOD(phase1_t, add_nonce_ke, bool,
        }
        nonceg->destroy(nonceg);
 
-       nonce_payload = nonce_payload_create(NONCE_V1);
+       nonce_payload = nonce_payload_create(PLV1_NONCE);
        nonce_payload->set_nonce(nonce_payload, nonce);
        message->add_payload(message, &nonce_payload->payload_interface);
 
@@ -720,7 +720,7 @@ METHOD(phase1_t, get_nonce_ke, bool,
        nonce_payload_t *nonce_payload;
        ke_payload_t *ke_payload;
 
-       ke_payload = (ke_payload_t*)message->get_payload(message, KEY_EXCHANGE_V1);
+       ke_payload = (ke_payload_t*)message->get_payload(message, PLV1_KEY_EXCHANGE);
        if (!ke_payload)
        {
                DBG1(DBG_IKE, "KE payload missing in message");
@@ -729,7 +729,7 @@ METHOD(phase1_t, get_nonce_ke, bool,
        this->dh_value = chunk_clone(ke_payload->get_key_exchange_data(ke_payload));
        this->dh->set_other_public_value(this->dh, this->dh_value);
 
-       nonce_payload = (nonce_payload_t*)message->get_payload(message, NONCE_V1);
+       nonce_payload = (nonce_payload_t*)message->get_payload(message, PLV1_NONCE);
        if (!nonce_payload)
        {
                DBG1(DBG_IKE, "NONCE payload missing in message");