The Pedigree Project
0.1
|
Modules | |
IPv4 address handling | |
IPv6 address handling | |
Client data handling | |
Flags | |
MIB2 statistics | |
Macros | |
#define | netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) |
Functions | |
struct netif * | netif_add (struct netif *netif, void *state, netif_init_fn init, netif_input_fn input) |
void | netif_remove (struct netif *netif) |
struct netif * | netif_find (const char *name) |
void | netif_set_default (struct netif *netif) |
void | netif_set_up (struct netif *netif) |
void | netif_set_down (struct netif *netif) |
void | netif_set_link_up (struct netif *netif) |
void | netif_set_link_down (struct netif *netif) |
#define netif_is_up | ( | netif | ) | (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) |
struct netif* netif_add | ( | struct netif * | netif, |
void * | state, | ||
netif_init_fn | init, | ||
netif_input_fn | input | ||
) |
Add a network interface to the list of lwIP netifs.
netif | a pre-allocated netif structure |
ipaddr | IP address for the new netif |
netmask | network mask for the new netif |
gw | default gateway IP address for the new netif |
state | opaque data passed to the new netif |
init | callback function that initializes the interface |
input | callback function that is called to pass ingress packets up in the protocol layer stack. It is recommended to use a function that passes the input directly to the stack (netif_input(), NO_SYS=1 mode) or via sending a message to TCPIP thread (tcpip_input(), NO_SYS=0 mode). These functions use netif flags NETIF_FLAG_ETHARP and NETIF_FLAG_ETHERNET to decide whether to forward to ethernet_input() or ip_input(). In other words, the functions only work when the netif driver is implemented correctly! Most members of struct netif should be be initialized by the netif init function = netif driver (init parameter of this function). IPv6: Don't forget to call netif_create_ip6_linklocal_address() after setting the MAC address in struct netif.hwaddr (IPv6 requires a link-local address). |
Definition at line 260 of file netif.c.
References ERR_OK, flags, input, LWIP_DEBUGF, LWIP_IPV6_NUM_ADDRESSES, LWIP_ND6_MAX_MULTICAST_SOLICIT, name, NETIF_DEBUG, NETIF_FLAG_IGMP, netif_list, next, num, and state.
Referenced by NetworkStack::registerDevice().
struct netif* netif_find | ( | const char * | name | ) |
Find a network interface by searching for its name
name | the name of the netif (like netif->name) plus concatenated number in ascii representation (e.g. 'en0') |
Definition at line 491 of file netif.c.
References IPADDR_TYPE_V4, LWIP_DBG_STATE, LWIP_DBG_TRACE, LWIP_DEBUGF, name, NETIF_DEBUG, next, and num.
void netif_remove | ( | struct netif * | netif | ) |
Remove a network interface from the list of lwIP netifs.
netif | the network interface to remove |
Definition at line 396 of file netif.c.
References flags, LWIP_DEBUGF, LWIP_IPV6_NUM_ADDRESSES, NETIF_DEBUG, NETIF_FLAG_IGMP, netif_is_up, netif_set_default(), netif_set_down(), and next.
Referenced by NetworkStack::deRegisterDevice().
void netif_set_default | ( | struct netif * | netif | ) |
Set a network interface as the default network interface (used to output all packets for which no specific route is found)
netif | the default network interface |
Definition at line 623 of file netif.c.
References LWIP_DEBUGF, name, and NETIF_DEBUG.
Referenced by netif_remove().
void netif_set_down | ( | struct netif * | netif | ) |
Bring an interface down, disabling any traffic processing.
Definition at line 701 of file netif.c.
References flags, NETIF_FLAG_ETHARP, and NETIF_FLAG_UP.
Referenced by netif_remove().
void netif_set_link_down | ( | struct netif * | netif | ) |
Called by a driver when its link goes down
Definition at line 779 of file netif.c.
References ERR_IF, ERR_MEM, ERR_OK, ERR_VAL, flags, hwaddr, hwaddr_len, IPADDR_TYPE_V6, pbuf::len, LWIP_DBG_STATE, LWIP_DBG_TRACE, LWIP_DEBUGF, LWIP_IPV6_NUM_ADDRESSES, LWIP_LOOPBACK_MAX_PBUFS, LWIP_NUM_NETIF_CLIENT_DATA, LWIP_UNUSED_ARG, name, NETIF_DEBUG, NETIF_FLAG_LINK_UP, NETIF_FLAG_MLD6, netif_list, pbuf::next, next, pbuf_alloc(), pbuf_clen(), pbuf_copy(), pbuf_free(), PBUF_LINK, PBUF_RAM, state, SYS_ARCH_DECL_PROTECT, tcpip_callback_with_block(), and pbuf::tot_len.
void netif_set_link_up | ( | struct netif * | netif | ) |
Called by a driver when its link goes up
Definition at line 754 of file netif.c.
References flags, NETIF_FLAG_LINK_UP, and NETIF_FLAG_UP.
void netif_set_up | ( | struct netif * | netif | ) |
Bring an interface up, available for processing traffic.
Definition at line 643 of file netif.c.
References flags, LWIP_ND6_MAX_MULTICAST_SOLICIT, NETIF_FLAG_ETHARP, NETIF_FLAG_IGMP, NETIF_FLAG_LINK_UP, and NETIF_FLAG_UP.