- defined all substructures for a SA payload
[strongswan.git] / Source / charon / payloads / transform_substructure.h
1 /**
2 * @file transform_substructure.h
3 *
4 * @brief Declaration of the class transform_substructure_t.
5 *
6 * An object of this type represents an IKEv2 TRANSFORM Substructure and contains Attributes.
7 *
8 */
9
10 /*
11 * Copyright (C) 2005 Jan Hutter, Martin Willi
12 * Hochschule fuer Technik Rapperswil
13 *
14 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License as published by the
16 * Free Software Foundation; either version 2 of the License, or (at your
17 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 */
24
25 #ifndef TRANSFORM_SUBSTRUCTURE_H_
26 #define TRANSFORM_SUBSTRUCTURE_H_
27
28 #include "../types.h"
29 #include "payload.h"
30 #include "../utils/linked_list.h"
31 #include "transform_attribute.h"
32
33 /**
34 * Object representing an IKEv2- TRANSFORM SUBSTRUCTURE
35 *
36 * The TRANSFORM SUBSTRUCTURE format is described in RFC section 3.3.2.
37 *
38 */
39 typedef struct transform_substructure_s transform_substructure_t;
40
41 struct transform_substructure_s {
42 /**
43 * implements payload_t interface
44 */
45 payload_t payload_interface;
46
47 /**
48 * @brief Creates an iterator of stored transform_attribute_t objects.
49 *
50 * @warning The created iterator has to get destroyed by the caller!
51 *
52 * @param this calling transform_substructure_t object
53 * @param iterator the created iterator is stored at the pointed pointer
54 * @param[in] forward iterator direction (TRUE: front to end)
55 * @return
56 * - SUCCESS or
57 * - OUT_OF_RES if iterator could not be created
58 */
59 status_t (*create_transform_attribute_iterator) (transform_substructure_t *this,linked_list_iterator_t **iterator, bool forward);
60
61 /**
62 * @brief Adds a transform_attribute_t object to this object.
63 *
64 * @warning The added proposal_substructure_t object is
65 * getting destroyed in destroy function of transform_substructure_t.
66 *
67 * @param this calling transform_substructure_t object
68 * @param proposal transform_attribute_t object to add
69 * @return - SUCCESS if succeeded
70 * - FAILED otherwise
71 */
72 status_t (*add_transform_attribute) (transform_substructure_t *this,transform_attribute_t *attribute);
73
74 /**
75 * @brief Destroys an transform_substructure_t object.
76 *
77 * @param this transform_substructure_t object to destroy
78 * @return
79 * SUCCESS in any case
80 */
81 status_t (*destroy) (transform_substructure_t *this);
82 };
83
84 /**
85 * @brief Creates an empty transform_substructure_t object
86 *
87 * @return
88 * - created transform_substructure_t object, or
89 * - NULL if failed
90 */
91
92 transform_substructure_t *transform_substructure_create();
93
94 #endif /*TRANSFORM_SUBSTRUCTURE_H_*/