#include "lwip/opt.h"
#include "lwip/err.h"
#include "lwip/ip_addr.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
Go to the source code of this file.
|
void | netif_init (void) |
|
struct netif * | netif_add (struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input) |
|
void | netif_set_addr (struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw) |
|
void | netif_remove (struct netif *netif) |
|
struct netif * | netif_find (char *name) |
|
void | netif_set_default (struct netif *netif) |
|
void | netif_set_ipaddr (struct netif *netif, ip_addr_t *ipaddr) |
|
void | netif_set_netmask (struct netif *netif, ip_addr_t *netmask) |
|
void | netif_set_gw (struct netif *netif, ip_addr_t *gw) |
|
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_FLAG_BROADCAST 0x02U |
If set, the netif has broadcast capability. Set by the netif driver in its init function.
Definition at line 72 of file netif.h.
#define NETIF_FLAG_DHCP 0x08U |
If set, the interface is configured using DHCP. Set by the DHCP code when starting or stopping DHCP.
Definition at line 78 of file netif.h.
#define NETIF_FLAG_ETHARP 0x20U |
If set, the netif is an ethernet device using ARP. Set by the netif driver in its init function. Used to check input packet types and use of DHCP.
Definition at line 88 of file netif.h.
#define NETIF_FLAG_ETHERNET 0x40U |
If set, the netif is an ethernet device. It might not use ARP or TCP/IP if it is used for PPPoE only.
Definition at line 92 of file netif.h.
#define NETIF_FLAG_IGMP 0x80U |
If set, the netif has IGMP capability. Set by the netif driver in its init function.
Definition at line 95 of file netif.h.
#define NETIF_FLAG_LINK_UP 0x10U |
If set, the interface has an active link (set by the network interface driver). Either set by the netif driver in its init function (if the link is up at that time) or at a later point once the link comes up (if link detection is supported by the hardware).
Definition at line 84 of file netif.h.
#define NETIF_FLAG_POINTTOPOINT 0x04U |
If set, the netif is one end of a point-to-point connection. Set by the netif driver in its init function.
Definition at line 75 of file netif.h.
#define NETIF_FLAG_UP 0x01U |
Whether the network interface is 'up'. This is a software flag used to control whether this network interface is enabled and processes traffic. It is set by the startup code (for static IP configuration) or by dhcp/autoip when an address has been assigned.
Definition at line 69 of file netif.h.
#define NETIF_INIT_SNMP |
( |
|
netif, |
|
|
|
type, |
|
|
|
speed |
|
) |
| |
Ask if a link is up
Definition at line 287 of file netif.h.
Ask if an interface is up
Definition at line 278 of file netif.h.
#define NETIF_MAX_HWADDR_LEN 6U |
must be the maximum of all used hardware address lengths across all types of interfaces in use
Definition at line 61 of file netif.h.
Function prototype for netif igmp_mac_filter functions
Definition at line 130 of file netif.h.
Function prototype for netif init functions. Set up flags and output/linkoutput callback functions in this function.
- Parameters
-
netif | The netif to initialize |
Definition at line 102 of file netif.h.
Function prototype for netif->input functions. This function is saved as 'input' callback function in the netif struct. Call it when a packet has been received.
- Parameters
-
p | The received packet, copied into a pbuf |
inp | The netif which received the packet |
Definition at line 109 of file netif.h.
Function prototype for netif->linkoutput functions. Only used for ethernet netifs. This function is called by ARP when a packet shall be sent.
- Parameters
-
netif | The netif which shall send a packet |
p | The packet to send (raw ethernet packet) |
Definition at line 126 of file netif.h.
Function prototype for netif->output functions. Called by lwIP when a packet shall be sent. For ethernet netif, set this to 'etharp_output' and set 'linkoutput'.
- Parameters
-
netif | The netif which shall send a packet |
p | The packet to send (p->payload points to IP header) |
ipaddr | The IP address to which the packet shall be sent |
Definition at line 118 of file netif.h.
typedef void(* netif_status_callback_fn)(struct netif *netif) |
Function prototype for netif status- or link-callback functions.
Definition at line 128 of file netif.h.
Add a network interface to the list of lwIP netifs.
- Parameters
-
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. |
- Returns
- netif, or NULL if failed.
Definition at line 137 of file netif.c.
struct netif* netif_find |
( |
char * |
name) | |
|
Find a network interface by searching for its name
- Parameters
-
name | the name of the netif (like netif->name) plus concatenated number in ascii representation (e.g. 'en0') |
Definition at line 286 of file netif.c.
void netif_remove |
( |
struct netif * |
netif) | |
|
Remove a network interface from the list of lwIP netifs.
- Parameters
-
netif | the network interface to remove |
Definition at line 236 of file netif.c.
Change IP address configuration for a network interface (including netmask and default gateway).
- Parameters
-
netif | the network interface to change |
ipaddr | the new IP address |
netmask | the new netmask |
gw | the new default gateway |
Definition at line 222 of file netif.c.
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)
- Parameters
-
netif | the default network interface |
Definition at line 426 of file netif.c.
void netif_set_down |
( |
struct netif * |
netif) | |
|
Bring an interface down, disabling any traffic processing.
- Note
- : Enabling DHCP on a down interface will make it come up once configured.
- See Also
- dhcp_start()
Definition at line 486 of file netif.c.
Change the default gateway for a network interface
- Parameters
-
netif | the network interface to change |
gw | the new default gateway |
- Note
- call netif_set_addr() if you also want to change ip address and netmask
Definition at line 384 of file netif.c.
Change the IP address of a network interface
- Parameters
-
netif | the network interface to change |
ipaddr | the new IP address |
- Note
- call netif_set_addr() if you also want to change netmask and default gateway
Definition at line 319 of file netif.c.
void netif_set_link_down |
( |
struct netif * |
netif) | |
|
Called by a driver when its link goes down
Definition at line 552 of file netif.c.
void netif_set_link_up |
( |
struct netif * |
netif) | |
|
Called by a driver when its link goes up
Definition at line 513 of file netif.c.
Change the netmask of a network interface
- Parameters
-
netif | the network interface to change |
netmask | the new netmask |
- Note
- call netif_set_addr() if you also want to change ip address and default gateway
Definition at line 405 of file netif.c.
void netif_set_up |
( |
struct netif * |
netif) | |
|
Bring an interface up, available for processing traffic.
- Note
- : Enabling DHCP on a down interface will make it come up once configured.
- See Also
- dhcp_start()
Definition at line 449 of file netif.c.
struct netif* netif_default |
The default network interface.
Definition at line 76 of file netif.c.
The list of network interfaces.
Definition at line 75 of file netif.c.