impl EthernetPort
{
#[inline(always)]
pub fn setVirtualLanOffloading(&self, virtualLanOffloadFeatures: VirtualLanOffloadFeatures) -> Result<(), UnsupportedByHardwareError>
{
match unsafe { rte_eth_dev_set_vlan_offload(self.portIdentifier(), virtualLanOffloadFeatures.bits()) }
{
result if result >= 0 => Ok(()),
NegativeE::ENOTSUP => Err(UnsupportedByHardwareError::IsUnsupportedByTheHardware),
NegativeE::ENODEV => panic!("The port identifier '{}' is invalid", self.portIdentifier()),
unexpected @ _ => panic!("Unexpected error code '{}' from rte_eth_dev_set_vlan_offload()", unexpected),
}
}
#[inline(always)]
pub fn getVirtualLanOffloading(&self) -> VirtualLanOffloadFeatures
{
match unsafe { rte_eth_dev_get_vlan_offload(self.portIdentifier()) }
{
result if result >= 0 => VirtualLanOffloadFeatures::from_bits(result).expect("Unknown bits from rte_eth_dev_get_vlan_offload()"),
NegativeE::ENODEV => panic!("The port identifier '{}' is invalid", self.portIdentifier()),
unexpected @ _ => panic!("Unexpected error code '{}' from rte_eth_dev_get_vlan_offload()", unexpected),
}
}
}