Skip to content

Commit

Permalink
link: Rename MacSecValidation to MacSecValidate
Browse files Browse the repository at this point in the history
Make sure the name is align with kernel constant name.

Signed-off-by: Gris Ge <[email protected]>
  • Loading branch information
cathay4t committed Dec 5, 2023
1 parent 1418939 commit a6af25c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions src/link/link_info/macsec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ impl From<MacSecCipherId> for u64 {

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[non_exhaustive]
pub enum MacSecValidation {
pub enum MacSecValidate {
Disabled,
Check,
Strict,
Other(u8),
}

impl From<u8> for MacSecValidation {
impl From<u8> for MacSecValidate {
fn from(d: u8) -> Self {
match d {
MACSEC_VALIDATE_DISABLED => Self::Disabled,
Expand All @@ -96,13 +96,13 @@ impl From<u8> for MacSecValidation {
}
}

impl From<MacSecValidation> for u8 {
fn from(d: MacSecValidation) -> Self {
impl From<MacSecValidate> for u8 {
fn from(d: MacSecValidate) -> Self {
match d {
MacSecValidation::Disabled => MACSEC_VALIDATE_DISABLED,
MacSecValidation::Check => MACSEC_VALIDATE_CHECK,
MacSecValidation::Strict => MACSEC_VALIDATE_STRICT,
MacSecValidation::Other(value) => value,
MacSecValidate::Disabled => MACSEC_VALIDATE_DISABLED,
MacSecValidate::Check => MACSEC_VALIDATE_CHECK,
MacSecValidate::Strict => MACSEC_VALIDATE_STRICT,
MacSecValidate::Other(value) => value,
}
}
}
Expand Down Expand Up @@ -153,7 +153,7 @@ pub enum InfoMacSec {
Es(u8),
Scb(u8),
ReplayProtect(u8),
Validation(MacSecValidation),
Validation(MacSecValidate),
Offload(MacSecOffload),
Other(DefaultNla),
}
Expand Down
2 changes: 1 addition & 1 deletion src/link/link_info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub use self::ipoib::InfoIpoib;
pub use self::ipvlan::InfoIpVlan;
pub use self::mac_vlan::{InfoMacVlan, InfoMacVtap};
pub use self::macsec::{
InfoMacSec, MacSecCipherId, MacSecOffload, MacSecValidation,
InfoMacSec, MacSecCipherId, MacSecOffload, MacSecValidate,
};
pub use self::sit::InfoSitTun;
pub use self::tun::InfoTun;
Expand Down
2 changes: 1 addition & 1 deletion src/link/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub use self::link_info::{
InfoGreTun6, InfoGtp, InfoHsr, InfoIpVlan, InfoIpoib, InfoKind, InfoMacSec,
InfoMacVlan, InfoMacVtap, InfoPortData, InfoPortKind, InfoSitTun, InfoTun,
InfoVeth, InfoVlan, InfoVrf, InfoVti, InfoVxlan, InfoXfrm, LinkInfo,
LinkXstats, MacSecCipherId, MacSecOffload, MacSecValidation, MiiStatus,
LinkXstats, MacSecCipherId, MacSecOffload, MacSecValidate, MiiStatus,
VlanQosMapping,
};
pub use self::link_layer_type::LinkLayerType;
Expand Down
4 changes: 2 additions & 2 deletions src/link/tests/macsec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use netlink_packet_utils::{Emitable, Parseable};
use crate::link::{
InfoData, InfoKind, InfoMacSec, LinkAttribute, LinkFlag, LinkHeader,
LinkInfo, LinkLayerType, LinkMessage, LinkMessageBuffer, MacSecCipherId,
MacSecOffload, MacSecValidation,
MacSecOffload, MacSecValidate,
};
use crate::AddressFamily;

Expand Down Expand Up @@ -54,7 +54,7 @@ fn test_macsec_link_info() {
InfoMacSec::Es(0),
InfoMacSec::Scb(0),
InfoMacSec::ReplayProtect(0),
InfoMacSec::Validation(MacSecValidation::Strict),
InfoMacSec::Validation(MacSecValidate::Strict),
InfoMacSec::Offload(MacSecOffload::Off),
])),
])],
Expand Down

0 comments on commit a6af25c

Please sign in to comment.