ConOpSys V2970  P004.07
ANVILEX control operating system
Macros | Functions | Variables
netif.c File Reference
#include "lwip/opt.h"
#include <string.h>
#include <stdlib.h>
#include "lwip/def.h"
#include "lwip/ip_addr.h"
#include "lwip/ip6_addr.h"
#include "lwip/netif.h"
#include "lwip/priv/tcp_priv.h"
#include "lwip/udp.h"
#include "lwip/priv/raw_priv.h"
#include "lwip/snmp.h"
#include "lwip/igmp.h"
#include "lwip/etharp.h"
#include "lwip/stats.h"
#include "lwip/sys.h"
#include "lwip/ip.h"
#include "netif/ethernet.h"
Include dependency graph for netif.c:

Macros

#define NETIF_STATUS_CALLBACK(n)
 
#define NETIF_LINK_CALLBACK(n)
 
#define netif_index_to_num(index)   ((index) - 1)
 
#define NETIF_REPORT_TYPE_IPV4   0x01
 
#define NETIF_REPORT_TYPE_IPV6   0x02
 

Functions

static void netif_issue_reports (struct netif *netif, u8_t report_type)
 
void netif_init (void)
 
err_t netif_input (struct pbuf *p, struct netif *inp)
 
struct netifnetif_add_noaddr (struct netif *netif, void *state, netif_init_fn init, netif_input_fn input)
 
struct netifnetif_add (struct netif *netif, void *state, netif_init_fn init, netif_input_fn input)
 
static void netif_do_ip_addr_changed (const ip_addr_t *old_addr, const ip_addr_t *new_addr)
 
void netif_remove (struct netif *netif)
 
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)
 
u8_t netif_name_to_index (const char *name)
 
char * netif_index_to_name (u8_t idx, char *name)
 
struct netifnetif_get_by_index (u8_t idx)
 
struct netifnetif_find (const char *name)
 

Variables

struct netifnetif_list
 
struct netifnetif_default
 
static u8_t netif_num
 

Detailed Description

lwIP network interface abstraction

Macro Definition Documentation

◆ netif_index_to_num

#define netif_index_to_num (   index)    ((index) - 1)

◆ NETIF_LINK_CALLBACK

#define NETIF_LINK_CALLBACK (   n)

◆ NETIF_REPORT_TYPE_IPV4

#define NETIF_REPORT_TYPE_IPV4   0x01

◆ NETIF_REPORT_TYPE_IPV6

#define NETIF_REPORT_TYPE_IPV6   0x02

◆ NETIF_STATUS_CALLBACK

#define NETIF_STATUS_CALLBACK (   n)

Function Documentation

◆ netif_do_ip_addr_changed()

static void netif_do_ip_addr_changed ( const ip_addr_t old_addr,
const ip_addr_t new_addr 
)
static

Referenced by netif_remove().

Here is the caller graph for this function:

◆ netif_init()

void netif_init ( void  )

References IP_ADDR6_HOST, netif_add(), netif_set_link_up(), netif_set_up(), NULL, and tcpip_input().

Referenced by lwip_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ netif_input()

err_t netif_input ( struct pbuf p,
struct netif inp 
)

Forwards a received packet for input processing with ethernet_input() or ip_input() depending on netif flags. Don't call directly, pass to netif_add() and call netif->input(). Only works if the netif driver correctly sets NETIF_FLAG_ETHARP and/or NETIF_FLAG_ETHERNET flag!

References netif::flags, LWIP_ASSERT, LWIP_ASSERT_CORE_LOCKED, NETIF_FLAG_ETHARP, NETIF_FLAG_ETHERNET, and NULL.

◆ netif_issue_reports()

static void netif_issue_reports ( struct netif netif,
u8_t  report_type 
)
static

Send ARP/IGMP/MLD/RS events, e.g. on link-up/netif-up or addr-change

References netif::flags, LWIP_ASSERT, NETIF_FLAG_ETHARP, NETIF_FLAG_IGMP, NETIF_FLAG_LINK_UP, NETIF_FLAG_UP, NETIF_REPORT_TYPE_IPV4, NETIF_REPORT_TYPE_IPV6, and NULL.

Referenced by netif_set_link_up(), and netif_set_up().

Here is the caller graph for this function:

Variable Documentation

◆ netif_default

struct netif* netif_default

The default network interface.

Referenced by netif_add(), netif_remove(), and netif_set_default().

◆ netif_list

struct netif* netif_list

The list of network interfaces.

Referenced by netif_add(), and netif_remove().

◆ netif_num

u8_t netif_num
static

Referenced by netif_add().