Skip to content

Conversation

@mccormickt
Copy link

@mccormickt mccormickt changed the title feat: add netlink support feat: add netkit support Nov 7, 2025
Copy link
Member

@cathay4t cathay4t left a 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;
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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,
Copy link
Member

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants