Struct pcap::Linktype

source ·
pub struct Linktype(pub i32);
Expand description

This is a datalink link type.

As an example, Linktype(1) is ethernet. A full list of linktypes is available here. The const bellow are not exhaustive.

use pcap::Linktype;

let lt = Linktype(1);
assert_eq!(Linktype::ETHERNET, lt);

Tuple Fields§

§0: i32

Implementations§

source§

impl Linktype

source

pub fn get_name(&self) -> Result<String, Error>

Gets the name of the link type, such as EN10MB

source

pub fn get_description(&self) -> Result<String, Error>

Gets the description of a link type.

source

pub fn from_name(name: &str) -> Result<Linktype, Error>

Gets the linktype from a name string

source

pub const NULL: Self = _

source

pub const ETHERNET: Self = _

source

pub const AX25: Self = _

source

pub const IEEE802_5: Self = _

source

pub const ARCNET_BSD: Self = _

source

pub const SLIP: Self = _

source

pub const PPP: Self = _

source

pub const FDDI: Self = _

source

pub const PPP_HDLC: Self = _

source

pub const PPP_ETHER: Self = _

source

pub const ATM_RFC1483: Self = _

source

pub const RAW: Self = _

source

pub const C_HDLC: Self = _

source

pub const IEEE802_11: Self = _

source

pub const FRELAY: Self = _

source

pub const LOOP: Self = _

source

pub const LINUX_SLL: Self = _

source

pub const LTALK: Self = _

source

pub const PFLOG: Self = _

source

pub const IEEE802_11_PRISM: Self = _

source

pub const IP_OVER_FC: Self = _

source

pub const SUNATM: Self = _

source

pub const IEEE802_11_RADIOTAP: Self = _

source

pub const ARCNET_LINUX: Self = _

source

pub const APPLE_IP_OVER_IEEE1394: Self = _

source

pub const MTP2_WITH_PHDR: Self = _

source

pub const MTP2: Self = _

source

pub const MTP3: Self = _

source

pub const SCCP: Self = _

source

pub const DOCSIS: Self = _

source

pub const LINUX_IRDA: Self = _

source

pub const USER0: Self = _

source

pub const USER1: Self = _

source

pub const USER2: Self = _

source

pub const USER3: Self = _

source

pub const USER4: Self = _

source

pub const USER5: Self = _

source

pub const USER6: Self = _

source

pub const USER7: Self = _

source

pub const USER8: Self = _

source

pub const USER9: Self = _

source

pub const USER10: Self = _

source

pub const USER11: Self = _

source

pub const USER12: Self = _

source

pub const USER13: Self = _

source

pub const USER14: Self = _

source

pub const USER15: Self = _

source

pub const IEEE802_11_AVS: Self = _

source

pub const BACNET_MS_TP: Self = _

source

pub const PPP_PPPD: Self = _

source

pub const GPRS_LLC: Self = _

source

pub const GPF_T: Self = _

source

pub const GPF_F: Self = _

source

pub const LINUX_LAPD: Self = _

source

pub const MFR: Self = _

source

pub const BLUETOOTH_HCI_H4: Self = _

source

pub const USB_LINUX: Self = _

source

pub const PPI: Self = _

source

pub const IEEE802_15_4_WITHFCS: Self = _

source

pub const SITA: Self = _

source

pub const ERF: Self = _

source

pub const BLUETOOTH_HCI_H4_WITH_PHDR: Self = _

source

pub const AX25_KISS: Self = _

source

pub const LAPD: Self = _

source

pub const PPP_WITH_DIR: Self = _

source

pub const C_HDLC_WITH_DIR: Self = _

source

pub const FRELAY_WITH_DIR: Self = _

source

pub const LAPB_WITH_DIR: Self = _

source

pub const IPMB_LINUX: Self = _

source

pub const IEEE802_15_4_NONASK_PHY: Self = _

source

pub const USB_LINUX_MMAPPED: Self = _

source

pub const FC_2: Self = _

source

pub const FC_2_WITH_FRAME_DELIMS: Self = _

source

pub const IPNET: Self = _

source

pub const CAN_SOCKETCAN: Self = _

source

pub const IPV4: Self = _

source

pub const IPV6: Self = _

source

pub const IEEE802_15_4_NOFCS: Self = _

source

pub const DBUS: Self = _

source

pub const DVB_CI: Self = _

source

pub const MUX27010: Self = _

source

pub const STANAG_5066_D_PDU: Self = _

source

pub const NFLOG: Self = _

source

pub const NETANALYZER: Self = _

source

pub const NETANALYZER_TRANSPARENT: Self = _

source

pub const IPOIB: Self = _

source

pub const MPEG_2_TS: Self = _

source

pub const NG40: Self = _

source

pub const NFC_LLCP: Self = _

source

pub const INFINIBAND: Self = _

source

pub const SCTP: Self = _

source

pub const USBPCAP: Self = _

source

pub const RTAC_SERIAL: Self = _

source

pub const BLUETOOTH_LE_LL: Self = _

source

pub const BLUETOOTH_LINUX_MONITOR: Self = _

source

pub const BLUETOOTH_BREDR_BB: Self = _

source

pub const BLUETOOTH_LE_LL_WITH_PHDR: Self = _

source

pub const PROFIBUS_DL: Self = _

source

pub const PKTAP: Self = _

source

pub const EPON: Self = _

source

pub const IPMI_HPM_2: Self = _

source

pub const ZWAVE_R1_R2: Self = _

source

pub const ZWAVE_R3: Self = _

source

pub const WATTSTOPPER_DLM: Self = _

source

pub const ISO_14443: Self = _

source

pub const RDS: Self = _

source

pub const USB_DARWIN: Self = _

source

pub const SDLC: Self = _

source

pub const LORATAP: Self = _

source

pub const VSOCK: Self = _

source

pub const NORDIC_BLE: Self = _

source

pub const DOCSIS31_XRA31: Self = _

source

pub const ETHERNET_MPACKET: Self = _

source

pub const DISPLAYPORT_AUX: Self = _

source

pub const LINUX_SLL2: Self = _

source

pub const OPENVIZSLA: Self = _

source

pub const EBHSCR: Self = _

source

pub const VPP_DISPATCH: Self = _

source

pub const DSA_TAG_BRCM: Self = _

source

pub const DSA_TAG_BRCM_PREPEND: Self = _

source

pub const IEEE802_15_4_TAP: Self = _

source

pub const DSA_TAG_DSA: Self = _

source

pub const DSA_TAG_EDSA: Self = _

source

pub const ELEE: Self = _

source

pub const Z_WAVE_SERIAL: Self = _

source

pub const USB_2_0: Self = _

source

pub const ATSC_ALP: Self = _

Trait Implementations§

source§

impl Clone for Linktype

source§

fn clone(&self) -> Linktype

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 Linktype

source§

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

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

impl PartialEq for Linktype

source§

fn eq(&self, other: &Linktype) -> 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 Linktype

source§

impl Eq for Linktype

source§

impl StructuralEq for Linktype

source§

impl StructuralPartialEq for Linktype

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.