removed unused 64-bit integer parsing rule
authorMartin Willi <martin@strongswan.org>
Mon, 18 May 2009 11:36:56 +0000 (13:36 +0200)
committerMartin Willi <martin@strongswan.org>
Mon, 18 May 2009 11:36:56 +0000 (13:36 +0200)
src/charon/encoding/generator.c
src/charon/encoding/parser.c
src/charon/encoding/payloads/encodings.c
src/charon/encoding/payloads/encodings.h

index 4831706..a969ad0 100644 (file)
@@ -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:
index d73ca27..bef8219 100644 (file)
@@ -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))
index 35faf42..85caeda 100644 (file)
@@ -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",
index 4df942d..03554f0 100644 (file)
@@ -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