Struct esp_idf_svc::sys::netif

source ·
#[repr(C)]
pub struct netif {
Show 30 fields pub next: *mut netif, pub ip_addr: ip_addr, pub netmask: ip_addr, pub gw: ip_addr, pub ip6_addr: [ip_addr; 3], pub ip6_addr_state: [u8; 3], pub ip6_addr_valid_life: [u32; 3], pub ip6_addr_pref_life: [u32; 3], pub input: Option<unsafe extern "C" fn(_: *mut pbuf, _: *mut netif) -> i8>, pub output: Option<unsafe extern "C" fn(_: *mut netif, _: *mut pbuf, _: *const ip4_addr) -> i8>, pub linkoutput: Option<unsafe extern "C" fn(_: *mut netif, _: *mut pbuf) -> i8>, pub output_ip6: Option<unsafe extern "C" fn(_: *mut netif, _: *mut pbuf, _: *const ip6_addr) -> i8>, pub state: *mut c_void, pub client_data: [*mut c_void; 3], pub hostname: *const i8, pub mtu: u16, pub mtu6: u16, pub hwaddr: [u8; 6], pub hwaddr_len: u8, pub flags: u8, pub name: [i8; 2], pub num: u8, pub ip6_autoconfig_enabled: u8, pub rs_count: u8, pub igmp_mac_filter: Option<unsafe extern "C" fn(_: *mut netif, _: *const ip4_addr, _: u32) -> i8>, pub mld_mac_filter: Option<unsafe extern "C" fn(_: *mut netif, _: *const ip6_addr, _: u32) -> i8>, pub loop_first: *mut pbuf, pub loop_last: *mut pbuf, pub loop_cnt_current: u16, pub reschedule_poll: u8,
}
Expand description

Generic data structure used for all lwIP network interfaces. The following fields should be filled in by the initialization function for the device driver: hwaddr_len, hwaddr[], mtu, flags

Fields§

§next: *mut netif

pointer to next in linked list

§ip_addr: ip_addr

IP address configuration in network byte order

§netmask: ip_addr§gw: ip_addr§ip6_addr: [ip_addr; 3]

Array of IPv6 addresses for this netif.

§ip6_addr_state: [u8; 3]

The state of each IPv6 address (Tentative, Preferred, etc). @see ip6_addr.h

§ip6_addr_valid_life: [u32; 3]

Remaining valid and preferred lifetime of each IPv6 address, in seconds. For valid lifetimes, the special value of IP6_ADDR_LIFE_STATIC (0) indicates the address is static and has no lifetimes.

§ip6_addr_pref_life: [u32; 3]§input: Option<unsafe extern "C" fn(_: *mut pbuf, _: *mut netif) -> i8>

This function is called by the network device driver to pass a packet up the TCP/IP stack.

§output: Option<unsafe extern "C" fn(_: *mut netif, _: *mut pbuf, _: *const ip4_addr) -> i8>

This function is called by the IP module when it wants to send a packet on the interface. This function typically first resolves the hardware address, then sends the packet. For ethernet physical layer, this is usually etharp_output()

§linkoutput: Option<unsafe extern "C" fn(_: *mut netif, _: *mut pbuf) -> i8>

This function is called by ethernet_output() when it wants to send a packet on the interface. This function outputs the pbuf as-is on the link medium.

§output_ip6: Option<unsafe extern "C" fn(_: *mut netif, _: *mut pbuf, _: *const ip6_addr) -> i8>

This function is called by the IPv6 module when it wants to send a packet on the interface. This function typically first resolves the hardware address, then sends the packet. For ethernet physical layer, this is usually ethip6_output()

§state: *mut c_void

This field can be set by the device driver and could point to state information for the device.

§client_data: [*mut c_void; 3]§hostname: *const i8§mtu: u16

maximum transfer unit (in bytes)

§mtu6: u16

maximum transfer unit (in bytes), updated by RA

§hwaddr: [u8; 6]

link level hardware address of this interface

§hwaddr_len: u8

number of bytes used in hwaddr

§flags: u8

flags (@see @ref netif_flags)

§name: [i8; 2]

descriptive abbreviation

§num: u8

number of this interface. Used for @ref if_api and @ref netifapi_netif, as well as for IPv6 zones

§ip6_autoconfig_enabled: u8

is this netif enabled for IPv6 autoconfiguration

§rs_count: u8

Number of Router Solicitation messages that remain to be sent.

§igmp_mac_filter: Option<unsafe extern "C" fn(_: *mut netif, _: *const ip4_addr, _: u32) -> i8>

This function could be called to add or delete an entry in the multicast filter table of the ethernet MAC.

§mld_mac_filter: Option<unsafe extern "C" fn(_: *mut netif, _: *const ip6_addr, _: u32) -> i8>

This function could be called to add or delete an entry in the IPv6 multicast filter table of the ethernet MAC.

§loop_first: *mut pbuf§loop_last: *mut pbuf§loop_cnt_current: u16§reschedule_poll: u8

Trait Implementations§

source§

impl Clone for netif

source§

fn clone(&self) -> netif

Returns a copy of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
source§

impl Default for netif

source§

fn default() -> netif

Returns the “default value” for a type. Read more
source§

impl Copy for netif

Auto Trait Implementations§

§

impl Freeze for netif

§

impl RefUnwindSafe for netif

§

impl !Send for netif

§

impl !Sync for netif

§

impl Unpin for netif

§

impl UnwindSafe for netif

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

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

Performs the conversion.