break;
case ADDRESS:
case SPI:
- case KEY_EXCHANGE_DATA:
- case KEY_EXCHANGE_DATA_V1:
- case NOTIFICATION_DATA:
- case NONCE_DATA:
- case HASH_DATA:
- case ID_DATA:
- case AUTH_DATA:
- case CERT_DATA:
- case CERTREQ_DATA:
- case SPIS:
- case CONFIGURATION_ATTRIBUTE_VALUE:
- case VID_DATA:
- case EAP_DATA:
- case ENCRYPTED_DATA:
- case UNKNOWN_DATA:
+ case CHUNK_DATA:
generate_from_chunk(this, rules[i].offset);
break;
case PROPOSALS:
}
break;
}
- /* chunks */
- case NONCE_DATA:
- case HASH_DATA:
- case ID_DATA:
- case AUTH_DATA:
- case CERT_DATA:
- case CERTREQ_DATA:
- case EAP_DATA:
- case SPIS:
- case VID_DATA:
- case CONFIGURATION_ATTRIBUTE_VALUE:
- case KEY_EXCHANGE_DATA:
- case KEY_EXCHANGE_DATA_V1:
- case NOTIFICATION_DATA:
- case ENCRYPTED_DATA:
- case UNKNOWN_DATA:
+ case CHUNK_DATA:
{
if (payload_length < header_length ||
!parse_chunk(this, rule_number, output + rule->offset,
{ RESERVED_BYTE, offsetof(private_auth_payload_t, reserved_byte[1]) },
{ RESERVED_BYTE, offsetof(private_auth_payload_t, reserved_byte[2]) },
/* some auth data bytes, length is defined in PAYLOAD_LENGTH */
- { AUTH_DATA, offsetof(private_auth_payload_t, auth_data) }
+ { CHUNK_DATA, offsetof(private_auth_payload_t, auth_data) }
};
/*
/* 1 Byte CERT type*/
{ U_INT_8, offsetof(private_cert_payload_t, encoding) },
/* some cert data bytes, length is defined in PAYLOAD_LENGTH */
- { CERT_DATA, offsetof(private_cert_payload_t, data) }
+ { CHUNK_DATA, offsetof(private_cert_payload_t, data) }
};
/*
/* 1 Byte CERTREQ type*/
{ U_INT_8, offsetof(private_certreq_payload_t, encoding) },
/* some certreq data bytes, length is defined in PAYLOAD_LENGTH */
- { CERTREQ_DATA, offsetof(private_certreq_payload_t, data) }
+ { CHUNK_DATA, offsetof(private_certreq_payload_t, data) }
};
/*
/* Length of attribute value */
{ CONFIGURATION_ATTRIBUTE_LENGTH, offsetof(private_configuration_attribute_t, length) },
/* Value of attribute if attribute format flag is zero */
- { CONFIGURATION_ATTRIBUTE_VALUE, offsetof(private_configuration_attribute_t, value) }
+ { CHUNK_DATA, offsetof(private_configuration_attribute_t, value) }
};
/*
{ U_INT_8, offsetof(private_delete_payload_t, spi_size) },
{ U_INT_16, offsetof(private_delete_payload_t, spi_count) },
/* some delete data bytes, length is defined in PAYLOAD_LENGTH */
- { SPIS, offsetof(private_delete_payload_t, spis) }
+ { CHUNK_DATA, offsetof(private_delete_payload_t, spis) }
};
/*
/* Length of the whole payload*/
{ PAYLOAD_LENGTH, offsetof(private_eap_payload_t, payload_length) },
/* chunt to data, starting at "code" */
- { EAP_DATA, offsetof(private_eap_payload_t, data) },
+ { CHUNK_DATA, offsetof(private_eap_payload_t, data) },
};
/*
#include "encodings.h"
-ENUM(encoding_type_names, U_INT_4, ENCRYPTED_DATA,
+ENUM(encoding_type_names, U_INT_4, IKE_SPI,
"U_INT_4",
"U_INT_8",
"U_INT_16",
"HEADER_LENGTH",
"SPI_SIZE",
"SPI",
- "KEY_EXCHANGE_DATA",
- "KEY_EXCHANGE_DATA_V1",
- "NOTIFICATION_DATA",
"PROPOSALS",
"PROPOSALS_V1",
"TRANSFORMS",
"TRANSFORM_ATTRIBUTES",
"TRANSFORM_ATTRIBUTES_V1",
"CONFIGURATION_ATTRIBUTES",
- "CONFIGURATION_ATTRIBUTE_VALUE",
"ATTRIBUTE_FORMAT",
"ATTRIBUTE_TYPE",
"ATTRIBUTE_LENGTH_OR_VALUE",
"TRAFFIC_SELECTORS",
"TS_TYPE",
"ADDRESS",
- "NONCE_DATA",
- "HASH_DATA",
- "ID_DATA",
- "AUTH_DATA",
- "CERT_DATA",
- "CERTREQ_DATA",
- "EAP_DATA",
- "SPIS",
- "VID_DATA",
- "UNKNOWN_DATA",
+ "CHUNK_DATA",
"IKE_SPI",
- "ENCRYPTED_DATA",
);
*/
SPI,
- /**
- * Representating a Key Exchange 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.
- */
- KEY_EXCHANGE_DATA,
-
- /**
- * Same as KEY_EXCHANGE_DATA, but for KEY_EXCHANGE_V1
- */
- KEY_EXCHANGE_DATA_V1,
-
- /**
- * Representating a Notification field.
- *
- * When generating the content of the chunkt pointing to
- * is written.
- *
- * When parsing (Payload Length - spi size - 8) bytes are read and written into the chunk pointing to.
- */
- NOTIFICATION_DATA,
-
/**
* Representating one or more proposal substructures.
*
*/
CONFIGURATION_ATTRIBUTES,
- /**
- *
- * 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.
- */
- CONFIGURATION_ATTRIBUTE_VALUE,
-
/**
* Representing a 1 Bit flag specifying the format of a transform attribute.
*
* is moved 1 bit forward afterwards.
*/
ATTRIBUTE_FORMAT,
+
/**
* Representing a 15 Bit unsigned int value used as attribute type
* in an attribute transform.
ADDRESS,
/**
- * 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,
-
- /**
- * Representating a Hash 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.
- */
- HASH_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.
+ * Representing a variable length byte field.
*/
- ID_DATA,
-
- /**
- * Representating a AUTH 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.
- */
- AUTH_DATA,
-
- /**
- * Representating a CERT Data field.
- *
- * When generating the content of the chunkt pointing to
- * is written.
- *
- * When parsing (Payload Length - 5) bytes are read and written into the chunk pointing to.
- */
- CERT_DATA,
-
- /**
- * Representating a CERTREQ Data field.
- *
- * When generating the content of the chunkt pointing to
- * is written.
- *
- * When parsing (Payload Length - 5) bytes are read and written into the chunk pointing to.
- */
- CERTREQ_DATA,
-
- /**
- * Representating an EAP message 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.
- */
- EAP_DATA,
-
- /**
- * Representating the SPIS field in a DELETE payload.
- *
- * 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.
- */
- SPIS,
-
- /**
- * Representating the VID DATA field in a VENDOR ID payload.
- *
- * 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.
- */
- VID_DATA,
-
- /**
- * Representating the DATA of an unknown payload.
- *
- * 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.
- */
- UNKNOWN_DATA,
+ CHUNK_DATA,
/**
* Representating an IKE_SPI field in an IKEv2 Header.
* When parsing 8 bytes are read and written into the u_int64_t pointing to.
*/
IKE_SPI,
-
- /**
- * Representing the encrypted data body of a encryption payload.
- */
- ENCRYPTED_DATA,
};
/**
/* Length of the whole encryption payload*/
{ PAYLOAD_LENGTH, offsetof(private_encryption_payload_t, payload_length) },
/* encrypted data, stored in a chunk. contains iv, data, padding */
- { ENCRYPTED_DATA, offsetof(private_encryption_payload_t, encrypted) },
+ { CHUNK_DATA, offsetof(private_encryption_payload_t, encrypted) },
};
/*
/* Length of the whole payload*/
{ PAYLOAD_LENGTH, offsetof(private_hash_payload_t, payload_length) },
/* Hash Data is from variable size */
- { HASH_DATA, offsetof(private_hash_payload_t, hash) },
+ { CHUNK_DATA, offsetof(private_hash_payload_t, hash) },
};
/*
{ RESERVED_BYTE, offsetof(private_id_payload_t, reserved_byte[1])},
{ RESERVED_BYTE, offsetof(private_id_payload_t, reserved_byte[2])},
/* some id data bytes, length is defined in PAYLOAD_LENGTH */
- { ID_DATA, offsetof(private_id_payload_t, id_data) },
+ { CHUNK_DATA, offsetof(private_id_payload_t, id_data) },
};
/*
{ U_INT_8, offsetof(private_id_payload_t, protocol_id) },
{ U_INT_16, offsetof(private_id_payload_t, port) },
/* some id data bytes, length is defined in PAYLOAD_LENGTH */
- { ID_DATA, offsetof(private_id_payload_t, id_data) },
+ { CHUNK_DATA, offsetof(private_id_payload_t, id_data) },
};
/*
{ RESERVED_BYTE, offsetof(private_ke_payload_t, reserved_byte[0])},
{ RESERVED_BYTE, offsetof(private_ke_payload_t, reserved_byte[1])},
/* Key Exchange Data is from variable size */
- { KEY_EXCHANGE_DATA, offsetof(private_ke_payload_t, key_exchange_data)},
+ { CHUNK_DATA, offsetof(private_ke_payload_t, key_exchange_data)},
};
/*
/* Length of the whole payload*/
{ PAYLOAD_LENGTH, offsetof(private_ke_payload_t, payload_length) },
/* Key Exchange Data is from variable size */
- { KEY_EXCHANGE_DATA_V1, offsetof(private_ke_payload_t, key_exchange_data)},
+ { CHUNK_DATA, offsetof(private_ke_payload_t, key_exchange_data)},
};
/*
/* 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_DATA, offsetof(private_nonce_payload_t, nonce) },
+ { CHUNK_DATA, offsetof(private_nonce_payload_t, nonce) },
};
/* 1 2 3
/* SPI as variable length field*/
{ SPI, offsetof(private_notify_payload_t, spi) },
/* Key Exchange Data is from variable size */
- { NOTIFICATION_DATA,offsetof(private_notify_payload_t, notification_data) }
+ { CHUNK_DATA, offsetof(private_notify_payload_t, notification_data) }
};
/*
/* Length of the whole payload*/
{ PAYLOAD_LENGTH, offsetof(private_unknown_payload_t, payload_length) },
/* some unknown data bytes, length is defined in PAYLOAD_LENGTH */
- { UNKNOWN_DATA, offsetof(private_unknown_payload_t, data) },
+ { CHUNK_DATA, offsetof(private_unknown_payload_t, data) },
};
/*
/* Length of the whole payload*/
{ PAYLOAD_LENGTH, offsetof(private_vendor_id_payload_t, payload_length)},
/* some vendor_id data bytes, length is defined in PAYLOAD_LENGTH */
- { VID_DATA, offsetof(private_vendor_id_payload_t, data) }
+ { CHUNK_DATA, offsetof(private_vendor_id_payload_t, data) }
};
/*