aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon
diff options
context:
space:
mode:
Diffstat (limited to 'Source/charon')
-rw-r--r--Source/charon/generator.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/charon/generator.c b/Source/charon/generator.c
index 8f30b16ab..247b65fb4 100644
--- a/Source/charon/generator.c
+++ b/Source/charon/generator.c
@@ -322,6 +322,10 @@ static status_t generate_u_int_type (private_generator_t *this,encoding_type_t i
case ATTRIBUTE_TYPE:
number_of_bits = 15;
break;
+ case IKE_SPI:
+ number_of_bits = 64;
+ break;
+
default:
return FAILED;
}
@@ -436,6 +440,14 @@ static status_t generate_u_int_type (private_generator_t *this,encoding_type_t i
this->write_bytes_to_buffer(this,&int32_val_low,sizeof(u_int32_t));
break;
}
+
+ case IKE_SPI:
+ {
+ /* 64 bit are written as they come :-) */
+ this->write_bytes_to_buffer(this,(this->data_struct + offset),sizeof(u_int64_t));
+ this->logger->log_bytes(this->logger, RAW|MOST, " =>", (void*)(this->data_struct + offset), sizeof(u_int64_t));
+ break;
+ }
default:
this->logger->log(this->logger, ERROR, "U_INT Type %s is not supported", mapping_find(encoding_type_m,int_type));
@@ -721,12 +733,13 @@ static status_t generate_payload (private_generator_t *this,payload_t *payload)
i, mapping_find(encoding_type_m,rules[i].type));
switch (rules[i].type)
{
- /* all u int values and ATTRIBUTE_TYPE are generated in generate_u_int_type */
+ /* all u int values, IKE_SPI and ATTRIBUTE_TYPE are generated in generate_u_int_type */
case U_INT_4:
case U_INT_8:
case U_INT_16:
case U_INT_32:
case U_INT_64:
+ case IKE_SPI:
case ATTRIBUTE_TYPE:
{
status = this->generate_u_int_type(this,rules[i].type,rules[i].offset);