Extended nonce payload for IKEv1 support
[strongswan.git] / src / libcharon / encoding / payloads / payload.c
index 47fe20c..56563ac 100644 (file)
@@ -76,16 +76,22 @@ ENUM_NEXT(payload_type_names, ID_PEER, ID_PEER, EXTENSIBLE_AUTHENTICATION,
 ENUM_NEXT(payload_type_names, HEADER, CONFIGURATION_ATTRIBUTE, ID_PEER,
        "HEADER",
        "PROPOSAL_SUBSTRUCTURE",
+       "PROPOSAL_SUBSTRUCTURE_V1",
        "TRANSFORM_SUBSTRUCTURE",
+       "TRANSFORM_SUBSTRUCTURE_V1",
        "TRANSFORM_ATTRIBUTE",
+       "TRANSFORM_ATTRIBUTE_V1",
        "TRAFFIC_SELECTOR_SUBSTRUCTURE",
        "CONFIGURATION_ATTRIBUTE");
 #else
 ENUM_NEXT(payload_type_names, HEADER, CONFIGURATION_ATTRIBUTE, EXTENSIBLE_AUTHENTICATION,
        "HEADER",
        "PROPOSAL_SUBSTRUCTURE",
+       "PROPOSAL_SUBSTRUCTURE_V1",
        "TRANSFORM_SUBSTRUCTURE",
+       "TRANSFORM_SUBSTRUCTURE_V1",
        "TRANSFORM_ATTRIBUTE",
+       "TRANSFORM_ATTRIBUTE_V1",
        "TRAFFIC_SELECTOR_SUBSTRUCTURE",
        "CONFIGURATION_ATTRIBUTE");
 #endif /* ME */
@@ -131,18 +137,24 @@ ENUM_NEXT(payload_type_short_names, ID_PEER, ID_PEER, EXTENSIBLE_AUTHENTICATION,
 ENUM_NEXT(payload_type_short_names, HEADER, CONFIGURATION_ATTRIBUTE, ID_PEER,
        "HDR",
        "PROP",
+       "PROP",
+       "TRANS",
        "TRANS",
        "TRANSATTR",
+       "TRANSATTR",
        "TSSUB",
-       "CPATTR");
+       "CATTR");
 #else
 ENUM_NEXT(payload_type_short_names, HEADER, CONFIGURATION_ATTRIBUTE, EXTENSIBLE_AUTHENTICATION,
        "HDR",
        "PROP",
+       "PROP",
+       "TRANS",
        "TRANS",
        "TRANSATTR",
+       "TRANSATTR",
        "TSSUB",
-       "CPATTR");
+       "CATTR");
 #endif /* ME */
 ENUM_END(payload_type_short_names, CONFIGURATION_ATTRIBUTE);
 
@@ -156,23 +168,26 @@ payload_t *payload_create(payload_type_t type)
                case HEADER:
                        return (payload_t*)ike_header_create();
                case SECURITY_ASSOCIATION:
-                       return (payload_t*)sa_payload_create();
+               case SECURITY_ASSOCIATION_V1:
+                       return (payload_t*)sa_payload_create(type);
                case PROPOSAL_SUBSTRUCTURE:
-                       return (payload_t*)proposal_substructure_create();
+               case PROPOSAL_SUBSTRUCTURE_V1:
+                       return (payload_t*)proposal_substructure_create(type);
                case TRANSFORM_SUBSTRUCTURE:
-                       return (payload_t*)transform_substructure_create();
+               case TRANSFORM_SUBSTRUCTURE_V1:
+                       return (payload_t*)transform_substructure_create(type);
                case TRANSFORM_ATTRIBUTE:
-                       return (payload_t*)transform_attribute_create();
+               case TRANSFORM_ATTRIBUTE_V1:
+                       return (payload_t*)transform_attribute_create(type);
                case NONCE:
-                       return (payload_t*)nonce_payload_create();
+               case NONCE_V1:
+                       return (payload_t*)nonce_payload_create(type);
                case ID_INITIATOR:
-                       return (payload_t*)id_payload_create(ID_INITIATOR);
                case ID_RESPONDER:
-                       return (payload_t*)id_payload_create(ID_RESPONDER);
 #ifdef ME
                case ID_PEER:
-                       return (payload_t*)id_payload_create(ID_PEER);
 #endif /* ME */
+                       return (payload_t*)id_payload_create(type);
                case AUTHENTICATION:
                        return (payload_t*)auth_payload_create();
                case CERTIFICATE:
@@ -192,7 +207,8 @@ payload_t *payload_create(payload_type_t type)
                case DELETE:
                        return (payload_t*)delete_payload_create(0);
                case VENDOR_ID:
-                       return (payload_t*)vendor_id_payload_create();
+               case VENDOR_ID_V1:
+                       return (payload_t*)vendor_id_payload_create(type);
                case CONFIGURATION:
                        return (payload_t*)cp_payload_create();
                case CONFIGURATION_ATTRIBUTE: