sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
Network interface (NETIF)

Topics

 Flags
 MIB2 statistics
 IPv4 address handling
 IPv6 address handling
 Client data handling

Classes

union  netif_ext_callback_args_t

Macros

#define netif_is_up(netif)
#define netif_is_up(netif)

Typedefs

typedef u16_t netif_nsc_reason_t
typedef void(*) netif_ext_callback_fn(struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args)

Functions

struct netif * netif_add_noaddr (struct netif *netif, void *state, netif_init_fn init, netif_input_fn input)
struct netif * netif_add (struct netif *netif, void *state, netif_init_fn init, netif_input_fn input)
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 netif * netif_get_by_index (u8_t idx)
struct netif * netif_find (const char *name)

Detailed Description

Macro Definition Documentation

◆ netif_is_up [1/2]

#define netif_is_up ( netif)
Value:
(((netif)->flags & NETIF_FLAG_UP) ? (u8)1 : (u8)0)
#define NETIF_FLAG_UP
Definition tcpip.h:1124

Ask if an interface is up

Definition at line 1423 of file tcpip.h.

◆ netif_is_up [2/2]

#define netif_is_up ( netif)
Value:
(((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0)

Ask if an interface is up

Definition at line 479 of file netif.h.

Typedef Documentation

◆ netif_ext_callback_fn

typedef void(*) netif_ext_callback_fn(struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args)

Function used for extended netif status callbacks Note: When parsing reason argument, keep in mind that more reasons may be added in the future!

Parameters
netifnetif that is affected by change
reasonchange reason
argsdepends on reason, see reason description

Definition at line 668 of file netif.h.

◆ netif_nsc_reason_t

typedef u16_t netif_nsc_reason_t

Extended netif status callback (NSC) reasons flags. May be extended in the future!

Definition at line 586 of file netif.h.

Function Documentation

◆ netif_add()

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.

Parameters
netifa pre-allocated netif structure
ipaddrIP address for the new netif
netmasknetwork mask for the new netif
gwdefault gateway IP address for the new netif
stateopaque data passed to the new netif
initcallback function that initializes the interface
inputcallback 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).
Returns
netif, or NULL if failed.

Definition at line 287 of file netif.c.

◆ netif_add_noaddr()

struct netif * netif_add_noaddr ( struct netif * netif,
void * state,
netif_init_fn init,
netif_input_fn input )

Add a network interface to the list of lwIP netifs.

Same as netif_add but without IPv4 addresses

Definition at line 250 of file netif.c.

◆ netif_find()

struct netif * netif_find ( const char * name)

Find a network interface by searching for its name

Parameters
namethe name of the netif (like netif->name) plus concatenated number in ascii representation (e.g. 'en0')

Definition at line 1755 of file netif.c.

◆ netif_get_by_index()

struct netif * netif_get_by_index ( u8_t idx)

Return the interface for the netif index

Parameters
idxindex of netif to find

Definition at line 1730 of file netif.c.

◆ netif_index_to_name()

char * netif_index_to_name ( u8_t idx,
char * name )

Return the interface name for the netif matching index or NULL if not found/on error

Parameters
idxthe interface index of the netif
namechar buffer of at least NETIF_NAMESIZE bytes

Definition at line 1710 of file netif.c.

◆ netif_name_to_index()

u8_t netif_name_to_index ( const char * name)

Return the interface index for the netif with name or NETIF_NO_INDEX if not found/on error

Parameters
namethe name of the netif

Definition at line 1691 of file netif.c.

◆ netif_remove()

void netif_remove ( struct netif * netif)

Remove a network interface from the list of lwIP netifs.

Parameters
netifthe network interface to remove

Definition at line 764 of file netif.c.

◆ netif_set_default()

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
netifthe default network interface

Definition at line 849 of file netif.c.

◆ netif_set_down()

void netif_set_down ( struct netif * netif)

Bring an interface down, disabling any traffic processing.

Definition at line 949 of file netif.c.

◆ netif_set_link_down()

void netif_set_link_down ( struct netif * netif)

Called by a driver when its link goes down

Definition at line 1056 of file netif.c.

◆ netif_set_link_up()

void netif_set_link_up ( struct netif * netif)

Called by a driver when its link goes up

Definition at line 1018 of file netif.c.

◆ netif_set_up()

void netif_set_up ( struct netif * netif)

Bring an interface up, available for processing traffic.

Definition at line 871 of file netif.c.