]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
encoding: Remove unused TS_TYPE and ADDRESS encodings
authorTobias Brunner <tobias@strongswan.org>
Thu, 13 Jan 2022 13:26:06 +0000 (14:26 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 14 Apr 2022 16:42:01 +0000 (18:42 +0200)
src/libcharon/encoding/generator.c
src/libcharon/encoding/parser.c
src/libcharon/encoding/payloads/encodings.c
src/libcharon/encoding/payloads/encodings.h

index f898c87bdf3b208b00edb9b95b8b00a50113d3e2..4bf0ab0cf8e6f99b0d1f1807631cc1c513c0f3c9 100644 (file)
@@ -205,7 +205,6 @@ static void generate_u_int_type(private_generator_t *this,
                case U_INT_4:
                        number_of_bits = 4;
                        break;
-               case TS_TYPE:
                case RESERVED_BYTE:
                case SPI_SIZE:
                case U_INT_8:
@@ -281,7 +280,6 @@ static void generate_u_int_type(private_generator_t *this,
                        }
                        break;
                }
-               case TS_TYPE:
                case RESERVED_BYTE:
                case SPI_SIZE:
                case U_INT_8:
@@ -478,7 +476,6 @@ METHOD(generator_t, generate_payload, void,
                        case IKE_SPI:
                        case RESERVED_BYTE:
                        case SPI_SIZE:
-                       case TS_TYPE:
                        case ATTRIBUTE_TYPE:
                        case ATTRIBUTE_LENGTH:
                                generate_u_int_type(this, rules[i].type, rules[i].offset);
@@ -491,7 +488,6 @@ METHOD(generator_t, generate_payload, void,
                                this->header_length_offset = get_offset(this);
                                generate_u_int_type(this, U_INT_32, rules[i].offset);
                                break;
-                       case ADDRESS:
                        case SPI:
                        case CHUNK_DATA:
                        case ENCRYPTED_DATA:
index de66ad467748e25aca83759510f32e6bc5ffb8e9..6e2e175d8b6d99506a874930f00df39d3afe8f83 100644 (file)
@@ -368,7 +368,6 @@ METHOD(parser_t, parse_payload, status_t,
        payload_t *pld;
        void *output;
        int payload_length = 0, spi_size = 0, attribute_length = 0, header_length;
-       uint16_t ts_type = 0;
        bool attribute_format = FALSE;
        int rule_number, rule_count;
        encoding_rule_t *rule;
@@ -588,28 +587,6 @@ METHOD(parser_t, parse_payload, status_t,
                                }
                                break;
                        }
-                       case TS_TYPE:
-                       {
-                               if (!parse_uint8(this, rule_number, output + rule->offset))
-                               {
-                                       pld->destroy(pld);
-                                       return PARSE_ERROR;
-                               }
-                               ts_type = *(uint8_t*)(output + rule->offset);
-                               break;
-                       }
-                       case ADDRESS:
-                       {
-                               int address_length = (ts_type == TS_IPV4_ADDR_RANGE) ? 4 : 16;
-
-                               if (!parse_chunk(this, rule_number, output + rule->offset,
-                                                                address_length))
-                               {
-                                       pld->destroy(pld);
-                                       return PARSE_ERROR;
-                               }
-                               break;
-                       }
                        default:
                        {
                                DBG1(DBG_ENC, "  no rule to parse rule %d %N",
index e81122e87fb52eaedb8d2b28bc5311002a8b4f39..580925c272772a758b7f1d3d3bccbaa7578d4c7c 100644 (file)
@@ -34,8 +34,6 @@ ENUM(encoding_type_names, U_INT_4, ENCRYPTED_DATA,
        "ATTRIBUTE_LENGTH_OR_VALUE",
        "ATTRIBUTE_LENGTH",
        "ATTRIBUTE_VALUE",
-       "TS_TYPE",
-       "ADDRESS",
        "CHUNK_DATA",
        "IKE_SPI",
        "ENCRYPTED_DATA",
index fb0e9ca3d29e4a7bae75f83830597d947b7c38ab..e5ea62c72c3903b970572938b11ad2f2ec7f75a4 100644 (file)
@@ -255,32 +255,6 @@ enum encoding_type_t {
         */
        ATTRIBUTE_VALUE,
 
-       /**
-        * Representing a Traffic selector type field.
-        *
-        * 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 16 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 16 bit forward afterwards.
-        */
-       TS_TYPE,
-
-       /**
-        * Representing an address field in a traffic selector.
-        *
-        * Depending on the last field of type TS_TYPE
-        * this field is either 4 or 16 byte long.
-        *
-        * When generating the content of the chunk pointing to
-        * is written.
-        *
-        * When parsing 4 or 16 bytes are read and written into the chunk pointing to.
-        */
-       ADDRESS,
-
        /**
         * Representing a variable length byte field.
         */