Skip to main content

SockProtocol

Enum SockProtocol 

Source
#[non_exhaustive]
#[repr(i32)]
pub enum SockProtocol {
Show 25 variants Tcp = 6, Udp = 17, Raw = 255, NetlinkRoute = 0, NetlinkUserSock = 2, NetlinkSockDiag = 4, NetlinkNFLOG = 5, NetlinkSELinux = 7, NetlinkISCSI = 8, NetlinkAudit = 9, NetlinkFIBLookup = 10, NetlinkNetFilter = 12, NetlinkSCSITransport = 18, NetlinkRDMA = 20, NetlinkIPv6Firewall = 13, NetlinkDECNetRoutingMessage = 14, NetlinkKObjectUEvent = 15, NetlinkGeneric = 16, NetlinkCrypto = 21, EthAll = 768, EthLoop = 24_576, EthIpv6 = 56_710, Icmp = 1, IcmpV6 = 58, Sctp = 132,
}
Expand description

Constants used in socket and socketpair to specify the protocol to use.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Tcp = 6

TCP protocol (ip(7))

§

Udp = 17

UDP protocol (ip(7))

§

Raw = 255

Raw sockets (raw(7))

§

NetlinkRoute = 0

Receives routing and link updates and may be used to modify the routing tables (both IPv4 and IPv6), IP addresses, link (ref)

§

NetlinkUserSock = 2

Reserved for user-mode socket protocols (ref)

§

NetlinkSockDiag = 4

Query information about sockets of various protocol families from the kernel (ref)

§

NetlinkNFLOG = 5

Netfilter/iptables ULOG. (ref)

§

NetlinkSELinux = 7

SELinux event notifications. (ref)

§

NetlinkISCSI = 8

Open-iSCSI (ref)

§

NetlinkAudit = 9

Auditing (ref)

§

NetlinkFIBLookup = 10

Access to FIB lookup from user space (ref)

§

NetlinkNetFilter = 12

Netfilter subsystem (ref)

§

NetlinkSCSITransport = 18

SCSI Transports (ref)

§

NetlinkRDMA = 20

Infiniband RDMA (ref)

§

NetlinkIPv6Firewall = 13

Transport IPv6 packets from netfilter to user space. Used by ip6_queue kernel module. (ref)

§

NetlinkDECNetRoutingMessage = 14

DECnet routing messages (ref)

§

NetlinkKObjectUEvent = 15

Kernel messages to user space (ref)

§

NetlinkGeneric = 16

Generic netlink family for simplified netlink usage. (ref)

§

NetlinkCrypto = 21

Netlink interface to request information about ciphers registered with the kernel crypto API as well as allow configuration of the kernel crypto API. (ref)

§

EthAll = 768

Non-DIX type protocol number defined for the Ethernet IEEE 802.3 interface that allows packets of all protocols defined in the interface to be received. (ref)

§

EthLoop = 24_576

Packet filter on loopback traffic

§

EthIpv6 = 56_710

Packet filter on IPv6 traffic

§

Icmp = 1

ICMP protocol (icmp(7))

§

IcmpV6 = 58

ICMPv6 protocol (ICMP over IPv6)

§

Sctp = 132

SCTP (sctp(7))

Implementations§

Source§

impl SockProtocol

Source

pub const CanRaw: SockProtocol = SockProtocol::Icmp

The Controller Area Network raw socket protocol (ref)

Source

pub const CanBcm: SockProtocol = SockProtocol::NetlinkUserSock

The Controller Area Network broadcast manager protocol (ref)

Source

pub const EthIp: SockProtocol

Packet filter on IPv4 traffic

Trait Implementations§

Source§

impl Clone for SockProtocol

Source§

fn clone(&self) -> SockProtocol

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for SockProtocol

Source§

impl Debug for SockProtocol

Source§

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

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

impl Eq for SockProtocol

Source§

impl Hash for SockProtocol

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SockProtocol

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SockProtocol

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> 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, 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.