aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/encoding/payloads/transform_substructure.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-11-17 15:44:42 +0100
committerMartin Willi <martin@revosec.ch>2012-03-20 17:30:42 +0100
commitf62a7c7c7192d791eb4c10e7ff4d09cf54c7d4da (patch)
tree3f9bd3f93211d661dcdc3b186598730c92aea4f0 /src/libcharon/encoding/payloads/transform_substructure.c
parent95a26523afc0d2a997cd1d4f738c287ae045ae4e (diff)
downloadstrongswan-f62a7c7c7192d791eb4c10e7ff4d09cf54c7d4da.tar.bz2
strongswan-f62a7c7c7192d791eb4c10e7ff4d09cf54c7d4da.tar.xz
Use a generic list encoding rule we can use to specify the wrapped payload type
Diffstat (limited to 'src/libcharon/encoding/payloads/transform_substructure.c')
-rw-r--r--src/libcharon/encoding/payloads/transform_substructure.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/libcharon/encoding/payloads/transform_substructure.c b/src/libcharon/encoding/payloads/transform_substructure.c
index 63464e9f3..9ee8b48db 100644
--- a/src/libcharon/encoding/payloads/transform_substructure.c
+++ b/src/libcharon/encoding/payloads/transform_substructure.c
@@ -83,19 +83,20 @@ struct private_transform_substructure_t {
*/
static encoding_rule_t encodings_v2[] = {
/* 1 Byte next payload type, stored in the field next_payload */
- { U_INT_8, offsetof(private_transform_substructure_t, next_payload) },
+ { U_INT_8, offsetof(private_transform_substructure_t, next_payload) },
/* 1 Reserved Byte */
- { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[0]) },
+ { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[0]) },
/* Length of the whole transform substructure*/
- { PAYLOAD_LENGTH, offsetof(private_transform_substructure_t, transform_length)},
+ { PAYLOAD_LENGTH, offsetof(private_transform_substructure_t, transform_length)},
/* transform type */
- { U_INT_8, offsetof(private_transform_substructure_t, transform_ton) },
+ { U_INT_8, offsetof(private_transform_substructure_t, transform_ton) },
/* transform identifier, as used by IKEv1 */
- { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[1]) },
+ { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[1]) },
/* transform identifier, as used by IKEv2 */
- { U_INT_16, offsetof(private_transform_substructure_t, transform_id_v2) },
+ { U_INT_16, offsetof(private_transform_substructure_t, transform_id_v2) },
/* Attributes in a transform attribute list */
- { TRANSFORM_ATTRIBUTES, offsetof(private_transform_substructure_t, attributes) }
+ { PAYLOAD_LIST + TRANSFORM_ATTRIBUTE,
+ offsetof(private_transform_substructure_t, attributes) }
};
/**
@@ -103,20 +104,21 @@ static encoding_rule_t encodings_v2[] = {
*/
static encoding_rule_t encodings_v1[] = {
/* 1 Byte next payload type, stored in the field next_payload */
- { U_INT_8, offsetof(private_transform_substructure_t, next_payload) },
+ { U_INT_8, offsetof(private_transform_substructure_t, next_payload) },
/* 1 Reserved Byte */
- { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[0]) },
+ { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[0]) },
/* Length of the whole transform substructure*/
- { PAYLOAD_LENGTH, offsetof(private_transform_substructure_t, transform_length)},
+ { PAYLOAD_LENGTH, offsetof(private_transform_substructure_t, transform_length)},
/* transform number */
- { U_INT_8, offsetof(private_transform_substructure_t, transform_ton)},
+ { U_INT_8, offsetof(private_transform_substructure_t, transform_ton)},
/* transform identifier, as used by IKEv1 */
- { U_INT_8, offsetof(private_transform_substructure_t, transform_id_v1) },
+ { U_INT_8, offsetof(private_transform_substructure_t, transform_id_v1) },
/* transform identifier, as used by IKEv2 */
- { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[1]) },
- { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[2]) },
+ { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[1]) },
+ { RESERVED_BYTE, offsetof(private_transform_substructure_t, reserved[2]) },
/* Attributes in a transform attribute list */
- { TRANSFORM_ATTRIBUTES_V1, offsetof(private_transform_substructure_t, attributes) }
+ { PAYLOAD_LIST + TRANSFORM_ATTRIBUTE_V1,
+ offsetof(private_transform_substructure_t, attributes) }
};
/*