-
Notifications
You must be signed in to change notification settings - Fork 64
feat: add netkit support #185
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
base: main
Are you sure you want to change the base?
Conversation
cathay4t
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Small changes required.
| } | ||
|
|
||
| const NETKIT_POLICY_PASS: u32 = 0; | ||
| const NETKIT_POLICY_DROP: u32 = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use kernel constant name for the seek of developer to search in linux kernel.
And also , you missed NETKIT_REDIRECT
NETKIT_PASS = 0,
NETKIT_DROP = 2,
NETKIT_REDIRECT = 7,|
|
||
| use super::super::{LinkMessage, LinkMessageBuffer}; | ||
|
|
||
| const NETKIT_MODE_L2: u32 = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use kernel constant name: NETKIT_L2
| const IFLA_NETKIT_PRIMARY: u16 = 2; | ||
| const IFLA_NETKIT_POLICY: u16 = 3; | ||
| const IFLA_NETKIT_PEER_POLICY: u16 = 4; | ||
| const IFLA_NETKIT_MODE: u16 = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing:
IFLA_NETKIT_SCRUB,
IFLA_NETKIT_PEER_SCRUB,
IFLA_NETKIT_HEADROOM,
IFLA_NETKIT_TAILROOM,It's OK to skip them for now.
| #[derive(Debug, PartialEq, Eq, Clone, Copy)] | ||
| #[non_exhaustive] | ||
| pub enum NetkitPolicy { | ||
| Pass, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iproute is treating this as forward.
Maybe create alias for that.
impl NetkitPolicy {
pub const Forward = Self::Pass;
}
This PR adds support for netkit devices
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=22360fad5889cbefe1eca695b0cc0273ab280b56