4 * @brief Interface of sa_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
27 #include <encoding/payloads/payload.h>
28 #include <encoding/payloads/proposal_substructure.h>
29 #include <utils/linked_list.h>
32 * Critical flag must not be set.
36 #define SA_PAYLOAD_CRITICAL_FLAG FALSE;
39 * SA_PAYLOAD length in bytes without any proposal substructure.
43 #define SA_PAYLOAD_HEADER_LENGTH 4
45 typedef struct sa_payload_t sa_payload_t
;
48 * Class representing an IKEv2-SA Payload.
50 * The SA Payload format is described in RFC section 3.3.
56 * The payload_t interface.
58 payload_t payload_interface
;
61 * @brief Creates an iterator of stored proposal_substructure_t objects.
63 * @warning The created iterator has to get destroyed by the caller!
65 * @warning When deleting an proposal using this iterator,
66 * the length of this transform substructure has to be refreshed
67 * by calling get_length()!
69 * @param this calling sa_payload_t object
70 * @param[in] forward iterator direction (TRUE: front to end)
71 * @return created iterator_t object
73 iterator_t
*(*create_proposal_substructure_iterator
) (sa_payload_t
*this, bool forward
);
76 * @brief Adds a proposal_substructure_t object to this object.
78 * @warning The added proposal_substructure_t object is
79 * getting destroyed in destroy function of sa_payload_t.
81 * @param this calling sa_payload_t object
82 * @param proposal proposal_substructure_t object to add
84 void (*add_proposal_substructure
) (sa_payload_t
*this,proposal_substructure_t
*proposal
);
87 * @brief Destroys an sa_payload_t object.
89 * @param this sa_payload_t object to destroy
91 void (*destroy
) (sa_payload_t
*this);
95 * @brief Creates an empty sa_payload_t object
97 * @return created sa_payload_t object
101 sa_payload_t
*sa_payload_create();
104 #endif /*SA_PAYLOAD_H_*/