Skip to content

Commit 45f9206

Browse files
azdlecathay4t
authored andcommitted
Allow TrafficGetFilterRequest to get ingress or egress filters
These options are the equivalent of: tc filter show dev DEV ingress and tc filter show dev DEV egress
1 parent 8a2e943 commit 45f9206

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/traffic_control/get.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,24 @@ impl TrafficFilterGetRequest {
136136
self.message.header.parent = TcHandle::ROOT;
137137
self
138138
}
139+
140+
/// Set parent to ingress.
141+
pub fn ingress(mut self) -> Self {
142+
self.message.header.parent = TcHandle {
143+
major: 0xffff,
144+
minor: TcHandle::MIN_INGRESS,
145+
};
146+
self
147+
}
148+
149+
/// Set parent to egress.
150+
pub fn egress(mut self) -> Self {
151+
self.message.header.parent = TcHandle {
152+
major: 0xffff,
153+
minor: TcHandle::MIN_EGRESS,
154+
};
155+
self
156+
}
139157
}
140158

141159
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)