diff --git a/tests/cases/test_tc_filter_data.xml b/tests/cases/test_tc_filter_data.xml index 66543e9..498e3b3 100644 --- a/tests/cases/test_tc_filter_data.xml +++ b/tests/cases/test_tc_filter_data.xml @@ -36,7 +36,6 @@ if_tc_f1 8001: - ip 1 20 @@ -72,7 +71,6 @@ if_tc_f2 8002: - ip 1 20 @@ -89,7 +87,6 @@ if_tc_f4 ingress - ip 1 10 @@ -111,7 +108,6 @@ if_tc_f5_red ingress - ip tc_filter_red 101 @@ -132,7 +128,6 @@ 10 - ip 1 10 diff --git a/yang/iproute2-tc-filter.yang b/yang/iproute2-tc-filter.yang index 094adda..7ee6ec8 100644 --- a/yang/iproute2-tc-filter.yang +++ b/yang/iproute2-tc-filter.yang @@ -38,12 +38,7 @@ module iproute2-tc-filter { default "1"; description "network namespace name"; } - leaf protocol { - type enumeration { - enum "ip"; - } - description "The protocol."; - } + } grouping filter-result { leaf classid { @@ -72,16 +67,28 @@ module iproute2-tc-filter { ipr2cgen:cmd-start; ipr2cgen:cmd-add "tc filter add"; ipr2cgen:cmd-delete "tc filter del"; - ipr2cgen:cmd-update "tc filter change"; + ipr2cgen:cmd-update "tc filter replace"; + ipr2cgen:replace-on-update; ipr2cgen:include_parent_leafs; + ipr2cgen:include-all-on-update; key "pref"; leaf pref { type uint32; description "the preference value"; } + leaf protocol { + type enumeration { + enum "ip"; + } + description "EthType protocol."; + default "ip"; + } leaf handle { - type uint16; // review + type string { + pattern '0x[0-9a-fA-F]+|\d+'; + } description "The filter ID."; + default "0x1"; } leaf prio { type uint8;