- skeleton implementation of ike_header
[strongswan.git] / Source / charon / payloads / payload.c
1 /**
2 * @file payload.c
3 *
4 * @brief Generic payload interface
5 *
6 *
7 */
8
9 /*
10 * Copyright (C) 2005 Jan Hutter, Martin Willi
11 * Hochschule fuer Technik Rapperswil
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
22 */
23
24
25 #include "payload.h"
26
27 #include "ike_header.h"
28
29
30
31
32
33 /*
34 * build the mappings for payload_type_t
35 */
36 mapping_t payload_type_t_mappings[] = {
37 {NO_PAYLOAD, "NO_PAYLOAD"},
38 {SECURITY_ASSOCIATION, "SECURITY_ASSOCIATION"},
39 {KEY_EXCHANGE, "KEY_EXCHANGE"},
40 {ID_INITIATOR, "ID_INITIATOR"},
41 {ID_RESPONDER, "ID_RESPONDER"},
42 {CERTIFICATE, "CERTIFICATE"},
43 {CERTIFICATE_REQUEST, "CERTIFICATE_REQUEST"},
44 {AUTHENTICATION, "AUTHENTICATION"},
45 {NONCE, "NONCE"},
46 {NOTIFY, "NOTIFY"},
47 {DELETE, "DELETE"},
48 {VENDOR_ID, "VENDOR_ID"},
49 {TRAFFIC_SELECTOR_INITIATOR, "TRAFFIC_SELECTOR_INITIATOR"},
50 {TRAFFIC_SELECTOR_RESPONDER, "TRAFFIC_SELECTOR_RESPONDER"},
51 {ENCRYPTED, "ENCRYPTED"},
52 {CONFIGURATION, "CONFIGURATION"},
53 {EXTENSIBLE_AUTHENTICATION, "EXTENSIBLE_AUTHENTICATION"},
54 {HEADER, "HEADER"},
55 {MAPPING_END, NULL}
56 };
57
58 /*
59 * see header
60 */
61 payload_t *create_payload(payload_type_t type)
62 {
63 switch (type)
64 {
65 case HEADER:
66 return (payload_t*)ike_header_create();
67 default:
68 return NULL;
69 }
70 }
71