aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/encoding
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-05-18 13:36:56 +0200
committerMartin Willi <martin@strongswan.org>2009-05-18 13:36:56 +0200
commit79a2afedd5fd939483ebfd45a42c661743b96872 (patch)
tree83746bf8ef4370f8218993d9f41867d109174340 /src/charon/encoding
parent4274885855e4f5ef14fafb396bd0ef6984573ef6 (diff)
downloadstrongswan-79a2afedd5fd939483ebfd45a42c661743b96872.tar.bz2
strongswan-79a2afedd5fd939483ebfd45a42c661743b96872.tar.xz
removed unused 64-bit integer parsing rule
Diffstat (limited to 'src/charon/encoding')
-rw-r--r--src/charon/encoding/generator.c18
-rw-r--r--src/charon/encoding/parser.c34
-rw-r--r--src/charon/encoding/payloads/encodings.c1
-rw-r--r--src/charon/encoding/payloads/encodings.h13
4 files changed, 0 insertions, 66 deletions
diff --git a/src/charon/encoding/generator.c b/src/charon/encoding/generator.c
index 48317069d..a969ad049 100644
--- a/src/charon/encoding/generator.c
+++ b/src/charon/encoding/generator.c
@@ -242,9 +242,6 @@ static void generate_u_int_type(private_generator_t *this,
case U_INT_32:
number_of_bits = 32;
break;
- case U_INT_64:
- number_of_bits = 64;
- break;
case ATTRIBUTE_TYPE:
number_of_bits = 15;
break;
@@ -358,20 +355,6 @@ static void generate_u_int_type(private_generator_t *this,
write_bytes_to_buffer(this, &int32_val, sizeof(u_int32_t));
break;
}
- case U_INT_64:
- {
- /* 64 bit integers are written as two 32 bit integers */
- u_int32_t int32_val_low = htonl(*((u_int32_t*)(this->data_struct + offset)));
- u_int32_t int32_val_high = htonl(*((u_int32_t*)(this->data_struct + offset) + 1));
- DBG3(DBG_ENC, " => %b %b",
- (void*)&int32_val_low, sizeof(int32_val_low),
- (void*)&int32_val_high, sizeof(int32_val_high));
- /* TODO add support for big endian machines */
- write_bytes_to_buffer(this, &int32_val_high, sizeof(u_int32_t));
- write_bytes_to_buffer(this, &int32_val_low, sizeof(u_int32_t));
- break;
- }
-
case IKE_SPI:
{
/* 64 bit are written as they come :-) */
@@ -548,7 +531,6 @@ static void generate_payload (private_generator_t *this,payload_t *payload)
case U_INT_8:
case U_INT_16:
case U_INT_32:
- case U_INT_64:
case IKE_SPI:
case TS_TYPE:
case ATTRIBUTE_TYPE:
diff --git a/src/charon/encoding/parser.c b/src/charon/encoding/parser.c
index d73ca279f..bef8219bf 100644
--- a/src/charon/encoding/parser.c
+++ b/src/charon/encoding/parser.c
@@ -244,31 +244,6 @@ static bool parse_uint32(private_parser_t *this, int rule_number,
}
/**
- * Parse a 64-Bit unsigned integer from the current parsing position.
- */
-static bool parse_uint64(private_parser_t *this, int rule_number,
- u_int64_t *output_pos)
-{
- if (this->byte_pos + sizeof(u_int64_t) > this->input_roof)
- {
- return short_input(this, rule_number);
- }
- if (this->bit_pos)
- {
- return bad_bitpos(this, rule_number);
- }
- if (output_pos)
- {
- /* assuming little endian host order */
- *(output_pos + 1) = ntohl(*((u_int32_t*)this->byte_pos));
- *output_pos = ntohl(*(((u_int32_t*)this->byte_pos) + 1));
- DBG3(DBG_ENC, " => %b", output_pos, sizeof(u_int64_t));
- }
- this->byte_pos += sizeof(u_int64_t);
- return TRUE;
-}
-
-/**
* Parse a given amount of bytes and writes them to a specific location
*/
static bool parse_bytes(private_parser_t *this, int rule_number,
@@ -459,15 +434,6 @@ static status_t parse_payload(private_parser_t *this,
}
break;
}
- case U_INT_64:
- {
- if (!parse_uint64(this, rule_number, output + rule->offset))
- {
- pld->destroy(pld);
- return PARSE_ERROR;
- }
- break;
- }
case IKE_SPI:
{
if (!parse_bytes(this, rule_number, output + rule->offset, 8))
diff --git a/src/charon/encoding/payloads/encodings.c b/src/charon/encoding/payloads/encodings.c
index 35faf42cc..85caeda82 100644
--- a/src/charon/encoding/payloads/encodings.c
+++ b/src/charon/encoding/payloads/encodings.c
@@ -22,7 +22,6 @@ ENUM(encoding_type_names, U_INT_4, ENCRYPTED_DATA,
"U_INT_8",
"U_INT_16",
"U_INT_32",
- "U_INT_64",
"RESERVED_BIT",
"RESERVED_BYTE",
"FLAG",
diff --git a/src/charon/encoding/payloads/encodings.h b/src/charon/encoding/payloads/encodings.h
index 4df942d77..03554f0af 100644
--- a/src/charon/encoding/payloads/encodings.h
+++ b/src/charon/encoding/payloads/encodings.h
@@ -97,19 +97,6 @@ enum encoding_type_t {
U_INT_32,
/**
- * Representing a 64 Bit unsigned int value.
- *
- * When generating it must be changed from host to network order.
- * The value is read from the associated data struct.
- * The current write position is moved 64 bit forward afterwards.
- *
- * When parsing it must be changed from network to host order.
- * The value is written to the associated data struct.
- * The current read pointer is moved 64 bit forward afterwards.
- */
- U_INT_64,
-
- /**
* represents a RESERVED_BIT used in FLAG-Bytes.
*
* When generating, the next bit is set to zero and the current write