fixed CHILD_SA rekeying/delete bug on 64bit machines
[strongswan.git] / src / 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-2006 Martin Willi
10 * Copyright (C) 2005 Jan Hutter
11 * Hochschule fuer Technik Rapperswil
12 *
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>.
17 *
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
21 * for more details.
22 */
23
24 #ifndef DELETE_PAYLOAD_H_
25 #define DELETE_PAYLOAD_H_
26
27 typedef struct delete_payload_t delete_payload_t;
28
29 #include <library.h>
30 #include <encoding/payloads/payload.h>
31 #include <encoding/payloads/proposal_substructure.h>
32
33 /**
34 * Length of a delete payload without the SPI in bytes.
35 *
36 * @ingroup payloads
37 */
38 #define DELETE_PAYLOAD_HEADER_LENGTH 8
39
40 /**
41 * @brief Class representing an IKEv2 DELETE payload.
42 *
43 * The DELETE payload format is described in RFC section 3.11.
44 *
45 * @b Constructors:
46 * - delete_payload_create()
47 *
48 * @todo Implement better setter/getters
49 *
50 * @ingroup payloads
51 */
52 struct delete_payload_t {
53 /**
54 * The payload_t interface.
55 */
56 payload_t payload_interface;
57
58 /**
59 * @brief Get the protocol ID.
60 *
61 * @param this calling delete_payload_t object
62 * @return protocol ID
63 */
64 protocol_id_t (*get_protocol_id) (delete_payload_t *this);
65
66 /**
67 * @brief Add an SPI to the list of deleted SAs.
68 *
69 * @param this calling delete_payload_t object
70 * @param spi spi to add
71 */
72 void (*add_spi) (delete_payload_t *this, u_int32_t spi);
73
74 /**
75 * @brief Get an iterator over the SPIs.
76 *
77 * The iterate() function returns a pointer to a u_int32_t SPI.
78 *
79 * @param this calling delete_payload_t object
80 * @return iterator over SPIs
81 */
82 iterator_t *(*create_spi_iterator) (delete_payload_t *this);
83
84 /**
85 * @brief Destroys an delete_payload_t object.
86 *
87 * @param this delete_payload_t object to destroy
88 */
89 void (*destroy) (delete_payload_t *this);
90 };
91
92 /**
93 * @brief Creates an empty delete_payload_t object.
94 *
95 * @param protocol_id protocol, such as AH|ESP
96 * @return delete_payload_t object
97 *
98 * @ingroup payloads
99 */
100 delete_payload_t *delete_payload_create(protocol_id_t protocol_id);
101
102 #endif /* DELETE_PAYLOAD_H_ */