diff --git a/regexp-tests/openconfig-packet-match-types-test.yang b/regexp-tests/openconfig-packet-match-types-test.yang index d386af0046..f213b583a8 100644 --- a/regexp-tests/openconfig-packet-match-types-test.yang +++ b/regexp-tests/openconfig-packet-match-types-test.yang @@ -26,4 +26,23 @@ module openconfig-packet-match-types-test { pt:pattern-test-fail "66999..67890"; pt:pattern-test-fail "70000..70000"; } + + leaf fragment-offset-range { + type oc-pkt-match-types:fragment-offset-range; + pt:pattern-test-pass "0..0"; + pt:pattern-test-pass "0..8191"; + pt:pattern-test-pass "8191..8191"; + pt:pattern-test-pass "100..200"; + pt:pattern-test-pass "00..00"; + pt:pattern-test-pass "0000..0000"; + pt:pattern-test-pass "1234..5678"; + pt:pattern-test-pass "7999..8191"; + pt:pattern-test-fail "100.200"; + pt:pattern-test-fail "0.8191"; + pt:pattern-test-fail "0..8192"; + pt:pattern-test-fail "8192..8192"; + pt:pattern-test-fail "9999..9999"; + pt:pattern-test-fail "10000..10000"; + pt:pattern-test-fail "-1..10"; + } } diff --git a/release/models/acl/openconfig-packet-match-types.yang b/release/models/acl/openconfig-packet-match-types.yang index 8c4ae88cf0..a4df5dcc22 100644 --- a/release/models/acl/openconfig-packet-match-types.yang +++ b/release/models/acl/openconfig-packet-match-types.yang @@ -383,12 +383,12 @@ module openconfig-packet-match-types { type string { pattern '(0{0,3}[0-9]|0{0,2}[1-9][0-9]|0?[1-9][0-9]{2}|[1-7][0-9]{3}|' - + '80[0-9]{2}|81[0-8][0-9]|819[0-1])\\.\\.(0{0,3}[0-9]|' + + '80[0-9]{2}|81[0-8][0-9]|819[0-1])\.\.(0{0,3}[0-9]|' + '0{0,2}[1-9][0-9]|0?[1-9][0-9]{2}|[1-7][0-9]{3}|' + '80[0-9]{2}|81[0-8][0-9]|819[0-1])'; oc-ext:posix-pattern '^((0{0,3}[0-9]|0{0,2}[1-9][0-9]|0?[1-9][0-9]{2}|[1-7][0-9]{3}|' - + '80[0-9]{2}|81[0-8][0-9]|819[0-1])\\.\\.(0{0,3}[0-9]|' + + '80[0-9]{2}|81[0-8][0-9]|819[0-1])\.\.(0{0,3}[0-9]|' + '0{0,2}[1-9][0-9]|0?[1-9][0-9]{2}|[1-7][0-9]{3}|' + '80[0-9]{2}|81[0-8][0-9]|819[0-1]))$'; }