aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/encoding/payloads/transform_substructure.h
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-11-16 13:46:54 +0100
committerMartin Willi <martin@revosec.ch>2012-03-20 17:30:40 +0100
commit1bf2971ff2d63f1f1c4d59d1091b8a1b11b0ef62 (patch)
treedc7c9946dcd757cca853b7ce2f6edc4c2381442a /src/libcharon/encoding/payloads/transform_substructure.h
parent3f6d1b13a7d53bf465c65687e18425d14a143af8 (diff)
downloadstrongswan-1bf2971ff2d63f1f1c4d59d1091b8a1b11b0ef62.tar.bz2
strongswan-1bf2971ff2d63f1f1c4d59d1091b8a1b11b0ef62.tar.xz
Implemented limited payload parsing for IKEv1 SA payloads
Diffstat (limited to 'src/libcharon/encoding/payloads/transform_substructure.h')
-rw-r--r--src/libcharon/encoding/payloads/transform_substructure.h35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/libcharon/encoding/payloads/transform_substructure.h b/src/libcharon/encoding/payloads/transform_substructure.h
index 102dbb3d3..e6a7f8e4d 100644
--- a/src/libcharon/encoding/payloads/transform_substructure.h
+++ b/src/libcharon/encoding/payloads/transform_substructure.h
@@ -45,9 +45,7 @@ typedef struct transform_substructure_t transform_substructure_t;
#define TRANSFORM_SUBSTRUCTURE_HEADER_LENGTH 8
/**
- * Class representing an IKEv2- TRANSFORM SUBSTRUCTURE.
- *
- * The TRANSFORM SUBSTRUCTURE format is described in RFC section 3.3.2.
+ * Class representing an IKEv1/IKEv2 transform substructure.
*/
struct transform_substructure_t {
@@ -75,11 +73,11 @@ struct transform_substructure_t {
void (*set_is_last_transform) (transform_substructure_t *this, bool is_last);
/**
- * get transform type of the current transform.
+ * Get transform type (IKEv2) or the transform number (IKEv1).
*
* @return Transform type of current transform substructure.
*/
- u_int8_t (*get_transform_type) (transform_substructure_t *this);
+ u_int8_t (*get_transform_type_or_number) (transform_substructure_t *this);
/**
* Get transform id of the current transform.
@@ -89,16 +87,11 @@ struct transform_substructure_t {
u_int16_t (*get_transform_id) (transform_substructure_t *this);
/**
- * Get transform id of the current transform.
+ * Create an enumerator over transform attributes.
*
- * @param key_length The key length is written to this location
- * @return
- * - SUCCESS if a key length attribute is contained
- * - FAILED if no key length attribute is part of this
- * transform or key length uses more then 16 bit!
+ * @return enumerator over transform_attribute_t*
*/
- status_t (*get_key_length) (transform_substructure_t *this,
- u_int16_t *key_length);
+ enumerator_t* (*create_attribute_enumerator)(transform_substructure_t *this);
/**
* Destroys an transform_substructure_t object.
@@ -109,19 +102,21 @@ struct transform_substructure_t {
/**
* Creates an empty transform_substructure_t object.
*
+ * @param type TRANSFORM_SUBSTRUCTURE or TRANSFORM_SUBSTRUCTURE_V1
* @return created transform_substructure_t object
*/
-transform_substructure_t *transform_substructure_create(void);
+transform_substructure_t *transform_substructure_create(payload_type_t type);
/**
* Creates an empty transform_substructure_t object.
*
- * @param type type of transform to create
- * @param id transform id specifc for the transform type
- * @param key_length key length for key length attribute, 0 to omit
- * @return transform_substructure_t object
+ * @param type TRANSFORM_SUBSTRUCTURE or TRANSFORM_SUBSTRUCTURE_V1
+ * @param type_or_number Type (IKEv2) or number (IKEv1) of transform
+ * @param id transform id specifc for the transform type
+ * @param key_length key length for key length attribute, 0 to omit
+ * @return transform_substructure_t object
*/
-transform_substructure_t *transform_substructure_create_type(
- transform_type_t type, u_int16_t id, u_int16_t key_length);
+transform_substructure_t *transform_substructure_create_type(payload_type_t type,
+ u_int8_t type_or_number, u_int16_t id, u_int16_t key_length);
#endif /** TRANSFORM_SUBSTRUCTURE_H_ @}*/