- nonce payload added
- tested
This commit is contained in:
@@ -47,6 +47,7 @@ mapping_t encoding_type_t_mappings[] = {
|
||||
{ATTRIBUTE_TYPE, "ATTRIBUTE_TYPE"},
|
||||
{ATTRIBUTE_LENGTH_OR_VALUE, "ATTRIBUTE_LENGTH_OR_VALUE"},
|
||||
{ATTRIBUTE_VALUE, "ATTRIBUTE_VALUE"},
|
||||
{NONCE_DATA, "NONCE_DATA"},
|
||||
{MAPPING_END, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -296,7 +296,17 @@ enum encoding_type_e{
|
||||
*
|
||||
* When parsing SPI_SIZE bytes are read and written into the chunk pointing to.
|
||||
*/
|
||||
ATTRIBUTE_VALUE
|
||||
ATTRIBUTE_VALUE,
|
||||
|
||||
/**
|
||||
* Representating a Nonce Data field
|
||||
*
|
||||
* When generating the content of the chunkt pointing to
|
||||
* is written.
|
||||
*
|
||||
* When parsing (Payload Length - 4) bytes are read and written into the chunk pointing to.
|
||||
*/
|
||||
NONCE_DATA
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -97,7 +97,7 @@ encoding_rule_t nonce_payload_encodings[] = {
|
||||
/* Length of the whole nonce payload*/
|
||||
{ PAYLOAD_LENGTH, offsetof(private_nonce_payload_t, payload_length) },
|
||||
/* some nonce bytes, lenth is defined in PAYLOAD_LENGTH */
|
||||
{ NONCE, offsetof(private_nonce_payload_t, nonce) }
|
||||
{ NONCE_DATA, offsetof(private_nonce_payload_t, nonce) }
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "ike_header.h"
|
||||
#include "sa_payload.h"
|
||||
#include "nonce_payload.h"
|
||||
|
||||
|
||||
|
||||
@@ -76,6 +77,8 @@ payload_t *payload_create(payload_type_t type)
|
||||
return (payload_t*)transform_substructure_create();
|
||||
case TRANSFORM_ATTRIBUTE:
|
||||
return (payload_t*)transform_attribute_create();
|
||||
case NONCE:
|
||||
return (payload_t*)nonce_payload_create();
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user