Skip to main content

TcpOptionKind

Enum TcpOptionKind 

Source
#[repr(u8)]
pub enum TcpOptionKind {
Show 15 variants Eol = 0, Nop = 1, Mss = 2, WScale = 3, SackOk = 4, Sack = 5, Timestamp = 8, AltChkSum = 14, AltChkSumOpt = 15, Md5 = 19, Mood = 25, Uto = 28, Ao = 29, Tfo = 34, Unknown(u8),
}
Expand description

TCP option kinds.

Variants§

§

Eol = 0

End of Option List (RFC 793)

§

Nop = 1

No Operation (RFC 793)

§

Mss = 2

Maximum Segment Size (RFC 793)

§

WScale = 3

Window Scale (RFC 7323)

§

SackOk = 4

SACK Permitted (RFC 2018)

§

Sack = 5

SACK (RFC 2018)

§

Timestamp = 8

Timestamps (RFC 7323)

§

AltChkSum = 14

Alternate Checksum Request (RFC 1146)

§

AltChkSumOpt = 15

Alternate Checksum Data (RFC 1146)

§

Md5 = 19

MD5 Signature (RFC 2385)

§

Mood = 25

Mood (RFC 5841) - April Fools

§

Uto = 28

User Timeout Option (RFC 5482)

§

Ao = 29

Authentication Option (RFC 5925)

§

Tfo = 34

TCP Fast Open (RFC 7413)

§

Unknown(u8)

Unknown option

Implementations§

Source§

impl TcpOptionKind

Source

pub fn from_byte(b: u8) -> Self

Create from raw option kind byte.

Source

pub fn to_byte(self) -> u8

Convert to raw option kind byte.

Source

pub fn name(&self) -> &'static str

Get the name of the option.

Source

pub fn is_single_byte(&self) -> bool

Check if this is a single-byte option (no length/data).

Source

pub fn expected_len(&self) -> Option<usize>

Get the expected fixed length for this option (if any). Returns None for variable-length options.

Trait Implementations§

Source§

impl Clone for TcpOptionKind

Source§

fn clone(&self) -> TcpOptionKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TcpOptionKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TcpOptionKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TcpOptionKind

Source§

fn eq(&self, other: &TcpOptionKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for TcpOptionKind

Source§

impl Eq for TcpOptionKind

Source§

impl StructuralPartialEq for TcpOptionKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V