Skip to content

Commit 050fd64

Browse files
ffmanceracathay4t
authored andcommitted
macsec: support MACsec interface
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]>
1 parent 55de269 commit 050fd64

File tree

2 files changed

+411
-1
lines changed

2 files changed

+411
-1
lines changed

src/rtnl/constants.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,34 @@ pub const IFLA_BR_VLAN_STATS_PER_PORT: u16 = 45;
463463
pub const IFLA_BR_MULTI_BOOLOPT: u16 = 46;
464464
pub const IFLA_BR_MCAST_QUERIER_STATE: u16 = 47;
465465

466+
pub const IFLA_MACSEC_UNSPEC: u16 = 0;
467+
pub const IFLA_MACSEC_SCI: u16 = 1;
468+
pub const IFLA_MACSEC_PORT: u16 = 2;
469+
pub const IFLA_MACSEC_ICV_LEN: u16 = 3;
470+
pub const IFLA_MACSEC_CIPHER_SUITE: u16 = 4;
471+
pub const IFLA_MACSEC_WINDOW: u16 = 5;
472+
pub const IFLA_MACSEC_ENCODING_SA: u16 = 6;
473+
pub const IFLA_MACSEC_ENCRYPT: u16 = 7;
474+
pub const IFLA_MACSEC_PROTECT: u16 = 8;
475+
pub const IFLA_MACSEC_INC_SCI: u16 = 9;
476+
pub const IFLA_MACSEC_ES: u16 = 10;
477+
pub const IFLA_MACSEC_SCB: u16 = 11;
478+
pub const IFLA_MACSEC_REPLAY_PROTECT: u16 = 12;
479+
pub const IFLA_MACSEC_VALIDATION: u16 = 13;
480+
// pub const IFLA_MACSEC_PAD: u16 = 14;
481+
pub const IFLA_MACSEC_OFFLOAD: u16 = 15;
482+
pub const MACSEC_VALIDATE_DISABLED: u8 = 0;
483+
pub const MACSEC_VALIDATE_CHECK: u8 = 1;
484+
pub const MACSEC_VALIDATE_STRICT: u8 = 2;
485+
pub const MACSEC_OFFLOAD_OFF: u8 = 0;
486+
pub const MACSEC_OFFLOAD_PHY: u8 = 1;
487+
pub const MACSEC_OFFLOAD_MAC: u8 = 2;
488+
pub const MACSEC_CIPHER_ID_GCM_AES_128: u64 = 0x0080C20001000001;
489+
pub const MACSEC_CIPHER_ID_GCM_AES_256: u64 = 0x0080C20001000002;
490+
pub const MACSEC_CIPHER_ID_GCM_AES_XPN_128: u64 = 0x0080C20001000003;
491+
pub const MACSEC_CIPHER_ID_GCM_AES_XPN_256: u64 = 0x0080C20001000004;
492+
pub const MACSEC_DEFAULT_CIPHER_ID: u64 = 0x0080020001000001;
493+
466494
pub const IFLA_MACVLAN_UNSPEC: u16 = 0;
467495
pub const IFLA_MACVLAN_MODE: u16 = 1;
468496
pub const IFLA_MACVLAN_FLAGS: u16 = 2;

0 commit comments

Comments
 (0)