Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tc-filter]: move protocol leaf under list rule, add replace-on-updat… #164

Merged
merged 1 commit into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions tests/cases/test_tc_filter_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<qdisc-filter>
<dev>if_tc_f1</dev>
<parent>8001:</parent>
<protocol>ip</protocol>
<netns>1</netns>
<rule>
<pref>20</pref>
Expand Down Expand Up @@ -72,7 +71,6 @@
<qdisc-filter>
<dev>if_tc_f2</dev>
<parent>8002:</parent>
<protocol>ip</protocol>
<netns>1</netns>
<rule>
<pref>20</pref>
Expand All @@ -89,7 +87,6 @@
<dev-filter>
<dev>if_tc_f4</dev>
<direction>ingress</direction>
<protocol>ip</protocol>
<netns>1</netns>
<rule>
<pref>10</pref>
Expand All @@ -111,7 +108,6 @@
<dev-filter>
<dev>if_tc_f5_red</dev>
<direction>ingress</direction>
<protocol>ip</protocol>
<netns>tc_filter_red</netns>
<rule>
<pref>101</pref>
Expand All @@ -132,7 +128,6 @@
</dev-filter>
<shared-block-filter xmlns="urn:okda:iproute2:tc:filter">
<block>10</block>
<protocol>ip</protocol>
<netns>1</netns>
<rule>
<pref>10</pref>
Expand Down
23 changes: 15 additions & 8 deletions yang/iproute2-tc-filter.yang
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down