2 * @file delete_payload.h
4 * @brief Interface of delete_payload_t.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
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>.
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
23 #ifndef DELETE_PAYLOAD_H_
24 #define DELETE_PAYLOAD_H_
27 #include <encoding/payloads/payload.h>
28 #include <encoding/payloads/proposal_substructure.h>
31 * Length of a delete payload without the SPI in bytes.
35 #define DELETE_PAYLOAD_HEADER_LENGTH 8
39 typedef struct delete_payload_t delete_payload_t
;
42 * @brief Class representing an IKEv2 DELETE payload.
44 * The DELETE payload format is described in RFC section 3.11.
47 * - delete_payload_create()
49 * @todo Implement better setter/getters
53 struct delete_payload_t
{
55 * The payload_t interface.
57 payload_t payload_interface
;
60 * @brief Set the protocol ID.
62 * @param this calling delete_payload_t object
63 * @param protocol_id protocol ID
65 void (*set_protocol_id
) (delete_payload_t
*this, protocol_id_t protocol_id
);
68 * @brief Get the protocol ID.
70 * @param this calling delete_payload_t object
73 protocol_id_t (*get_protocol_id
) (delete_payload_t
*this);
76 * @brief Set the SPI size.
79 * @param this calling delete_payload_t object
80 * @param spi_size SPI size
82 void (*set_spi_size
) (delete_payload_t
*this, u_int8_t spi_size
);
85 * @brief Get the SPI size.
87 * @param this calling delete_payload_t object
90 u_int8_t (*get_spi_size
) (delete_payload_t
*this);
93 * @brief Set the SPI count.
95 * @param this calling delete_payload_t object
96 * @param spi_count SPI count
98 void (*set_spi_count
) (delete_payload_t
*this, u_int16_t spi_count
);
101 * @brief Get the SPI count.
103 * @param this calling delete_payload_t object
104 * @return Number of SPI's
106 u_int16_t (*get_spi_count
) (delete_payload_t
*this);
109 * @brief Set the SPI's.
111 * Data are getting cloned.
113 * @param this calling delete_payload_t object
114 * @param data SPI's as chunk_t
116 void (*set_spis
) (delete_payload_t
*this, chunk_t spis
);
119 * @brief Get the SPI's.
121 * Returned data are a copy of the internal one.
123 * @param this calling delete_payload_t object
124 * @return SPI's chunk_t
126 chunk_t (*get_spis_clone
) (delete_payload_t
*this);
129 * @brief Get the SPI's.
131 * Returned data are NOT copied.
133 * @param this calling delete_payload_t object
134 * @return SPI's as chunk_t
136 chunk_t (*get_spis
) (delete_payload_t
*this);
139 * @brief Destroys an delete_payload_t object.
141 * @param this delete_payload_t object to destroy
143 void (*destroy
) (delete_payload_t
*this);
147 * @brief Creates an empty delete_payload_t object.
149 * @return delete_payload_t object
153 delete_payload_t
*delete_payload_create(void);
156 #endif /* DELETE_PAYLOAD_H_ */