#[repr(C)]pub struct VxlanHdr {
pub flags: u8,
pub _reserved1: [u8; 3],
pub vni: [u8; 3],
pub _reserved2: u8,
}Expand description
VXLAN (Virtual eXtensible Local Area Network) header.
Encapsulates OSI layer 2 Ethernet frames within layer 4 UDP packets. Uses a 24-bit VXLAN Network Identifier (VNI) for traffic segregation. Header length: 8 bytes. Reference: RFC 7348.
Fields§
§flags: u8Flags (8 bits). Bit 3 (I flag) must be 1 if VNI is present. Other bits are reserved (R).
_reserved1: [u8; 3]Reserved field (24 bits). Must be zero on transmission.
vni: [u8; 3]Contains the 24-bit VNI (upper 3 bytes) and an 8-bit reserved field (the lowest byte). The reserved field (the lowest byte) must be zero on transmission.
_reserved2: u8Implementations§
Source§impl VxlanHdr
impl VxlanHdr
Sourcepub fn with_flags(flags: u8, vni: [u8; 3]) -> Self
pub fn with_flags(flags: u8, vni: [u8; 3]) -> Self
Sourcepub fn vni_present(&self) -> bool
pub fn vni_present(&self) -> bool
Sourcepub fn set_vni_present(&mut self, present: bool)
pub fn set_vni_present(&mut self, present: bool)
Sets or clears the I-flag (VNI Present).
Preserves other flag bits.
§Parameters
present: Iftrue, sets the I-flag; otherwise, clears it.
Trait Implementations§
Source§impl<'de, WincodeConfig: Config> SchemaRead<'de, WincodeConfig> for VxlanHdr
impl<'de, WincodeConfig: Config> SchemaRead<'de, WincodeConfig> for VxlanHdr
Source§impl<WincodeConfig: Config> SchemaWrite<WincodeConfig> for VxlanHdr
impl<WincodeConfig: Config> SchemaWrite<WincodeConfig> for VxlanHdr
Source§impl<WincodeConfig: Config> ZeroCopy<WincodeConfig> for VxlanHdr
impl<WincodeConfig: Config> ZeroCopy<WincodeConfig> for VxlanHdr
Source§fn from_bytes<'de>(bytes: &'de [u8], config: C) -> Result<&'de Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
fn from_bytes<'de>(bytes: &'de [u8], config: C) -> Result<&'de Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
Like
crate::ZeroCopy::from_bytes, but allows the caller to provide a custom configuration.Source§fn from_bytes_mut<'de>(
bytes: &'de mut [u8],
config: C,
) -> Result<&'de mut Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
fn from_bytes_mut<'de>(
bytes: &'de mut [u8],
config: C,
) -> Result<&'de mut Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
Like
crate::ZeroCopy::from_bytes_mut, but allows the caller to provide a custom configuration.impl Copy for VxlanHdr
Auto Trait Implementations§
impl Freeze for VxlanHdr
impl RefUnwindSafe for VxlanHdr
impl Send for VxlanHdr
impl Sync for VxlanHdr
impl Unpin for VxlanHdr
impl UnsafeUnpin for VxlanHdr
impl UnwindSafe for VxlanHdr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
Source§impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
Source§impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given
Reader into dst.Source§impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given
Reader into dst.Source§impl<T, C> Serialize<C> for T
impl<T, C> Serialize<C> for T
Source§fn serialize_into(
dst: impl Writer,
src: &Self::Src,
config: C,
) -> Result<(), WriteError>
fn serialize_into( dst: impl Writer, src: &Self::Src, config: C, ) -> Result<(), WriteError>
Serialize a serializable type into the given
Writer.Source§fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.
Source§impl<T> Serialize for T
impl<T> Serialize for T
Source§fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
Serialize a serializable type into the given byte buffer.
Source§fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.