Added member fields for reserved bits and bytes in all payloads
[strongswan.git] / src / libcharon / encoding / payloads / ts_payload.c
index d693b11..28f760e 100644 (file)
@@ -50,6 +50,16 @@ struct private_ts_payload_t {
        bool critical;
 
        /**
+        * reserved bits
+        */
+       bool reserved_bit[7];
+
+       /**
+        * reserved bytes
+        */
+       bool reserved_byte[3];
+
+       /**
         * Length of this payload.
         */
        u_int16_t payload_length;
@@ -76,24 +86,24 @@ encoding_rule_t ts_payload_encodings[] = {
        { U_INT_8,                      offsetof(private_ts_payload_t, next_payload)    },
        /* the critical bit */
        { FLAG,                         offsetof(private_ts_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_ts_payload_t, reserved_bit[0]) },
+       { RESERVED_BIT,         offsetof(private_ts_payload_t, reserved_bit[1]) },
+       { RESERVED_BIT,         offsetof(private_ts_payload_t, reserved_bit[2]) },
+       { RESERVED_BIT,         offsetof(private_ts_payload_t, reserved_bit[3]) },
+       { RESERVED_BIT,         offsetof(private_ts_payload_t, reserved_bit[4]) },
+       { RESERVED_BIT,         offsetof(private_ts_payload_t, reserved_bit[5]) },
+       { RESERVED_BIT,         offsetof(private_ts_payload_t, reserved_bit[6]) },
        /* Length of the whole payload*/
        { PAYLOAD_LENGTH,       offsetof(private_ts_payload_t, payload_length)  },
        /* 1 Byte TS type*/
        { U_INT_8,                      offsetof(private_ts_payload_t, ts_num)                  },
        /* 3 reserved bytes */
-       { RESERVED_BYTE,        0                                                                                               },
-       { RESERVED_BYTE,        0                                                                                               },
-       { RESERVED_BYTE,        0                                                                                               },
+       { RESERVED_BYTE,        offsetof(private_ts_payload_t, reserved_byte[0])},
+       { RESERVED_BYTE,        offsetof(private_ts_payload_t, reserved_byte[1])},
+       { RESERVED_BYTE,        offsetof(private_ts_payload_t, reserved_byte[2])},
        /* some ts data bytes, length is defined in PAYLOAD_LENGTH */
-       { TRAFFIC_SELECTORS,    offsetof(private_ts_payload_t, substrs)         }
+       { TRAFFIC_SELECTORS,offsetof(private_ts_payload_t, substrs)                     }
 };
 
 /*