summaryrefslogtreecommitdiff
path: root/src/charon/encoding/payloads/payload.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/encoding/payloads/payload.c')
-rw-r--r--src/charon/encoding/payloads/payload.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/charon/encoding/payloads/payload.c b/src/charon/encoding/payloads/payload.c
index 3bd4cdb13..2c51c60de 100644
--- a/src/charon/encoding/payloads/payload.c
+++ b/src/charon/encoding/payloads/payload.c
@@ -7,6 +7,7 @@
*/
/*
+ * Copyright (C) 2007 Tobias Brunner
* Copyright (C) 2005-2006 Martin Willi
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
@@ -63,7 +64,13 @@ ENUM_NEXT(payload_type_names, SECURITY_ASSOCIATION, EXTENSIBLE_AUTHENTICATION, N
"ENCRYPTED",
"CONFIGURATION",
"EXTENSIBLE_AUTHENTICATION");
+#ifdef P2P
+ENUM_NEXT(payload_type_names, ID_PEER, ID_PEER, EXTENSIBLE_AUTHENTICATION,
+ "ID_PEER");
+ENUM_NEXT(payload_type_names, HEADER, UNKNOWN_PAYLOAD, ID_PEER,
+#else
ENUM_NEXT(payload_type_names, HEADER, UNKNOWN_PAYLOAD, EXTENSIBLE_AUTHENTICATION,
+#endif /* P2P */
"HEADER",
"PROPOSAL_SUBSTRUCTURE",
"TRANSFORM_SUBSTRUCTURE",
@@ -93,7 +100,13 @@ ENUM_NEXT(payload_type_short_names, SECURITY_ASSOCIATION, EXTENSIBLE_AUTHENTICAT
"E",
"CP",
"EAP");
+#ifdef P2P
+ENUM_NEXT(payload_type_short_names, ID_PEER, ID_PEER, EXTENSIBLE_AUTHENTICATION,
+ "IDp");
+ENUM_NEXT(payload_type_short_names, HEADER, UNKNOWN_PAYLOAD, ID_PEER,
+#else
ENUM_NEXT(payload_type_short_names, HEADER, UNKNOWN_PAYLOAD, EXTENSIBLE_AUTHENTICATION,
+#endif /* P2P */
"HDR",
"PROP",
"TRANS",
@@ -123,9 +136,13 @@ payload_t *payload_create(payload_type_t type)
case NONCE:
return (payload_t*)nonce_payload_create();
case ID_INITIATOR:
- return (payload_t*)id_payload_create(TRUE);
+ return (payload_t*)id_payload_create(ID_INITIATOR);
case ID_RESPONDER:
- return (payload_t*)id_payload_create(FALSE);
+ return (payload_t*)id_payload_create(ID_RESPONDER);
+#ifdef P2P
+ case ID_PEER:
+ return (payload_t*)id_payload_create(ID_PEER);
+#endif /* P2P */
case AUTHENTICATION:
return (payload_t*)auth_payload_create();
case CERTIFICATE: