- added and tested id_payload_t
This commit is contained in:
@@ -34,6 +34,10 @@ OBJS+= $(BUILD_DIR)notify_payload.o
|
||||
$(BUILD_DIR)notify_payload.o : $(PAYLOADS_DIR)notify_payload.c $(PAYLOADS_DIR)notify_payload.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)id_payload.o
|
||||
$(BUILD_DIR)id_payload.o : $(PAYLOADS_DIR)id_payload.c $(PAYLOADS_DIR)id_payload.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)payload.o
|
||||
$(BUILD_DIR)payload.o : $(PAYLOADS_DIR)payload.c $(PAYLOADS_DIR)payload.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
@@ -48,5 +48,7 @@ mapping_t encoding_type_m[] = {
|
||||
{ATTRIBUTE_LENGTH_OR_VALUE, "ATTRIBUTE_LENGTH_OR_VALUE"},
|
||||
{ATTRIBUTE_VALUE, "ATTRIBUTE_VALUE"},
|
||||
{NONCE_DATA, "NONCE_DATA"},
|
||||
{ID_DATA, "ID_DATA"},
|
||||
{ENCRYPTED_DATA, "ENCRYPTED_DATA"},
|
||||
{MAPPING_END, NULL}
|
||||
};
|
||||
|
||||
@@ -308,6 +308,16 @@ enum encoding_type_t{
|
||||
* When parsing (Payload Length - 4) bytes are read and written into the chunk pointing to.
|
||||
*/
|
||||
NONCE_DATA,
|
||||
|
||||
/**
|
||||
* Representating a ID Data field.
|
||||
*
|
||||
* When generating the content of the chunkt pointing to
|
||||
* is written.
|
||||
*
|
||||
* When parsing (Payload Length - 8) bytes are read and written into the chunk pointing to.
|
||||
*/
|
||||
ID_DATA,
|
||||
|
||||
/**
|
||||
* Representating an IKE_SPI field in an IKEv2 Header.
|
||||
@@ -319,6 +329,9 @@ enum encoding_type_t{
|
||||
*/
|
||||
IKE_SPI,
|
||||
|
||||
/**
|
||||
* Representing the encrypted data body of a encryption payload.
|
||||
*/
|
||||
ENCRYPTED_DATA,
|
||||
|
||||
};
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <encoding/payloads/ike_header.h>
|
||||
#include <encoding/payloads/sa_payload.h>
|
||||
#include <encoding/payloads/nonce_payload.h>
|
||||
#include <encoding/payloads/id_payload.h>
|
||||
#include <encoding/payloads/ke_payload.h>
|
||||
#include <encoding/payloads/notify_payload.h>
|
||||
|
||||
@@ -81,6 +82,10 @@ payload_t *payload_create(payload_type_t type)
|
||||
return (payload_t*)transform_attribute_create();
|
||||
case NONCE:
|
||||
return (payload_t*)nonce_payload_create();
|
||||
case ID_INITIATOR:
|
||||
return (payload_t*)id_payload_create(TRUE);
|
||||
case ID_RESPONDER:
|
||||
return (payload_t*)id_payload_create(FALSE);
|
||||
case KEY_EXCHANGE:
|
||||
return (payload_t*)ke_payload_create();
|
||||
case NOTIFY:
|
||||
|
||||
Reference in New Issue
Block a user