UbixOS  2.0
netif.c File Reference
#include "net/opt.h"
#include <string.h>
#include "net/def.h"
#include "net/ip_addr.h"
#include "net/ip6_addr.h"
#include "net/netif.h"
#include "net/priv/tcp_priv.h"
#include "net/udp.h"
#include "net/raw.h"
#include "net/snmp.h"
#include "net/igmp.h"
#include "net/etharp.h"
#include "net/stats.h"
#include "net/sys.h"
#include "net/ip.h"
#include "netif/ethernet.h"
Include dependency graph for netif.c:

Go to the source code of this file.

Macros

#define NETIF_LINK_CALLBACK(n)
 
#define NETIF_REPORT_TYPE_IPV4   0x01
 
#define NETIF_REPORT_TYPE_IPV6   0x02
 
#define NETIF_STATUS_CALLBACK(n)
 

Functions

struct netifnetif_add (struct netif *netif, void *state, netif_init_fn init, netif_input_fn input)
 
struct netifnetif_find (const char *name)
 
void netif_init (void)
 
err_t netif_input (struct pbuf *p, struct netif *inp)
 
void netif_remove (struct netif *netif)
 
void netif_set_default (struct netif *netif)
 
void netif_set_down (struct netif *netif)
 
void netif_set_link_down (struct netif *netif)
 
void netif_set_link_up (struct netif *netif)
 
void netif_set_up (struct netif *netif)
 

Variables

struct netifnetif_default
 
struct netifnetif_list
 

Detailed Description

lwIP network interface abstraction

Definition in file netif.c.

Macro Definition Documentation

◆ NETIF_LINK_CALLBACK

#define NETIF_LINK_CALLBACK (   n)

Definition at line 101 of file netif.c.

◆ NETIF_REPORT_TYPE_IPV4

#define NETIF_REPORT_TYPE_IPV4   0x01

Definition at line 113 of file netif.c.

◆ NETIF_REPORT_TYPE_IPV6

#define NETIF_REPORT_TYPE_IPV6   0x02

Definition at line 114 of file netif.c.

◆ NETIF_STATUS_CALLBACK

#define NETIF_STATUS_CALLBACK (   n)

Definition at line 95 of file netif.c.

Function Documentation

◆ netif_init()

void netif_init ( void  )

Definition at line 163 of file netif.c.

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:

◆ 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!

Definition at line 203 of file netif.c.

References netif::flags, NETIF_FLAG_ETHARP, and NETIF_FLAG_ETHERNET.

Variable Documentation

◆ netif_default

struct netif* netif_default

The default network interface.

Definition at line 105 of file netif.c.

Referenced by netif_remove(), and netif_set_default().

◆ netif_list

struct netif* netif_list

The list of network interfaces.

Definition at line 104 of file netif.c.

Referenced by netif_find(), and netif_remove().