- mapping for payload_type_t added
[strongswan.git] / Source / charon / encodings.c
1 /**
2 * @file encodings.c
3 *
4 * @brief Type definitions for parser and generator,
5 * also payload types are defined here.
6 *
7 * Header is parsed like a payload and gets its one payload_id
8 * from PRIVATE USE space. Also the substructures
9 * of specific payload types get their own payload_id
10 * from PRIVATE_USE space. See RFC for mor informations.
11 *
12 */
13
14 /*
15 * Copyright (C) 2005 Jan Hutter, Martin Willi
16 * Hochschule fuer Technik Rapperswil
17 *
18 * This program is free software; you can redistribute it and/or modify it
19 * under the terms of the GNU General Public License as published by the
20 * Free Software Foundation; either version 2 of the License, or (at your
21 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
22 *
23 * This program is distributed in the hope that it will be useful, but
24 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 * for more details.
27 */
28
29 #include <stdlib.h>
30
31 #include "types.h"
32 #include "encodings.h"
33 #include "encodings/ike_header.h"
34
35 extern payload_info_t ike_header_info;
36
37 /*
38 * build the mappings for payload_type_t
39 */
40 mapping_t payload_type_t_mappings[] = {
41 {NO_PAYLOAD, "NO_PAYLOAD"},
42 {SECURITY_ASSOCIATION, "SECURITY_ASSOCIATION"},
43 {KEY_EXCHANGE, "KEY_EXCHANGE"},
44 {ID_INITIATOR, "ID_INITIATOR"},
45 {ID_RESPONDER, "ID_RESPONDER"},
46 {CERTIFICATE, "CERTIFICATE"},
47 {CERTIFICATE_REQUEST, "CERTIFICATE_REQUEST"},
48 {AUTHENTICATION, "AUTHENTICATION"},
49 {NONCE, "NONCE"},
50 {NOTIFY, "NOTIFY"},
51 {DELETE, "DELETE"},
52 {VENDOR_ID, "VENDOR_ID"},
53 {TRAFFIC_SELECTOR_INITIATOR, "TRAFFIC_SELECTOR_INITIATOR"},
54 {TRAFFIC_SELECTOR_RESPONDER, "TRAFFIC_SELECTOR_RESPONDER"},
55 {ENCRYPTED, "ENCRYPTED"},
56 {CONFIGURATION, "CONFIGURATION"},
57 {EXTENSIBLE_AUTHENTICATION, "EXTENSIBLE_AUTHENTICATION"},
58 {HEADER, "HEADER"},
59 {MAPPING_END, NULL}
60 };
61
62
63 /**
64 * List containing all payload informations
65 * supported by parser and generator.
66 *
67 * @warning This list must be NULL terminated.
68 */
69 payload_info_t *payload_infos[] = {
70 &ike_header_info,
71 NULL
72 };
73
74