2 * @file delete_payload.h
4 * @brief Interface of delete_payload_t.
9 * Copyright (C) 2005-2006 Martin Willi
10 * Copyright (C) 2005 Jan Hutter
11 * Hochschule fuer Technik Rapperswil
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>.
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
24 #ifndef DELETE_PAYLOAD_H_
25 #define DELETE_PAYLOAD_H_
27 typedef struct delete_payload_t delete_payload_t
;
30 #include <encoding/payloads/payload.h>
31 #include <encoding/payloads/proposal_substructure.h>
34 * Length of a delete payload without the SPI in bytes.
38 #define DELETE_PAYLOAD_HEADER_LENGTH 8
41 * @brief Class representing an IKEv2 DELETE payload.
43 * The DELETE payload format is described in RFC section 3.11.
46 * - delete_payload_create()
48 * @todo Implement better setter/getters
52 struct delete_payload_t
{
54 * The payload_t interface.
56 payload_t payload_interface
;
59 * @brief Get the protocol ID.
61 * @param this calling delete_payload_t object
64 protocol_id_t (*get_protocol_id
) (delete_payload_t
*this);
67 * @brief Add an SPI to the list of deleted SAs.
69 * @param this calling delete_payload_t object
70 * @param spi spi to add
72 void (*add_spi
) (delete_payload_t
*this, u_int32_t spi
);
75 * @brief Get an iterator over the SPIs.
77 * The iterate() function returns a pointer to a u_int32_t SPI.
79 * @param this calling delete_payload_t object
80 * @return iterator over SPIs
82 iterator_t
*(*create_spi_iterator
) (delete_payload_t
*this);
85 * @brief Destroys an delete_payload_t object.
87 * @param this delete_payload_t object to destroy
89 void (*destroy
) (delete_payload_t
*this);
93 * @brief Creates an empty delete_payload_t object.
95 * @param protocol_id protocol, such as AH|ESP
96 * @return delete_payload_t object
100 delete_payload_t
*delete_payload_create(protocol_id_t protocol_id
);
102 #endif /* DELETE_PAYLOAD_H_ */