Enum nix::sys::socket::SockProtocol

source ·
#[non_exhaustive]
#[repr(i32)]
pub enum SockProtocol {
Show 22 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, Icmp = 1, IcmpV6 = 58,
}
Available on crate feature socket only.
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)

§

Icmp = 1

ICMP protocol (icmp(7))

§

IcmpV6 = 58

ICMPv6 protocol (ICMP over IPv6)

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)

Trait Implementations§

source§

impl Clone for SockProtocol

source§

fn clone(&self) -> SockProtocol

Returns a copy 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 SockProtocol

source§

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

Formats the value using the given formatter. Read more
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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for SockProtocol

source§

impl Eq for SockProtocol

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

§

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

§

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

§

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.