Skip to content

Commit

Permalink
macsec: support MACsec interface
Browse files Browse the repository at this point in the history
The patch is introducing MACsec interface support. In addition, it is
providing the InfoMacSec Nla. This Nla is gathering all the IFLA_MACSEC_
netlink attributes.

Please, notice that IFLA_MACSEC_PAD is omitted as it is used in SCI and
Cipher suite. It is not exposed in the nla_policy for MACsec.

Unit test added.

Signed-off-by: Fernando Fernandez Mancera <[email protected]>
  • Loading branch information
ffmancera authored and cathay4t committed Aug 29, 2023
1 parent 55de269 commit 050fd64
Show file tree
Hide file tree
Showing 2 changed files with 411 additions and 1 deletion.
28 changes: 28 additions & 0 deletions src/rtnl/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,34 @@ pub const IFLA_BR_VLAN_STATS_PER_PORT: u16 = 45;
pub const IFLA_BR_MULTI_BOOLOPT: u16 = 46;
pub const IFLA_BR_MCAST_QUERIER_STATE: u16 = 47;

pub const IFLA_MACSEC_UNSPEC: u16 = 0;
pub const IFLA_MACSEC_SCI: u16 = 1;
pub const IFLA_MACSEC_PORT: u16 = 2;
pub const IFLA_MACSEC_ICV_LEN: u16 = 3;
pub const IFLA_MACSEC_CIPHER_SUITE: u16 = 4;
pub const IFLA_MACSEC_WINDOW: u16 = 5;
pub const IFLA_MACSEC_ENCODING_SA: u16 = 6;
pub const IFLA_MACSEC_ENCRYPT: u16 = 7;
pub const IFLA_MACSEC_PROTECT: u16 = 8;
pub const IFLA_MACSEC_INC_SCI: u16 = 9;
pub const IFLA_MACSEC_ES: u16 = 10;
pub const IFLA_MACSEC_SCB: u16 = 11;
pub const IFLA_MACSEC_REPLAY_PROTECT: u16 = 12;
pub const IFLA_MACSEC_VALIDATION: u16 = 13;
// pub const IFLA_MACSEC_PAD: u16 = 14;
pub const IFLA_MACSEC_OFFLOAD: u16 = 15;
pub const MACSEC_VALIDATE_DISABLED: u8 = 0;
pub const MACSEC_VALIDATE_CHECK: u8 = 1;
pub const MACSEC_VALIDATE_STRICT: u8 = 2;
pub const MACSEC_OFFLOAD_OFF: u8 = 0;
pub const MACSEC_OFFLOAD_PHY: u8 = 1;
pub const MACSEC_OFFLOAD_MAC: u8 = 2;
pub const MACSEC_CIPHER_ID_GCM_AES_128: u64 = 0x0080C20001000001;
pub const MACSEC_CIPHER_ID_GCM_AES_256: u64 = 0x0080C20001000002;
pub const MACSEC_CIPHER_ID_GCM_AES_XPN_128: u64 = 0x0080C20001000003;
pub const MACSEC_CIPHER_ID_GCM_AES_XPN_256: u64 = 0x0080C20001000004;
pub const MACSEC_DEFAULT_CIPHER_ID: u64 = 0x0080020001000001;

pub const IFLA_MACVLAN_UNSPEC: u16 = 0;
pub const IFLA_MACVLAN_MODE: u16 = 1;
pub const IFLA_MACVLAN_FLAGS: u16 = 2;
Expand Down
Loading

0 comments on commit 050fd64

Please sign in to comment.