diff --git a/doc/guide/classify.xml b/doc/guide/classify.xml
index 491ee1502b..626ac7c1bc 100644
--- a/doc/guide/classify.xml
+++ b/doc/guide/classify.xml
@@ -718,6 +718,7 @@
Concatconcat('foo','bar')Return the
concatenation of the strings
Ifelseifelse('foo' == 'bar','us','them')Return the branch value according to the condition
+Hexstringhexstring('foo', '-')Converts the value to a hexadecimal string, e.g. 0a:1b:2c:3e
@@ -772,6 +773,16 @@ concatenation of the strings
ifelse(option[230].exists, option[230].hex, 'none')
+
+ Hexstring
+ The hexstring function "hexstring(binary, separator)" returns
+ the binary value as its hexadecimal string representation:
+ pairs of hexadecimal digits separated by the separator, e.g
+ ':', '-', '' (empty separator).
+
+ hexstring(pkt4.mac, ':')
+
+
diff --git a/doc/guide/hooks-radius.xml b/doc/guide/hooks-radius.xml
index 90e0aac8fd..175009399f 100644
--- a/doc/guide/hooks-radius.xml
+++ b/doc/guide/hooks-radius.xml
@@ -569,7 +569,7 @@ Please make sure that your compilation has the following:
// the incoming packet or even its metadata (e.g. the interface
// it was received over from)
"name": "Configuration-Token",
- "expr": "pkt.iface"
+ "expr": "hexstring(pkt4.mac,':')"
}
] // End of attributes
} // End of access
diff --git a/doc/guide/hooks.xml b/doc/guide/hooks.xml
index ad8e7619f1..3d48fd9ecc 100644
--- a/doc/guide/hooks.xml
+++ b/doc/guide/hooks.xml
@@ -1215,7 +1215,9 @@ $
can be represented as 626174. Alternatively, it can be expressed
as quoted value (using double and single quotes), e.g. "'bar'".
The former is more convenient for printable characters, while hex
- string values are more convenient for non-printable characters.
+ string values are more convenient for non-printable characters
+ and does not require the use of the hexstring
+ operator.
"Dhcp6": {
diff --git a/src/lib/eval/eval.dox b/src/lib/eval/eval.dox
index 4f7d814273..bb7e1ff178 100644
--- a/src/lib/eval/eval.dox
+++ b/src/lib/eval/eval.dox
@@ -160,7 +160,9 @@ instantiated with the appropriate value and put onto the expression vector.
- isc::dhcp::TokenSubstring -- represents the substring(text, start, length) operator.
- isc::dhcp::TokenConcat -- represents the concat operator which
concatenate two other tokens.
- - isc::dhcp::TokenIfElse == represents the ifelse(cond, iftrue, ifelse) operator.
+ - isc::dhcp::TokenIfElse -- represents the ifelse(cond, iftrue, ifelse) operator.
+ - isc::dhcp::TokenToHexString -- represents the hexstring operator which
+ converts a binary value to its hexadecimal string representation.
- isc::dhcp::TokenNot -- the logical not operator.
- isc::dhcp::TokenAnd -- the logical and (strict) operator.
- isc::dhcp::TokenOr -- the logical or (strict) operator (strict means
diff --git a/src/lib/eval/eval_messages.mes b/src/lib/eval/eval_messages.mes
index c70b7aeb3f..1bf42ed9f6 100644
--- a/src/lib/eval/eval_messages.mes
+++ b/src/lib/eval/eval_messages.mes
@@ -144,6 +144,15 @@ string and an empty result will be pushed onto the stack. The start,
length and string are still popped from the stack and the result is
still pushed. The strings are displayed in hex.
+# For use with TokenToHexString
+
+% EVAL_DEBUG_TOHEXSTRING Popping binary value %1 and separator %2, pushing result %3
+This debug message indicates that two values are being popped from
+the value stack and a result is being pushed onto the value stack.
+The values being popped are the binary value to convert and the separator.
+The binary value is converted to its hexadecimal string representation
+and pushed onto the stack. The binary value is displayed in hex.
+
% EVAL_DEBUG_VENDOR_CLASS_DATA Data %1 (out of %2 received) in vendor class found, pushing result '%3'
This debug message indicates that vendor class option was found and passed
enterprise-id checks and has sufficient number of data chunks. The total number
diff --git a/src/lib/eval/lexer.cc b/src/lib/eval/lexer.cc
index 48c177a6d9..7e66c7d797 100644
--- a/src/lib/eval/lexer.cc
+++ b/src/lib/eval/lexer.cc
@@ -710,8 +710,8 @@ static void yynoreturn yy_fatal_error ( const char* msg );
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
(yy_c_buf_p) = yy_cp;
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
-#define YY_NUM_RULES 53
-#define YY_END_OF_BUFFER 54
+#define YY_NUM_RULES 54
+#define YY_END_OF_BUFFER 55
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -719,42 +719,44 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static const flex_int16_t yy_acclist[291] =
+static const flex_int16_t yy_acclist[298] =
{ 0,
- 54, 52, 53, 1, 52, 53, 2, 53, 52, 53,
- 46, 52, 53, 47, 52, 53, 51, 52, 53, 50,
- 52, 53, 52, 53, 45, 52, 53, 5, 52, 53,
- 5, 52, 53, 52, 53, 52, 53, 52, 53,16390,
- 52, 53,16390, 48, 52, 53, 49, 52, 53, 52,
- 53,16390, 52, 53,16390, 52, 53,16390, 52, 53,
- 16390, 52, 53,16390, 52, 53,16390, 52, 53,16390,
- 52, 53,16390, 52, 53,16390, 52, 53,16390, 52,
- 53,16390, 52, 53,16390, 52, 53,16390, 52, 53,
- 16390, 52, 53,16390, 52, 53,16390, 52, 53,16390,
+ 55, 53, 54, 1, 53, 54, 2, 54, 53, 54,
+ 47, 53, 54, 48, 53, 54, 52, 53, 54, 51,
+ 53, 54, 53, 54, 46, 53, 54, 5, 53, 54,
+ 5, 53, 54, 53, 54, 53, 54, 53, 54,16390,
+ 53, 54,16390, 49, 53, 54, 50, 53, 54, 53,
+ 54,16390, 53, 54,16390, 53, 54,16390, 53, 54,
+ 16390, 53, 54,16390, 53, 54,16390, 53, 54,16390,
+ 53, 54,16390, 53, 54,16390, 53, 54,16390, 53,
+ 54,16390, 53, 54,16390, 53, 54,16390, 53, 54,
+ 16390, 53, 54,16390, 53, 54,16390, 53, 54,16390,
1, 2, 3, 5, 5, 7, 8,16390,16390, 8198,
16390,16390,16390,16390,16390,16390,16390,16390,16390,16390,
16390,16390,16390,16390,16390,16390,16390,16390,16390,16390,
- 43,16390,16390,16390,16390,16390,16390,16390,16390,16390,
- 16390,16390, 4, 7, 38,16390, 42,16390,16390,16390,
+ 44,16390,16390,16390,16390,16390,16390,16390,16390,16390,
+ 16390,16390, 4, 7, 38,16390, 43,16390,16390,16390,
16390, 20,16390,16390,16390,16390, 15,16390,16390,16390,
- 16390,16390, 21,16390,16390, 23,16390,16390,16390, 41,
+ 16390,16390, 21,16390,16390, 23,16390,16390,16390, 42,
16390,16390,16390, 17,16390,16390,16390, 19,16390,16390,
16390,16390,16390,16390,16390,16390, 35,16390,16390,16390,
- 16390, 24,16390,16390,16390,16390,16390,16390,16390,16390,
+ 16390,16390, 24,16390,16390,16390,16390,16390,16390,16390,
+
+ 16390,16390, 22,16390, 30,16390,16390,16390,16390, 14,
+ 16390,16390,16390,16390,16390,16390,16390,16390,16390,16390,
+ 25,16390, 18,16390,16390,16390,16390,16390,16390,16390,
+ 16390,16390,16390,16390,16390,16390, 26,16390, 39,16390,
+ 16390, 16,16390, 27,16390,16390, 40,16390,16390, 45,
+ 16390,16390, 9,16390,16390, 10,16390, 11,16390, 29,
+ 16390,16390,16390, 33,16390, 28,16390, 7,16390,16390,
+ 16390, 31,16390,16390,16390, 32,16390,16390,16390, 13,
+ 16390, 12,16390,16390,16390,16390, 41,16390, 37,16390,
+ 16390, 36,16390,16390,16390, 34,16390
- 16390, 22,16390, 30,16390,16390,16390,16390, 14,16390,
- 16390,16390,16390,16390,16390,16390,16390,16390, 25,16390,
- 18,16390,16390,16390,16390,16390,16390,16390,16390,16390,
- 16390,16390,16390,16390, 26,16390, 39,16390,16390, 16,
- 16390, 27,16390, 40,16390,16390, 44,16390,16390, 9,
- 16390,16390, 10,16390, 11,16390, 29,16390,16390,16390,
- 33,16390, 28,16390, 7,16390,16390, 31,16390,16390,
- 16390, 32,16390,16390, 13,16390, 12,16390,16390,16390,
- 16390, 37,16390,16390, 36,16390,16390,16390, 34,16390
} ;
-static const flex_int16_t yy_accept[208] =
+static const flex_int16_t yy_accept[214] =
{ 0,
1, 1, 1, 2, 4, 7, 9, 11, 14, 17,
20, 23, 25, 28, 31, 34, 36, 38, 41, 44,
@@ -769,16 +771,17 @@ static const flex_int16_t yy_accept[208] =
159, 160, 161, 162, 163, 165, 166, 168, 169, 170,
172, 173, 174, 176, 177, 178, 180, 181, 182, 183,
- 184, 185, 185, 186, 187, 189, 190, 191, 192, 194,
- 195, 196, 197, 198, 199, 200, 201, 202, 204, 206,
- 207, 208, 209, 211, 212, 213, 214, 214, 215, 216,
- 217, 218, 219, 221, 223, 224, 225, 226, 227, 228,
- 229, 230, 231, 232, 233, 234, 235, 235, 237, 239,
- 240, 242, 244, 246, 247, 249, 250, 252, 253, 255,
- 257, 259, 260, 261, 263, 265, 266, 267, 268, 270,
- 271, 272, 274, 274, 275, 277, 279, 280, 281, 282,
+ 184, 185, 185, 186, 187, 189, 190, 191, 192, 193,
+ 195, 196, 197, 198, 199, 200, 201, 202, 203, 205,
+ 207, 208, 209, 210, 212, 213, 214, 215, 215, 216,
+ 217, 218, 219, 220, 221, 223, 225, 226, 227, 228,
+ 229, 230, 231, 232, 233, 234, 235, 236, 237, 237,
+ 239, 241, 242, 244, 246, 247, 249, 250, 252, 253,
+ 255, 256, 258, 260, 262, 263, 264, 266, 268, 269,
+ 270, 271, 272, 274, 275, 276, 278, 278, 279, 280,
- 284, 285, 287, 288, 289, 291, 291
+ 282, 284, 285, 286, 287, 289, 291, 292, 294, 295,
+ 296, 298, 298
} ;
static const YY_CHAR yy_ec[256] =
@@ -822,107 +825,107 @@ static const YY_CHAR yy_meta[45] =
1, 1, 1, 1
} ;
-static const flex_int16_t yy_base[212] =
+static const flex_int16_t yy_base[218] =
{ 0,
- 0, 0, 319, 320, 316, 314, 312, 320, 320, 320,
- 320, 34, 320, 39, 36, 300, 298, 81, 115, 320,
- 320, 24, 37, 37, 26, 282, 45, 284, 43, 48,
- 275, 43, 59, 283, 106, 50, 282, 277, 305, 303,
- 301, 320, 122, 137, 112, 289, 288, 0, 287, 0,
- 320, 143, 150, 0, 0, 320, 268, 274, 276, 263,
- 257, 256, 255, 263, 270, 249, 264, 246, 74, 254,
- 253, 262, 252, 256, 244, 243, 0, 255, 241, 247,
- 256, 253, 253, 233, 252, 239, 250, 146, 0, 0,
- 0, 0, 246, 246, 247, 0, 242, 229, 241, 0,
+ 0, 0, 325, 326, 322, 320, 318, 326, 326, 326,
+ 326, 34, 326, 39, 36, 306, 304, 81, 115, 326,
+ 326, 24, 37, 37, 26, 288, 45, 290, 43, 48,
+ 281, 43, 59, 289, 106, 50, 288, 283, 311, 309,
+ 307, 326, 122, 137, 112, 295, 294, 0, 293, 0,
+ 326, 143, 150, 0, 0, 326, 274, 280, 282, 269,
+ 263, 262, 261, 269, 276, 255, 270, 252, 74, 260,
+ 259, 268, 258, 262, 250, 249, 0, 261, 247, 253,
+ 262, 259, 259, 239, 258, 245, 256, 146, 0, 0,
+ 0, 0, 252, 252, 253, 0, 248, 235, 247, 233,
- 231, 228, 239, 230, 0, 230, 0, 237, 220, 0,
- 228, 220, 148, 234, 230, 0, 216, 214, 218, 226,
- 225, 154, 224, 226, 0, 210, 207, 220, 0, 218,
- 217, 204, 219, 214, 196, 203, 215, 0, 0, 193,
- 210, 195, 0, 195, 197, 206, 162, 193, 190, 192,
- 189, 189, 0, 0, 199, 199, 186, 186, 187, 195,
- 156, 172, 169, 175, 167, 165, 166, 0, 0, 164,
- 0, 0, 0, 175, 0, 173, 0, 173, 0, 0,
- 0, 167, 171, 187, 0, 170, 164, 156, 0, 155,
- 157, 0, 183, 152, 0, 0, 161, 156, 161, 0,
+ 236, 233, 244, 235, 0, 235, 0, 242, 225, 0,
+ 233, 225, 148, 239, 235, 0, 221, 219, 223, 231,
+ 230, 154, 229, 231, 0, 215, 212, 225, 210, 0,
+ 222, 221, 208, 223, 218, 200, 207, 219, 0, 0,
+ 197, 214, 199, 0, 199, 201, 210, 162, 197, 194,
+ 196, 193, 193, 192, 0, 0, 202, 202, 189, 189,
+ 190, 198, 156, 185, 184, 190, 172, 169, 166, 0,
+ 0, 168, 0, 0, 174, 0, 177, 0, 175, 0,
+ 175, 0, 0, 0, 169, 173, 189, 0, 170, 166,
+ 161, 157, 0, 156, 158, 0, 183, 153, 162, 0,
- 164, 0, 124, 115, 0, 320, 208, 210, 212, 85,
- 215
+ 0, 161, 156, 161, 0, 0, 164, 0, 124, 115,
+ 0, 326, 208, 210, 212, 85, 215
} ;
-static const flex_int16_t yy_def[212] =
+static const flex_int16_t yy_def[218] =
{ 0,
- 206, 1, 206, 206, 206, 206, 207, 206, 206, 206,
- 206, 206, 206, 206, 14, 208, 206, 206, 18, 206,
- 206, 18, 18, 18, 18, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 206, 206,
- 207, 206, 206, 206, 14, 208, 209, 210, 208, 211,
- 206, 206, 19, 18, 19, 206, 19, 19, 19, 19,
+ 212, 1, 212, 212, 212, 212, 213, 212, 212, 212,
+ 212, 212, 212, 212, 14, 214, 212, 212, 18, 212,
+ 212, 18, 18, 18, 18, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 212, 212,
+ 213, 212, 212, 212, 14, 214, 215, 216, 214, 217,
+ 212, 212, 19, 18, 19, 212, 19, 19, 19, 19,
18, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 206, 210, 211,
+ 19, 19, 19, 19, 19, 19, 19, 212, 216, 217,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 206, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 212, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 206, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 212, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 206, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 212, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 206, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 212, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 206, 206, 206, 206,
- 206
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 0, 212, 212, 212, 212, 212
} ;
-static const flex_int16_t yy_nxt[365] =
+static const flex_int16_t yy_nxt[371] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 15, 15, 16, 17, 18, 19, 19, 20,
21, 4, 22, 18, 23, 24, 25, 18, 26, 27,
28, 19, 29, 30, 31, 32, 33, 34, 35, 36,
19, 37, 19, 38, 43, 43, 43, 43, 44, 45,
- 45, 45, 45, 46, 206, 47, 57, 48, 58, 61,
+ 45, 45, 45, 46, 212, 47, 57, 48, 58, 61,
63, 47, 47, 47, 47, 47, 47, 59, 64, 70,
- 72, 66, 60, 71, 73, 62, 84, 67, 206, 76,
+ 72, 66, 60, 71, 73, 62, 84, 67, 212, 76,
77, 48, 52, 52, 68, 78, 74, 85, 89, 53,
79, 54, 54, 54, 54, 46, 103, 54, 55, 55,
104, 56, 53, 54, 54, 54, 54, 54, 54, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55, 55, 206,
- 206, 55, 43, 43, 43, 43, 81, 55, 55, 55,
+ 55, 55, 55, 55, 55, 55, 55, 55, 55, 212,
+ 212, 55, 43, 43, 43, 43, 81, 55, 55, 55,
55, 55, 55, 82, 52, 52, 83, 88, 88, 88,
- 88, 206, 206, 205, 206, 122, 88, 88, 88, 88,
- 138, 139, 204, 56, 147, 147, 147, 147, 179, 180,
- 206, 167, 147, 147, 147, 147, 186, 186, 186, 186,
- 186, 186, 186, 186, 206, 206, 203, 202, 201, 200,
- 199, 197, 196, 195, 194, 193, 192, 191, 190, 189,
+ 88, 212, 212, 211, 212, 122, 88, 88, 88, 88,
+ 139, 140, 210, 56, 148, 148, 148, 148, 182, 183,
+ 212, 169, 148, 148, 148, 148, 189, 189, 189, 189,
+ 189, 189, 189, 189, 212, 212, 209, 208, 207, 206,
+ 205, 204, 202, 201, 200, 199, 198, 197, 196, 195,
- 188, 187, 185, 206, 184, 183, 182, 198, 41, 181,
+ 194, 193, 192, 212, 191, 190, 188, 203, 41, 187,
41, 41, 41, 49, 49, 47, 47, 90, 90, 90,
- 178, 177, 176, 175, 174, 173, 172, 171, 170, 169,
- 168, 166, 165, 164, 163, 162, 161, 160, 159, 158,
- 157, 156, 155, 154, 153, 152, 151, 150, 149, 148,
- 146, 145, 144, 143, 142, 141, 140, 137, 136, 135,
- 134, 133, 132, 131, 130, 129, 128, 127, 126, 125,
- 124, 123, 121, 120, 119, 118, 117, 116, 115, 114,
- 113, 112, 111, 110, 109, 108, 107, 106, 105, 102,
- 101, 100, 99, 98, 97, 96, 95, 94, 93, 92,
+ 186, 185, 184, 181, 180, 179, 178, 177, 176, 175,
+ 174, 173, 172, 171, 170, 168, 167, 166, 165, 164,
+ 163, 162, 161, 160, 159, 158, 157, 156, 155, 154,
+ 153, 152, 151, 150, 149, 147, 146, 145, 144, 143,
+ 142, 141, 138, 137, 136, 135, 134, 133, 132, 131,
+ 130, 129, 128, 127, 126, 125, 124, 123, 121, 120,
+ 119, 118, 117, 116, 115, 114, 113, 112, 111, 110,
+ 109, 108, 107, 106, 105, 102, 101, 100, 99, 98,
- 91, 50, 46, 50, 42, 40, 39, 87, 86, 80,
- 75, 69, 65, 51, 50, 42, 40, 39, 206, 3,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
- 206, 206, 206, 206
+ 97, 96, 95, 94, 93, 92, 91, 50, 46, 50,
+ 42, 40, 39, 87, 86, 80, 75, 69, 65, 51,
+ 50, 42, 40, 39, 212, 3, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212
} ;
-static const flex_int16_t yy_chk[365] =
+static const flex_int16_t yy_chk[371] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -932,7 +935,7 @@ static const flex_int16_t yy_chk[365] =
14, 14, 14, 14, 15, 14, 22, 14, 22, 24,
25, 14, 14, 14, 14, 14, 14, 23, 25, 29,
30, 27, 23, 29, 30, 24, 36, 27, 15, 32,
- 32, 14, 18, 18, 27, 33, 30, 36, 210, 18,
+ 32, 14, 18, 18, 27, 33, 30, 36, 216, 18,
33, 18, 18, 18, 18, 18, 69, 18, 18, 18,
69, 18, 18, 18, 18, 18, 18, 18, 18, 18,
@@ -940,50 +943,50 @@ static const flex_int16_t yy_chk[365] =
18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
45, 19, 43, 43, 43, 43, 35, 19, 19, 19,
19, 19, 19, 35, 52, 52, 35, 44, 44, 44,
- 44, 53, 53, 204, 45, 88, 88, 88, 88, 88,
- 113, 113, 203, 52, 122, 122, 122, 122, 161, 161,
- 53, 147, 147, 147, 147, 147, 167, 167, 167, 167,
- 186, 186, 186, 186, 193, 193, 201, 199, 198, 197,
- 194, 191, 190, 188, 187, 184, 183, 182, 178, 176,
+ 44, 53, 53, 210, 45, 88, 88, 88, 88, 88,
+ 113, 113, 209, 52, 122, 122, 122, 122, 163, 163,
+ 53, 148, 148, 148, 148, 148, 169, 169, 169, 169,
+ 189, 189, 189, 189, 197, 197, 207, 204, 203, 202,
+ 199, 198, 195, 194, 192, 191, 190, 187, 186, 185,
- 174, 170, 166, 193, 165, 164, 163, 193, 207, 162,
- 207, 207, 207, 208, 208, 209, 209, 211, 211, 211,
- 160, 159, 158, 157, 156, 155, 152, 151, 150, 149,
- 148, 146, 145, 144, 142, 141, 140, 137, 136, 135,
- 134, 133, 132, 131, 130, 128, 127, 126, 124, 123,
- 121, 120, 119, 118, 117, 115, 114, 112, 111, 109,
- 108, 106, 104, 103, 102, 101, 99, 98, 97, 95,
- 94, 93, 87, 86, 85, 84, 83, 82, 81, 80,
- 79, 78, 76, 75, 74, 73, 72, 71, 70, 68,
- 67, 66, 65, 64, 63, 62, 61, 60, 59, 58,
+ 181, 179, 177, 197, 175, 172, 168, 197, 213, 167,
+ 213, 213, 213, 214, 214, 215, 215, 217, 217, 217,
+ 166, 165, 164, 162, 161, 160, 159, 158, 157, 154,
+ 153, 152, 151, 150, 149, 147, 146, 145, 143, 142,
+ 141, 138, 137, 136, 135, 134, 133, 132, 131, 129,
+ 128, 127, 126, 124, 123, 121, 120, 119, 118, 117,
+ 115, 114, 112, 111, 109, 108, 106, 104, 103, 102,
+ 101, 100, 99, 98, 97, 95, 94, 93, 87, 86,
+ 85, 84, 83, 82, 81, 80, 79, 78, 76, 75,
+ 74, 73, 72, 71, 70, 68, 67, 66, 65, 64,
- 57, 49, 47, 46, 41, 40, 39, 38, 37, 34,
- 31, 28, 26, 17, 16, 7, 6, 5, 3, 206,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
- 206, 206, 206, 206
+ 63, 62, 61, 60, 59, 58, 57, 49, 47, 46,
+ 41, 40, 39, 38, 37, 34, 31, 28, 26, 17,
+ 16, 7, 6, 5, 3, 212, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212
} ;
/* Table of booleans, true if rule could match eol. */
-static const flex_int32_t yy_rule_can_match_eol[54] =
+static const flex_int32_t yy_rule_can_match_eol[55] =
{ 0,
0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
extern int yy_flex_debug;
int yy_flex_debug = 1;
-static const flex_int16_t yy_rule_linenum[53] =
+static const flex_int16_t yy_rule_linenum[54] =
{ 0,
106, 111, 117, 127, 133, 151, 158, 172, 173, 174,
175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
- 215, 216
+ 215, 216, 217
} ;
static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
@@ -1049,7 +1052,7 @@ namespace {
/* To avoid the call to exit... oops! */
#define YY_FATAL_ERROR(msg) isc::eval::EvalContext::fatal(msg)
-#line 1052 "lexer.cc"
+#line 1055 "lexer.cc"
/* noyywrap disables automatic rewinding for the next file to parse. Since we
always parse only a single string, there's no need to do any wraps. And
using yywrap requires linking with -lfl, which provides the default yywrap
@@ -1074,8 +1077,8 @@ namespace {
by moving it ahead by yyleng bytes. yyleng specifies the length of the
currently matched token. */
#define YY_USER_ACTION loc.columns(evalleng);
-#line 1077 "lexer.cc"
-#line 1078 "lexer.cc"
+#line 1080 "lexer.cc"
+#line 1081 "lexer.cc"
#define INITIAL 0
@@ -1380,7 +1383,7 @@ YY_DECL
-#line 1383 "lexer.cc"
+#line 1386 "lexer.cc"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -1408,14 +1411,14 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 207 )
+ if ( yy_current_state >= 213 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
*(yy_state_ptr)++ = yy_current_state;
++yy_cp;
}
- while ( yy_current_state != 206 );
+ while ( yy_current_state != 212 );
yy_find_action:
/* %% [10.0] code to find the action number goes here */
@@ -1478,13 +1481,13 @@ do_action: /* This label is used only to access EOF actions. */
{
if ( yy_act == 0 )
fprintf( stderr, "--scanner backing up\n" );
- else if ( yy_act < 53 )
+ else if ( yy_act < 54 )
fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
(long)yy_rule_linenum[yy_act], yytext );
- else if ( yy_act == 53 )
+ else if ( yy_act == 54 )
fprintf( stderr, "--accepting default rule (\"%s\")\n",
yytext );
- else if ( yy_act == 54 )
+ else if ( yy_act == 55 )
fprintf( stderr, "--(end of buffer or a NUL)\n" );
else
fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
@@ -1750,73 +1753,78 @@ return isc::eval::EvalParser::make_IFELSE(loc);
case 41:
YY_RULE_SETUP
#line 205 "lexer.ll"
-return isc::eval::EvalParser::make_NOT(loc);
+return isc::eval::EvalParser::make_TOHEXSTRING(loc);
YY_BREAK
case 42:
YY_RULE_SETUP
#line 206 "lexer.ll"
-return isc::eval::EvalParser::make_AND(loc);
+return isc::eval::EvalParser::make_NOT(loc);
YY_BREAK
case 43:
YY_RULE_SETUP
#line 207 "lexer.ll"
-return isc::eval::EvalParser::make_OR(loc);
+return isc::eval::EvalParser::make_AND(loc);
YY_BREAK
case 44:
YY_RULE_SETUP
#line 208 "lexer.ll"
-return isc::eval::EvalParser::make_MEMBER(loc);
+return isc::eval::EvalParser::make_OR(loc);
YY_BREAK
case 45:
YY_RULE_SETUP
#line 209 "lexer.ll"
-return isc::eval::EvalParser::make_DOT(loc);
+return isc::eval::EvalParser::make_MEMBER(loc);
YY_BREAK
case 46:
YY_RULE_SETUP
#line 210 "lexer.ll"
-return isc::eval::EvalParser::make_LPAREN(loc);
+return isc::eval::EvalParser::make_DOT(loc);
YY_BREAK
case 47:
YY_RULE_SETUP
#line 211 "lexer.ll"
-return isc::eval::EvalParser::make_RPAREN(loc);
+return isc::eval::EvalParser::make_LPAREN(loc);
YY_BREAK
case 48:
YY_RULE_SETUP
#line 212 "lexer.ll"
-return isc::eval::EvalParser::make_LBRACKET(loc);
+return isc::eval::EvalParser::make_RPAREN(loc);
YY_BREAK
case 49:
YY_RULE_SETUP
#line 213 "lexer.ll"
-return isc::eval::EvalParser::make_RBRACKET(loc);
+return isc::eval::EvalParser::make_LBRACKET(loc);
YY_BREAK
case 50:
YY_RULE_SETUP
#line 214 "lexer.ll"
-return isc::eval::EvalParser::make_COMA(loc);
+return isc::eval::EvalParser::make_RBRACKET(loc);
YY_BREAK
case 51:
YY_RULE_SETUP
#line 215 "lexer.ll"
-return isc::eval::EvalParser::make_ANY(loc);
+return isc::eval::EvalParser::make_COMA(loc);
YY_BREAK
case 52:
YY_RULE_SETUP
#line 216 "lexer.ll"
-driver.error (loc, "Invalid character: " + std::string(evaltext));
- YY_BREAK
-case YY_STATE_EOF(INITIAL):
-#line 217 "lexer.ll"
-return isc::eval::EvalParser::make_END(loc);
+return isc::eval::EvalParser::make_ANY(loc);
YY_BREAK
case 53:
YY_RULE_SETUP
+#line 217 "lexer.ll"
+driver.error (loc, "Invalid character: " + std::string(evaltext));
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
#line 218 "lexer.ll"
+return isc::eval::EvalParser::make_END(loc);
+ YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 219 "lexer.ll"
ECHO;
YY_BREAK
-#line 1819 "lexer.cc"
+#line 1827 "lexer.cc"
case YY_END_OF_BUFFER:
{
@@ -2102,7 +2110,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 207 )
+ if ( yy_current_state >= 213 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -2130,11 +2138,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 207 )
+ if ( yy_current_state >= 213 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- yy_is_jam = (yy_current_state == 206);
+ yy_is_jam = (yy_current_state == 212);
if ( ! yy_is_jam )
*(yy_state_ptr)++ = yy_current_state;
@@ -2900,7 +2908,7 @@ void yyfree (void * ptr )
/* %ok-for-header */
-#line 218 "lexer.ll"
+#line 219 "lexer.ll"
using namespace isc::eval;
diff --git a/src/lib/eval/lexer.ll b/src/lib/eval/lexer.ll
index d990b013eb..8d3f1b4fd3 100644
--- a/src/lib/eval/lexer.ll
+++ b/src/lib/eval/lexer.ll
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+/* Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -201,6 +201,7 @@ addr6 [0-9a-fA-F]*\:[0-9a-fA-F]*\:[0-9a-fA-F:.]*
"all" return isc::eval::EvalParser::make_ALL(loc);
"concat" return isc::eval::EvalParser::make_CONCAT(loc);
"ifelse" return isc::eval::EvalParser::make_IFELSE(loc);
+"hexstring" return isc::eval::EvalParser::make_TOHEXSTRING(loc);
"not" return isc::eval::EvalParser::make_NOT(loc);
"and" return isc::eval::EvalParser::make_AND(loc);
"or" return isc::eval::EvalParser::make_OR(loc);
diff --git a/src/lib/eval/location.hh b/src/lib/eval/location.hh
index 291696d580..b20a76b1a8 100644
--- a/src/lib/eval/location.hh
+++ b/src/lib/eval/location.hh
@@ -1,8 +1,9 @@
-// A Bison parser, made by GNU Bison 3.0.4.
+// Generated 201809161042
+// A Bison parser, made by GNU Bison 3.0.5.
// Locations for Bison parsers in C++
-// Copyright (C) 2002-2015 Free Software Foundation, Inc.
+// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -40,9 +41,9 @@
# include "position.hh"
-#line 14 "parser.yy" // location.cc:296
+#line 14 "parser.yy" // location.cc:292
namespace isc { namespace eval {
-#line 46 "location.hh" // location.cc:296
+#line 46 "location.hh" // location.cc:292
/// Abstract a location.
class location
{
@@ -52,30 +53,27 @@ namespace isc { namespace eval {
location (const position& b, const position& e)
: begin (b)
, end (e)
- {
- }
+ {}
/// Construct a 0-width location in \a p.
explicit location (const position& p = position ())
: begin (p)
, end (p)
- {
- }
+ {}
/// Construct a 0-width location in \a f, \a l, \a c.
explicit location (std::string* f,
- unsigned int l = 1u,
- unsigned int c = 1u)
+ unsigned l = 1u,
+ unsigned c = 1u)
: begin (f, l, c)
, end (f, l, c)
- {
- }
+ {}
/// Initialization.
void initialize (std::string* f = YY_NULLPTR,
- unsigned int l = 1u,
- unsigned int c = 1u)
+ unsigned l = 1u,
+ unsigned c = 1u)
{
begin.initialize (f, l, c);
end = begin;
@@ -173,7 +171,7 @@ namespace isc { namespace eval {
inline std::basic_ostream&
operator<< (std::basic_ostream& ostr, const location& loc)
{
- unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
+ unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
ostr << loc.begin;
if (loc.end.filename
&& (!loc.begin.filename
@@ -186,7 +184,7 @@ namespace isc { namespace eval {
return ostr;
}
-#line 14 "parser.yy" // location.cc:296
+#line 14 "parser.yy" // location.cc:292
} } // isc::eval
-#line 192 "location.hh" // location.cc:296
+#line 189 "location.hh" // location.cc:292
#endif // !YY_EVAL_LOCATION_HH_INCLUDED
diff --git a/src/lib/eval/parser.cc b/src/lib/eval/parser.cc
index 7f6290134a..86a9b2345f 100644
--- a/src/lib/eval/parser.cc
+++ b/src/lib/eval/parser.cc
@@ -1,8 +1,8 @@
-// A Bison parser, made by GNU Bison 3.0.4.
+// A Bison parser, made by GNU Bison 3.0.5.
// Skeleton implementation for Bison LALR(1) parsers in C++
-// Copyright (C) 2002-2015 Free Software Foundation, Inc.
+// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@
// First part of user declarations.
-#line 39 "parser.cc" // lalr1.cc:404
+#line 39 "parser.cc" // lalr1.cc:406
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -49,13 +49,13 @@
// User implementation prologue.
-#line 53 "parser.cc" // lalr1.cc:412
+#line 53 "parser.cc" // lalr1.cc:414
// Unqualified %code blocks.
-#line 33 "parser.yy" // lalr1.cc:413
+#line 33 "parser.yy" // lalr1.cc:415
# include "eval_context.h"
-#line 59 "parser.cc" // lalr1.cc:413
+#line 59 "parser.cc" // lalr1.cc:415
#ifndef YY_
@@ -106,7 +106,7 @@
{ \
*yycdebug_ << Title << ' '; \
yy_print_ (*yycdebug_, Symbol); \
- *yycdebug_ << std::endl; \
+ *yycdebug_ << '\n'; \
} \
} while (false)
@@ -125,9 +125,9 @@
#else // !EVALDEBUG
# define YYCDEBUG if (false) std::cerr
-# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol)
-# define YY_REDUCE_PRINT(Rule) static_cast(0)
-# define YY_STACK_PRINT() static_cast(0)
+# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol)
+# define YY_REDUCE_PRINT(Rule) static_cast (0)
+# define YY_STACK_PRINT() static_cast (0)
#endif // !EVALDEBUG
@@ -139,9 +139,9 @@
#define YYERROR goto yyerrorlab
#define YYRECOVERING() (!!yyerrstatus_)
-#line 14 "parser.yy" // lalr1.cc:479
+#line 14 "parser.yy" // lalr1.cc:481
namespace isc { namespace eval {
-#line 145 "parser.cc" // lalr1.cc:479
+#line 145 "parser.cc" // lalr1.cc:481
/* Return YYSTR after stripping away unnecessary quotes and
backslashes, so that it's suitable for yyerror. The heuristic is
@@ -202,24 +202,20 @@ namespace isc { namespace eval {
// by_state.
- inline
EvalParser::by_state::by_state ()
: state (empty_state)
{}
- inline
EvalParser::by_state::by_state (const by_state& other)
: state (other.state)
{}
- inline
void
EvalParser::by_state::clear ()
{
state = empty_state;
}
- inline
void
EvalParser::by_state::move (by_state& that)
{
@@ -227,12 +223,10 @@ namespace isc { namespace eval {
that.clear ();
}
- inline
EvalParser::by_state::by_state (state_type s)
: state (s)
{}
- inline
EvalParser::symbol_number_type
EvalParser::by_state::type_get () const
{
@@ -242,55 +236,104 @@ namespace isc { namespace eval {
return yystos_[state];
}
- inline
EvalParser::stack_symbol_type::stack_symbol_type ()
{}
+ EvalParser::stack_symbol_type::stack_symbol_type (const stack_symbol_type& that)
+ : super_type (that.state, that.location)
+ {
+ switch (that.type_get ())
+ {
+ case 62: // option_repr_type
+ value.copy< TokenOption::RepresentationType > (that.value);
+ break;
+
+ case 66: // pkt4_field
+ value.copy< TokenPkt4::FieldType > (that.value);
+ break;
+
+ case 67: // pkt6_field
+ value.copy< TokenPkt6::FieldType > (that.value);
+ break;
+
+ case 64: // pkt_metadata
+ value.copy< TokenPkt::MetadataType > (that.value);
+ break;
+
+ case 68: // relay6_field
+ value.copy< TokenRelay6Field::FieldType > (that.value);
+ break;
+
+ case 63: // nest_level
+ value.copy< int8_t > (that.value);
+ break;
+
+ case 50: // "constant string"
+ case 51: // "integer"
+ case 52: // "constant hexstring"
+ case 53: // "option name"
+ case 54: // "ip address"
+ value.copy< std::string > (that.value);
+ break;
+
+ case 61: // option_code
+ value.copy< uint16_t > (that.value);
+ break;
+
+ case 60: // integer_expr
+ case 65: // enterprise_id
+ value.copy< uint32_t > (that.value);
+ break;
+
+ default:
+ break;
+ }
+
+ }
- inline
EvalParser::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that)
: super_type (s, that.location)
{
- switch (that.type_get ())
+ switch (that.type_get ())
{
- case 61: // option_repr_type
+ case 62: // option_repr_type
value.move< TokenOption::RepresentationType > (that.value);
break;
- case 65: // pkt4_field
+ case 66: // pkt4_field
value.move< TokenPkt4::FieldType > (that.value);
break;
- case 66: // pkt6_field
+ case 67: // pkt6_field
value.move< TokenPkt6::FieldType > (that.value);
break;
- case 63: // pkt_metadata
+ case 64: // pkt_metadata
value.move< TokenPkt::MetadataType > (that.value);
break;
- case 67: // relay6_field
+ case 68: // relay6_field
value.move< TokenRelay6Field::FieldType > (that.value);
break;
- case 62: // nest_level
+ case 63: // nest_level
value.move< int8_t > (that.value);
break;
- case 49: // "constant string"
- case 50: // "integer"
- case 51: // "constant hexstring"
- case 52: // "option name"
- case 53: // "ip address"
+ case 50: // "constant string"
+ case 51: // "integer"
+ case 52: // "constant hexstring"
+ case 53: // "option name"
+ case 54: // "ip address"
value.move< std::string > (that.value);
break;
- case 60: // option_code
+ case 61: // option_code
value.move< uint16_t > (that.value);
break;
- case 59: // integer_expr
- case 64: // enterprise_id
+ case 60: // integer_expr
+ case 65: // enterprise_id
value.move< uint32_t > (that.value);
break;
@@ -302,51 +345,50 @@ namespace isc { namespace eval {
that.type = empty_symbol;
}
- inline
EvalParser::stack_symbol_type&
EvalParser::stack_symbol_type::operator= (const stack_symbol_type& that)
{
state = that.state;
- switch (that.type_get ())
+ switch (that.type_get ())
{
- case 61: // option_repr_type
+ case 62: // option_repr_type
value.copy< TokenOption::RepresentationType > (that.value);
break;
- case 65: // pkt4_field
+ case 66: // pkt4_field
value.copy< TokenPkt4::FieldType > (that.value);
break;
- case 66: // pkt6_field
+ case 67: // pkt6_field
value.copy< TokenPkt6::FieldType > (that.value);
break;
- case 63: // pkt_metadata
+ case 64: // pkt_metadata
value.copy< TokenPkt::MetadataType > (that.value);
break;
- case 67: // relay6_field
+ case 68: // relay6_field
value.copy< TokenRelay6Field::FieldType > (that.value);
break;
- case 62: // nest_level
+ case 63: // nest_level
value.copy< int8_t > (that.value);
break;
- case 49: // "constant string"
- case 50: // "integer"
- case 51: // "constant hexstring"
- case 52: // "option name"
- case 53: // "ip address"
+ case 50: // "constant string"
+ case 51: // "integer"
+ case 52: // "constant hexstring"
+ case 53: // "option name"
+ case 54: // "ip address"
value.copy< std::string > (that.value);
break;
- case 60: // option_code
+ case 61: // option_code
value.copy< uint16_t > (that.value);
break;
- case 59: // integer_expr
- case 64: // enterprise_id
+ case 60: // integer_expr
+ case 65: // enterprise_id
value.copy< uint32_t > (that.value);
break;
@@ -360,7 +402,6 @@ namespace isc { namespace eval {
template
- inline
void
EvalParser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const
{
@@ -386,102 +427,102 @@ namespace isc { namespace eval {
<< yysym.location << ": ";
switch (yytype)
{
- case 49: // "constant string"
+ case 50: // "constant string"
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< std::string > (); }
-#line 394 "parser.cc" // lalr1.cc:636
+#line 435 "parser.cc" // lalr1.cc:635
break;
- case 50: // "integer"
+ case 51: // "integer"
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< std::string > (); }
-#line 401 "parser.cc" // lalr1.cc:636
+#line 442 "parser.cc" // lalr1.cc:635
break;
- case 51: // "constant hexstring"
+ case 52: // "constant hexstring"
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< std::string > (); }
-#line 408 "parser.cc" // lalr1.cc:636
+#line 449 "parser.cc" // lalr1.cc:635
break;
- case 52: // "option name"
+ case 53: // "option name"
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< std::string > (); }
-#line 415 "parser.cc" // lalr1.cc:636
+#line 456 "parser.cc" // lalr1.cc:635
break;
- case 53: // "ip address"
+ case 54: // "ip address"
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< std::string > (); }
-#line 422 "parser.cc" // lalr1.cc:636
+#line 463 "parser.cc" // lalr1.cc:635
break;
- case 59: // integer_expr
+ case 60: // integer_expr
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< uint32_t > (); }
-#line 429 "parser.cc" // lalr1.cc:636
+#line 470 "parser.cc" // lalr1.cc:635
break;
- case 60: // option_code
+ case 61: // option_code
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< uint16_t > (); }
-#line 436 "parser.cc" // lalr1.cc:636
+#line 477 "parser.cc" // lalr1.cc:635
break;
- case 61: // option_repr_type
+ case 62: // option_repr_type
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< TokenOption::RepresentationType > (); }
-#line 443 "parser.cc" // lalr1.cc:636
+#line 484 "parser.cc" // lalr1.cc:635
break;
- case 62: // nest_level
+ case 63: // nest_level
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< int8_t > (); }
-#line 450 "parser.cc" // lalr1.cc:636
+#line 491 "parser.cc" // lalr1.cc:635
break;
- case 63: // pkt_metadata
+ case 64: // pkt_metadata
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< TokenPkt::MetadataType > (); }
-#line 457 "parser.cc" // lalr1.cc:636
+#line 498 "parser.cc" // lalr1.cc:635
break;
- case 64: // enterprise_id
+ case 65: // enterprise_id
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< uint32_t > (); }
-#line 464 "parser.cc" // lalr1.cc:636
+#line 505 "parser.cc" // lalr1.cc:635
break;
- case 65: // pkt4_field
+ case 66: // pkt4_field
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< TokenPkt4::FieldType > (); }
-#line 471 "parser.cc" // lalr1.cc:636
+#line 512 "parser.cc" // lalr1.cc:635
break;
- case 66: // pkt6_field
+ case 67: // pkt6_field
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< TokenPkt6::FieldType > (); }
-#line 478 "parser.cc" // lalr1.cc:636
+#line 519 "parser.cc" // lalr1.cc:635
break;
- case 67: // relay6_field
+ case 68: // relay6_field
-#line 110 "parser.yy" // lalr1.cc:636
+#line 111 "parser.yy" // lalr1.cc:635
{ yyoutput << yysym.value.template as< TokenRelay6Field::FieldType > (); }
-#line 485 "parser.cc" // lalr1.cc:636
+#line 526 "parser.cc" // lalr1.cc:635
break;
@@ -492,7 +533,6 @@ namespace isc { namespace eval {
}
#endif
- inline
void
EvalParser::yypush_ (const char* m, state_type s, symbol_type& sym)
{
@@ -500,7 +540,6 @@ namespace isc { namespace eval {
yypush_ (m, t);
}
- inline
void
EvalParser::yypush_ (const char* m, stack_symbol_type& s)
{
@@ -509,9 +548,8 @@ namespace isc { namespace eval {
yystack_.push (s);
}
- inline
void
- EvalParser::yypop_ (unsigned int n)
+ EvalParser::yypop_ (unsigned n)
{
yystack_.pop (n);
}
@@ -543,7 +581,7 @@ namespace isc { namespace eval {
}
#endif // EVALDEBUG
- inline EvalParser::state_type
+ EvalParser::state_type
EvalParser::yy_lr_goto_state_ (state_type yystate, int yysym)
{
int yyr = yypgoto_[yysym - yyntokens_] + yystate;
@@ -553,13 +591,13 @@ namespace isc { namespace eval {
return yydefgoto_[yysym - yyntokens_];
}
- inline bool
+ bool
EvalParser::yy_pact_value_is_default_ (int yyvalue)
{
return yyvalue == yypact_ninf_;
}
- inline bool
+ bool
EvalParser::yy_table_value_is_error_ (int yyvalue)
{
return yyvalue == yytable_ninf_;
@@ -590,7 +628,7 @@ namespace isc { namespace eval {
// avoid gratuitous conflicts when merging into the master branch.
try
{
- YYCDEBUG << "Starting parse" << std::endl;
+ YYCDEBUG << "Starting parse\n";
/* Initialize the stack. The initial state will be set in
@@ -602,7 +640,7 @@ namespace isc { namespace eval {
// A new symbol was pushed on the stack.
yynewstate:
- YYCDEBUG << "Entering state " << yystack_[0].state << std::endl;
+ YYCDEBUG << "Entering state " << yystack_[0].state << '\n';
// Accept?
if (yystack_[0].state == yyfinal_)
@@ -675,50 +713,50 @@ namespace isc { namespace eval {
yylen = yyr2_[yyn];
{
stack_symbol_type yylhs;
- yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);
+ yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
/* Variants are always initialized to an empty instance of the
correct type. The default '$$ = $1' action is NOT applied
when using variants. */
- switch (yyr1_[yyn])
+ switch (yyr1_[yyn])
{
- case 61: // option_repr_type
+ case 62: // option_repr_type
yylhs.value.build< TokenOption::RepresentationType > ();
break;
- case 65: // pkt4_field
+ case 66: // pkt4_field
yylhs.value.build< TokenPkt4::FieldType > ();
break;
- case 66: // pkt6_field
+ case 67: // pkt6_field
yylhs.value.build< TokenPkt6::FieldType > ();
break;
- case 63: // pkt_metadata
+ case 64: // pkt_metadata
yylhs.value.build< TokenPkt::MetadataType > ();
break;
- case 67: // relay6_field
+ case 68: // relay6_field
yylhs.value.build< TokenRelay6Field::FieldType > ();
break;
- case 62: // nest_level
+ case 63: // nest_level
yylhs.value.build< int8_t > ();
break;
- case 49: // "constant string"
- case 50: // "integer"
- case 51: // "constant hexstring"
- case 52: // "option name"
- case 53: // "ip address"
+ case 50: // "constant string"
+ case 51: // "integer"
+ case 52: // "constant hexstring"
+ case 53: // "option name"
+ case 54: // "ip address"
yylhs.value.build< std::string > ();
break;
- case 60: // option_code
+ case 61: // option_code
yylhs.value.build< uint16_t > ();
break;
- case 59: // integer_expr
- case 64: // enterprise_id
+ case 60: // integer_expr
+ case 65: // enterprise_id
yylhs.value.build< uint32_t > ();
break;
@@ -727,10 +765,11 @@ namespace isc { namespace eval {
}
- // Compute the default @$.
+ // Default location.
{
slice slice (yystack_, yylen);
YYLLOC_DEFAULT (yylhs.location, slice, yylen);
+ yyerror_range[1].location = yylhs.location;
}
// Perform the reduction.
@@ -740,52 +779,52 @@ namespace isc { namespace eval {
switch (yyn)
{
case 6:
-#line 130 "parser.yy" // lalr1.cc:859
+#line 131 "parser.yy" // lalr1.cc:856
{
TokenPtr neg(new TokenNot());
ctx.expression.push_back(neg);
}
-#line 749 "parser.cc" // lalr1.cc:859
+#line 788 "parser.cc" // lalr1.cc:856
break;
case 7:
-#line 135 "parser.yy" // lalr1.cc:859
+#line 136 "parser.yy" // lalr1.cc:856
{
TokenPtr neg(new TokenAnd());
ctx.expression.push_back(neg);
}
-#line 758 "parser.cc" // lalr1.cc:859
+#line 797 "parser.cc" // lalr1.cc:856
break;
case 8:
-#line 140 "parser.yy" // lalr1.cc:859
+#line 141 "parser.yy" // lalr1.cc:856
{
TokenPtr neg(new TokenOr());
ctx.expression.push_back(neg);
}
-#line 767 "parser.cc" // lalr1.cc:859
+#line 806 "parser.cc" // lalr1.cc:856
break;
case 9:
-#line 145 "parser.yy" // lalr1.cc:859
+#line 146 "parser.yy" // lalr1.cc:856
{
TokenPtr eq(new TokenEqual());
ctx.expression.push_back(eq);
}
-#line 776 "parser.cc" // lalr1.cc:859
+#line 815 "parser.cc" // lalr1.cc:856
break;
case 10:
-#line 150 "parser.yy" // lalr1.cc:859
+#line 151 "parser.yy" // lalr1.cc:856
{
TokenPtr opt(new TokenOption(yystack_[3].value.as< uint16_t > (), TokenOption::EXISTS));
ctx.expression.push_back(opt);
}
-#line 785 "parser.cc" // lalr1.cc:859
+#line 824 "parser.cc" // lalr1.cc:856
break;
case 11:
-#line 155 "parser.yy" // lalr1.cc:859
+#line 156 "parser.yy" // lalr1.cc:856
{
switch (ctx.getUniverse()) {
case Option::V4:
@@ -805,11 +844,11 @@ namespace isc { namespace eval {
error(yystack_[5].location, "relay4 can only be used in DHCPv4.");
}
}
-#line 809 "parser.cc" // lalr1.cc:859
+#line 848 "parser.cc" // lalr1.cc:856
break;
case 12:
-#line 175 "parser.yy" // lalr1.cc:859
+#line 176 "parser.yy" // lalr1.cc:856
{
switch (ctx.getUniverse()) {
case Option::V6:
@@ -823,11 +862,11 @@ namespace isc { namespace eval {
error(yystack_[10].location, "relay6 can only be used in DHCPv6.");
}
}
-#line 827 "parser.cc" // lalr1.cc:859
+#line 866 "parser.cc" // lalr1.cc:856
break;
case 13:
-#line 189 "parser.yy" // lalr1.cc:859
+#line 190 "parser.yy" // lalr1.cc:856
{
// Expression: vendor-class[1234].exists
//
@@ -836,11 +875,11 @@ namespace isc { namespace eval {
TokenPtr exist(new TokenVendorClass(ctx.getUniverse(), yystack_[3].value.as< uint32_t > (), TokenOption::EXISTS));
ctx.expression.push_back(exist);
}
-#line 840 "parser.cc" // lalr1.cc:859
+#line 879 "parser.cc" // lalr1.cc:856
break;
case 14:
-#line 198 "parser.yy" // lalr1.cc:859
+#line 199 "parser.yy" // lalr1.cc:856
{
// Expression: vendor[1234].exists
//
@@ -849,11 +888,11 @@ namespace isc { namespace eval {
TokenPtr exist(new TokenVendor(ctx.getUniverse(), yystack_[3].value.as< uint32_t > (), TokenOption::EXISTS));
ctx.expression.push_back(exist);
}
-#line 853 "parser.cc" // lalr1.cc:859
+#line 892 "parser.cc" // lalr1.cc:856
break;
case 15:
-#line 207 "parser.yy" // lalr1.cc:859
+#line 208 "parser.yy" // lalr1.cc:856
{
// Expression vendor[1234].option[123].exists
//
@@ -863,11 +902,11 @@ namespace isc { namespace eval {
TokenPtr exist(new TokenVendor(ctx.getUniverse(), yystack_[8].value.as< uint32_t > (), TokenOption::EXISTS, yystack_[3].value.as< uint16_t > ()));
ctx.expression.push_back(exist);
}
-#line 867 "parser.cc" // lalr1.cc:859
+#line 906 "parser.cc" // lalr1.cc:856
break;
case 16:
-#line 217 "parser.yy" // lalr1.cc:859
+#line 218 "parser.yy" // lalr1.cc:856
{
// Expression member('foo')
//
@@ -882,47 +921,47 @@ namespace isc { namespace eval {
TokenPtr member(new TokenMember(cc));
ctx.expression.push_back(member);
}
-#line 886 "parser.cc" // lalr1.cc:859
+#line 925 "parser.cc" // lalr1.cc:856
break;
case 17:
-#line 234 "parser.yy" // lalr1.cc:859
+#line 235 "parser.yy" // lalr1.cc:856
{
TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ()));
ctx.expression.push_back(str);
}
-#line 895 "parser.cc" // lalr1.cc:859
+#line 934 "parser.cc" // lalr1.cc:856
break;
case 18:
-#line 239 "parser.yy" // lalr1.cc:859
+#line 240 "parser.yy" // lalr1.cc:856
{
TokenPtr hex(new TokenHexString(yystack_[0].value.as< std::string > ()));
ctx.expression.push_back(hex);
}
-#line 904 "parser.cc" // lalr1.cc:859
+#line 943 "parser.cc" // lalr1.cc:856
break;
case 19:
-#line 244 "parser.yy" // lalr1.cc:859
+#line 245 "parser.yy" // lalr1.cc:856
{
TokenPtr ip(new TokenIpAddress(yystack_[0].value.as< std::string > ()));
ctx.expression.push_back(ip);
}
-#line 913 "parser.cc" // lalr1.cc:859
+#line 952 "parser.cc" // lalr1.cc:856
break;
case 20:
-#line 249 "parser.yy" // lalr1.cc:859
+#line 250 "parser.yy" // lalr1.cc:856
{
TokenPtr opt(new TokenOption(yystack_[3].value.as< uint16_t > (), yystack_[0].value.as< TokenOption::RepresentationType > ()));
ctx.expression.push_back(opt);
}
-#line 922 "parser.cc" // lalr1.cc:859
+#line 961 "parser.cc" // lalr1.cc:856
break;
case 21:
-#line 254 "parser.yy" // lalr1.cc:859
+#line 255 "parser.yy" // lalr1.cc:856
{
switch (ctx.getUniverse()) {
case Option::V4:
@@ -942,11 +981,11 @@ namespace isc { namespace eval {
error(yystack_[5].location, "relay4 can only be used in DHCPv4.");
}
}
-#line 946 "parser.cc" // lalr1.cc:859
+#line 985 "parser.cc" // lalr1.cc:856
break;
case 22:
-#line 275 "parser.yy" // lalr1.cc:859
+#line 276 "parser.yy" // lalr1.cc:856
{
switch (ctx.getUniverse()) {
case Option::V6:
@@ -960,20 +999,20 @@ namespace isc { namespace eval {
error(yystack_[10].location, "relay6 can only be used in DHCPv6.");
}
}
-#line 964 "parser.cc" // lalr1.cc:859
+#line 1003 "parser.cc" // lalr1.cc:856
break;
case 23:
-#line 290 "parser.yy" // lalr1.cc:859
+#line 291 "parser.yy" // lalr1.cc:856
{
TokenPtr pkt_metadata(new TokenPkt(yystack_[0].value.as< TokenPkt::MetadataType > ()));
ctx.expression.push_back(pkt_metadata);
}
-#line 973 "parser.cc" // lalr1.cc:859
+#line 1012 "parser.cc" // lalr1.cc:856
break;
case 24:
-#line 295 "parser.yy" // lalr1.cc:859
+#line 296 "parser.yy" // lalr1.cc:856
{
switch (ctx.getUniverse()) {
case Option::V4:
@@ -987,11 +1026,11 @@ namespace isc { namespace eval {
error(yystack_[2].location, "pkt4 can only be used in DHCPv4.");
}
}
-#line 991 "parser.cc" // lalr1.cc:859
+#line 1030 "parser.cc" // lalr1.cc:856
break;
case 25:
-#line 309 "parser.yy" // lalr1.cc:859
+#line 310 "parser.yy" // lalr1.cc:856
{
switch (ctx.getUniverse()) {
case Option::V6:
@@ -1005,11 +1044,11 @@ namespace isc { namespace eval {
error(yystack_[2].location, "pkt6 can only be used in DHCPv6.");
}
}
-#line 1009 "parser.cc" // lalr1.cc:859
+#line 1048 "parser.cc" // lalr1.cc:856
break;
case 26:
-#line 323 "parser.yy" // lalr1.cc:859
+#line 324 "parser.yy" // lalr1.cc:856
{
switch (ctx.getUniverse()) {
case Option::V6:
@@ -1023,38 +1062,47 @@ namespace isc { namespace eval {
error(yystack_[5].location, "relay6 can only be used in DHCPv6.");
}
}
-#line 1027 "parser.cc" // lalr1.cc:859
+#line 1066 "parser.cc" // lalr1.cc:856
break;
case 27:
-#line 338 "parser.yy" // lalr1.cc:859
+#line 339 "parser.yy" // lalr1.cc:856
{
TokenPtr sub(new TokenSubstring());
ctx.expression.push_back(sub);
}
-#line 1036 "parser.cc" // lalr1.cc:859
+#line 1075 "parser.cc" // lalr1.cc:856
break;
case 28:
-#line 343 "parser.yy" // lalr1.cc:859
+#line 344 "parser.yy" // lalr1.cc:856
{
TokenPtr conc(new TokenConcat());
ctx.expression.push_back(conc);
}
-#line 1045 "parser.cc" // lalr1.cc:859
+#line 1084 "parser.cc" // lalr1.cc:856
break;
case 29:
-#line 348 "parser.yy" // lalr1.cc:859
+#line 349 "parser.yy" // lalr1.cc:856
{
TokenPtr cond(new TokenIfElse());
ctx.expression.push_back(cond);
}
-#line 1054 "parser.cc" // lalr1.cc:859
+#line 1093 "parser.cc" // lalr1.cc:856
break;
case 30:
-#line 353 "parser.yy" // lalr1.cc:859
+#line 354 "parser.yy" // lalr1.cc:856
+ {
+ TokenPtr tohex(new TokenToHexString());
+ ctx.expression.push_back(tohex);
+ }
+#line 1102 "parser.cc" // lalr1.cc:856
+ break;
+
+ case 31:
+#line 359 "parser.yy" // lalr1.cc:856
{
// expression: vendor.enterprise
//
@@ -1063,11 +1111,11 @@ namespace isc { namespace eval {
TokenPtr vendor(new TokenVendor(ctx.getUniverse(), 0, TokenVendor::ENTERPRISE_ID));
ctx.expression.push_back(vendor);
}
-#line 1067 "parser.cc" // lalr1.cc:859
+#line 1115 "parser.cc" // lalr1.cc:856
break;
- case 31:
-#line 362 "parser.yy" // lalr1.cc:859
+ case 32:
+#line 368 "parser.yy" // lalr1.cc:856
{
// expression: vendor-class.enterprise
//
@@ -1077,11 +1125,11 @@ namespace isc { namespace eval {
TokenVendor::ENTERPRISE_ID));
ctx.expression.push_back(vendor);
}
-#line 1081 "parser.cc" // lalr1.cc:859
+#line 1129 "parser.cc" // lalr1.cc:856
break;
- case 32:
-#line 372 "parser.yy" // lalr1.cc:859
+ case 33:
+#line 378 "parser.yy" // lalr1.cc:856
{
// This token will search for vendor option with
// specified enterprise-id. If found, will search
@@ -1090,11 +1138,11 @@ namespace isc { namespace eval {
TokenPtr opt(new TokenVendor(ctx.getUniverse(), yystack_[8].value.as< uint32_t > (), yystack_[0].value.as< TokenOption::RepresentationType > (), yystack_[3].value.as< uint16_t > ()));
ctx.expression.push_back(opt);
}
-#line 1094 "parser.cc" // lalr1.cc:859
+#line 1142 "parser.cc" // lalr1.cc:856
break;
- case 33:
-#line 381 "parser.yy" // lalr1.cc:859
+ case 34:
+#line 387 "parser.yy" // lalr1.cc:856
{
// expression: vendor-class[1234].data
//
@@ -1107,11 +1155,11 @@ namespace isc { namespace eval {
TokenVendor::DATA, 0));
ctx.expression.push_back(vendor_class);
}
-#line 1111 "parser.cc" // lalr1.cc:859
+#line 1159 "parser.cc" // lalr1.cc:856
break;
- case 34:
-#line 394 "parser.yy" // lalr1.cc:859
+ case 35:
+#line 400 "parser.yy" // lalr1.cc:856
{
// expression: vendor-class[1234].data[5]
//
@@ -1124,247 +1172,247 @@ namespace isc { namespace eval {
TokenVendor::DATA, index));
ctx.expression.push_back(vendor_class);
}
-#line 1128 "parser.cc" // lalr1.cc:859
+#line 1176 "parser.cc" // lalr1.cc:856
break;
- case 35:
-#line 407 "parser.yy" // lalr1.cc:859
+ case 36:
+#line 413 "parser.yy" // lalr1.cc:856
{
TokenPtr integer(new TokenInteger(yystack_[0].value.as< uint32_t > ()));
ctx.expression.push_back(integer);
}
-#line 1137 "parser.cc" // lalr1.cc:859
- break;
-
- case 36:
-#line 414 "parser.yy" // lalr1.cc:859
- {
- yylhs.value.as< uint32_t > () = ctx.convertUint32(yystack_[0].value.as< std::string > (), yystack_[0].location);
- }
-#line 1145 "parser.cc" // lalr1.cc:859
+#line 1185 "parser.cc" // lalr1.cc:856
break;
case 37:
-#line 420 "parser.yy" // lalr1.cc:859
+#line 420 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< uint16_t > () = ctx.convertOptionCode(yystack_[0].value.as< std::string > (), yystack_[0].location);
+ yylhs.value.as< uint32_t > () = ctx.convertUint32(yystack_[0].value.as< std::string > (), yystack_[0].location);
}
-#line 1153 "parser.cc" // lalr1.cc:859
+#line 1193 "parser.cc" // lalr1.cc:856
break;
case 38:
-#line 424 "parser.yy" // lalr1.cc:859
+#line 426 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< uint16_t > () = ctx.convertOptionName(yystack_[0].value.as< std::string > (), yystack_[0].location);
+ yylhs.value.as< uint16_t > () = ctx.convertOptionCode(yystack_[0].value.as< std::string > (), yystack_[0].location);
}
-#line 1161 "parser.cc" // lalr1.cc:859
+#line 1201 "parser.cc" // lalr1.cc:856
break;
case 39:
-#line 430 "parser.yy" // lalr1.cc:859
+#line 430 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::TEXTUAL;
- }
-#line 1169 "parser.cc" // lalr1.cc:859
+ yylhs.value.as< uint16_t > () = ctx.convertOptionName(yystack_[0].value.as< std::string > (), yystack_[0].location);
+ }
+#line 1209 "parser.cc" // lalr1.cc:856
break;
case 40:
-#line 434 "parser.yy" // lalr1.cc:859
+#line 436 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::HEXADECIMAL;
+ yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::TEXTUAL;
}
-#line 1177 "parser.cc" // lalr1.cc:859
+#line 1217 "parser.cc" // lalr1.cc:856
break;
case 41:
-#line 440 "parser.yy" // lalr1.cc:859
+#line 440 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< int8_t > () = ctx.convertNestLevelNumber(yystack_[0].value.as< std::string > (), yystack_[0].location);
- }
-#line 1185 "parser.cc" // lalr1.cc:859
+ yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::HEXADECIMAL;
+ }
+#line 1225 "parser.cc" // lalr1.cc:856
break;
case 42:
-#line 449 "parser.yy" // lalr1.cc:859
+#line 446 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::IFACE;
- }
-#line 1193 "parser.cc" // lalr1.cc:859
+ yylhs.value.as< int8_t > () = ctx.convertNestLevelNumber(yystack_[0].value.as< std::string > (), yystack_[0].location);
+ }
+#line 1233 "parser.cc" // lalr1.cc:856
break;
case 43:
-#line 453 "parser.yy" // lalr1.cc:859
+#line 455 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::SRC;
+ yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::IFACE;
}
-#line 1201 "parser.cc" // lalr1.cc:859
+#line 1241 "parser.cc" // lalr1.cc:856
break;
case 44:
-#line 457 "parser.yy" // lalr1.cc:859
+#line 459 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::DST;
+ yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::SRC;
}
-#line 1209 "parser.cc" // lalr1.cc:859
+#line 1249 "parser.cc" // lalr1.cc:856
break;
case 45:
-#line 461 "parser.yy" // lalr1.cc:859
+#line 463 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::LEN;
+ yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::DST;
}
-#line 1217 "parser.cc" // lalr1.cc:859
+#line 1257 "parser.cc" // lalr1.cc:856
break;
case 46:
-#line 467 "parser.yy" // lalr1.cc:859
+#line 467 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< uint32_t > () = ctx.convertUint32(yystack_[0].value.as< std::string > (), yystack_[0].location);
- }
-#line 1225 "parser.cc" // lalr1.cc:859
+ yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::LEN;
+ }
+#line 1265 "parser.cc" // lalr1.cc:856
break;
case 47:
-#line 471 "parser.yy" // lalr1.cc:859
+#line 473 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< uint32_t > () = 0;
+ yylhs.value.as< uint32_t > () = ctx.convertUint32(yystack_[0].value.as< std::string > (), yystack_[0].location);
}
-#line 1233 "parser.cc" // lalr1.cc:859
+#line 1273 "parser.cc" // lalr1.cc:856
break;
case 48:
-#line 477 "parser.yy" // lalr1.cc:859
+#line 477 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::CHADDR;
- }
-#line 1241 "parser.cc" // lalr1.cc:859
+ yylhs.value.as< uint32_t > () = 0;
+ }
+#line 1281 "parser.cc" // lalr1.cc:856
break;
case 49:
-#line 481 "parser.yy" // lalr1.cc:859
+#line 483 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::HLEN;
+ yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::CHADDR;
}
-#line 1249 "parser.cc" // lalr1.cc:859
+#line 1289 "parser.cc" // lalr1.cc:856
break;
case 50:
-#line 485 "parser.yy" // lalr1.cc:859
+#line 487 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::HTYPE;
+ yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::HLEN;
}
-#line 1257 "parser.cc" // lalr1.cc:859
+#line 1297 "parser.cc" // lalr1.cc:856
break;
case 51:
-#line 489 "parser.yy" // lalr1.cc:859
+#line 491 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::CIADDR;
+ yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::HTYPE;
}
-#line 1265 "parser.cc" // lalr1.cc:859
+#line 1305 "parser.cc" // lalr1.cc:856
break;
case 52:
-#line 493 "parser.yy" // lalr1.cc:859
+#line 495 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::GIADDR;
+ yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::CIADDR;
}
-#line 1273 "parser.cc" // lalr1.cc:859
+#line 1313 "parser.cc" // lalr1.cc:856
break;
case 53:
-#line 497 "parser.yy" // lalr1.cc:859
+#line 499 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::YIADDR;
+ yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::GIADDR;
}
-#line 1281 "parser.cc" // lalr1.cc:859
+#line 1321 "parser.cc" // lalr1.cc:856
break;
case 54:
-#line 501 "parser.yy" // lalr1.cc:859
+#line 503 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::SIADDR;
+ yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::YIADDR;
}
-#line 1289 "parser.cc" // lalr1.cc:859
+#line 1329 "parser.cc" // lalr1.cc:856
break;
case 55:
-#line 505 "parser.yy" // lalr1.cc:859
+#line 507 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::MSGTYPE;
- }
-#line 1297 "parser.cc" // lalr1.cc:859
+ yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::SIADDR;
+ }
+#line 1337 "parser.cc" // lalr1.cc:856
break;
case 56:
-#line 509 "parser.yy" // lalr1.cc:859
+#line 511 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::TRANSID;
+ yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::MSGTYPE;
}
-#line 1305 "parser.cc" // lalr1.cc:859
+#line 1345 "parser.cc" // lalr1.cc:856
break;
case 57:
-#line 515 "parser.yy" // lalr1.cc:859
+#line 515 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt6::FieldType > () = TokenPkt6::MSGTYPE;
+ yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::TRANSID;
}
-#line 1313 "parser.cc" // lalr1.cc:859
+#line 1353 "parser.cc" // lalr1.cc:856
break;
case 58:
-#line 519 "parser.yy" // lalr1.cc:859
+#line 521 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenPkt6::FieldType > () = TokenPkt6::TRANSID;
+ yylhs.value.as< TokenPkt6::FieldType > () = TokenPkt6::MSGTYPE;
}
-#line 1321 "parser.cc" // lalr1.cc:859
+#line 1361 "parser.cc" // lalr1.cc:856
break;
case 59:
-#line 525 "parser.yy" // lalr1.cc:859
+#line 525 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenRelay6Field::FieldType > () = TokenRelay6Field::PEERADDR;
- }
-#line 1329 "parser.cc" // lalr1.cc:859
+ yylhs.value.as< TokenPkt6::FieldType > () = TokenPkt6::TRANSID;
+ }
+#line 1369 "parser.cc" // lalr1.cc:856
break;
case 60:
-#line 529 "parser.yy" // lalr1.cc:859
+#line 531 "parser.yy" // lalr1.cc:856
{
- yylhs.value.as< TokenRelay6Field::FieldType > () = TokenRelay6Field::LINKADDR;
+ yylhs.value.as< TokenRelay6Field::FieldType > () = TokenRelay6Field::PEERADDR;
}
-#line 1337 "parser.cc" // lalr1.cc:859
+#line 1377 "parser.cc" // lalr1.cc:856
break;
case 61:
-#line 535 "parser.yy" // lalr1.cc:859
+#line 535 "parser.yy" // lalr1.cc:856
+ {
+ yylhs.value.as< TokenRelay6Field::FieldType > () = TokenRelay6Field::LINKADDR;
+ }
+#line 1385 "parser.cc" // lalr1.cc:856
+ break;
+
+ case 62:
+#line 541 "parser.yy" // lalr1.cc:856
{
TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ()));
ctx.expression.push_back(str);
}
-#line 1346 "parser.cc" // lalr1.cc:859
+#line 1394 "parser.cc" // lalr1.cc:856
break;
- case 62:
-#line 542 "parser.yy" // lalr1.cc:859
+ case 63:
+#line 548 "parser.yy" // lalr1.cc:856
{
TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ()));
ctx.expression.push_back(str);
}
-#line 1355 "parser.cc" // lalr1.cc:859
+#line 1403 "parser.cc" // lalr1.cc:856
break;
- case 63:
-#line 547 "parser.yy" // lalr1.cc:859
+ case 64:
+#line 553 "parser.yy" // lalr1.cc:856
{
TokenPtr str(new TokenString("all"));
ctx.expression.push_back(str);
}
-#line 1364 "parser.cc" // lalr1.cc:859
+#line 1412 "parser.cc" // lalr1.cc:856
break;
-#line 1368 "parser.cc" // lalr1.cc:859
+#line 1416 "parser.cc" // lalr1.cc:856
default:
break;
}
@@ -1426,7 +1474,6 @@ namespace isc { namespace eval {
code. */
if (false)
goto yyerrorlab;
- yyerror_range[1].location = yystack_[yylen - 1].location;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
yypop_ (yylen);
@@ -1500,8 +1547,7 @@ namespace isc { namespace eval {
}
catch (...)
{
- YYCDEBUG << "Exception caught: cleaning lookahead and stack"
- << std::endl;
+ YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
// Do not try to display the values of the reclaimed symbols,
// as their printer might throw an exception.
if (!yyla.empty ())
@@ -1519,7 +1565,7 @@ namespace isc { namespace eval {
void
EvalParser::error (const syntax_error& yyexc)
{
- error (yyexc.location, yyexc.what());
+ error (yyexc.location, yyexc.what ());
}
// Generate an error message.
@@ -1595,12 +1641,13 @@ namespace isc { namespace eval {
case N: \
yyformat = S; \
break
- YYCASE_(0, YY_("syntax error"));
- YYCASE_(1, YY_("syntax error, unexpected %s"));
- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+ default: // Avoid compiler warnings.
+ YYCASE_ (0, YY_("syntax error"));
+ YYCASE_ (1, YY_("syntax error, unexpected %s"));
+ YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
#undef YYCASE_
}
@@ -1619,153 +1666,156 @@ namespace isc { namespace eval {
}
- const signed char EvalParser::yypact_ninf_ = -114;
+ const signed char EvalParser::yypact_ninf_ = -118;
const signed char EvalParser::yytable_ninf_ = -1;
const short int
EvalParser::yypact_[] =
{
- 18, 25, 72, 32, 25, 25, 14, 26, 37, 70,
- 80, 84, 99, 105, 110, 100, 33, 90, -114, -114,
- -114, -114, -114, 38, 116, -114, 101, 121, 122, 117,
- 118, -114, -114, 73, -114, -38, -38, 89, 91, 47,
- 59, 72, 72, 25, 20, -31, 95, -31, 96, 25,
- 25, 72, -38, -38, 89, -31, -31, -114, -114, -114,
- 127, 128, -114, 129, 142, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- 112, 113, -3, -114, -114, -114, -114, -114, 131, -114,
- 134, -114, -114, 145, -114, 136, 137, 138, 139, 140,
- 141, 143, 144, -114, 107, 72, 72, 146, 147, 148,
- 149, 150, 151, 152, 5, 76, 13, -114, 123, 158,
- 135, -14, 1, 66, 66, 29, 125, 163, -114, -114,
- -114, -114, -114, -114, 159, -114, -114, -114, -30, -114,
- 72, -114, 160, 161, -114, 162, 164, -38, -114, -114,
- 169, 174, 130, -38, -38, -38, 165, -114, -114, 166,
- 167, 168, 170, 171, -114, 172, 173, 175, 108, 111,
- 66, 66, -114, -114, -114, -114
+ -14, 27, 76, 17, 27, 27, 37, 41, 53, 39,
+ 52, 59, 77, 85, 93, 98, 88, 29, 94, -118,
+ -118, -118, -118, -118, 56, 104, -118, 114, 124, 129,
+ 119, 120, -118, -118, 7, -118, 87, 87, 67, 95,
+ 50, 62, 76, 76, 27, 76, 100, -35, 99, -35,
+ 101, 27, 27, 76, 87, 87, 67, -35, -35, -118,
+ -118, -118, 131, 133, -118, 134, 147, -118, -118, -118,
+ -118, -118, -118, -118, -118, -118, -118, -118, -118, -118,
+ -118, -118, 116, 117, -3, 118, -118, -118, -118, -118,
+ -118, 139, -118, 140, -118, -118, 151, -118, 142, 143,
+ 144, 145, 146, 148, 149, 150, -118, 112, 76, 76,
+ 76, 152, 153, 154, 155, 156, 157, 158, 9, 64,
+ 12, -118, 128, 164, 141, 172, -15, 0, 103, 103,
+ 36, 132, 170, -118, -118, -118, -118, -118, -118, 165,
+ -118, -118, -118, -29, -118, 76, -118, -118, 166, 167,
+ -118, 168, 169, 87, -118, -118, 181, 182, 136, 87,
+ 87, 87, 173, -118, -118, 174, 175, 176, 177, 171,
+ -118, 178, 179, 180, 80, 113, 103, 103, -118, -118,
+ -118, -118
};
const unsigned char
EvalParser::yydefact_[] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 17, 36,
- 18, 19, 2, 4, 0, 35, 0, 0, 0, 0,
- 0, 3, 1, 0, 6, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
+ 37, 18, 19, 2, 4, 0, 36, 0, 0, 0,
+ 0, 0, 3, 1, 0, 6, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5, 37, 38,
- 0, 0, 41, 0, 0, 42, 43, 44, 45, 23,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 24,
- 0, 0, 0, 57, 58, 25, 47, 46, 0, 31,
- 0, 30, 7, 8, 9, 0, 0, 0, 0, 0,
- 0, 0, 0, 16, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 61, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 39, 40,
- 10, 20, 11, 21, 0, 59, 60, 26, 0, 28,
- 0, 13, 33, 0, 14, 0, 0, 0, 63, 62,
- 0, 0, 0, 0, 0, 0, 0, 27, 29, 0,
- 0, 0, 0, 0, 34, 0, 0, 0, 0, 0,
- 0, 0, 12, 22, 15, 32
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
+ 38, 39, 0, 0, 42, 0, 0, 43, 44, 45,
+ 46, 23, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 24, 0, 0, 0, 0, 58, 59, 25, 48,
+ 47, 0, 32, 0, 31, 7, 8, 9, 0, 0,
+ 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 62, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 40, 41, 10, 20, 11, 21, 0,
+ 60, 61, 26, 0, 28, 0, 30, 13, 34, 0,
+ 14, 0, 0, 0, 64, 63, 0, 0, 0, 0,
+ 0, 0, 0, 27, 29, 0, 0, 0, 0, 0,
+ 35, 0, 0, 0, 0, 0, 0, 0, 12, 22,
+ 15, 33
};
const short int
EvalParser::yypgoto_[] =
{
- -114, -114, -114, 4, -2, -114, -35, -113, 133, -114,
- -40, -114, -114, -114, -114, -114
+ -118, -118, -118, 3, -2, -118, -36, -117, 138, -118,
+ -34, -118, -118, -118, -118, -118
};
const short int
EvalParser::yydefgoto_[] =
{
- -1, 3, 22, 23, 24, 25, 60, 131, 63, 69,
- 88, 79, 85, 137, 118, 150
+ -1, 3, 23, 24, 25, 26, 62, 136, 65, 71,
+ 91, 81, 88, 142, 122, 156
};
const unsigned char
EvalParser::yytable_[] =
{
- 31, 61, 133, 49, 50, 148, 141, 90, 33, 34,
- 143, 133, 58, 86, 59, 98, 99, 95, 96, 87,
- 149, 144, 134, 128, 129, 130, 135, 136, 4, 35,
- 5, 142, 32, 106, 6, 7, 8, 9, 145, 80,
- 81, 36, 135, 136, 49, 50, 10, 82, 45, 94,
- 46, 11, 37, 92, 93, 173, 175, 173, 175, 12,
- 83, 84, 13, 14, 15, 1, 2, 16, 17, 65,
- 66, 67, 68, 38, 18, 19, 20, 57, 21, 49,
- 50, 26, 27, 28, 128, 129, 70, 71, 72, 73,
- 74, 75, 76, 10, 128, 129, 132, 39, 11, 77,
- 78, 40, 41, 119, 120, 47, 12, 48, 42, 13,
- 14, 15, 156, 43, 29, 30, 52, 44, 160, 161,
- 162, 18, 19, 20, 51, 21, 128, 129, 172, 128,
- 129, 174, 55, 56, 46, 48, 53, 54, 151, 62,
- 64, 89, 91, 100, 101, 102, 103, 107, 104, 105,
- 108, 49, 109, 110, 111, 112, 113, 117, 114, 138,
- 115, 116, 139, 121, 122, 123, 124, 125, 126, 127,
- 142, 140, 146, 157, 147, 152, 153, 154, 158, 155,
- 159, 163, 164, 165, 166, 0, 167, 97, 168, 169,
- 170, 0, 171
+ 32, 63, 138, 51, 52, 147, 154, 34, 35, 149,
+ 89, 59, 138, 51, 52, 93, 90, 33, 98, 99,
+ 150, 139, 155, 101, 102, 140, 141, 133, 134, 135,
+ 4, 148, 5, 109, 1, 2, 6, 7, 8, 9,
+ 82, 83, 39, 85, 47, 151, 48, 84, 10, 140,
+ 141, 97, 36, 11, 95, 96, 37, 179, 181, 179,
+ 181, 12, 51, 52, 13, 14, 15, 16, 38, 40,
+ 17, 18, 67, 68, 69, 70, 41, 19, 20, 21,
+ 42, 22, 133, 134, 137, 27, 28, 29, 43, 72,
+ 73, 74, 75, 76, 77, 78, 44, 10, 133, 134,
+ 178, 45, 11, 79, 80, 46, 123, 124, 125, 49,
+ 12, 50, 53, 13, 14, 15, 16, 162, 64, 30,
+ 31, 133, 134, 166, 167, 168, 19, 20, 21, 54,
+ 22, 133, 134, 180, 57, 58, 48, 50, 60, 55,
+ 61, 86, 87, 157, 56, 66, 92, 103, 94, 104,
+ 105, 106, 107, 108, 110, 111, 112, 51, 113, 114,
+ 115, 116, 117, 121, 143, 118, 119, 120, 144, 126,
+ 127, 128, 129, 130, 131, 132, 146, 145, 148, 152,
+ 153, 158, 159, 160, 161, 163, 164, 165, 174, 169,
+ 170, 171, 172, 173, 100, 175, 176, 177
};
- const short int
+ const unsigned char
EvalParser::yycheck_[] =
{
- 2, 36, 115, 6, 7, 35, 20, 47, 4, 5,
- 9, 124, 50, 44, 52, 55, 56, 52, 53, 50,
- 50, 20, 9, 18, 19, 20, 13, 14, 3, 15,
- 5, 45, 0, 36, 9, 10, 11, 12, 9, 41,
- 42, 15, 13, 14, 6, 7, 21, 43, 15, 51,
- 17, 26, 15, 49, 50, 168, 169, 170, 171, 34,
- 40, 41, 37, 38, 39, 47, 48, 42, 43, 22,
- 23, 24, 25, 3, 49, 50, 51, 4, 53, 6,
- 7, 9, 10, 11, 18, 19, 27, 28, 29, 30,
- 31, 32, 33, 21, 18, 19, 20, 17, 26, 40,
- 41, 17, 3, 105, 106, 15, 34, 17, 3, 37,
- 38, 39, 147, 3, 42, 43, 15, 17, 153, 154,
- 155, 49, 50, 51, 8, 53, 18, 19, 20, 18,
- 19, 20, 15, 15, 17, 17, 15, 15, 140, 50,
- 49, 46, 46, 16, 16, 16, 4, 16, 36, 36,
- 16, 6, 16, 16, 16, 16, 16, 50, 17, 36,
- 17, 17, 4, 17, 17, 17, 17, 17, 17, 17,
- 45, 36, 9, 4, 15, 15, 15, 15, 4, 15,
- 50, 16, 16, 16, 16, -1, 16, 54, 17, 17,
- 17, -1, 17
+ 2, 37, 119, 6, 7, 20, 35, 4, 5, 9,
+ 45, 4, 129, 6, 7, 49, 51, 0, 54, 55,
+ 20, 9, 51, 57, 58, 13, 14, 18, 19, 20,
+ 3, 46, 5, 36, 48, 49, 9, 10, 11, 12,
+ 42, 43, 3, 45, 15, 9, 17, 44, 21, 13,
+ 14, 53, 15, 26, 51, 52, 15, 174, 175, 176,
+ 177, 34, 6, 7, 37, 38, 39, 40, 15, 17,
+ 43, 44, 22, 23, 24, 25, 17, 50, 51, 52,
+ 3, 54, 18, 19, 20, 9, 10, 11, 3, 27,
+ 28, 29, 30, 31, 32, 33, 3, 21, 18, 19,
+ 20, 3, 26, 41, 42, 17, 108, 109, 110, 15,
+ 34, 17, 8, 37, 38, 39, 40, 153, 51, 43,
+ 44, 18, 19, 159, 160, 161, 50, 51, 52, 15,
+ 54, 18, 19, 20, 15, 15, 17, 17, 51, 15,
+ 53, 41, 42, 145, 15, 50, 47, 16, 47, 16,
+ 16, 4, 36, 36, 36, 16, 16, 6, 16, 16,
+ 16, 16, 16, 51, 36, 17, 17, 17, 4, 17,
+ 17, 17, 17, 17, 17, 17, 4, 36, 46, 9,
+ 15, 15, 15, 15, 15, 4, 4, 51, 17, 16,
+ 16, 16, 16, 16, 56, 17, 17, 17
};
const unsigned char
EvalParser::yystos_[] =
{
- 0, 47, 48, 55, 3, 5, 9, 10, 11, 12,
- 21, 26, 34, 37, 38, 39, 42, 43, 49, 50,
- 51, 53, 56, 57, 58, 59, 9, 10, 11, 42,
- 43, 58, 0, 57, 57, 15, 15, 15, 3, 17,
- 17, 3, 3, 3, 17, 15, 17, 15, 17, 6,
- 7, 8, 15, 15, 15, 15, 15, 4, 50, 52,
- 60, 60, 50, 62, 49, 22, 23, 24, 25, 63,
- 27, 28, 29, 30, 31, 32, 33, 40, 41, 65,
- 58, 58, 57, 40, 41, 66, 44, 50, 64, 46,
- 64, 46, 57, 57, 58, 60, 60, 62, 64, 64,
- 16, 16, 16, 4, 36, 36, 36, 16, 16, 16,
- 16, 16, 16, 16, 17, 17, 17, 50, 68, 58,
- 58, 17, 17, 17, 17, 17, 17, 17, 18, 19,
- 20, 61, 20, 61, 9, 13, 14, 67, 36, 4,
- 36, 20, 45, 9, 20, 9, 9, 15, 35, 50,
- 69, 58, 15, 15, 15, 15, 60, 4, 4, 50,
- 60, 60, 60, 16, 16, 16, 16, 16, 17, 17,
- 17, 17, 20, 61, 20, 61
+ 0, 48, 49, 56, 3, 5, 9, 10, 11, 12,
+ 21, 26, 34, 37, 38, 39, 40, 43, 44, 50,
+ 51, 52, 54, 57, 58, 59, 60, 9, 10, 11,
+ 43, 44, 59, 0, 58, 58, 15, 15, 15, 3,
+ 17, 17, 3, 3, 3, 3, 17, 15, 17, 15,
+ 17, 6, 7, 8, 15, 15, 15, 15, 15, 4,
+ 51, 53, 61, 61, 51, 63, 50, 22, 23, 24,
+ 25, 64, 27, 28, 29, 30, 31, 32, 33, 41,
+ 42, 66, 59, 59, 58, 59, 41, 42, 67, 45,
+ 51, 65, 47, 65, 47, 58, 58, 59, 61, 61,
+ 63, 65, 65, 16, 16, 16, 4, 36, 36, 36,
+ 36, 16, 16, 16, 16, 16, 16, 16, 17, 17,
+ 17, 51, 69, 59, 59, 59, 17, 17, 17, 17,
+ 17, 17, 17, 18, 19, 20, 62, 20, 62, 9,
+ 13, 14, 68, 36, 4, 36, 4, 20, 46, 9,
+ 20, 9, 9, 15, 35, 51, 70, 59, 15, 15,
+ 15, 15, 61, 4, 4, 51, 61, 61, 61, 16,
+ 16, 16, 16, 16, 17, 17, 17, 17, 20, 62,
+ 20, 62
};
const unsigned char
EvalParser::yyr1_[] =
{
- 0, 54, 55, 55, 56, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 57, 57, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 59, 60, 60, 61,
- 61, 62, 63, 63, 63, 63, 64, 64, 65, 65,
- 65, 65, 65, 65, 65, 65, 65, 66, 66, 67,
- 67, 68, 69, 69
+ 0, 55, 56, 56, 57, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 59, 59, 59,
+ 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
+ 59, 59, 59, 59, 59, 59, 59, 60, 61, 61,
+ 62, 62, 63, 64, 64, 64, 64, 65, 65, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 67, 67,
+ 68, 68, 69, 70, 70
};
const unsigned char
@@ -1774,10 +1824,10 @@ namespace isc { namespace eval {
0, 2, 2, 2, 1, 3, 2, 3, 3, 3,
6, 6, 11, 6, 6, 11, 4, 1, 1, 1,
6, 6, 11, 3, 3, 3, 6, 8, 6, 8,
- 3, 3, 11, 6, 9, 1, 1, 1, 1, 1,
+ 6, 3, 3, 11, 6, 9, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1
+ 1, 1, 1, 1, 1
};
@@ -1793,28 +1843,28 @@ namespace isc { namespace eval {
"\"text\"", "\"hex\"", "\"exists\"", "\"pkt\"", "\"iface\"", "\"src\"",
"\"dst\"", "\"len\"", "\"pkt4\"", "\"mac\"", "\"hlen\"", "\"htype\"",
"\"ciaddr\"", "\"giaddr\"", "\"yiaddr\"", "\"siaddr\"", "\"substring\"",
- "\"all\"", "\",\"", "\"concat\"", "\"ifelse\"", "\"pkt6\"",
- "\"msgtype\"", "\"transid\"", "\"vendor-class\"", "\"vendor\"", "\"*\"",
- "\"data\"", "\"enterprise\"", "\"top-level bool\"",
- "\"top-level string\"", "\"constant string\"", "\"integer\"",
- "\"constant hexstring\"", "\"option name\"", "\"ip address\"", "$accept",
- "start", "expression", "bool_expr", "string_expr", "integer_expr",
- "option_code", "option_repr_type", "nest_level", "pkt_metadata",
- "enterprise_id", "pkt4_field", "pkt6_field", "relay6_field",
- "start_expr", "length_expr", YY_NULLPTR
+ "\"all\"", "\",\"", "\"concat\"", "\"ifelse\"", "\"hexstring\"",
+ "\"pkt6\"", "\"msgtype\"", "\"transid\"", "\"vendor-class\"",
+ "\"vendor\"", "\"*\"", "\"data\"", "\"enterprise\"",
+ "\"top-level bool\"", "\"top-level string\"", "\"constant string\"",
+ "\"integer\"", "\"constant hexstring\"", "\"option name\"",
+ "\"ip address\"", "$accept", "start", "expression", "bool_expr",
+ "string_expr", "integer_expr", "option_code", "option_repr_type",
+ "nest_level", "pkt_metadata", "enterprise_id", "pkt4_field",
+ "pkt6_field", "relay6_field", "start_expr", "length_expr", YY_NULLPTR
};
#if EVALDEBUG
const unsigned short int
EvalParser::yyrline_[] =
{
- 0, 119, 119, 120, 125, 128, 129, 134, 139, 144,
- 149, 154, 174, 188, 197, 206, 216, 233, 238, 243,
- 248, 253, 274, 289, 294, 308, 322, 337, 342, 347,
- 352, 361, 371, 380, 393, 406, 413, 419, 423, 429,
- 433, 439, 448, 452, 456, 460, 466, 470, 476, 480,
- 484, 488, 492, 496, 500, 504, 508, 514, 518, 524,
- 528, 534, 541, 546
+ 0, 120, 120, 121, 126, 129, 130, 135, 140, 145,
+ 150, 155, 175, 189, 198, 207, 217, 234, 239, 244,
+ 249, 254, 275, 290, 295, 309, 323, 338, 343, 348,
+ 353, 358, 367, 377, 386, 399, 412, 419, 425, 429,
+ 435, 439, 445, 454, 458, 462, 466, 472, 476, 482,
+ 486, 490, 494, 498, 502, 506, 510, 514, 520, 524,
+ 530, 534, 540, 547, 552
};
// Print the state stack on the debug stream.
@@ -1827,18 +1877,18 @@ namespace isc { namespace eval {
i_end = yystack_.end ();
i != i_end; ++i)
*yycdebug_ << ' ' << i->state;
- *yycdebug_ << std::endl;
+ *yycdebug_ << '\n';
}
// Report on the debug stream that the rule \a yyrule is going to be reduced.
void
EvalParser::yy_reduce_print_ (int yyrule)
{
- unsigned int yylno = yyrline_[yyrule];
+ unsigned yylno = yyrline_[yyrule];
int yynrhs = yyr2_[yyrule];
// Print the symbols being reduced, and their result.
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
- << " (line " << yylno << "):" << std::endl;
+ << " (line " << yylno << "):\n";
// The symbols being reduced.
for (int yyi = 0; yyi < yynrhs; yyi++)
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
@@ -1847,10 +1897,10 @@ namespace isc { namespace eval {
#endif // EVALDEBUG
-#line 14 "parser.yy" // lalr1.cc:1167
+#line 14 "parser.yy" // lalr1.cc:1163
} } // isc::eval
-#line 1853 "parser.cc" // lalr1.cc:1167
-#line 553 "parser.yy" // lalr1.cc:1168
+#line 1903 "parser.cc" // lalr1.cc:1163
+#line 559 "parser.yy" // lalr1.cc:1164
void
isc::eval::EvalParser::error(const location_type& loc,
diff --git a/src/lib/eval/parser.h b/src/lib/eval/parser.h
index 7b8614a2ad..c79f0fddbb 100644
--- a/src/lib/eval/parser.h
+++ b/src/lib/eval/parser.h
@@ -1,8 +1,8 @@
-// A Bison parser, made by GNU Bison 3.0.4.
+// A Bison parser, made by GNU Bison 3.0.5.
// Skeleton interface for Bison LALR(1) parsers in C++
-// Copyright (C) 2002-2015 Free Software Foundation, Inc.
+// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@
#ifndef YY_EVAL_PARSER_H_INCLUDED
# define YY_EVAL_PARSER_H_INCLUDED
// // "%code requires" blocks.
-#line 17 "parser.yy" // lalr1.cc:377
+#line 17 "parser.yy" // lalr1.cc:379
#include
#include
@@ -51,7 +51,7 @@
using namespace isc::dhcp;
using namespace isc::eval;
-#line 55 "parser.h" // lalr1.cc:377
+#line 55 "parser.h" // lalr1.cc:379
# include
# include // std::abort
@@ -134,9 +134,9 @@ using namespace isc::eval;
# endif /* ! defined YYDEBUG */
#endif /* ! defined EVALDEBUG */
-#line 14 "parser.yy" // lalr1.cc:377
+#line 14 "parser.yy" // lalr1.cc:379
namespace isc { namespace eval {
-#line 140 "parser.h" // lalr1.cc:377
+#line 140 "parser.h" // lalr1.cc:379
@@ -393,21 +393,22 @@ namespace isc { namespace eval {
TOKEN_COMA = 291,
TOKEN_CONCAT = 292,
TOKEN_IFELSE = 293,
- TOKEN_PKT6 = 294,
- TOKEN_MSGTYPE = 295,
- TOKEN_TRANSID = 296,
- TOKEN_VENDOR_CLASS = 297,
- TOKEN_VENDOR = 298,
- TOKEN_ANY = 299,
- TOKEN_DATA = 300,
- TOKEN_ENTERPRISE = 301,
- TOKEN_TOPLEVEL_BOOL = 302,
- TOKEN_TOPLEVEL_STRING = 303,
- TOKEN_STRING = 304,
- TOKEN_INTEGER = 305,
- TOKEN_HEXSTRING = 306,
- TOKEN_OPTION_NAME = 307,
- TOKEN_IP_ADDRESS = 308
+ TOKEN_TOHEXSTRING = 294,
+ TOKEN_PKT6 = 295,
+ TOKEN_MSGTYPE = 296,
+ TOKEN_TRANSID = 297,
+ TOKEN_VENDOR_CLASS = 298,
+ TOKEN_VENDOR = 299,
+ TOKEN_ANY = 300,
+ TOKEN_DATA = 301,
+ TOKEN_ENTERPRISE = 302,
+ TOKEN_TOPLEVEL_BOOL = 303,
+ TOKEN_TOPLEVEL_STRING = 304,
+ TOKEN_STRING = 305,
+ TOKEN_INTEGER = 306,
+ TOKEN_HEXSTRING = 307,
+ TOKEN_OPTION_NAME = 308,
+ TOKEN_IP_ADDRESS = 309
};
};
@@ -678,6 +679,10 @@ namespace isc { namespace eval {
symbol_type
make_IFELSE (const location_type& l);
+ static inline
+ symbol_type
+ make_TOHEXSTRING (const location_type& l);
+
static inline
symbol_type
make_PKT6 (const location_type& l);
@@ -823,7 +828,7 @@ namespace isc { namespace eval {
// number is the opposite. If YYTABLE_NINF, syntax error.
static const unsigned char yytable_[];
- static const short int yycheck_[];
+ static const unsigned char yycheck_[];
// YYSTOS[STATE-NUM] -- The (internal number of the) accessing
// symbol of state STATE-NUM.
@@ -909,6 +914,8 @@ namespace isc { namespace eval {
typedef basic_symbol super_type;
/// Construct an empty symbol.
stack_symbol_type ();
+ /// Copy construct.
+ stack_symbol_type (const stack_symbol_type& that);
/// Steal the contents from \a sym to build this.
stack_symbol_type (state_type s, symbol_type& sym);
/// Assignment, needed by push_back.
@@ -937,18 +944,18 @@ namespace isc { namespace eval {
void yypush_ (const char* m, state_type s, symbol_type& sym);
/// Pop \a n symbols the three stacks.
- void yypop_ (unsigned int n = 1);
+ void yypop_ (unsigned n = 1);
/// Constants.
enum
{
yyeof_ = 0,
- yylast_ = 192, ///< Last index in yytable_.
+ yylast_ = 197, ///< Last index in yytable_.
yynnts_ = 16, ///< Number of nonterminal symbols.
- yyfinal_ = 32, ///< Termination state number.
+ yyfinal_ = 33, ///< Termination state number.
yyterror_ = 1,
yyerrcode_ = 256,
- yyntokens_ = 54 ///< Number of tokens.
+ yyntokens_ = 55 ///< Number of tokens.
};
@@ -995,14 +1002,14 @@ namespace isc { namespace eval {
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54
};
- const unsigned int user_token_number_max_ = 308;
+ const unsigned user_token_number_max_ = 309;
const token_number_type undef_token_ = 2;
- if (static_cast(t) <= yyeof_)
+ if (static_cast (t) <= yyeof_)
return yyeof_;
- else if (static_cast (t) <= user_token_number_max_)
+ else if (static_cast (t) <= user_token_number_max_)
return translate_table[t];
else
return undef_token_;
@@ -1016,58 +1023,56 @@ namespace isc { namespace eval {
// basic_symbol.
template
- inline
EvalParser::basic_symbol::basic_symbol ()
: value ()
{}
template
- inline
EvalParser::basic_symbol::basic_symbol (const basic_symbol& other)
: Base (other)
, value ()
, location (other.location)
{
- switch (other.type_get ())
+ switch (other.type_get ())
{
- case 61: // option_repr_type
+ case 62: // option_repr_type
value.copy< TokenOption::RepresentationType > (other.value);
break;
- case 65: // pkt4_field
+ case 66: // pkt4_field
value.copy< TokenPkt4::FieldType > (other.value);
break;
- case 66: // pkt6_field
+ case 67: // pkt6_field
value.copy< TokenPkt6::FieldType > (other.value);
break;
- case 63: // pkt_metadata
+ case 64: // pkt_metadata
value.copy< TokenPkt::MetadataType > (other.value);
break;
- case 67: // relay6_field
+ case 68: // relay6_field
value.copy< TokenRelay6Field::FieldType > (other.value);
break;
- case 62: // nest_level
+ case 63: // nest_level
value.copy< int8_t > (other.value);
break;
- case 49: // "constant string"
- case 50: // "integer"
- case 51: // "constant hexstring"
- case 52: // "option name"
- case 53: // "ip address"
+ case 50: // "constant string"
+ case 51: // "integer"
+ case 52: // "constant hexstring"
+ case 53: // "option name"
+ case 54: // "ip address"
value.copy< std::string > (other.value);
break;
- case 60: // option_code
+ case 61: // option_code
value.copy< uint16_t > (other.value);
break;
- case 59: // integer_expr
- case 64: // enterprise_id
+ case 60: // integer_expr
+ case 65: // enterprise_id
value.copy< uint32_t > (other.value);
break;
@@ -1077,55 +1082,53 @@ namespace isc { namespace eval {
}
-
template
- inline
EvalParser::basic_symbol::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l)
: Base (t)
, value ()
, location (l)
{
(void) v;
- switch (this->type_get ())
+ switch (this->type_get ())
{
- case 61: // option_repr_type
+ case 62: // option_repr_type
value.copy< TokenOption::RepresentationType > (v);
break;
- case 65: // pkt4_field
+ case 66: // pkt4_field
value.copy< TokenPkt4::FieldType > (v);
break;
- case 66: // pkt6_field
+ case 67: // pkt6_field
value.copy< TokenPkt6::FieldType > (v);
break;
- case 63: // pkt_metadata
+ case 64: // pkt_metadata
value.copy< TokenPkt::MetadataType > (v);
break;
- case 67: // relay6_field
+ case 68: // relay6_field
value.copy< TokenRelay6Field::FieldType > (v);
break;
- case 62: // nest_level
+ case 63: // nest_level
value.copy< int8_t > (v);
break;
- case 49: // "constant string"
- case 50: // "integer"
- case 51: // "constant hexstring"
- case 52: // "option name"
- case 53: // "ip address"
+ case 50: // "constant string"
+ case 51: // "integer"
+ case 52: // "constant hexstring"
+ case 53: // "option name"
+ case 54: // "ip address"
value.copy< std::string > (v);
break;
- case 60: // option_code
+ case 61: // option_code
value.copy< uint16_t > (v);
break;
- case 59: // integer_expr
- case 64: // enterprise_id
+ case 60: // integer_expr
+ case 65: // enterprise_id
value.copy< uint32_t > (v);
break;
@@ -1209,14 +1212,12 @@ namespace isc { namespace eval {
template
- inline
EvalParser::basic_symbol::~basic_symbol ()
{
clear ();
}
template
- inline
void
EvalParser::basic_symbol::clear ()
{
@@ -1231,46 +1232,46 @@ namespace isc { namespace eval {
}
// Type destructor.
- switch (yytype)
+ switch (yytype)
{
- case 61: // option_repr_type
+ case 62: // option_repr_type
value.template destroy< TokenOption::RepresentationType > ();
break;
- case 65: // pkt4_field
+ case 66: // pkt4_field
value.template destroy< TokenPkt4::FieldType > ();
break;
- case 66: // pkt6_field
+ case 67: // pkt6_field
value.template destroy< TokenPkt6::FieldType > ();
break;
- case 63: // pkt_metadata
+ case 64: // pkt_metadata
value.template destroy< TokenPkt::MetadataType > ();
break;
- case 67: // relay6_field
+ case 68: // relay6_field
value.template destroy< TokenRelay6Field::FieldType > ();
break;
- case 62: // nest_level
+ case 63: // nest_level
value.template destroy< int8_t > ();
break;
- case 49: // "constant string"
- case 50: // "integer"
- case 51: // "constant hexstring"
- case 52: // "option name"
- case 53: // "ip address"
+ case 50: // "constant string"
+ case 51: // "integer"
+ case 52: // "constant hexstring"
+ case 53: // "option name"
+ case 54: // "ip address"
value.template destroy< std::string > ();
break;
- case 60: // option_code
+ case 61: // option_code
value.template destroy< uint16_t > ();
break;
- case 59: // integer_expr
- case 64: // enterprise_id
+ case 60: // integer_expr
+ case 65: // enterprise_id
value.template destroy< uint32_t > ();
break;
@@ -1282,7 +1283,6 @@ namespace isc { namespace eval {
}
template
- inline
bool
EvalParser::basic_symbol::empty () const
{
@@ -1290,51 +1290,50 @@ namespace isc { namespace eval {
}
template
- inline
void
EvalParser::basic_symbol::move (basic_symbol& s)
{
- super_type::move(s);
- switch (this->type_get ())
+ super_type::move (s);
+ switch (this->type_get ())
{
- case 61: // option_repr_type
+ case 62: // option_repr_type
value.move< TokenOption::RepresentationType > (s.value);
break;
- case 65: // pkt4_field
+ case 66: // pkt4_field
value.move< TokenPkt4::FieldType > (s.value);
break;
- case 66: // pkt6_field
+ case 67: // pkt6_field
value.move< TokenPkt6::FieldType > (s.value);
break;
- case 63: // pkt_metadata
+ case 64: // pkt_metadata
value.move< TokenPkt::MetadataType > (s.value);
break;
- case 67: // relay6_field
+ case 68: // relay6_field
value.move< TokenRelay6Field::FieldType > (s.value);
break;
- case 62: // nest_level
+ case 63: // nest_level
value.move< int8_t > (s.value);
break;
- case 49: // "constant string"
- case 50: // "integer"
- case 51: // "constant hexstring"
- case 52: // "option name"
- case 53: // "ip address"
+ case 50: // "constant string"
+ case 51: // "integer"
+ case 52: // "constant hexstring"
+ case 53: // "option name"
+ case 54: // "ip address"
value.move< std::string > (s.value);
break;
- case 60: // option_code
+ case 61: // option_code
value.move< uint16_t > (s.value);
break;
- case 59: // integer_expr
- case 64: // enterprise_id
+ case 60: // integer_expr
+ case 65: // enterprise_id
value.move< uint32_t > (s.value);
break;
@@ -1398,7 +1397,7 @@ namespace isc { namespace eval {
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
- 305, 306, 307, 308
+ 305, 306, 307, 308, 309
};
return static_cast (yytoken_number_[type]);
}
@@ -1625,6 +1624,12 @@ namespace isc { namespace eval {
return symbol_type (token::TOKEN_IFELSE, l);
}
+ EvalParser::symbol_type
+ EvalParser::make_TOHEXSTRING (const location_type& l)
+ {
+ return symbol_type (token::TOKEN_TOHEXSTRING, l);
+ }
+
EvalParser::symbol_type
EvalParser::make_PKT6 (const location_type& l)
{
@@ -1716,9 +1721,9 @@ namespace isc { namespace eval {
}
-#line 14 "parser.yy" // lalr1.cc:377
+#line 14 "parser.yy" // lalr1.cc:379
} } // isc::eval
-#line 1722 "parser.h" // lalr1.cc:377
+#line 1727 "parser.h" // lalr1.cc:379
diff --git a/src/lib/eval/parser.yy b/src/lib/eval/parser.yy
index f9f0261627..f35fa23a77 100644
--- a/src/lib/eval/parser.yy
+++ b/src/lib/eval/parser.yy
@@ -74,6 +74,7 @@ using namespace isc::eval;
COMA ","
CONCAT "concat"
IFELSE "ifelse"
+ TOHEXSTRING "hexstring"
PKT6 "pkt6"
MSGTYPE "msgtype"
TRANSID "transid"
@@ -349,6 +350,11 @@ string_expr : STRING
TokenPtr cond(new TokenIfElse());
ctx.expression.push_back(cond);
}
+ | TOHEXSTRING "(" string_expr "," string_expr ")"
+ {
+ TokenPtr tohex(new TokenToHexString());
+ ctx.expression.push_back(tohex);
+ }
| VENDOR "." ENTERPRISE
{
// expression: vendor.enterprise
diff --git a/src/lib/eval/position.hh b/src/lib/eval/position.hh
index 6d547f2746..cb72c16895 100644
--- a/src/lib/eval/position.hh
+++ b/src/lib/eval/position.hh
@@ -1,8 +1,9 @@
-// A Bison parser, made by GNU Bison 3.0.4.
+// Generated 201809161042
+// A Bison parser, made by GNU Bison 3.0.5.
// Positions for Bison parsers in C++
-// Copyright (C) 2002-2015 Free Software Foundation, Inc.
+// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -50,28 +51,27 @@
# endif
# endif
-#line 14 "parser.yy" // location.cc:296
+#line 14 "parser.yy" // location.cc:292
namespace isc { namespace eval {
-#line 56 "position.hh" // location.cc:296
+#line 56 "position.hh" // location.cc:292
/// Abstract a position.
class position
{
public:
/// Construct a position.
explicit position (std::string* f = YY_NULLPTR,
- unsigned int l = 1u,
- unsigned int c = 1u)
+ unsigned l = 1u,
+ unsigned c = 1u)
: filename (f)
, line (l)
, column (c)
- {
- }
+ {}
/// Initialization.
void initialize (std::string* fn = YY_NULLPTR,
- unsigned int l = 1u,
- unsigned int c = 1u)
+ unsigned l = 1u,
+ unsigned c = 1u)
{
filename = fn;
line = l;
@@ -100,15 +100,15 @@ namespace isc { namespace eval {
/// File name to which this position refers.
std::string* filename;
/// Current line number.
- unsigned int line;
+ unsigned line;
/// Current column number.
- unsigned int column;
+ unsigned column;
private:
/// Compute max(min, lhs+rhs) (provided min <= lhs).
- static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min)
+ static unsigned add_ (unsigned lhs, int rhs, unsigned min)
{
- return (0 < rhs || -static_cast(rhs) < lhs
+ return (0 < rhs || -static_cast(rhs) < lhs
? rhs + lhs
: min);
}
@@ -174,7 +174,7 @@ namespace isc { namespace eval {
return ostr << pos.line << '.' << pos.column;
}
-#line 14 "parser.yy" // location.cc:296
+#line 14 "parser.yy" // location.cc:292
} } // isc::eval
-#line 180 "position.hh" // location.cc:296
+#line 179 "position.hh" // location.cc:292
#endif // !YY_EVAL_POSITION_HH_INCLUDED
diff --git a/src/lib/eval/stack.hh b/src/lib/eval/stack.hh
index e0d2dfe10f..2d70e54f4b 100644
--- a/src/lib/eval/stack.hh
+++ b/src/lib/eval/stack.hh
@@ -1,8 +1,9 @@
-// A Bison parser, made by GNU Bison 3.0.4.
+// Generated 201809161042
+// A Bison parser, made by GNU Bison 3.0.5.
// Stack handling for Bison parsers in C++
-// Copyright (C) 2002-2015 Free Software Foundation, Inc.
+// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -40,9 +41,10 @@
# include
-#line 14 "parser.yy" // stack.hh:132
+#line 14 "parser.yy" // stack.hh:131
namespace isc { namespace eval {
-#line 46 "stack.hh" // stack.hh:132
+#line 46 "stack.hh" // stack.hh:131
+ /// A stack with random access from its top.
template >
class stack
{
@@ -57,20 +59,24 @@ namespace isc { namespace eval {
seq_.reserve (200);
}
- stack (unsigned int n)
+ stack (unsigned n)
: seq_ (n)
{}
- inline
+ /// Random access.
+ ///
+ /// Index 0 returns the topmost element.
T&
- operator[] (unsigned int i)
+ operator[] (unsigned i)
{
return seq_[seq_.size () - 1 - i];
}
- inline
+ /// Random access.
+ ///
+ /// Index 0 returns the topmost element.
const T&
- operator[] (unsigned int i) const
+ operator[] (unsigned i) const
{
return seq_[seq_.size () - 1 - i];
}
@@ -78,7 +84,6 @@ namespace isc { namespace eval {
/// Steal the contents of \a t.
///
/// Close to move-semantics.
- inline
void
push (T& t)
{
@@ -86,9 +91,8 @@ namespace isc { namespace eval {
operator[](0).move (t);
}
- inline
void
- pop (unsigned int n = 1)
+ pop (unsigned n = 1)
{
for (; n; --n)
seq_.pop_back ();
@@ -100,21 +104,18 @@ namespace isc { namespace eval {
seq_.clear ();
}
- inline
typename S::size_type
size () const
{
return seq_.size ();
}
- inline
const_iterator
begin () const
{
return seq_.rbegin ();
}
- inline
const_iterator
end () const
{
@@ -133,25 +134,24 @@ namespace isc { namespace eval {
class slice
{
public:
- slice (const S& stack, unsigned int range)
+ slice (const S& stack, unsigned range)
: stack_ (stack)
, range_ (range)
{}
- inline
const T&
- operator [] (unsigned int i) const
+ operator [] (unsigned i) const
{
return stack_[range_ - i];
}
private:
const S& stack_;
- unsigned int range_;
+ unsigned range_;
};
-#line 14 "parser.yy" // stack.hh:132
+#line 14 "parser.yy" // stack.hh:131
} } // isc::eval
-#line 156 "stack.hh" // stack.hh:132
+#line 155 "stack.hh" // stack.hh:131
#endif // !YY_EVAL_STACK_HH_INCLUDED
diff --git a/src/lib/eval/tests/context_unittest.cc b/src/lib/eval/tests/context_unittest.cc
index ab487cc138..58ee2db223 100644
--- a/src/lib/eval/tests/context_unittest.cc
+++ b/src/lib/eval/tests/context_unittest.cc
@@ -462,6 +462,14 @@ public:
EXPECT_TRUE(alt);
}
+ /// @brief checks if the given token is a hexstring operator
+ void checkTokenToHexString(const TokenPtr& token) {
+ ASSERT_TRUE(token);
+ boost::shared_ptr tohex =
+ boost::dynamic_pointer_cast(token);
+ EXPECT_TRUE(tohex);
+ }
+
/// @brief checks if the given expression raises the expected message
/// when it is parsed.
void checkError(const string& expr, const string& msg) {
@@ -1056,6 +1064,12 @@ TEST_F(EvalContextTest, pkt4FieldChaddr) {
testPkt4Field("pkt4.mac == 0x000102030405", TokenPkt4::CHADDR, 3);
}
+// Tests whether chaddr field in DHCPv4 can be accessed and converted.
+TEST_F(EvalContextTest, pkt4FieldChaddrHexa) {
+ testPkt4Field("hexstring(pkt4.mac, ':') == '00:01:02:03:04:05'",
+ TokenPkt4::CHADDR, 5);
+}
+
// Tests whether hlen field in DHCPv4 can be accessed.
TEST_F(EvalContextTest, pkt4FieldHlen) {
testPkt4Field("pkt4.hlen == 0x6", TokenPkt4::HLEN, 3);
@@ -1310,6 +1324,25 @@ TEST_F(EvalContextTest, ifElse) {
checkTokenIfElse(tmp4);
}
+// Test the parsing of a hexstring expression
+TEST_F(EvalContextTest, toHexString) {
+ EvalContext eval(Option::V4);
+
+ EXPECT_NO_THROW(parsed_ =
+ eval.parseString("hexstring(0x666f,'-') == '66-6f'"));
+ EXPECT_TRUE(parsed_);
+
+ ASSERT_EQ(5, eval.expression.size());
+
+ TokenPtr tmp1 = eval.expression.at(0);
+ TokenPtr tmp2 = eval.expression.at(1);
+ TokenPtr tmp3 = eval.expression.at(2);
+
+ checkTokenHexString(tmp1, "fo");
+ checkTokenString(tmp2, "-");
+ checkTokenToHexString(tmp3);
+}
+
//
// Test some scanner error cases
TEST_F(EvalContextTest, scanErrors) {
diff --git a/src/lib/eval/tests/evaluate_unittest.cc b/src/lib/eval/tests/evaluate_unittest.cc
index 5afb635c91..839981c29d 100644
--- a/src/lib/eval/tests/evaluate_unittest.cc
+++ b/src/lib/eval/tests/evaluate_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -504,6 +504,12 @@ TEST_F(ExpressionsTest, evaluateString) {
"ifelse(option[100].exists,"
"option[100].hex,'none?'))",
"hundred4");
+
+ // Check that hexstring works as expecting.
+ testExpressionString(Option::V4, "hexstring(0x1234,':')", "12:34");
+ testExpressionString(Option::V4, "hexstring(0x56789a,'-')", "56-78-9a");
+ testExpressionString(Option::V4, "hexstring(0xbcde,'')", "bcde");
+ testExpressionString(Option::V4, "hexstring(0xf01234,'..')", "f0..12..34");
}
};
diff --git a/src/lib/eval/tests/token_unittest.cc b/src/lib/eval/tests/token_unittest.cc
index f74c13d3b5..69191211e1 100644
--- a/src/lib/eval/tests/token_unittest.cc
+++ b/src/lib/eval/tests/token_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -1954,6 +1954,35 @@ TEST_F(TokenTest, concat) {
EXPECT_TRUE(checkFile());
}
+// This test checks if a token representing a hexstring request
+// throws an exception if there aren't enough values on the stack.
+// The actual packet is not used.
+TEST_F(TokenTest, tohexstring) {
+ ASSERT_NO_THROW(t_.reset(new TokenToHexString()));
+
+ // Hexstring equires two values on the stack, try
+ // with 0 and 1 both should throw an exception
+ EXPECT_THROW(t_->evaluate(*pkt4_, values_), EvalBadStack);
+
+ values_.push("foo");
+ EXPECT_THROW(t_->evaluate(*pkt4_, values_), EvalBadStack);
+
+ // Two should work
+ values_.push("-");
+ EXPECT_NO_THROW(t_->evaluate(*pkt4_, values_));
+
+ // Check the result
+ ASSERT_EQ(1, values_.size());
+ EXPECT_EQ("66-6f-6f", values_.top());
+
+ // Check that the debug output was correct. Add the strings
+ // to the test vector in the class and then call checkFile
+ // for comparison
+ addString("EVAL_DEBUG_TOHEXSTRING Popping binary value 0x666F6F and "
+ "separator -, pushing result 66-6f-6f");
+ EXPECT_TRUE(checkFile());
+}
+
// This test checks if a token representing an ifelse is able
// to select the branch following the condition.
TEST_F(TokenTest, ifElse) {
diff --git a/src/lib/eval/token.cc b/src/lib/eval/token.cc
index 7225d4bb1f..1147fdfa3b 100644
--- a/src/lib/eval/token.cc
+++ b/src/lib/eval/token.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -21,6 +21,8 @@
#include
#include
#include
+#include
+#include
using namespace isc::dhcp;
using namespace isc::util;
@@ -629,6 +631,39 @@ TokenIfElse::evaluate(Pkt& /*pkt*/, ValueStack& values) {
}
}
+void
+TokenToHexString::evaluate(Pkt& /*pkt*/, ValueStack& values) {
+ if (values.size() < 2) {
+ isc_throw(EvalBadStack, "Incorrect stack order. Expected at least "
+ "2 values for hexstring, got " << values.size());
+ }
+
+ string separator = values.top();
+ values.pop();
+ string binary = values.top();
+ values.pop();
+
+ bool first = true;
+ stringstream tmp;
+ tmp << hex;
+ for (size_t i = 0; i < binary.size(); ++i) {
+ if (!first) {
+ tmp << separator;
+ } else {
+ first = false;
+ }
+ tmp << setw(2) << setfill('0')
+ << (static_cast(binary[i]) & 0xff);
+ }
+ values.push(tmp.str());
+
+ // Log what we popped and pushed
+ LOG_DEBUG(eval_logger, EVAL_DBG_STACK, EVAL_DEBUG_TOHEXSTRING)
+ .arg(toHex(binary))
+ .arg(separator)
+ .arg(tmp.str());
+}
+
void
TokenNot::evaluate(Pkt& /*pkt*/, ValueStack& values) {
diff --git a/src/lib/eval/token.h b/src/lib/eval/token.h
index 330bc60dfb..0d9472e54d 100644
--- a/src/lib/eval/token.h
+++ b/src/lib/eval/token.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -725,6 +725,45 @@ public:
void evaluate(Pkt& pkt, ValueStack& values);
};
+/// @brief Token that converts to hexadecimal string
+///
+/// For example in the sub-expression "hexstring(pkt4.mac, ':')"
+/// the binary MAC address is converted to its usual hexadecimal
+/// representation as a list of (6) pairs of hexadecimal digits
+/// separated by colons (':').
+/// Please note the token is named TokenToHexString when the syntax
+/// use the hexstring name without a leading "to".
+class TokenToHexString : public Token {
+public:
+ /// @brief Constructor (does nothing)
+ TokenToHexString() { }
+
+ /// @brief Convert a binary value to its hexadecimal string representation
+ ///
+ /// Evaluation does not use packet information. It requires at least
+ /// two values to be present on the stack. It will consume the top
+ /// two values on the stack as parameters and push the resulting
+ /// hexadecimal string onto the stack.
+ /// From the top it expects the values on the stack as:
+ /// - separator
+ /// - binary
+ ///
+ /// binary is the binary value (note it can be any value, i.e.
+ /// it is not checked to really be not printable).
+ /// separator is litteral for instance '-' or ':'. The empty separator
+ /// means no separator.
+ ///
+ /// The following example use a binary MAC address 06:ce:8f:55:b3:33:
+ /// - , '-' => "06-ce-8f-55-b3-33"
+ ///
+ /// @throw EvalBadStack if there are less than 2 values on stack
+ ///
+ /// @param pkt (unused)
+ /// @param values - stack of values (2 arguments will be popped, 1 result
+ /// will be pushed)
+ void evaluate(Pkt& pkt, ValueStack& values);
+};
+
/// @brief Token that represents logical negation operator
///
/// For example in the expression "not(option[vendor-class].text == 'MSF')"
diff --git a/src/lib/yang/models/ietf-dhcpv6-client.yang b/src/lib/yang/models/ietf-dhcpv6-client.yang
index 85d05d55fa..c4faa971e1 100644
--- a/src/lib/yang/models/ietf-dhcpv6-client.yang
+++ b/src/lib/yang/models/ietf-dhcpv6-client.yang
@@ -25,6 +25,11 @@ module ietf-dhcpv6-client {
description "This model defines a YANG data model that can be
used to configure and manage a DHCPv6 client.";
+ revision 2018-09-04 {
+ description "";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ }
+
revision 2018-03-04 {
description "Resolved most issues on the DHC official
github";
@@ -41,7 +46,6 @@ module ietf-dhcpv6-client {
YANG model.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang";
}
-
/*
* Data Nodes
*/
diff --git a/src/lib/yang/models/ietf-dhcpv6-options.yang b/src/lib/yang/models/ietf-dhcpv6-options.yang
index 6731942cd5..76169f1e43 100644
--- a/src/lib/yang/models/ietf-dhcpv6-options.yang
+++ b/src/lib/yang/models/ietf-dhcpv6-options.yang
@@ -21,9 +21,14 @@ module ietf-dhcpv6-options {
ian.farrer@telekom.de
sladjana.zechlin@telekom.de
hezihao9512@gmail.com";
+
description "This model defines a YANG data model that can be
used to configure DHCPv6 options.";
+ revision 2018-09-04 {
+ description "";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ }
revision 2018-03-04 {
description "Resolved most issues on the DHC official
github";
@@ -31,8 +36,8 @@ module ietf-dhcpv6-options {
}
revision 2017-12-22 {
- description "Resolve most issues on Ian's github.";
- reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ description "Resolve most issues on Ian's github.";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
}
revision 2017-11-24 {
@@ -46,173 +51,174 @@ module ietf-dhcpv6-options {
*/
// features for server options
- feature server-unicast-op {
- description "Support for Server Unicast option";
- }
- feature sip-server-domain-name-list-op {
- description "Support for SIP Server Domain Name List option";
- }
- feature sip-server-address-list-op {
- description "Support for SIP Server Address List option";
- }
+ feature server-unicast-op {
+ description "Support for Server Unicast option";
+ }
+ feature sip-server-domain-name-list-op {
+ description "Support for SIP Server Domain Name List option";
+ }
+ feature sip-server-address-list-op {
+ description "Support for SIP Server Address List option";
+ }
feature dns-servers-op {
description "Support for DNS Servers Option";
}
- feature domain-searchlist-op {
- description "Support for Domain Search List Option";
- }
- feature nis-config-op {
- description "Support for Network Information Service (NIS)
- Servers option";
- }
- feature nis-plus-config-op {
- description "Support for Network Information Service V2 (NIS+)
- Servers option";
- }
- feature nis-domain-name-op {
- description "Support for Network Information Service (NIS)
- Domain Name option";
- }
- feature nis-plus-domain-name-op {
- description "Support for Network Information Service V2 (NIS+)
- Server option";
- }
- feature sntp-server-op {
- description "Support for Simple Network Protocol Configuration
- (SNTP) Servers option";
- }
- feature info-refresh-time-op {
- description "Support for Information Refresh Time option";
- }
- feature client-fqdn-op {
- description "Support for Client FQDN option";
- }
- feature posix-timezone-op {
- description "Support for New POIX Timezone option";
- }
- feature tzdb-timezone-op {
- description "Support for New TZDB Timezone option";
- }
- feature ntp-server-op {
- description "Support for Network Time Protocol (NTP)
- Server option";
- }
- feature boot-file-url-op {
- description "Support for Boot File URL option";
- }
- feature boot-file-param-op {
- description "Support for Boot File Parameters option";
- }
- feature aftr-name-op {
- description "Support for Address Family Transition
- Router (AFTR) option";
- }
- feature kbr-default-name-op {
- description "Support for Kerberos Default Name
- Option";
- }
- feature kbr-kdc-op {
- description "Support for Kerberos KDC option";
- }
- feature sol-max-rt-op {
- description "Support for SOL_MAX_RT option";
- }
- feature inf-max-rt-op {
- description "Support for INF_MAX_RT option";
- }
- feature addr-selection-op {
- description "Support for Address Selection opiton";
- }
- feature pcp-server-op {
- description "Support for Port Control Protocol (PCP)
- option";
- }
- feature s46-rule-op {
- description "Support for S46 Rule option";
- }
- feature s46-br-op {
- description "Support for S46 Border Relay (BR) option";
- }
- feature s46-dmr-op {
- description "Support for S46 Default Mapping Rule
- (DMR) option";
- }
- feature s46-v4-v6-binding-op {
- description "Support for S46 IPv4/IPv6 Address
- Bind option";
- }
+ feature domain-searchlist-op {
+ description "Support for Domain Search List Option";
+ }
+ feature nis-config-op {
+ description "Support for Network Information Service (NIS)
+ Servers option";
+ }
+ feature nis-plus-config-op {
+ description "Support for Network Information Service V2 (NIS+)
+ Servers option";
+ }
+ feature nis-domain-name-op {
+ description "Support for Network Information Service (NIS)
+ Domain Name option";
+ }
+ feature nis-plus-domain-name-op {
+ description "Support for Network Information Service V2 (NIS+)
+ Server option";
+ }
+ feature sntp-server-op {
+ description "Support for Simple Network Protocol Configuration
+ (SNTP) Servers option";
+ }
+ feature info-refresh-time-op {
+ description "Support for Information Refresh Time option";
+ }
+ feature client-fqdn-op {
+ description "Support for Client FQDN option";
+ }
+ feature posix-timezone-op {
+ description "Support for New POIX Timezone option";
+ }
+ feature tzdb-timezone-op {
+ description "Support for New TZDB Timezone option";
+ }
+ feature ntp-server-op {
+ description "Support for Network Time Protocol (NTP)
+ Server option";
+ }
+ feature boot-file-url-op {
+ description "Support for Boot File URL option";
+ }
+ feature boot-file-param-op {
+ description "Support for Boot File Parameters option";
+ }
+ feature aftr-name-op {
+ description "Support for Address Family Transition
+ Router (AFTR) option";
+ }
+ feature kbr-default-name-op {
+ description "Support for Kerberos Default Name
+ Option";
+ }
+ feature kbr-kdc-op {
+ description "Support for Kerberos KDC option";
+ }
+ feature sol-max-rt-op {
+ description "Support for SOL_MAX_RT option";
+ }
+ feature inf-max-rt-op {
+ description "Support for INF_MAX_RT option";
+ }
+ feature addr-selection-op {
+ description "Support for Address Selection opiton";
+ }
+ feature pcp-server-op {
+ description "Support for Port Control Protocol (PCP)
+ option";
+ }
+ feature s46-rule-op {
+ description "Support for S46 Rule option";
+ }
+ feature s46-br-op {
+ description "Support for S46 Border Relay (BR) option";
+ }
+ feature s46-dmr-op {
+ description "Support for S46 Default Mapping Rule
+ (DMR) option";
+ }
+ feature s46-v4-v6-binding-op {
+ description "Support for S46 IPv4/IPv6 Address
+ Bind option";
+ }
- // features for relay-supplied options
- feature erp-local-domain-name-op {
- description "Support for ERP Local Domain Name option";
- }
+ // features for relay-supplied options
+ feature erp-local-domain-name-op {
+ description "Support for ERP Local Domain Name option";
+ }
- // features for client options
- feature option-request-op {
- description "Support for Option Request option";
- }
- feature rapid-commit-op {
- description "Support for Rapid Commit option";
- }
- feature user-class-op {
- description "Support for User Class option";
- }
- feature vendor-class-op {
- description "Support for Vendor Class option";
- }
- feature client-arch-type-op {
- description "Support for Client System Architecture
- Type option";
- }
- feature client-network-interface-identifier-op {
- description "Support for Client Network Interface
- Identifier option";
- }
- feature kbr-principal-name-op {
- description "Support for Kerberos Principal
- Name option";
- }
- feature kbr-realm-name-op {
- description "Support Kerberos Realm Name option";
- }
- feature client-link-layer-addr-op {
- description "Support for Client Link-Layer Address
- Option";
- }
+ // features for client options
+ feature option-request-op {
+ description "Support for Option Request option";
+ }
+ feature rapid-commit-op {
+ description "Support for Rapid Commit option";
+ }
+ feature user-class-op {
+ description "Support for User Class option";
+ }
+ feature vendor-class-op {
+ description "Support for Vendor Class option";
+ }
+ feature client-arch-type-op {
+ description "Support for Client System Architecture
+ Type option";
+ }
+ feature client-network-interface-identifier-op {
+ description "Support for Client Network Interface
+ Identifier option";
+ }
+ feature kbr-principal-name-op {
+ description "Support for Kerberos Principal
+ Name option";
+ }
+ feature kbr-realm-name-op {
+ description "Support Kerberos Realm Name option";
+ }
+ feature client-link-layer-addr-op {
+ description "Support for Client Link-Layer Address
+ Option";
+ }
+
+ // features for custom options
+ feature operator-op-ipv6-address {
+ description "Support for Option with IPv6 Addresses";
+ }
+ feature operator-op-single-flag {
+ description "Support for Option with Single Flag";
+ }
+ feature operator-op-ipv6-prefix {
+ description "Support for Option with IPv6 Prefix";
+ }
+ feature operator-op-int32 {
+ description "Support for Opion with 32-bit
+ Integer Value";
+ }
+ feature operator-op-int16 {
+ description "Support for Opion with 16-bit Integer Value";
+ }
+ feature operator-op-int8 {
+ description "Support for Opion with 8-bit Integer Value";
+ }
+ feature operator-op-uri {
+ description "Support for Opion with URI";
+ }
+ feature operator-op-textstring {
+ description "Support for Opion with Text String";
+ }
+ feature operator-op-var-data {
+ description "Support for Opion with Variable-Length Data";
+ }
+ feature operator-op-dns-wire {
+ description "Support for Opion with DNS Wire
+ Format Domain Name List";
+ }
- // features for custom options
- feature operator-op-ipv6-address {
- description "Support for Option with IPv6 Addresses";
- }
- feature operator-op-single-flag {
- description "Support for Option with Single Flag";
- }
- feature operator-op-ipv6-prefix {
- description "Support for Option with IPv6 Prefix";
- }
- feature operator-op-int32 {
- description "Support for Opion with 32-bit
- Integer Value";
- }
- feature operator-op-int16 {
- description "Support for Opion with 16-bit Integer Value";
- }
- feature operator-op-int8 {
- description "Support for Opion with 8-bit Integer Value";
- }
- feature operator-op-uri {
- description "Support for Opion with URI";
- }
- feature operator-op-textstring {
- description "Support for Opion with Text String";
- }
- feature operator-op-var-data {
- description "Support for Opion with Variable-Length Data";
- }
- feature operator-op-dns-wire {
- description "Support for Opion with DNS Wire
- Format Domain Name List";
- }
/*
* Groupings
*/
@@ -234,8 +240,8 @@ module ietf-dhcpv6-options {
}
container sip-server-domain-name-list-option {
- // if-feature sip-server-domain-name-list-op;
- // presence "Enable this option";
+ if-feature sip-server-domain-name-list-op;
+ presence "Enable this option";
description "OPTION_SIP_SERVER_D (21) SIP Servers Domain Name List";
reference "RFC3319: Dynamic Host Configuration Protocol
(DHCPv6) Options for Session Initiation Protocol (SIP) Servers";
@@ -247,8 +253,8 @@ module ietf-dhcpv6-options {
}
container sip-server-address-list-option {
- // if-feature sip-server-address-list-op;
- // presence "Enable this option";
+ if-feature sip-server-address-list-op;
+ presence "Enable this option";
description "OPTION_SIP_SERVER_A (22) SIP Servers IPv6 Address List";
reference "RFC3319: Dynamic Host Configuration Protocol (DHCPv6)
Options for Session Initiation Protocol (SIP) Servers";
@@ -269,8 +275,8 @@ module ietf-dhcpv6-options {
}
container dns-servers-option {
- // if-feature dns-servers-op;
- // presence "Enable this option";
+ if-feature dns-servers-op;
+ presence "Enable this option";
description "OPTION_DNS_SERVERS (23) DNS recursive Name Server option";
reference "RFC3646: DNS Configuration options for Dynamic Host Configuration
Protocol for IPv6 (DHCPv6)";
@@ -291,8 +297,8 @@ module ietf-dhcpv6-options {
}
container domain-searchlist-option {
- // if-feature domain-searchlist-op;
- // presence "Enable this option";
+ if-feature domain-searchlist-op;
+ presence "Enable this option";
description "OPTION_DOMAIN_LIST (24) Domain Search List Option";
reference "RFC3646: DNS Configuration options for Dynamic
Host Configuration Protocol for IPv6 (DHCPv6)";
@@ -311,10 +317,9 @@ module ietf-dhcpv6-options {
}
}
}
-
container nis-config-option {
- // if-feature nis-config-op;
- // presence "Enable this option";
+ if-feature nis-config-op;
+ presence "Enable this option";
description "OPTION_NIS_SERVERS (27) Network Information Service (NIS)
Servers Option.";
reference "RFC3898: Network Information Service (NIS) Configuration
@@ -336,8 +341,8 @@ module ietf-dhcpv6-options {
}
container nis-plus-config-option {
- // if-feature nis-plus-config-op;
- // presence "Enable this option";
+ if-feature nis-plus-config-op;
+ presence "Enable this option";
description "OPTION_NISP_SERVERS (28): Network Information Service V2
(NIS+) Servers Option.";
reference "RFC3989: Network Information Service (NIS) Configuration
@@ -357,6 +362,7 @@ module ietf-dhcpv6-options {
}
}
}
+
container nis-domain-name-option {
if-feature nis-domain-name-op;
presence "Enable this option";
@@ -391,7 +397,7 @@ module ietf-dhcpv6-options {
container sntp-server-option {
- // if-feature sntp-server-op;
+ if-feature sntp-server-op;
presence "Enable this option";
description "OPTION_SNTP_SERVERS (31) Simple Network Time Protocol
(SNTP) Servers Option";
@@ -414,7 +420,7 @@ module ietf-dhcpv6-options {
}
container info-refresh-time-option {
- //if-feature info-refresh-time-op;
+ if-feature info-refresh-time-op;
presence "Enable this option";
description "OPTION_INFORMATION_REFRESH_TIME (32) Information Refresh
Time option.";
@@ -428,7 +434,7 @@ module ietf-dhcpv6-options {
}
container client-fqdn-option {
- //if-feature client-fqdn-op;
+ if-feature client-fqdn-op;
presence "Enable this option";
description "OPTION_CLIENT_FQDN (39) DHCPv6 Client FQDN Option";
reference "RFC4704: The Dynamic Host Configuration Protocol for IPv6
@@ -451,7 +457,7 @@ module ietf-dhcpv6-options {
}
container posix-timezone-option {
- //if-feature posix-timezone-op;
+ if-feature posix-timezone-op;
presence "Enable this option";
description "OPTION_NEW_POSIX_TIMEZONE (41) Posix Timezone option";
reference "RFC4833: Timezone Options for DHCP";
@@ -463,7 +469,7 @@ module ietf-dhcpv6-options {
}
container tzdb-timezone-option {
- //if-feature tzdb-timezone-op;
+ if-feature tzdb-timezone-op;
presence "Enable this option";
description "OPTION_NEW_TZDB_TIMEZONE (42) Timezone Database option";
reference "RFC4822: Timezone Options for DHCP";
@@ -480,7 +486,7 @@ module ietf-dhcpv6-options {
// Zihao - Re-modelled so it only contains one time source suboption
- //if-feature ntp-server-op;
+ if-feature ntp-server-op;
presence "Enable this option";
description "OPTION_NTP_SERVER (56) NTP Server Option for DHCPv6";
reference "RFC5908: Network Time Protocol (NTP) Server Option for
@@ -494,63 +500,63 @@ module ietf-dhcpv6-options {
description "NTP server id";
}
choice ntp-time-source-suboption {
- description "Select a NTP time source suboption.";
- case server-address {
- leaf-list ntp-serv-addr-suboption {
- type inet:ipv6-address;
- description "NTP server addr";
- }
+ description "Select a NTP time source suboption.";
+ case server-address {
+ leaf-list ntp-serv-addr-suboption {
+ type inet:ipv6-address;
+ description "NTP server addr";
+ }
}
- case server-multicast-address {
- leaf-list ntp-serv-mul-addr-suboption {
+ case server-multicast-address {
+ leaf-list ntp-serv-mul-addr-suboption {
type inet:ipv6-address;
- description "NTP server multicast addr";
+ description "NTP server multicast addr";
}
- }
- case server-fqdn {
- leaf-list ntp-serv-fqdn-suboption {
+ }
+ case server-fqdn {
+ leaf-list ntp-serv-fqdn-suboption {
type string;
description "NTP server fqdn";
}
- }
+ }
}
}
}
- container boot-file-url-option {
- //if-feature boot-file-url-op;
- presence "Enable this option";
- description "OPT_BOOTFILE_URL (59) Boot File URL option";
- reference "RFC5970: DHCPv6 Options for Network Boot";
- list boot-file {
- key boot-file-id;
- description "boot file info";
- leaf boot-file-id {
- type uint8;
- mandatory true;
- description "boot file id";
- }
+ container boot-file-url-option {
+ if-feature boot-file-url-op;
+ presence "Enable this option";
+ description "OPT_BOOTFILE_URL (59) Boot File URL Option";
+ reference "RFC5970: DHCPv6 Options for Network Boot";
+ list boot-file {
+ key boot-file-id;
+ description "boot file info";
+ leaf boot-file-id {
+ type uint8;
+ mandatory true;
+ description "boot file id";
+ }
leaf-list suitable-arch-type {
type uint16;
description "architecture type";
}
leaf-list suitable-net-if {
- type uint32;
- description "network interface";
+ type uint32;
+ description "network interface";
}
- leaf boot-file-url {
- type string;
- mandatory true;
- description "url for boot file";
+ leaf boot-file-url {
+ type string;
+ mandatory true;
+ description "url for boot file";
+ }
+ }
}
- }
- }
- container boot-file-param-option {
- //if-feature boot-file-param-op;
- presence "Enable this option";
- description "OPT_BOOTFiLE_PARAM (60) Boot File Parameters Option";
- reference "RFC5970: DHCPv6 Options for Network Boot";
+ container boot-file-param-option {
+ if-feature boot-file-param-op;
+ presence "Enable this option";
+ description "OPT_BOOTFiLE_PARAM (60) Boot File Parameters Option";
+ reference "RFC5970: DHCPv6 Options for Network Boot";
list boot-file-paras {
key para-id;
description "boot file parameters";
@@ -565,10 +571,10 @@ module ietf-dhcpv6-options {
description "parameter value";
}
}
- }
+ }
container aftr-name-option {
- //if-feature aftr-name-op;
+ if-feature aftr-name-op;
presence "Enable this option";
description "OPTION_AFTR_NAME (64) AFTR-Name DHCPv6 Option";
reference "RFC6334: Dynamic Host Configuration Protocol for IPv6
@@ -581,10 +587,10 @@ module ietf-dhcpv6-options {
}
container kbr-default-name-option {
- //if-feature kbr-default-name-op;
- presence "Enable this option";
- description "OPTION_KRB_DEFAULT_REALM_NAME (77) Kerberos Default Realm Name Option";
- reference "RFC6784: Kerberos Options for DHCPv6";
+ if-feature kbr-default-name-op;
+ presence "Enable this option";
+ description "OPTION_KRB_DEFAULT_REALM_NAME (77) Kerberos Default Realm Name Option";
+ reference "RFC6784: Kerberos Options for DHCPv6";
leaf default-realm-name {
type string;
mandatory true;
@@ -593,10 +599,10 @@ module ietf-dhcpv6-options {
}
container kbr-kdc-option {
- //if-feature kbr-kdc-op;
- presence "Enable this option";
- description "OPTION_KRB_KDC (78) Kerberos KDB Option";
- reference "RFC6784: Kerberos Options for DHCPv6";
+ if-feature kbr-kdc-op;
+ presence "Enable this option";
+ description "OPTION_KRB_KDC (78) Kerberos KDB Option";
+ reference "RFC6784: Kerberos Options for DHCPv6";
list kdc-info {
key kdc-id;
description "kdc info";
@@ -639,7 +645,7 @@ module ietf-dhcpv6-options {
}
container sol-max-rt-option {
- //if-feature sol-max-rt-op;
+ if-feature sol-max-rt-op;
presence "Enable this option";
description "OPTION_SOL_MAX_RT (82) sol max rt option";
reference "RFC7083: Modification to Default Values of
@@ -652,7 +658,7 @@ module ietf-dhcpv6-options {
}
container inf-max-rt-option {
- //if-feature inf-max-rt-op;
+ if-feature inf-max-rt-op;
presence "Enable this option";
description "OPTION_INF_MAX_RT (83) inf max rt option";
reference "RFC7083: Modification to Default Values of
@@ -665,7 +671,7 @@ module ietf-dhcpv6-options {
}
container addr-selection-option {
- //if-feature addr-selection-op;
+ if-feature addr-selection-op;
presence "Enable this option";
description "OPTION_ADDRSEL (84) and OPTION_ADDRSEL_TABLE (85)";
reference "RFC7078: Distributing Address Selection Policy Using
@@ -715,7 +721,7 @@ module ietf-dhcpv6-options {
}
container pcp-server-option {
- //if-feature pcp-server-op;
+ if-feature pcp-server-op;
presence "Enable this option";
description "OPTION_V6_PCP_SERVER (86) pcp server option";
reference "RFC7291: DHCP Options for the Port Control
@@ -737,7 +743,7 @@ module ietf-dhcpv6-options {
}
container s46-rule-option {
- //if-feature s46-rule-op;
+ if-feature s46-rule-op;
presence "Enable this option";
description "OPTION_S46_RULE (89) S46 rule option";
reference "RFC7598: DHCPv6 Options for Configuration of
@@ -787,7 +793,7 @@ module ietf-dhcpv6-options {
}
container s46-br-option {
- //if-feature s46-br-op;
+ if-feature s46-br-op;
presence "Enable this option";
description "OPTION_S46_BR (90) S46 BR Option";
reference "RFC7598: DHCPv6 Options for Configuration of
@@ -809,7 +815,7 @@ module ietf-dhcpv6-options {
}
container s46-dmr-option {
- //if-feature s46-dmr-op;
+ if-feature s46-dmr-op;
presence "Enable this option";
description "OPTION_S46_DMR (91) S46 DMR Option";
reference "RFC7598: DHCPv6 Options for Configuration of
@@ -836,7 +842,7 @@ module ietf-dhcpv6-options {
}
container s46-v4-v6-binding-option {
- //if-feature s46-v4-v6-binding-op;
+ if-feature s46-v4-v6-binding-op;
presence "Enable this option";
description "OPTION_S46_V4V6BIND (92) S46 IPv4/IPv6 Address
Binding option";
@@ -858,7 +864,8 @@ module ietf-dhcpv6-options {
leaf bind-prefix6-len {
type uint8;
mandatory true;
- description "bind ipv6 prefix length";
+ description "bind ipv6 prefix
+ length";
}
leaf bind-ipv6-prefix {
type inet:ipv6-address;
@@ -878,7 +885,7 @@ module ietf-dhcpv6-options {
description "OPTION_RSOO (66) Relay-Supplied Options option";
reference "RFC6422: Relay-Supplied DHCP Options";
container erp-local-domain-name-option {
- //if-feature erp-local-domain-name-op;
+ if-feature erp-local-domain-name-op;
presence "Enable this option";
description "OPTION_ERP_LOCAL_DOMAIN_NAME (65) DHCPv6 ERP Local
Domain Name Option";
@@ -942,7 +949,7 @@ module ietf-dhcpv6-options {
}
container option-request-option {
- //if-feature option-request-op;
+ if-feature option-request-op;
presence "Enable this option";
description "OPTION_ORO (6) Option Request Option";
reference "RFC3315: Dynamic Host Configuration Protocol for
@@ -965,7 +972,7 @@ module ietf-dhcpv6-options {
}
container user-class-option {
- //if-feature user-class-op;
+ if-feature user-class-op;
presence "Enable this option";
description "OPTION_USER_CLASS (15) User Class Option";
reference "RFC3315: Dynamic Host Configuration Protocol
@@ -990,7 +997,7 @@ module ietf-dhcpv6-options {
}
container vendor-class-option {
- //if-feature vendor-class-op;
+ if-feature vendor-class-op;
presence "Enable this option";
description "OPTION_VENDOR_CLASS (16) Vendor Class Option";
reference "RFC3315: Dynamic Host Configuration Protocol
@@ -1001,8 +1008,8 @@ module ietf-dhcpv6-options {
description "enterprise number";
}
list vendor-class {
- key vendor-class-id;
- description "vendor class";
+ key vendor-class-id;
+ description "vendor class";
leaf vendor-class-id {
type uint8;
mandatory true;
@@ -1022,7 +1029,7 @@ module ietf-dhcpv6-options {
}
container client-fqdn-option {
- //if-feature client-fqdn-op;
+ if-feature client-fqdn-op;
presence "Enable this option";
description "OPTION_CLIENT_FQDN (39) The Dynamic Host
Configuration Protocol for IPv6 (DHCPv6) Client Fully
@@ -1048,7 +1055,7 @@ module ietf-dhcpv6-options {
}
container client-arch-type-option {
- //if-feature client-arch-type-op;
+ if-feature client-arch-type-op;
presence "Enable this option";
description "OPTION_CLIENT_ARCH_TYPE (61) Client System
Architecture Type Option";
@@ -1070,10 +1077,10 @@ module ietf-dhcpv6-options {
}
container client-network-interface-identifier-option {
- //if-feature client-network-interface-identifier-op;
+ if-feature client-network-interface-identifier-op;
presence "Enable this option";
description "OPTION_NII (62) Client Network Interface
- Identifier Option";
+ Identifier Option";
reference "RFC5970: DHCPv6 Options for Network Boot";
leaf type {
type uint8;
@@ -1093,47 +1100,47 @@ module ietf-dhcpv6-options {
}
container kbr-principal-name-option {
- //if-feature kbr-principal-name-op;
+ if-feature kbr-principal-name-op;
presence "Enable this option";
description "OPTION_KRB_PRINCIPAL_NAME (75) Kerberos
Principal Name Option";
reference "RFC6784: Kerberos Options for DHCPv6";
list principle-name {
- key principle-name-id;
- description "principle name";
- leaf principle-name-id {
- type uint8;
- mandatory true;
- description "principle name id";
- }
- leaf name-type {
- type int32;
- mandatory true;
- description "This field specifies the type of name that follows.";
- }
- leaf name-string {
- type string;
- mandatory true;
- description "This field encodes a sequence of components that form
- a name, each component encoded as a KerberoString";
- }
+ key principle-name-id;
+ description "principle name";
+ leaf principle-name-id {
+ type uint8;
+ mandatory true;
+ description "principle name id";
+ }
+ leaf name-type {
+ type int32;
+ mandatory true;
+ description "This field specifies the type of name that follows.";
+ }
+ leaf name-string {
+ type string;
+ mandatory true;
+ description "This field encodes a sequence of components that form
+ a name, each component encoded as a KerberoString";
+ }
}
}
container kbr-realm-name-option {
- //if-feature kbr-realm-name-op;
- presence "Enable this option";
- description "OPTION_KRB_REALM_NAME (76) Kerberos Realm Name Option";
- reference "RFC6784: Kerberos Options for DHCPv6";
- leaf realm-name {
- type string;
- mandatory true;
- description "realm name";
- }
+ if-feature kbr-realm-name-op;
+ presence "Enable this option";
+ description "OPTION_KRB_REALM_NAME (76) Kerberos Realm Name Option";
+ reference "RFC6784: Kerberos Options for DHCPv6";
+ leaf realm-name {
+ type string;
+ mandatory true;
+ description "realm name";
+ }
}
container client-link-layer-addr-option {
- //if-feature client-link-layer-addr-op;
+ if-feature client-link-layer-addr-op;
presence "Enable this option";
description "OPTION_CLIENT_LINKLAYER_ADDR (79) DHCPv6 Client
Link-Layer Address Option";
@@ -1160,7 +1167,7 @@ module ietf-dhcpv6-options {
description "operator customized options";
container operator-option-ipv6-address {
- //if-feature operator-op-ipv6-address;
+ if-feature operator-op-ipv6-address;
presence "Enable this option";
description "operator ipv6 address option";
reference "RFC7227: Guidelines for Creating New DHCPv6 Options";
@@ -1181,7 +1188,7 @@ module ietf-dhcpv6-options {
}
container operator-option-single-flag {
- //if-feature operator-op-single-flag;
+ if-feature operator-op-single-flag;
presence "Enable this option";
description "operator single flag";
reference "RFC7227: Guidelines for Creating New DHCPv6
@@ -1203,7 +1210,7 @@ module ietf-dhcpv6-options {
}
container operator-option-ipv6-prefix {
- //if-feature operator-op-ipv6-prefix;
+ if-feature operator-op-ipv6-prefix;
presence "Enable this option";
description "operator ipv6 prefix option";
reference "RFC7227: Guidelines for Creating New DHCPv6
@@ -1230,7 +1237,7 @@ module ietf-dhcpv6-options {
}
container operator-option-int32 {
- //if-feature operator-op-int32;
+ if-feature operator-op-int32;
presence "Enable this option";
description "operator integer 32 option";
reference "RFC7227: Guidelines for Creating New DHCPv6
@@ -1252,7 +1259,7 @@ module ietf-dhcpv6-options {
}
container operator-option-int16 {
- //if-feature operator-op-int16;
+ if-feature operator-op-int16;
presence "Enable this option";
description "operator integer 16 option";
reference "RFC7227: Guidelines for Creating New DHCPv6
@@ -1274,7 +1281,7 @@ module ietf-dhcpv6-options {
}
container operator-option-int8 {
- //if-feature operator-op-int8;
+ if-feature operator-op-int8;
presence "Enable this option";
description "operator integer 8 option";
reference "RFC7227: Guidelines for Creating New DHCPv6
@@ -1296,7 +1303,7 @@ module ietf-dhcpv6-options {
}
container operator-option-uri {
- //if-feature operator-op-uri;
+ if-feature operator-op-uri;
presence "Enable this option";
description "operator uri option";
reference "RFC7227: Guidelines for Creating New DHCPv6 Options";
@@ -1317,7 +1324,7 @@ module ietf-dhcpv6-options {
}
container operator-option-textstring {
- //if-feature operator-op-textstring;
+ if-feature operator-op-textstring;
presence "Enable this option";
description "operator itext string option";
reference "RFC7227: Guidelines for Creating New DHCPv6 Options";
@@ -1338,7 +1345,7 @@ module ietf-dhcpv6-options {
}
container operator-option-var-data {
- //if-feature operator-op-var-data;
+ if-feature operator-op-var-data;
presence "Enable this option";
description "operator variable length data option";
reference "RFC7227: Guidelines for Creating New DHCPv6 Options";
@@ -1359,7 +1366,7 @@ module ietf-dhcpv6-options {
}
container operator-option-dns-wire {
- //if-feature operator-op-dns-wire;
+ if-feature operator-op-dns-wire;
presence "Enable this option";
description "operator dns wire format domain name list option";
reference "RFC7227: Guidelines for Creating New DHCPv6
@@ -1379,5 +1386,6 @@ module ietf-dhcpv6-options {
}
}
}
+
}
}
diff --git a/src/lib/yang/models/ietf-dhcpv6-relay.yang b/src/lib/yang/models/ietf-dhcpv6-relay.yang
index f884e4a6ab..b480ff4b3a 100644
--- a/src/lib/yang/models/ietf-dhcpv6-relay.yang
+++ b/src/lib/yang/models/ietf-dhcpv6-relay.yang
@@ -30,6 +30,11 @@ module ietf-dhcpv6-relay {
"This model defines a YANG data model that can be
used to configure and manage a DHCPv6 relay.";
+ revision 2018-09-04 {
+ description "";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ }
+
revision 2018-03-04 {
description "Resolved most issues on the DHC official
github";
@@ -127,6 +132,7 @@ module ietf-dhcpv6-relay {
}
uses dhcpv6-types:vendor-infor;
}
+
container rsoo-option-sets {
description
"DHCPv6 relay agent could provide some information that would
diff --git a/src/lib/yang/models/ietf-dhcpv6-server.yang b/src/lib/yang/models/ietf-dhcpv6-server.yang
index 4c5fafaeea..0e13df47bd 100644
--- a/src/lib/yang/models/ietf-dhcpv6-server.yang
+++ b/src/lib/yang/models/ietf-dhcpv6-server.yang
@@ -1,344 +1,459 @@
module ietf-dhcpv6-server {
- yang-version 1.1;
- namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server";
- prefix "dhcpv6-server";
+ yang-version 1.1;
+ namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server";
+ prefix "dhcpv6-server";
- import ietf-inet-types {
- prefix inet;
+ import ietf-inet-types {
+ prefix inet;
}
- import ietf-yang-types {
- prefix yang;
- }
- import ietf-dhcpv6-options {
- prefix dhcpv6-options;
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import ietf-dhcpv6-options {
+ prefix dhcpv6-options;
}
import ietf-dhcpv6-types {
- prefix dhcpv6-types;
+ prefix dhcpv6-types;
}
import ietf-interfaces {
- prefix if;
+ prefix if;
}
organization "DHC WG";
contact
- "cuiyong@tsinghua.edu.cn
- lh.sunlinh@gmail.com
- ian.farrer@telekom.de
- sladjana.zechlin@telekom.de
- hezihao9512@gmail.com";
- description "This model defines a YANG data model that can be
- used to configure and manage a DHCPv6 server.";
+ "cuiyong@tsinghua.edu.cn
+ lh.sunlinh@gmail.com
+ ian.farrer@telekom.de
+ sladjana.zechlin@telekom.de
+ hezihao9512@gmail.com";
+
+ description "This model defines a YANG data model that can be
+ used to configure and manage a DHCPv6 server.";
+
+ revision 2018-09-04 {
+ description "";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ }
revision 2018-03-04 {
- description "Resolved most issues on the DHC official
- github";
- reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ description "Resolved most issues on the DHC official
+ github";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
}
- revision 2017-12-22 {
- description "Resolve most issues on Ian's github.";
- reference "I-D: draft-ietf-dhc-dhcpv6-yang";
- }
-
- revision 2017-11-24 {
- description "First version of the separated server specific
- YANG model.";
- reference "I-D: draft-ietf-dhc-dhcpv6-yang";
- }
-
- /*
- * Typedef
- */
- typedef threshold {
- type union {
- type uint16 {
- range 0..100;
- }
- type enumeration {
- enum "disabled" {
- description "No threshold";
+ revision 2017-12-22 {
+ description "Resolve most issues on Ian's github.";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
}
- }
- }
- description "Threshold value in percent";
- }
- /*
- * Data Nodes
- */
- container server {
- presence "Enables the server";
- description "DHCPv6 server portion";
+ revision 2017-11-24 {
+ description "First version of the separated server specific
+ YANG model.";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ }
+
+ /*
+ * Typedef
+ */
+ typedef threshold {
+ type union {
+ type uint16 {
+ range 0..100;
+ }
+ type enumeration {
+ enum "disabled" {
+ description "No threshold";
+ }
+ }
+ }
+ description "Threshold value in percent";
+ }
+
+ /*
+ * Data Nodes
+ */
+ container server {
+ presence "Enables the server";
+ description "DHCPv6 server portion";
/*
* Configuration data
*/
container server-config {
- description "This container contains the configuration data
+ description "This container contains the configuration data
of a server.";
- container serv-attributes {
- description
- "This container contains basic attributes of a DHCPv6 server
- such as IPv6 address, server name and so on. Some optional
- functions that can be provided by the server is also included.";
- container duid {
- description "Sets the DUID of server";
- uses dhcpv6-types:duid;
- }
- leaf name {
- type string;
- description "server's name";
- }
- leaf description {
- type string;
- description "description of the server.";
- }
- leaf-list ipv6-address {
- type inet:ipv6-address;
- description "server's IPv6 address.";
- }
- leaf-list interfaces-config {
- // Note - this should probably be references to
- // entries in the ietf-interfaces model
- type if:interface-ref;
- description "A leaf list to denote which one or more interfaces
- the server should listen on. The default value is to listen
- on all the interfaces. This node is also used to set a unicast
- address for the server to listen with a specific interface.
- For example, if people want the server to listen on a unicast
- address with a specific interface, he can use the format like
- 'eth1/2001:db8::1'.";
- }
- uses dhcpv6-types:vendor-infor;
- }
+ container serv-attributes {
+ description
+ "This container contains basic attributes of a DHCPv6 server
+ such as IPv6 address, server name and so on. Some optional
+ functions that can be provided by the server is also included.";
+ container duid {
+ description "Sets the DUID of server";
+ uses dhcpv6-types:duid;
+ }
+ leaf name {
+ type string;
+ description "server's name";
+ }
+ leaf description {
+ type string;
+ description "description of the server.";
+ }
+ leaf-list ipv6-address {
+ type inet:ipv6-address;
+ description "server's IPv6 address.";
+ }
+ leaf-list interfaces-config {
+ // Note - this should probably be references to
+ // entries in the ietf-interfaces model
+ type if:interface-ref;
+ description "A leaf list to denote which one or more interfaces
+ the server should listen on. The default value is to listen
+ on all the interfaces. This node is also used to set a unicast
+ address for the server to listen with a specific interface.
+ For example, if people want the server to listen on a unicast
+ address with a specific interface, he can use the format like
+ 'eth1/2001:db8::1'.";
+ }
+ container lease-storage {
+ description "Indicates how the server stores the lease";
+ choice storage-type {
+ description "the type of lease storage";
+ // leaf persist {
+ // type boolean;
+ // mandatory true;
+ // description "controls whether the new leases and updates to existing leases are
+ // written to the file";
+ // }
+ case memfile {
+ description "the server stores lease information in a CSV file";
- container option-sets {
- description "DHCPv6 employs various options to carry additional
+ leaf memfile-name {
+ type string;
+ description "specifies an absolute location of the lease file in which new leases
+ and lease updates will be recorded";
+ }
+
+ leaf memfile-lfc-interval {
+ type uint64;
+ description "specifies the interval in seconds, at which the server will perform a
+ lease file cleanup (LFC)";
+ }
+
+ }
+ case mysql {
+ leaf mysql-name {
+ type string;
+ description "type of the database";
+ }
+ leaf mysql-host {
+ type string;
+ description "If the database is located
+ on a different system to the DHCPv6 server, the database host name must also be specified.";
+ }
+ leaf mysql-password {
+ type string;
+ description "the credentials of the account under which the server will access the database";
+ }
+ leaf mysql-port {
+ type uint8;
+ description "If the database is located on a different system, the port number may be specified";
+ }
+ leaf mysql-lfc-interval {
+ type uint64;
+ description "specifies the interval in seconds, at which the server will perform a
+ lease file cleanup (LFC)";
+ }
+ leaf mysql-connect-timeout {
+ type uint64;
+ description "If the database is located on a different system, a longer interval needs to be specified";
+ }
+
+ }
+ case postgresql {
+ leaf postgresql-name {
+ type string;
+ description "type of the database";
+ }
+ leaf postgresql-host {
+ type string;
+ description "If the database is located
+ on a different system to the DHCPv6 server, the database host name must also be specified.";
+ }
+ leaf postgresql-password {
+ type string;
+ description "the credentials of the account under which the server will access the database";
+ }
+ leaf postgresql-port {
+ type uint8;
+ description "If the database is located on a different system, the port number may be specified";
+ }
+ leaf postgresql-lfc-interval {
+ type uint64;
+ description "specifies the interval in seconds, at which the server will perform a
+ lease file cleanup (LFC)";
+ }
+ leaf postgresql-connect-timeout {
+ type uint64;
+ description "If the database is located on a different system, a longer interval needs to be specified";
+ }
+ }
+ case cassandra {
+ leaf cassandra-name {
+ type string;
+ description "type of the database";
+ }
+ leaf cassandra-contact-points {
+ type string;
+ description "Cassandra takes a list of comma separated IP addresses to contact the cluster";
+ }
+ leaf cassandra-password {
+ type string;
+ description "the credentials of the account under which the server will access the database";
+ }
+ leaf cassandra-lfc-interval {
+ type uint64;
+ description "specifies the interval in seconds, at which the server will perform a
+ lease file cleanup (LFC)";
+ }
+ leaf cassandra-connect-timeout {
+ type uint64;
+ description "If the database is located on a different system, a longer interval needs to be specified";
+ }
+ }
+ }
+ }
+ uses dhcpv6-types:vendor-infor;
+ }
+
+ container option-sets {
+ description "DHCPv6 employs various options to carry additional
information and parameters in DHCP messages. This container defines
all the possible options that need to be configured at the server
side. ";
list option-set {
- key option-set-id;
- description "A server may allow different option sets to be
- configured for different conditions (i.e. different networks,
- clients and etc). This 'option-set' list enables various sets of
- options being defined and configured in a single server. Different
- sets are distinguished by the key called 'option-set-id'. All the
- possible options discussed above are defined in the list and each
- option is corresponding to a container. Since all the options in
- the list are optional, each container in this list has a 'presence'
- statement to indicate whether this option (container) will be
- included in the current option set or not. In addition, each container
- also has a 'if-feature' statement to indicate whether the server
- supports this option (container).";
+ key option-set-id;
+ description "A server may allow different option sets to be
+ configured for different conditions (i.e. different networks,
+ clients and etc). This 'option-set' list enables various sets of
+ options being defined and configured in a single server. Different
+ sets are distinguished by the key called 'option-set-id'. All the
+ possible options discussed above are defined in the list and each
+ option is corresponding to a container. Since all the options in
+ the list are optional, each container in this list has a 'presence'
+ statement to indicate whether this option (container) will be
+ included in the current option set or not. In addition, each container
+ also has a 'if-feature' statement to indicate whether the server
+ supports this option (container).";
leaf option-set-id {
- type uint32;
- description "option set id";
+ type uint32;
+ description "option set id";
}
uses dhcpv6-options:server-option-definitions;
uses dhcpv6-options:custom-option-definitions;
}
- }
+ }
- container network-ranges {
+ container network-ranges {
description "This model supports a hierarchy
- to achieve dynamic configuration. That is to say we could configure the
- server at different levels through this model. The top level is a global
- level which is defined as the container 'network-ranges'. The following
- levels are defined as sub-containers under it. The 'network-ranges'
- contains the parameters (e.g. option-sets) that would be allocated to
- all the clients served by this server.";
+ to achieve dynamic configuration. That is to say we could configure the
+ server at different levels through this model. The top level is a global
+ level which is defined as the container 'network-ranges'. The following
+ levels are defined as sub-containers under it. The 'network-ranges'
+ contains the parameters (e.g. option-sets) that would be allocated to
+ all the clients served by this server.";
leaf option-set-id {
type leafref {
path "/server/server-config/option-sets/option-set/option-set-id";
}
description
- "The ID field of relevant global option-set to be provisioned to
- clients.";
+ "The ID field of relevant global option-set to be provisioned to
+ clients.";
}
list network-range {
- key network-range-id;
- description
- "Under the 'network-ranges' container, a 'network-range' list
- is defined to configure the server at a network level which is also
- considered as the second level. Different network are identified by the
- key 'network-range-id'. This is because a server may have different
+ key network-range-id;
+ description
+ "Under the 'network-ranges' container, a 'network-range' list
+ is defined to configure the server at a network level which is also
+ considered as the second level. Different network are identified by the
+ key 'network-range-id'. This is because a server may have different
configuration parameters (e.g. option sets) for different networks.";
- leaf network-range-id {
- type uint32;
- mandatory true;
- description "equivalent to subnet id";
- }
- leaf network-description {
- type string;
- mandatory true;
- description "description of the subnet";
- }
- leaf network-prefix {
- type inet:ipv6-prefix;
- mandatory true;
- description "subnet prefix";
- }
- leaf option-set-id {
+ leaf network-range-id {
+ type uint32;
+ mandatory true;
+ description "equivalent to subnet id";
+ }
+ leaf network-description {
+ type string;
+ mandatory true;
+ description "description of the subnet";
+ }
+ leaf network-prefix {
+ type inet:ipv6-prefix;
+ mandatory true;
+ description "subnet prefix";
+ }
+ leaf option-set-id {
type leafref {
path "/server/server-config/option-sets/option-set/option-set-id";
}
description "The ID field of relevant option-set to be provisioned to
clients of this network-range.";
- }
+ }
- container address-pools {
+ container address-pools {
description
"A container that describes the DHCPv6 server's
address pools.";
list address-pool {
- key pool-id;
- description "A DHCPv6 server can be configured with
- several address pools. This list defines such address pools
- which are distinguished by the key called 'pool-id'.";
- leaf pool-id {
- type uint32;
+ key pool-id;
+ description "A DHCPv6 server can be configured with
+ several address pools. This list defines such address pools
+ which are distinguished by the key called 'pool-id'.";
+ leaf pool-id {
+ type uint32;
mandatory true;
description "pool id";
- }
- leaf pool-prefix {
+ }
+ leaf pool-prefix {
type inet:ipv6-prefix;
mandatory true;
description "pool prefix";
- }
- leaf start-address {
+ }
+ leaf start-address {
type inet:ipv6-address-no-zone;
mandatory true;
description "start address";
- }
- leaf end-address {
+ }
+ leaf end-address {
type inet:ipv6-address-no-zone;
mandatory true;
description "end address";
}
- leaf valid-lifetime {
+ leaf valid-lifetime {
type yang:timeticks;
mandatory true;
description "valid liftime for IA";
- }
- leaf renew-time {
+ }
+ leaf renew-time {
type yang:timeticks;
mandatory true;
description "renew time";
}
- leaf rebind-time {
+ leaf rebind-time {
type yang:timeticks;
mandatory true;
description "rebind time";
- }
- leaf preferred-lifetime {
- type yang:timeticks;
- mandatory true;
- description "preferred lifetime for IA";
- }
- leaf rapid-commit {
- type boolean;
- mandatory false;
- description "A boolean value specifies whether the pool
- supports client-server exchanges involving two messages.";
- }
+ }
+ leaf preferred-lifetime {
+ type yang:timeticks;
+ mandatory true;
+ description "preferred lifetime for IA";
+ }
+ leaf rapid-commit {
+ type boolean;
+ mandatory true;
+ description "A boolean value specifies whether the pool
+ supports client-server exchanges involving two messages.";
+ }
leaf client-class {
type string;
description
"If this leaf is specified, this pool will only serve
the clients belonging to this class.";
}
- leaf max-address-count {
+ leaf max-address-count {
type threshold;
mandatory true;
description "maximum count of addresses that can
- be allocated in this pool. This value may be
- less than count of total addresses.";
- }
- leaf option-set-id {
+ be allocated in this pool. This value may be
+ less than count of total addresses.";
+ }
+ leaf option-set-id {
type leafref {
- path "/server/server-config/option-sets/option-set/option-set-id";
+ path "/server/server-config/option-sets/option-set/option-set-id";
}
mandatory true;
description "The ID field of relevant option-set to be
- provisioned to clients of this address-pool.";
- }
- }
- }
- container pd-pools {
+ provisioned to clients of this address-pool.";
+ }
+ }
+ }
+
+ container pd-pools {
description "If a server supports prefix delegation function, this
- container will be used to define the delegating router's prefix
- pools.";
+ container will be used to define the delegating router's prefix
+ pools.";
list pd-pool {
- key pool-id;
- description "Similar to server's address pools, a delegating
- router can also be configured with multiple prefix pools
- specified by a list called 'prefix-pool'.";
- leaf pool-id {
- type uint32;
- mandatory true;
- description "pool id";
- }
- leaf prefix {
- type inet:ipv6-prefix;
- mandatory true;
- description "ipv6 prefix";
- }
- leaf prefix-length {
- type uint8;
- mandatory true;
- description "prefix length";
- }
- leaf valid-lifetime {
- type yang:timeticks;
+ key pool-id;
+ description "Similar to server's address pools, a delegating
+ router can also be configured with multiple prefix pools
+ specified by a list called 'prefix-pool'.";
+ leaf pool-id {
+ type uint32;
+ mandatory true;
+ description "pool id";
+ }
+ leaf prefix {
+ type inet:ipv6-prefix;
+ mandatory true;
+ description "ipv6 prefix";
+ }
+ leaf prefix-length {
+ type uint8;
+ mandatory true;
+ description "prefix length";
+ }
+ leaf valid-lifetime {
+ type yang:timeticks;
mandatory true;
description "valid lifetime for IA";
- }
- leaf renew-time {
+ }
+ leaf renew-time {
type yang:timeticks;
mandatory true;
description "renew time";
- }
- leaf rebind-time {
+ }
+ leaf rebind-time {
type yang:timeticks;
mandatory true;
description "rebind time";
- }
- leaf preferred-lifetime {
+ }
+ leaf preferred-lifetime {
type yang:timeticks;
mandatory true;
description "preferred lifetime for IA";
- }
- leaf rapid-commit {
- type boolean;
- mandatory false;
- description "A boolean value specifies whether the server
- support client-server exchanges involving two messages defined.";
- }
- leaf client-class {
+ }
+ leaf rapid-commit {
+ type boolean;
+ mandatory true;
+ description "A boolean value specifies whether the server
+ support client-server exchanges involving two messages defined.";
+ }
+ leaf client-class {
type string;
description "client class";
}
- leaf max-pd-space-utilization {
+ leaf max-pd-space-utilization {
type threshold;
- mandatory false;
+ mandatory true;
description "Maximum utilization of pd space in this pool";
- }
- leaf option-set-id {
- type leafref {
- path "/server/server-config/option-sets/option-set/option-set-id";
+ }
+ leaf option-set-id {
+ type leafref {
+ path "/server/server-config/option-sets/option-set/option-set-id";
+ }
+ mandatory true;
+ description "The ID field of relevant option-set to be
+ provisioned to clients of this prefix-pool.";
+ }
}
- mandatory false;
- description "The ID field of relevant option-set to be
- provisioned to clients of this prefix-pool.";
- }
- }
- }
+ }
container host-reservations {
description
- "This container allows the server to make reservations at host level.";
+ "This container allows the server to make reservations at host level.";
list host-reservation {
key cli-id;
description "This list allows the server to reserve addresses,
@@ -351,7 +466,7 @@ module ietf-dhcpv6-server {
choice client-identifier {
description "When making reservations, the server needs to choose a
- identifier to identify the server. Currently 'DUID' and 'hardware
+ identifier to identify the client. Currently 'DUID' and 'hardware
address' are supported.";
case duid {
description "DUID";
@@ -375,19 +490,19 @@ module ietf-dhcpv6-server {
key reserv-prefix-id;
description "reserved prefix reservation";
leaf reserv-prefix-id {
- type uint32;
- mandatory true;
- description "reserved prefix id";
+ type uint32;
+ mandatory true;
+ description "reserved prefix id";
}
leaf reserv-prefix {
- type inet:ipv6-prefix;
- mandatory true;
- description "reserved prefix";
- }
+ type inet:ipv6-prefix;
+ mandatory true;
+ description "reserved prefix";
+ }
leaf reserv-prefix-len {
- type uint8;
- mandatory true;
- description "reserved prefix length";
+ type uint8;
+ mandatory true;
+ description "reserved prefix length";
}
}
@@ -407,446 +522,446 @@ module ietf-dhcpv6-server {
}
}
- }
+ }
- container relay-opaque-paras {
+ container relay-opaque-paras {
description "This container contains some opaque values in Relay Agent
- options that need to be configured on the server side only for value
- match. Such Relay Agent options include Interface-Id option,
- Remote-Id option and Subscriber-Id option.";
+ options that need to be configured on the server side only for value
+ match. Such Relay Agent options include Interface-Id option,
+ Remote-Id option and Subscriber-Id option.";
list relays {
- key relay-name;
- description "relay agents";
- leaf relay-name {
- type string;
- mandatory true;
- description "relay agent name";
+ key relay-name;
+ description "relay agents";
+ leaf relay-name {
+ type string;
+ mandatory true;
+ description "relay agent name";
}
- list interface-info {
- key if-name;
- description "interface info";
- leaf if-name {
- type string;
- mandatory true;
- description "interface name";
- }
- leaf interface-id {
- type string;
- mandatory true;
- description "interface id";
- }
- }
- list subscribers {
- key subscriber;
- description "subscribers";
- leaf subscriber {
- type uint32;
- mandatory true;
- description "subscriber";
- }
- leaf subscriber-id {
- type string;
- mandatory true;
- description "subscriber id";
- }
- }
- list remote-host {
- key ent-num;
- description "remote host";
- leaf ent-num {
- type uint32;
- mandatory true;
- description "enterprise number";
- }
- leaf remote-id {
- type string;
- mandatory true;
- description "remote id";
- }
- }
- }
- }
+ list interface-info {
+ key if-name;
+ description "interface info";
+ leaf if-name {
+ type string;
+ mandatory true;
+ description "interface name";
+ }
+ leaf interface-id {
+ type string;
+ mandatory true;
+ description "interface id";
+ }
+ }
+ list subscribers {
+ key subscriber;
+ description "subscribers";
+ leaf subscriber {
+ type uint32;
+ mandatory true;
+ description "subscriber";
+ }
+ leaf subscriber-id {
+ type string;
+ mandatory true;
+ description "subscriber id";
+ }
+ }
+ list remote-host {
+ key ent-num;
+ description "remote host";
+ leaf ent-num {
+ type uint32;
+ mandatory true;
+ description "enterprise number";
+ }
+ leaf remote-id {
+ type string;
+ mandatory true;
+ description "remote id";
+ }
+ }
+ }
+ }
- container rsoo-enabled-options {
+ container rsoo-enabled-options {
description "rsoo enabled options";
list rsoo-enabled-option {
- key option-code;
- description "rsoo enabled option";
- leaf option-code {
- type uint16;
- mandatory true;
- description "option code";
- }
- leaf description {
- type string;
- mandatory true;
- description "description of the option";
- }
+ key option-code;
+ description "rsoo enabled option";
+ leaf option-code {
+ type uint16;
+ mandatory true;
+ description "option code";
+ }
+ leaf description {
+ type string;
+ mandatory true;
+ description "description of the option";
+ }
}
- }
-
- }
-
- /*
- * State data
- */
- container server-state {
- config "false";
- description "states of server";
- container network-ranges {
- description "This model supports a hierarchy to achieve dynamic configuration.
- That is to say we could configure the server at different levels through
- this model. The top level is a global level which is defined as the container
- 'network-ranges'. The following levels are defined as sub-containers under it.
- The 'network-ranges' contains the parameters (e.g. option-sets) that would be
- allocated to all the clients served by this server.";
- list network-range {
- key network-range-id;
- description "The ID field of relevant option-set to be provisioned
- to clients of this network-range.";
- leaf network-range-id {
- type uint32;
- mandatory true;
- description "equivalent to subnet id";
- }
- container address-pools {
- description "A container that describes the DHCPv6 server's address pools";
- list address-pool {
- key pool-id;
- description "A DHCPv6 server can be configured with
- several address pools. This list defines such address pools
- which are distinguished by the key called 'pool-id'.";
- leaf pool-id {
- type uint32;
- mandatory true;
- description "pool id";
- }
- leaf total-address-count {
- type uint64;
- mandatory true;
- description "count of total addresses in the pool";
- }
- leaf allocated-address-conut {
- type uint64;
- mandatory true;
- description "count of allocated addresses in the pool";
- }
- }
- list binding-info {
- key cli-id;
- description "A list that records a binding information for each DHCPv6
- client that has already been allocated IPv6 addresses.";
- leaf cli-id {
- type uint32;
- mandatory true;
- description "client id";
- }
- container duid {
- description "Read the DUID";
- uses dhcpv6-types:duid;
- }
- list cli-ia {
- key iaid;
- description "client IA";
- leaf ia-type {
- type string;
- mandatory true;
- description "IA type";
- }
- leaf iaid {
- type uint32;
- mandatory true;
- description "IAID";
- }
- leaf-list cli-addr {
- type inet:ipv6-address;
- description "client addr";
- }
- leaf pool-id {
- type uint32;
- mandatory true;
- description "pool id";
- }
- }
- }
}
- container pd-pools {
- description "If a server supports prefix delegation function,
- this container will be used to define the delegating
- router's prefix pools.";
- list prefix-pool {
+
+ }
+
+ /*
+ * State data
+ */
+ container server-state {
+ config "false";
+ description "states of server";
+ container network-ranges {
+ description "This model supports a hierarchy to achieve dynamic configuration.
+ That is to say we could configure the server at different levels through
+ this model. The top level is a global level which is defined as the container
+ 'network-ranges'. The following levels are defined as sub-containers under it.
+ The 'network-ranges' contains the parameters (e.g. option-sets) that would be
+ allocated to all the clients served by this server.";
+ list network-range {
+ key network-range-id;
+ description "The ID field of relevant option-set to be provisioned
+ to clients of this network-range.";
+ leaf network-range-id {
+ type uint32;
+ mandatory true;
+ description "equivalent to subnet id";
+ }
+ container address-pools {
+ description "A container that describes the DHCPv6 server's address pools";
+ list address-pool {
+ key pool-id;
+ description "A DHCPv6 server can be configured with
+ several address pools. This list defines such address pools
+ which are distinguished by the key called 'pool-id'.";
+ leaf pool-id {
+ type uint32;
+ mandatory true;
+ description "pool id";
+ }
+ leaf total-address-count {
+ type uint64;
+ mandatory true;
+ description "count of total addresses in the pool";
+ }
+ leaf allocated-address-conut {
+ type uint64;
+ mandatory true;
+ description "count of allocated addresses in the pool";
+ }
+ }
+ list binding-info {
+ key cli-id;
+ description "A list that records a binding information for each DHCPv6
+ client that has already been allocated IPv6 addresses.";
+ leaf cli-id {
+ type uint32;
+ mandatory true;
+ description "client id";
+ }
+ container duid {
+ description "Read the DUID";
+ uses dhcpv6-types:duid;
+ }
+ list cli-ia {
+ key iaid;
+ description "client IA";
+ leaf ia-type {
+ type string;
+ mandatory true;
+ description "IA type";
+ }
+ leaf iaid {
+ type uint32;
+ mandatory true;
+ description "IAID";
+ }
+ leaf-list cli-addr {
+ type inet:ipv6-address;
+ description "client addr";
+ }
+ leaf pool-id {
+ type uint32;
+ mandatory true;
+ description "pool id";
+ }
+ }
+ }
+ }
+ container pd-pools {
+ description "If a server supports prefix delegation function,
+ this container will be used to define the delegating
+ router's prefix pools.";
+ list prefix-pool {
key pool-id;
description "Similar to server's address pools, a delegating
- router can also be configured with multiple prefix pools
- specified by a list called 'prefix-pool'.";
+ router can also be configured with multiple prefix pools
+ specified by a list called 'prefix-pool'.";
leaf pool-id {
- type uint32;
- mandatory true;
- description "pool id";
+ type uint32;
+ mandatory true;
+ description "pool id";
}
leaf pd-space-utilization {
- type threshold;
- mandatory true;
- description "current PD space utilization";
+ type threshold;
+ mandatory true;
+ description "current PD space utilization";
}
- }
- list binding-info {
- key cli-id;
- description "A list records a binding information for each DHCPv6
- client that has already been alloated IPv6 prefixes.";
- leaf cli-id {
- type uint32;
- mandatory true;
- description "client id";
- }
- container duid {
- description "Reads the DUID";
- uses dhcpv6-types:duid;
- }
- list cli-iapd {
- key iaid;
- description "client IAPD";
- leaf iaid {
- type uint32;
- mandatory true;
- description "IAID";
- }
- leaf-list cli-prefix {
- type inet:ipv6-prefix;
- description "client ipv6 prefix";
- }
- leaf-list cli-prefix-len {
- type uint8;
- description "client prefix length";
- }
- leaf pool-id {
- type uint32;
- mandatory true;
- description "pool id";
- }
- }
- }
- }
+ }
+ list binding-info {
+ key cli-id;
+ description "A list records a binding information for each DHCPv6
+ client that has already been alloated IPv6 prefixes.";
+ leaf cli-id {
+ type uint32;
+ mandatory true;
+ description "client id";
+ }
+ container duid {
+ description "Reads the DUID";
+ uses dhcpv6-types:duid;
+ }
+ list cli-iapd {
+ key iaid;
+ description "client IAPD";
+ leaf iaid {
+ type uint32;
+ mandatory true;
+ description "IAID";
+ }
+ leaf-list cli-prefix {
+ type inet:ipv6-prefix;
+ description "client ipv6 prefix";
+ }
+ leaf-list cli-prefix-len {
+ type uint8;
+ description "client prefix length";
+ }
+ leaf pool-id {
+ type uint32;
+ mandatory true;
+ description "pool id";
+ }
+ }
+ }
+ }
- container host-reservations {
+ container host-reservations {
description "This container provides host reservations in the host level.";
- list binding-info {
- key cli-id;
- description
- "A list records a binding information for each DHCPv6
- client that has already been alloated IPv6 addresses or prefixes
- by host reservations.";
- leaf cli-id {
- type uint32;
- mandatory true;
- description "client id";
- }
- container duid {
- description "Reads the DUID";
- uses dhcpv6-types:duid;
- }
- list cli-ia {
- key iaid;
- description "client IA";
- leaf ia-type {
- type string;
- mandatory true;
- description "IA type, IA_NA or IA_TA";
- }
- leaf iaid {
- type uint32;
- mandatory true;
- description "IAID";
- }
- leaf-list cli-addr {
- type inet:ipv6-address;
- description "client addr";
- }
- }
+ list binding-info {
+ key cli-id;
+ description
+ "A list records a binding information for each DHCPv6
+ client that has already been alloated IPv6 addresses or prefixes
+ by host reservations.";
+ leaf cli-id {
+ type uint32;
+ mandatory true;
+ description "client id";
+ }
+ container duid {
+ description "Reads the DUID";
+ uses dhcpv6-types:duid;
+ }
+ list cli-ia {
+ key iaid;
+ description "client IA";
+ leaf ia-type {
+ type string;
+ mandatory true;
+ description "IA type, IA_NA or IA_TA";
+ }
+ leaf iaid {
+ type uint32;
+ mandatory true;
+ description "IAID";
+ }
+ leaf-list cli-addr {
+ type inet:ipv6-address;
+ description "client addr";
+ }
+ }
- list cli-iapd {
- key iaid;
- description "client IAPD";
- leaf iaid {
- type uint32;
- mandatory true;
- description "IAID";
+ list cli-iapd {
+ key iaid;
+ description "client IAPD";
+ leaf iaid {
+ type uint32;
+ mandatory true;
+ description "IAID";
+ }
+ leaf-list cli-prefix {
+ type inet:ipv6-prefix;
+ description "client ipv6 prefix";
+ }
+ leaf-list cli-prefix-len {
+ type uint8;
+ description "client prefix length";
+ }
+ }
+ }
}
- leaf-list cli-prefix {
- type inet:ipv6-prefix;
- description "client ipv6 prefix";
- }
- leaf-list cli-prefix-len {
- type uint8;
- description "client prefix length";
- }
- }
- }
- }
- }
- }
+ }
+ }
container packet-stats {
- description "A container presents the packet statistics related to
- the DHCPv6 server.";
+ description "A container presents the packet statistics related to
+ the DHCPv6 server.";
leaf solicit-count {
- type uint32;
- mandatory true;
- description "solicit counter";
+ type uint32;
+ mandatory true;
+ description "solicit counter";
}
leaf request-count {
- type uint32;
- mandatory true;
- description "request counter";
+ type uint32;
+ mandatory true;
+ description "request counter";
}
leaf renew-count {
- type uint32;
- mandatory true;
- description "renew counter";
+ type uint32;
+ mandatory true;
+ description "renew counter";
}
leaf rebind-count {
- type uint32;
- mandatory true;
- description "rebind counter";
+ type uint32;
+ mandatory true;
+ description "rebind counter";
}
leaf decline-count {
- type uint32;
- mandatory true;
- description "decline count";
+ type uint32;
+ mandatory true;
+ description "decline count";
}
leaf release-count {
- type uint32;
- mandatory true;
- description "release counter";
+ type uint32;
+ mandatory true;
+ description "release counter";
}
leaf info-req-count {
- type uint32;
- mandatory true;
- description "information request counter";
+ type uint32;
+ mandatory true;
+ description "information request counter";
}
leaf advertise-count {
- type uint32;
- mandatory true;
- description "advertise counter";
+ type uint32;
+ mandatory true;
+ description "advertise counter";
}
leaf confirm-count {
- type uint32;
- mandatory true;
- description "confirm counter";
+ type uint32;
+ mandatory true;
+ description "confirm counter";
}
leaf reply-count {
- type uint32;
- mandatory true;
- description "reply counter";
+ type uint32;
+ mandatory true;
+ description "reply counter";
}
leaf reconfigure-count {
- type uint32;
- mandatory true;
- description "reconfigure counter";
+ type uint32;
+ mandatory true;
+ description "reconfigure counter";
}
leaf relay-forward-count {
- type uint32;
- mandatory true;
- description "relay forward counter";
+ type uint32;
+ mandatory true;
+ description "relay forward counter";
}
leaf relay-reply-count {
- type uint32;
- mandatory true;
- description "relay reply counter";
+ type uint32;
+ mandatory true;
+ description "relay reply counter";
}
}
- }
- }
+ }
+ }
- /*
- * Notifications
- */
+ /*
+ * Notifications
+ */
- notification notifications {
- description "dhcpv6 server notification module";
+ notification notifications {
+ description "dhcpv6 server notification module";
container dhcpv6-server-event {
- description "dhcpv6 server event";
- container address-pool-running-out {
+ description "dhcpv6 server event";
+ container address-pool-running-out {
description "raised when the address pool is going to
- run out. A threshold for utilization ratio of the pool has
- been defined in the server feature so that it will notify the
- administrator when the utilization ratio reaches the
- threshold, and such threshold is a settable parameter";
+ run out. A threshold for utilization ratio of the pool has
+ been defined in the server feature so that it will notify the
+ administrator when the utilization ratio reaches the
+ threshold, and such threshold is a settable parameter";
leaf total-address-count {
- type uint64;
- mandatory true;
- description "count of total addresses in the pool";
+ type uint64;
+ mandatory true;
+ description "count of total addresses in the pool";
}
leaf max-address-count {
- type uint64;
- mandatory true;
- description "maximum count of addresses that can be allocated
- in the pool. This value may be less than count of total
- addresses";
+ type uint64;
+ mandatory true;
+ description "maximum count of addresses that can be allocated
+ in the pool. This value may be less than count of total
+ addresses";
}
leaf allocated-address-conut {
- type uint64;
- mandatory true;
- description "count of allocated addresses in the pool";
- }
- container duid {
- description "server duid";
- uses dhcpv6-types:duid;
+ type uint64;
+ mandatory true;
+ description "count of allocated addresses in the pool";
}
+ container duid {
+ description "server duid";
+ uses dhcpv6-types:duid;
+ }
leaf serv-name {
- type string;
- description "server name";
+ type string;
+ description "server name";
}
leaf pool-name {
- type string;
- mandatory true;
- description "pool name";
+ type string;
+ mandatory true;
+ description "pool name";
}
- }
- container pd-pool-running-out {
+ }
+ container pd-pool-running-out {
description "raised when the address/prefix pool is going to
- run out. A threshold for utilization ratio of the pool has
- been defined in the server feature so that it will notify the
- administrator when the utilization ratio reaches the
- threshold, and such threshold is a settable parameter";
- leaf max-pd-space-utilization {
- type threshold;
- mandatory true;
- description "maximum pd space utilization";
- }
- leaf pd-space-utilization {
- type threshold;
- mandatory true;
- description "current pd space utilization";
- }
+ run out. A threshold for utilization ratio of the pool has
+ been defined in the server feature so that it will notify the
+ administrator when the utilization ratio reaches the
+ threshold, and such threshold is a settable parameter";
+ leaf max-pd-space-utilization {
+ type threshold;
+ mandatory true;
+ description "maximum pd space utilization";
+ }
+ leaf pd-space-utilization {
+ type threshold;
+ mandatory true;
+ description "current pd space utilization";
+ }
container duid {
- description "Sets the DUID";
- uses dhcpv6-types:duid;
+ description "Sets the DUID";
+ uses dhcpv6-types:duid;
}
leaf serv-name {
- type string;
- description "server name";
+ type string;
+ description "server name";
}
leaf pool-name {
- type string;
- mandatory true;
- description "pool name";
+ type string;
+ mandatory true;
+ description "pool name";
}
- }
- container invalid-client-detected {
- description "raised when the server has found a client which
- can be regarded as a potential attacker. Some description
- could also be included.";
+ }
+ container invalid-client-detected {
+ description "raised when the server has found a client which
+ can be regarded as a potential attacker. Some description
+ could also be included.";
container duid {
- description "Sets the DUID";
- uses dhcpv6-types:duid;
+ description "Sets the DUID";
+ uses dhcpv6-types:duid;
}
leaf description {
- type string;
- description "description of the event";
+ type string;
+ description "description of the event";
+ }
+ }
+ }
}
- }
- }
- }
}
diff --git a/src/lib/yang/models/ietf-dhcpv6-types.yang b/src/lib/yang/models/ietf-dhcpv6-types.yang
index 7614adab0b..f7f5468543 100644
--- a/src/lib/yang/models/ietf-dhcpv6-types.yang
+++ b/src/lib/yang/models/ietf-dhcpv6-types.yang
@@ -21,6 +21,11 @@ module ietf-dhcpv6-types {
description "This model defines a YANG data model that can be
used to define some commonly used DHCPv6 types";
+ revision 2018-09-04 {
+ description "";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ }
+
revision 2018-01-30 {
description "Initial revision";
reference "I-D: draft-ietf-dhc-dhcpv6-yang";