Added member fields for reserved bits and bytes in all payloads
[strongswan.git] / src / libcharon / encoding / payloads / id_payload.c
index e4ca88e..3befadf 100644 (file)
@@ -52,6 +52,16 @@ struct private_id_payload_t {
        bool critical;
 
        /**
+        * Reserved bits
+        */
+       bool reserved_bit[7];
+
+       /**
+        * Reserved bytes
+        */
+       u_int8_t reserved_byte[3];
+
+       /**
         * Length of this payload.
         */
        u_int16_t payload_length;
@@ -78,22 +88,22 @@ encoding_rule_t id_payload_encodings[] = {
        { U_INT_8,                      offsetof(private_id_payload_t, next_payload)    },
        /* the critical bit */
        { FLAG,                         offsetof(private_id_payload_t, critical)                },
-       /* 7 Bit reserved bits, nowhere stored */
-       { RESERVED_BIT,         0                                                                                               },
-       { RESERVED_BIT,         0                                                                                               },
-       { RESERVED_BIT,         0                                                                                               },
-       { RESERVED_BIT,         0                                                                                               },
-       { RESERVED_BIT,         0                                                                                               },
-       { RESERVED_BIT,         0                                                                                               },
-       { RESERVED_BIT,         0                                                                                               },
+       /* 7 Bit reserved bits */
+       { RESERVED_BIT,         offsetof(private_id_payload_t, reserved_bit[0]) },
+       { RESERVED_BIT,         offsetof(private_id_payload_t, reserved_bit[1]) },
+       { RESERVED_BIT,         offsetof(private_id_payload_t, reserved_bit[2]) },
+       { RESERVED_BIT,         offsetof(private_id_payload_t, reserved_bit[3]) },
+       { RESERVED_BIT,         offsetof(private_id_payload_t, reserved_bit[4]) },
+       { RESERVED_BIT,         offsetof(private_id_payload_t, reserved_bit[5]) },
+       { RESERVED_BIT,         offsetof(private_id_payload_t, reserved_bit[6]) },
        /* Length of the whole payload*/
        { PAYLOAD_LENGTH,       offsetof(private_id_payload_t, payload_length)  },
        /* 1 Byte ID type*/
        { U_INT_8,                      offsetof(private_id_payload_t, id_type)                 },
        /* 3 reserved bytes */
-       { RESERVED_BYTE,        0                                                                                               },
-       { RESERVED_BYTE,        0                                                                                               },
-       { RESERVED_BYTE,        0                                                                                               },
+       { RESERVED_BYTE,        offsetof(private_id_payload_t, reserved_byte[0])},
+       { 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)                 }
 };