changed enum and structs names to _t
This commit is contained in:
@@ -41,12 +41,13 @@
|
||||
#include <encoding/payloads/notify_payload.h>
|
||||
#include <encoding/payloads/nonce_payload.h>
|
||||
|
||||
|
||||
typedef struct private_generator_t private_generator_t;
|
||||
|
||||
/**
|
||||
* Private part of a generator_t object
|
||||
*/
|
||||
typedef struct private_generator_s private_generator_t;
|
||||
|
||||
struct private_generator_s {
|
||||
struct private_generator_t {
|
||||
/**
|
||||
* Public part of a generator_t object
|
||||
*/
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
*/
|
||||
#define GENERATOR_DATA_BUFFER_INCREASE_VALUE 500
|
||||
|
||||
typedef struct generator_t generator_t;
|
||||
|
||||
/**
|
||||
*A generator_t object which generates payloads of specific type.
|
||||
*/
|
||||
typedef struct generator_s generator_t;
|
||||
|
||||
struct generator_s {
|
||||
struct generator_t {
|
||||
|
||||
/**
|
||||
* @brief Generates a specific payload from given payload object.
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
#include <encoding/payloads/payload.h>
|
||||
|
||||
|
||||
typedef struct supported_payload_entry_t supported_payload_entry_t;
|
||||
|
||||
/**
|
||||
* Supported payload entry used in message_rule_t
|
||||
*
|
||||
*/
|
||||
typedef struct supported_payload_entry_s supported_payload_entry_t;
|
||||
|
||||
struct supported_payload_entry_s {
|
||||
struct supported_payload_entry_t {
|
||||
/**
|
||||
* Payload type
|
||||
*/
|
||||
@@ -59,13 +59,13 @@ struct supported_payload_entry_s {
|
||||
size_t max_occurence;
|
||||
};
|
||||
|
||||
typedef struct message_rule_t message_rule_t;
|
||||
|
||||
/**
|
||||
* Message Rule used to find out which payloads are supported by each message type
|
||||
*
|
||||
*/
|
||||
typedef struct message_rule_s message_rule_t;
|
||||
|
||||
struct message_rule_s {
|
||||
struct message_rule_t {
|
||||
/**
|
||||
* Type of message
|
||||
*/
|
||||
|
||||
@@ -30,16 +30,14 @@
|
||||
#include <utils/linked_list.h>
|
||||
|
||||
|
||||
|
||||
typedef struct message_t message_t;
|
||||
|
||||
/**
|
||||
* @brief This class is used to represent an IKEv2-Message.
|
||||
*
|
||||
* An IKEv2-Message is either a request or response.
|
||||
*/
|
||||
typedef struct message_s message_t;
|
||||
|
||||
struct message_s {
|
||||
struct message_t {
|
||||
|
||||
/**
|
||||
* @brief Sets the IKE major version of the message.
|
||||
|
||||
@@ -43,14 +43,15 @@
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct private_parser_t private_parser_t;
|
||||
|
||||
/**
|
||||
* @private data stored in a context
|
||||
*
|
||||
* contains pointers and counters to store current state
|
||||
*/
|
||||
typedef struct private_parser_s private_parser_t;
|
||||
|
||||
struct private_parser_s {
|
||||
struct private_parser_t {
|
||||
/**
|
||||
* Public members, see parser_t
|
||||
*/
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <encoding/payloads/payload.h>
|
||||
|
||||
|
||||
typedef struct parser_t parser_t;
|
||||
|
||||
/**
|
||||
* @brief A parser_t object which parses payloads
|
||||
*
|
||||
@@ -35,9 +37,7 @@
|
||||
* payloads can be parsed out of the chunk using parse_payload.
|
||||
* The parser remains the state until destroyed.
|
||||
*/
|
||||
typedef struct parser_s parser_t;
|
||||
|
||||
struct parser_s {
|
||||
struct parser_t {
|
||||
|
||||
/**
|
||||
* @brief parses the next payload
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <definitions.h>
|
||||
|
||||
|
||||
typedef enum encoding_type_t encoding_type_t;
|
||||
|
||||
/**
|
||||
* @brief All different kinds of encoding types.
|
||||
*
|
||||
@@ -40,9 +42,7 @@
|
||||
* which has to be parsed or generated differently has its own
|
||||
* type defined here.
|
||||
*/
|
||||
typedef enum encoding_type_e encoding_type_t;
|
||||
|
||||
enum encoding_type_e{
|
||||
enum encoding_type_t{
|
||||
/**
|
||||
* Representing a 4 Bit unsigned int value
|
||||
*
|
||||
|
||||
@@ -31,9 +31,14 @@
|
||||
#include <encoding/payloads/encodings.h>
|
||||
#include <utils/allocator.h>
|
||||
|
||||
typedef struct private_ike_header_s private_ike_header_t;
|
||||
|
||||
struct private_ike_header_s {
|
||||
typedef struct private_ike_header_t private_ike_header_t;
|
||||
|
||||
/**
|
||||
* Private data of an ike_header_t Object
|
||||
*
|
||||
*/
|
||||
struct private_ike_header_t {
|
||||
/**
|
||||
* public interface
|
||||
*/
|
||||
|
||||
@@ -49,14 +49,14 @@
|
||||
*/
|
||||
#define IKE_HEADER_LENGTH 28
|
||||
|
||||
typedef enum exchange_type_t exchange_type_t;
|
||||
|
||||
/**
|
||||
* @brief Different types of IKE-Exchanges.
|
||||
*
|
||||
* See RFC for different types.
|
||||
*/
|
||||
typedef enum exchange_type_e exchange_type_t;
|
||||
|
||||
enum exchange_type_e{
|
||||
enum exchange_type_t{
|
||||
|
||||
/**
|
||||
* EXCHANGE_TYPE_UNDEFINED, not a official message type :-)
|
||||
@@ -82,6 +82,8 @@ enum exchange_type_e{
|
||||
|
||||
extern mapping_t exchange_type_m[];
|
||||
|
||||
typedef struct ike_header_t ike_header_t;
|
||||
|
||||
/**
|
||||
* Object representing an IKEv2-Header
|
||||
*
|
||||
@@ -90,9 +92,7 @@ extern mapping_t exchange_type_m[];
|
||||
* both versions of the IKE-protocol.
|
||||
*
|
||||
*/
|
||||
typedef struct ike_header_s ike_header_t;
|
||||
|
||||
struct ike_header_s {
|
||||
struct ike_header_t {
|
||||
/**
|
||||
* implements payload_t interface
|
||||
*/
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
#include <utils/allocator.h>
|
||||
|
||||
|
||||
typedef struct private_ke_payload_t private_ke_payload_t;
|
||||
|
||||
/**
|
||||
* Private data of an ke_payload_t Object
|
||||
*
|
||||
*/
|
||||
typedef struct private_ke_payload_s private_ke_payload_t;
|
||||
|
||||
struct private_ke_payload_s {
|
||||
struct private_ke_payload_t {
|
||||
/**
|
||||
* public ke_payload_t interface
|
||||
*/
|
||||
|
||||
@@ -42,15 +42,16 @@
|
||||
*/
|
||||
#define KE_PAYLOAD_HEADER_LENGTH 8
|
||||
|
||||
|
||||
typedef struct ke_payload_t ke_payload_t;
|
||||
|
||||
/**
|
||||
* Object representing an IKEv2-KE Payload
|
||||
*
|
||||
* The KE Payload format is described in RFC section 3.4.
|
||||
*
|
||||
*/
|
||||
typedef struct ke_payload_s ke_payload_t;
|
||||
|
||||
struct ke_payload_s {
|
||||
struct ke_payload_t {
|
||||
/**
|
||||
* implements payload_t interface
|
||||
*/
|
||||
|
||||
@@ -31,14 +31,13 @@
|
||||
#include <utils/allocator.h>
|
||||
|
||||
|
||||
typedef struct private_nonce_payload_t private_nonce_payload_t;
|
||||
|
||||
/**
|
||||
* Private data of an nonce_payload_t' Object
|
||||
*
|
||||
*/
|
||||
typedef struct private_nonce_payload_s private_nonce_payload_t;
|
||||
|
||||
struct private_nonce_payload_s {
|
||||
struct private_nonce_payload_t {
|
||||
/**
|
||||
* public nonce_payload_t interface
|
||||
*/
|
||||
|
||||
@@ -33,15 +33,15 @@
|
||||
*/
|
||||
#define NONCE_PAYLOAD_HEADER_LENGTH 4
|
||||
|
||||
typedef struct nonce_payload_t nonce_payload_t;
|
||||
|
||||
/**
|
||||
* Object representing an IKEv2 Nonce payload
|
||||
*
|
||||
* The Nonce payload format is described in draft section 3.3.
|
||||
*
|
||||
*/
|
||||
typedef struct nonce_payload_s nonce_payload_t;
|
||||
|
||||
struct nonce_payload_s {
|
||||
struct nonce_payload_t {
|
||||
/**
|
||||
* implements payload_t interface
|
||||
*/
|
||||
|
||||
@@ -32,13 +32,14 @@
|
||||
#include <encoding/payloads/encodings.h>
|
||||
#include <utils/allocator.h>
|
||||
|
||||
|
||||
typedef struct private_notify_payload_t private_notify_payload_t;
|
||||
|
||||
/**
|
||||
* Private data of an notify_payload_t Object
|
||||
*
|
||||
*/
|
||||
typedef struct private_notify_payload_s private_notify_payload_t;
|
||||
|
||||
struct private_notify_payload_s {
|
||||
struct private_notify_payload_t {
|
||||
/**
|
||||
* public notify_payload_t interface
|
||||
*/
|
||||
|
||||
@@ -42,15 +42,15 @@
|
||||
*/
|
||||
#define NOTIFY_PAYLOAD_HEADER_LENGTH 8
|
||||
|
||||
typedef struct notify_payload_t notify_payload_t;
|
||||
|
||||
/**
|
||||
* Object representing an IKEv2-Notify Payload
|
||||
*
|
||||
* The Notify Payload format is described in Draft section 3.10.
|
||||
*
|
||||
*/
|
||||
typedef struct notify_payload_s notify_payload_t;
|
||||
|
||||
struct notify_payload_s {
|
||||
struct notify_payload_t {
|
||||
/**
|
||||
* implements payload_t interface
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <encoding/payloads/encodings.h>
|
||||
|
||||
|
||||
typedef enum payload_type_t payload_type_t;
|
||||
|
||||
/**
|
||||
* Payload-Types of a IKEv2-Message
|
||||
*
|
||||
@@ -36,9 +38,7 @@
|
||||
* Header and substructures are also defined as
|
||||
* payload types with values from PRIVATE USE space.
|
||||
*/
|
||||
typedef enum payload_type_e payload_type_t;
|
||||
|
||||
enum payload_type_e{
|
||||
enum payload_type_t{
|
||||
|
||||
/**
|
||||
* NO_PAYLOAD
|
||||
@@ -150,15 +150,15 @@ enum payload_type_e{
|
||||
extern mapping_t payload_type_m[];
|
||||
|
||||
|
||||
typedef struct payload_t payload_t;
|
||||
|
||||
/**
|
||||
* @brief Generic interface for all payload types (inclusive
|
||||
* header and substructures)
|
||||
*
|
||||
*
|
||||
*/
|
||||
typedef struct payload_s payload_t;
|
||||
|
||||
struct payload_s {
|
||||
struct payload_t {
|
||||
/**
|
||||
* @brief Destroys a payload and all included substructures.
|
||||
*
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
#include <utils/allocator.h>
|
||||
#include <utils/linked_list.h>
|
||||
|
||||
typedef struct private_proposal_substructure_t private_proposal_substructure_t;
|
||||
|
||||
/**
|
||||
* Private data of an proposal_substructure_t' Object
|
||||
*
|
||||
*/
|
||||
typedef struct private_proposal_substructure_s private_proposal_substructure_t;
|
||||
|
||||
struct private_proposal_substructure_s {
|
||||
struct private_proposal_substructure_t {
|
||||
/**
|
||||
* public proposal_substructure_t interface
|
||||
*/
|
||||
|
||||
@@ -37,27 +37,27 @@
|
||||
#define PROPOSAL_SUBSTRUCTURE_HEADER_LENGTH 8
|
||||
|
||||
|
||||
typedef enum protocol_id_t protocol_id_t;
|
||||
|
||||
/**
|
||||
* Protocol ID of a proposal
|
||||
*/
|
||||
typedef enum protocol_id_e protocol_id_t;
|
||||
|
||||
enum protocol_id_e {
|
||||
enum protocol_id_t {
|
||||
UNDEFINED_PROTOCOL_ID = 201,
|
||||
IKE = 1,
|
||||
AH = 2,
|
||||
ESP = 3,
|
||||
};
|
||||
|
||||
typedef struct proposal_substructure_t proposal_substructure_t;
|
||||
|
||||
/**
|
||||
* Object representing an IKEv2- PROPOSAL SUBSTRUCTURE
|
||||
*
|
||||
* The PROPOSAL SUBSTRUCTURE format is described in RFC section 3.3.1.
|
||||
*
|
||||
*/
|
||||
typedef struct proposal_substructure_s proposal_substructure_t;
|
||||
|
||||
struct proposal_substructure_s {
|
||||
struct proposal_substructure_t {
|
||||
/**
|
||||
* implements payload_t interface
|
||||
*/
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
#include <utils/linked_list.h>
|
||||
|
||||
|
||||
typedef struct private_sa_payload_t private_sa_payload_t;
|
||||
|
||||
/**
|
||||
* Private data of an sa_payload_t' Object
|
||||
*
|
||||
*/
|
||||
typedef struct private_sa_payload_s private_sa_payload_t;
|
||||
|
||||
struct private_sa_payload_s {
|
||||
struct private_sa_payload_t {
|
||||
/**
|
||||
* public sa_payload_t interface
|
||||
*/
|
||||
|
||||
@@ -41,15 +41,15 @@
|
||||
*/
|
||||
#define SA_PAYLOAD_HEADER_LENGTH 4
|
||||
|
||||
typedef struct sa_payload_t sa_payload_t;
|
||||
|
||||
/**
|
||||
* Object representing an IKEv2-SA Payload
|
||||
*
|
||||
* The SA Payload format is described in RFC section 3.3.
|
||||
*
|
||||
*/
|
||||
typedef struct sa_payload_s sa_payload_t;
|
||||
|
||||
struct sa_payload_s {
|
||||
struct sa_payload_t {
|
||||
/**
|
||||
* implements payload_t interface
|
||||
*/
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
#include <types.h>
|
||||
#include <utils/allocator.h>
|
||||
|
||||
typedef struct private_transform_attribute_t private_transform_attribute_t;
|
||||
|
||||
/**
|
||||
* Private data of an transform_attribute_t Object
|
||||
*
|
||||
*/
|
||||
typedef struct private_transform_attribute_s private_transform_attribute_t;
|
||||
|
||||
struct private_transform_attribute_s {
|
||||
struct private_transform_attribute_t {
|
||||
/**
|
||||
* public transform_attribute_t interface
|
||||
*/
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
#include <encoding/payloads/payload.h>
|
||||
|
||||
|
||||
typedef enum transform_attribute_type_t transform_attribute_type_t;
|
||||
|
||||
/**
|
||||
* Type of the attribute, as in IKEv2 draft 3.3.5
|
||||
*/
|
||||
typedef enum transform_attribute_type_e transform_attribute_type_t;
|
||||
|
||||
enum transform_attribute_type_e {
|
||||
enum transform_attribute_type_t {
|
||||
ATTRIBUTE_UNDEFINED = 16384,
|
||||
KEY_LENGTH = 14
|
||||
};
|
||||
@@ -44,15 +44,15 @@ enum transform_attribute_type_e {
|
||||
*/
|
||||
extern mapping_t transform_attribute_type_m[];
|
||||
|
||||
typedef struct transform_attribute_t transform_attribute_t;
|
||||
|
||||
/**
|
||||
* Object representing an IKEv2- TRANSFORM Attribute
|
||||
*
|
||||
* The TRANSFORM ATTRIBUTE format is described in RFC section 3.3.5.
|
||||
*
|
||||
*/
|
||||
typedef struct transform_attribute_s transform_attribute_t;
|
||||
|
||||
struct transform_attribute_s {
|
||||
struct transform_attribute_t {
|
||||
/**
|
||||
* implements payload_t interface
|
||||
*/
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
#include <utils/allocator.h>
|
||||
#include <utils/linked_list.h>
|
||||
|
||||
|
||||
typedef struct private_transform_substructure_t private_transform_substructure_t;
|
||||
|
||||
/**
|
||||
* Private data of an transform_substructure_t' Object
|
||||
*
|
||||
*/
|
||||
typedef struct private_transform_substructure_s private_transform_substructure_t;
|
||||
|
||||
struct private_transform_substructure_s {
|
||||
struct private_transform_substructure_t {
|
||||
/**
|
||||
* public transform_substructure_t interface
|
||||
*/
|
||||
|
||||
@@ -43,12 +43,12 @@
|
||||
#define TRANSFORM_SUBSTRUCTURE_HEADER_LENGTH 8
|
||||
|
||||
|
||||
typedef enum transform_type_t transform_type_t;
|
||||
|
||||
/**
|
||||
* Type of a transform, as in IKEv2 draft 3.3.2
|
||||
*/
|
||||
typedef enum transform_type_e transform_type_t;
|
||||
|
||||
enum transform_type_e {
|
||||
enum transform_type_t {
|
||||
UNDEFINED_TRANSFORM_TYPE = 241,
|
||||
ENCRYPTION_ALGORITHM = 1,
|
||||
PSEUDO_RANDOM_FUNCTION = 2,
|
||||
@@ -62,12 +62,12 @@ enum transform_type_e {
|
||||
*/
|
||||
extern mapping_t transform_type_m[];
|
||||
|
||||
typedef enum encryption_algorithm_t encryption_algorithm_t;
|
||||
|
||||
/**
|
||||
* Encryption algorithm, as in IKEv2 draft 3.3.2
|
||||
*/
|
||||
typedef enum encryption_algorithm_e encryption_algorithm_t;
|
||||
|
||||
enum encryption_algorithm_e {
|
||||
enum encryption_algorithm_t {
|
||||
ENCR_UNDEFINED = 1024,
|
||||
ENCR_DES_IV64 = 1,
|
||||
ENCR_DES = 2,
|
||||
@@ -89,12 +89,12 @@ enum encryption_algorithm_e {
|
||||
*/
|
||||
extern mapping_t encryption_algorithm_m[];
|
||||
|
||||
typedef enum pseudo_random_function_t pseudo_random_function_t;
|
||||
|
||||
/**
|
||||
* Pseudo random function, as in IKEv2 draft 3.3.2
|
||||
*/
|
||||
typedef enum pseudo_random_function_e pseudo_random_function_t;
|
||||
|
||||
enum pseudo_random_function_e {
|
||||
enum pseudo_random_function_t {
|
||||
PRF_UNDEFINED = 1024,
|
||||
PRF_HMAC_MD5 = 1,
|
||||
PRF_HMAC_SHA1 = 2,
|
||||
@@ -107,12 +107,12 @@ enum pseudo_random_function_e {
|
||||
*/
|
||||
extern mapping_t pseudo_random_function_m[];
|
||||
|
||||
typedef enum integrity_algorithm_t integrity_algorithm_t;
|
||||
|
||||
/**
|
||||
* Integrity algorithm, as in IKEv2 draft 3.3.2
|
||||
*/
|
||||
typedef enum integrity_algorithm_e integrity_algorithm_t;
|
||||
|
||||
enum integrity_algorithm_e {
|
||||
enum integrity_algorithm_t {
|
||||
AUTH_UNDEFINED = 1024,
|
||||
AUTH_HMAC_MD5_96 = 1,
|
||||
AUTH_HMAC_SHA1_96 = 2,
|
||||
@@ -127,12 +127,12 @@ enum integrity_algorithm_e {
|
||||
extern mapping_t integrity_algorithm_m[];
|
||||
|
||||
|
||||
typedef enum diffie_hellman_group_t diffie_hellman_group_t;
|
||||
|
||||
/**
|
||||
* Diffie-Hellman group, as in IKEv2 draft 3.3.2 and RFC 3526
|
||||
*/
|
||||
typedef enum diffie_hellman_group_e diffie_hellman_group_t;
|
||||
|
||||
enum diffie_hellman_group_e {
|
||||
enum diffie_hellman_group_t {
|
||||
MODP_UNDEFINED = 1024,
|
||||
MODP_768_BIT = 1,
|
||||
MODP_1024_BIT = 2,
|
||||
@@ -149,12 +149,12 @@ enum diffie_hellman_group_e {
|
||||
*/
|
||||
extern mapping_t diffie_hellman_group_m[];
|
||||
|
||||
typedef enum extended_sequence_numbers_t extended_sequence_numbers_t;
|
||||
|
||||
/**
|
||||
* Extended sequence numbers, as in IKEv2 draft 3.3.2
|
||||
*/
|
||||
typedef enum extended_sequence_numbers_e extended_sequence_numbers_t;
|
||||
|
||||
enum extended_sequence_numbers_e {
|
||||
enum extended_sequence_numbers_t {
|
||||
NO_EXT_SEQ_NUMBERS = 0,
|
||||
EXT_SEQ_NUMBERS = 1
|
||||
};
|
||||
@@ -164,15 +164,15 @@ enum extended_sequence_numbers_e {
|
||||
*/
|
||||
extern mapping_t extended_sequence_numbers_m[];
|
||||
|
||||
typedef struct transform_substructure_t transform_substructure_t;
|
||||
|
||||
/**
|
||||
* Object representing an IKEv2- TRANSFORM SUBSTRUCTURE
|
||||
*
|
||||
* The TRANSFORM SUBSTRUCTURE format is described in RFC section 3.3.2.
|
||||
*
|
||||
*/
|
||||
typedef struct transform_substructure_s transform_substructure_t;
|
||||
|
||||
struct transform_substructure_s {
|
||||
struct transform_substructure_t {
|
||||
/**
|
||||
* implements payload_t interface
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user