]>
Commit | Line | Data |
---|---|---|
510c3426 JH |
1 | /** |
2 | * @file certreq_payload.h | |
3 | * | |
4 | * @brief Interface of certreq_payload_t. | |
5 | * | |
6 | */ | |
7 | ||
8 | /* | |
9 | * Copyright (C) 2005 Jan Hutter, Martin Willi | |
10 | * Hochschule fuer Technik Rapperswil | |
11 | * | |
12 | * This program is free software; you can redistribute it and/or modify it | |
13 | * under the terms of the GNU General Public License as published by the | |
14 | * Free Software Foundation; either version 2 of the License, or (at your | |
15 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
16 | * | |
17 | * This program is distributed in the hope that it will be useful, but | |
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
19 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
20 | * for more details. | |
21 | */ | |
22 | ||
16b9a73c MW |
23 | #ifndef CERTREQ_PAYLOAD_H_ |
24 | #define CERTREQ_PAYLOAD_H_ | |
510c3426 JH |
25 | |
26 | #include <types.h> | |
27 | #include <encoding/payloads/payload.h> | |
28 | #include <encoding/payloads/cert_payload.h> | |
29 | ||
30 | /** | |
31 | * Length of a CERTREQ payload without the CERTREQ data in bytes. | |
32 | * | |
33 | * @ingroup payloads | |
34 | */ | |
35 | #define CERTREQ_PAYLOAD_HEADER_LENGTH 5 | |
36 | ||
37 | ||
38 | typedef struct certreq_payload_t certreq_payload_t; | |
39 | ||
40 | /** | |
c3dc864e | 41 | * @brief Class representing an IKEv2 CERTREQ payload. |
510c3426 | 42 | * |
8a491129 | 43 | * The CERTREQ payload format is described in RFC section 3.7. |
c3dc864e MW |
44 | * This is just a dummy implementation to fullfill the standards |
45 | * requirements. A full implementation would offer setters/getters | |
46 | * for the different encoding types. | |
510c3426 | 47 | * |
c3dc864e MW |
48 | * @b Constructors: |
49 | * - certreq_payload_create() | |
510c3426 | 50 | * |
2b547481 MW |
51 | * @todo Implement payload functionality. |
52 | * | |
c3dc864e | 53 | * @ingroup payloads |
510c3426 JH |
54 | */ |
55 | struct certreq_payload_t { | |
56 | /** | |
57 | * The payload_t interface. | |
58 | */ | |
59 | payload_t payload_interface; | |
60 | ||
61 | /** | |
62 | * @brief Set the CERT encoding. | |
510c3426 JH |
63 | * |
64 | * @param this calling certreq_payload_t object | |
65 | * @param encoding CERT encoding | |
66 | */ | |
67 | void (*set_cert_encoding) (certreq_payload_t *this, cert_encoding_t encoding); | |
68 | ||
69 | /** | |
70 | * @brief Get the CERT encoding. | |
71 | * | |
72 | * @param this calling certreq_payload_t object | |
73 | * @return Encoding of the CERT | |
74 | */ | |
75 | cert_encoding_t (*get_cert_encoding) (certreq_payload_t *this); | |
76 | ||
77 | /** | |
78 | * @brief Set the CERTREQ data. | |
79 | * | |
80 | * Data are getting cloned. | |
81 | * | |
82 | * @param this calling certreq_payload_t object | |
83 | * @param data CERTREQ data as chunk_t | |
84 | */ | |
85 | void (*set_data) (certreq_payload_t *this, chunk_t data); | |
86 | ||
87 | /** | |
88 | * @brief Get the CERTREQ data. | |
89 | * | |
90 | * Returned data are a copy of the internal one. | |
91 | * | |
92 | * @param this calling certreq_payload_t object | |
93 | * @return CERTREQ data as chunk_t | |
94 | */ | |
95 | chunk_t (*get_data_clone) (certreq_payload_t *this); | |
96 | ||
97 | /** | |
98 | * @brief Get the CERTREQ data. | |
99 | * | |
100 | * Returned data are NOT copied. | |
101 | * | |
102 | * @param this calling certreq_payload_t object | |
103 | * @return CERTREQ data as chunk_t | |
104 | */ | |
105 | chunk_t (*get_data) (certreq_payload_t *this); | |
106 | ||
107 | /** | |
108 | * @brief Destroys an certreq_payload_t object. | |
109 | * | |
110 | * @param this certreq_payload_t object to destroy | |
111 | */ | |
112 | void (*destroy) (certreq_payload_t *this); | |
113 | }; | |
114 | ||
115 | /** | |
116 | * @brief Creates an empty certreq_payload_t object. | |
117 | * | |
c3dc864e | 118 | * @return certreq_payload_t object |
510c3426 JH |
119 | * |
120 | * @ingroup payloads | |
121 | */ | |
f768bdc3 | 122 | certreq_payload_t *certreq_payload_create(void); |
510c3426 JH |
123 | |
124 | ||
16b9a73c | 125 | #endif /* CERTREQ_PAYLOAD_H_ */ |