]> git.ipfire.org Git - people/ms/strongswan.git/blob - programs/charon/charon/encoding/payloads/delete_payload.h
- import of strongswan-2.7.0
[people/ms/strongswan.git] / programs / charon / charon / encoding / payloads / delete_payload.h
1 /**
2 * @file delete_payload.h
3 *
4 * @brief Interface of delete_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
23 #ifndef DELETE_PAYLOAD_H_
24 #define DELETE_PAYLOAD_H_
25
26 #include <types.h>
27 #include <encoding/payloads/payload.h>
28 #include <encoding/payloads/proposal_substructure.h>
29
30 /**
31 * Length of a delete payload without the SPI in bytes.
32 *
33 * @ingroup payloads
34 */
35 #define DELETE_PAYLOAD_HEADER_LENGTH 8
36
37
38
39 typedef struct delete_payload_t delete_payload_t;
40
41 /**
42 * @brief Class representing an IKEv2 DELETE payload.
43 *
44 * The DELETE payload format is described in RFC section 3.11.
45 *
46 * @b Constructors:
47 * - delete_payload_create()
48 *
49 * @todo Implement better setter/getters
50 *
51 * @ingroup payloads
52 */
53 struct delete_payload_t {
54 /**
55 * The payload_t interface.
56 */
57 payload_t payload_interface;
58
59 /**
60 * @brief Set the protocol ID.
61 *
62 * @param this calling delete_payload_t object
63 * @param protocol_id protocol ID
64 */
65 void (*set_protocol_id) (delete_payload_t *this, protocol_id_t protocol_id);
66
67 /**
68 * @brief Get the protocol ID.
69 *
70 * @param this calling delete_payload_t object
71 * @return protocol ID
72 */
73 protocol_id_t (*get_protocol_id) (delete_payload_t *this);
74
75 /**
76 * @brief Set the SPI size.
77 *
78 *
79 * @param this calling delete_payload_t object
80 * @param spi_size SPI size
81 */
82 void (*set_spi_size) (delete_payload_t *this, u_int8_t spi_size);
83
84 /**
85 * @brief Get the SPI size.
86 *
87 * @param this calling delete_payload_t object
88 * @return SPI size
89 */
90 u_int8_t (*get_spi_size) (delete_payload_t *this);
91
92 /**
93 * @brief Set the SPI count.
94 *
95 * @param this calling delete_payload_t object
96 * @param spi_count SPI count
97 */
98 void (*set_spi_count) (delete_payload_t *this, u_int16_t spi_count);
99
100 /**
101 * @brief Get the SPI count.
102 *
103 * @param this calling delete_payload_t object
104 * @return Number of SPI's
105 */
106 u_int16_t (*get_spi_count) (delete_payload_t *this);
107
108 /**
109 * @brief Set the SPI's.
110 *
111 * Data are getting cloned.
112 *
113 * @param this calling delete_payload_t object
114 * @param data SPI's as chunk_t
115 */
116 void (*set_spis) (delete_payload_t *this, chunk_t spis);
117
118 /**
119 * @brief Get the SPI's.
120 *
121 * Returned data are a copy of the internal one.
122 *
123 * @param this calling delete_payload_t object
124 * @return SPI's chunk_t
125 */
126 chunk_t (*get_spis_clone) (delete_payload_t *this);
127
128 /**
129 * @brief Get the SPI's.
130 *
131 * Returned data are NOT copied.
132 *
133 * @param this calling delete_payload_t object
134 * @return SPI's as chunk_t
135 */
136 chunk_t (*get_spis) (delete_payload_t *this);
137
138 /**
139 * @brief Destroys an delete_payload_t object.
140 *
141 * @param this delete_payload_t object to destroy
142 */
143 void (*destroy) (delete_payload_t *this);
144 };
145
146 /**
147 * @brief Creates an empty delete_payload_t object.
148 *
149 * @return delete_payload_t object
150 *
151 * @ingroup payloads
152 */
153 delete_payload_t *delete_payload_create();
154
155
156 #endif /* DELETE_PAYLOAD_H_ */