@@ -35,34 +35,35 @@ class BadDataTypeCast : public Exception {
35
35
36
36
// / @brief Data types of DHCP option fields.
37
37
// /
38
- // / @warning The order of data types matters: OPT_UNKNOWN_TYPE
39
- // / must always be the last position. Also, OPT_RECORD_TYPE
40
- // / must be at last but one position. This is because some
41
- // / functions perform sanity checks on data type values using
42
- // / '>' operators, assuming that all values beyond the
43
- // / OPT_RECORD_TYPE are invalid.
44
- enum OptionDataType {
45
- OPT_EMPTY_TYPE,
46
- OPT_BINARY_TYPE,
47
- OPT_BOOLEAN_TYPE,
48
- OPT_INT8_TYPE,
49
- OPT_INT16_TYPE,
50
- OPT_INT32_TYPE,
51
- OPT_UINT8_TYPE,
52
- OPT_UINT16_TYPE,
53
- OPT_UINT32_TYPE,
54
- OPT_ANY_ADDRESS_TYPE,
55
- OPT_IPV4_ADDRESS_TYPE,
56
- OPT_IPV6_ADDRESS_TYPE,
57
- OPT_IPV6_PREFIX_TYPE,
58
- OPT_PSID_TYPE,
59
- OPT_STRING_TYPE,
60
- OPT_TUPLE_TYPE,
61
- OPT_FQDN_TYPE,
38
+ // / @warning Do NOT alter existing values to add (or remove) new types.
39
+ // / These values are stored by config backend. Altering any existing
40
+ // / values will produce code that is incompatiable with pre-existing data.
41
+ // / Futhermore, the order of data types matters: OPT_UNKNOWN_TYPE
42
+ // / must always be and OPT_RECORD_TYPE must be at second to last.
43
+ // / This is because some functions perform sanity checks on data type
44
+ // / values using '>' operators, assuming that all values beyond the
45
+ enum OptionDataType : int {
46
+ OPT_EMPTY_TYPE = 0 ,
47
+ OPT_BINARY_TYPE = 1 ,
48
+ OPT_BOOLEAN_TYPE = 2 ,
49
+ OPT_INT8_TYPE = 3 ,
50
+ OPT_INT16_TYPE = 4 ,
51
+ OPT_INT32_TYPE = 5 ,
52
+ OPT_UINT8_TYPE = 6 ,
53
+ OPT_UINT16_TYPE = 7 ,
54
+ OPT_UINT32_TYPE = 8 ,
55
+ OPT_ANY_ADDRESS_TYPE = 9 ,
56
+ OPT_IPV4_ADDRESS_TYPE = 10 ,
57
+ OPT_IPV6_ADDRESS_TYPE = 11 ,
58
+ OPT_IPV6_PREFIX_TYPE = 12 ,
59
+ OPT_PSID_TYPE = 13 ,
60
+ OPT_STRING_TYPE = 14 ,
61
+ OPT_TUPLE_TYPE = 15 ,
62
+ OPT_FQDN_TYPE = 16 ,
62
63
// Type to be used only internally. Allows convenient notation of the option config.
63
- OPT_INTERNAL_TYPE,
64
- OPT_RECORD_TYPE = 254 , // Do not alter this value.
65
- OPT_UNKNOWN_TYPE = 255 // Do not alter this value.
64
+ OPT_INTERNAL_TYPE = 17 ,
65
+ OPT_RECORD_TYPE = 254 ,
66
+ OPT_UNKNOWN_TYPE = 255
66
67
};
67
68
68
69
// / @brief Parameters being used to make up an option definition.
0 commit comments