- removed memory allocation checks!!!
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file payload.h
|
||||
*
|
||||
* @brief Generic payload interface
|
||||
* @brief Generic payload interface.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@@ -32,11 +32,13 @@
|
||||
typedef enum payload_type_t payload_type_t;
|
||||
|
||||
/**
|
||||
* Payload-Types of a IKEv2-Message
|
||||
* Payload-Types of a IKEv2-Message.
|
||||
*
|
||||
*
|
||||
* Header and substructures are also defined as
|
||||
* payload types with values from PRIVATE USE space.
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
enum payload_type_t{
|
||||
|
||||
@@ -49,69 +51,84 @@ enum payload_type_t{
|
||||
* SA
|
||||
*/
|
||||
SECURITY_ASSOCIATION = 33,
|
||||
|
||||
/**
|
||||
* KE
|
||||
*/
|
||||
KEY_EXCHANGE = 34,
|
||||
|
||||
/**
|
||||
* IDi
|
||||
*/
|
||||
ID_INITIATOR = 35,
|
||||
|
||||
/**
|
||||
* IDr
|
||||
*/
|
||||
ID_RESPONDER = 36,
|
||||
|
||||
/**
|
||||
* CERT
|
||||
*/
|
||||
CERTIFICATE = 37,
|
||||
|
||||
/**
|
||||
* CERTREQ
|
||||
*/
|
||||
CERTIFICATE_REQUEST = 38,
|
||||
|
||||
/**
|
||||
* AUTH
|
||||
*/
|
||||
AUTHENTICATION = 39,
|
||||
|
||||
/**
|
||||
* Ni, Nr
|
||||
*/
|
||||
NONCE = 40,
|
||||
|
||||
/**
|
||||
* N
|
||||
*/
|
||||
NOTIFY = 41,
|
||||
|
||||
/**
|
||||
* D
|
||||
*/
|
||||
DELETE = 42,
|
||||
|
||||
/**
|
||||
* V
|
||||
*/
|
||||
VENDOR_ID = 43,
|
||||
|
||||
/**
|
||||
* TSi
|
||||
*/
|
||||
TRAFFIC_SELECTOR_INITIATOR = 44,
|
||||
|
||||
/**
|
||||
* TSr
|
||||
*/
|
||||
TRAFFIC_SELECTOR_RESPONDER = 45,
|
||||
|
||||
/**
|
||||
* E
|
||||
*/
|
||||
ENCRYPTED = 46,
|
||||
|
||||
/**
|
||||
* CP
|
||||
*/
|
||||
CONFIGURATION = 47,
|
||||
|
||||
/**
|
||||
* EAP
|
||||
*/
|
||||
EXTENSIBLE_AUTHENTICATION = 48,
|
||||
|
||||
/**
|
||||
* Header has a value of PRIVATE USE space
|
||||
* Header has a value of PRIVATE USE space.
|
||||
*
|
||||
* This payload type is not send over wire and just
|
||||
* used internally to handle IKEv2-Header like a payload.
|
||||
@@ -119,7 +136,7 @@ enum payload_type_t{
|
||||
HEADER = 140,
|
||||
|
||||
/**
|
||||
* PROPOSAL_SUBSTRUCTURE has a value of PRIVATE USE space
|
||||
* PROPOSAL_SUBSTRUCTURE has a value of PRIVATE USE space.
|
||||
*
|
||||
* This payload type is not send over wire and just
|
||||
* used internally to handle a proposal substructure like a payload.
|
||||
@@ -127,7 +144,7 @@ enum payload_type_t{
|
||||
PROPOSAL_SUBSTRUCTURE = 141,
|
||||
|
||||
/**
|
||||
* TRANSFORM_SUBSTRUCTURE has a value of PRIVATE USE space
|
||||
* TRANSFORM_SUBSTRUCTURE has a value of PRIVATE USE space.
|
||||
*
|
||||
* This payload type is not send over wire and just
|
||||
* used internally to handle a transform substructure like a payload.
|
||||
@@ -135,7 +152,7 @@ enum payload_type_t{
|
||||
TRANSFORM_SUBSTRUCTURE = 142,
|
||||
|
||||
/**
|
||||
* TRANSFORM_ATTRIBUTE has a value of PRIVATE USE space
|
||||
* TRANSFORM_ATTRIBUTE has a value of PRIVATE USE space.
|
||||
*
|
||||
* This payload type is not send over wire and just
|
||||
* used internally to handle a transform attribute like a payload.
|
||||
@@ -145,7 +162,7 @@ enum payload_type_t{
|
||||
|
||||
|
||||
/*
|
||||
* build string mapping array for payload_type_t
|
||||
* Build string mapping array for payload_type_t.
|
||||
*/
|
||||
extern mapping_t payload_type_m[];
|
||||
|
||||
@@ -154,19 +171,17 @@ typedef struct payload_t payload_t;
|
||||
|
||||
/**
|
||||
* @brief Generic interface for all payload types (inclusive
|
||||
* header and substructures)
|
||||
*
|
||||
* header and substructures).
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
struct payload_t {
|
||||
/**
|
||||
* @brief Destroys a payload and all included substructures.
|
||||
*
|
||||
* @param this payload to destroy
|
||||
* @return
|
||||
* SUCCESS in any case
|
||||
*/
|
||||
status_t (*destroy) (payload_t *this);
|
||||
void (*destroy) (payload_t *this);
|
||||
|
||||
/**
|
||||
* @brief Get encoding rules for this payload
|
||||
@@ -174,10 +189,8 @@ struct payload_t {
|
||||
* @param this calling object
|
||||
* @param[out] rules location to store pointer of first rule
|
||||
* @param[out] rule_count location to store number of rules
|
||||
* @return
|
||||
* SUCCESS in any case
|
||||
*/
|
||||
status_t (*get_encoding_rules) (payload_t *this, encoding_rule_t **rules, size_t *rule_count);
|
||||
void (*get_encoding_rules) (payload_t *this, encoding_rule_t **rules, size_t *rule_count);
|
||||
|
||||
/**
|
||||
* @brief get type of payload
|
||||
@@ -200,9 +213,8 @@ struct payload_t {
|
||||
*
|
||||
* @param this calling object
|
||||
* @param type type of next payload
|
||||
* @return SUCCESS in any case
|
||||
*/
|
||||
status_t (*set_next_type) (payload_t *this,payload_type_t type);
|
||||
void (*set_next_type) (payload_t *this,payload_type_t type);
|
||||
|
||||
/**
|
||||
* @brief get length of payload
|
||||
@@ -230,9 +242,7 @@ struct payload_t {
|
||||
* It supports all payload_t methods.
|
||||
*
|
||||
* @param type type of the payload to create
|
||||
* @return
|
||||
* - created payload, or
|
||||
* - NULL if failed
|
||||
* @return created payload
|
||||
*/
|
||||
|
||||
payload_t *payload_create(payload_type_t type);
|
||||
|
||||
Reference in New Issue
Block a user