Detailed Description

See also
gnrc_netif_ops_t

Definition at line 194 of file netif.h.

#include <netif.h>

Data Fields

void(* init )(gnrc_netif_t *netif)
 Initializes network interface beyond the default settings. More...
 
int(* send )(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
 Send a packet over the network interface. More...
 
gnrc_pktsnip_t *(* recv )(gnrc_netif_t *netif)
 Receives a packet from the network interface. More...
 
int(* get )(gnrc_netif_t *netif, gnrc_netapi_opt_t *opt)
 Gets an option from the network interface. More...
 
int(* set )(gnrc_netif_t *netif, const gnrc_netapi_opt_t *opt)
 Sets an option from the network interface. More...
 
void(* msg_handler )(gnrc_netif_t *netif, msg_t *msg)
 Message handler for network interface. More...
 

Field Documentation

◆ get

int(* gnrc_netif_ops::get) (gnrc_netif_t *netif, gnrc_netapi_opt_t *opt)

Gets an option from the network interface.

Use gnrc_netif_get_from_netdev() to just get options from gnrc_netif_t::dev.

Parameters
[in]netifThe network interface.
[in]optThe option parameters.
Returns
Number of bytes in data.
-EOVERFLOW, if max_len is lesser than the required space.
-ENOTSUP, if opt is not supported to be set.
Any negative error code reported by gnrc_netif_t::dev.

Definition at line 266 of file netif.h.

◆ init

void(* gnrc_netif_ops::init) (gnrc_netif_t *netif)

Initializes network interface beyond the default settings.

Precondition
netif != NULL
Parameters
[in]netifThe network interface.

This is called after the network device's initial configuration, right before the interface's thread starts receiving messages. It is not necessary to lock the interface's mutex gnrc_netif_t::mutex, since it is already locked. Set to gnrc_netif_default_init() if you do not need any special initialization. If you do need special initialization, it is recommended to call gnrc_netif_default_init() at the start of the custom initialization function set here.

Definition at line 210 of file netif.h.

◆ msg_handler

void(* gnrc_netif_ops::msg_handler) (gnrc_netif_t *netif, msg_t *msg)

Message handler for network interface.

This message handler is used, when the network interface needs to handle message types beyond the ones defined in netapi. Leave NULL if this is not the case.

Parameters
[in]netifThe network interface.
[in]msgMessage to be handled.

Definition at line 295 of file netif.h.

◆ recv

gnrc_pktsnip_t*(* gnrc_netif_ops::recv) (gnrc_netif_t *netif)

Receives a packet from the network interface.

Precondition
netif != NULL
Note
The function takes the bytes received via netdev_driver_t::recv() from gnrc_netif_t::dev and re-formats it to a packet containing a Generic network interface header and a payload header in receive order.
Parameters
[in]netifThe network interface.
Returns
The packet received. Contains the payload (with the type marked accordingly) and a Generic network interface header in receive order.
NULL, if Packet buffer was full.

Definition at line 250 of file netif.h.

◆ send

int(* gnrc_netif_ops::send) (gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)

Send a packet over the network interface.

Precondition
netif != NULL && pkt != NULL
Note
The function re-formats the content of pkt to a format expected by the netdev_driver_t::send() method of gnrc_netif_t::dev and releases the packet before returning (so no additional release should be required after calling this method).
Parameters
[in]netifThe network interface.
[in]pktA packet to send.
Returns
The number of bytes actually sent on success
-EBADMSG, if the Generic network interface header in pkt is missing or is in an unexpected format.
-ENOTSUP, if sending pkt in the given format isn't supported (e.g. empty payload with Ethernet).
Any negative error code reported by gnrc_netif_t::dev.

Definition at line 232 of file netif.h.

◆ set

int(* gnrc_netif_ops::set) (gnrc_netif_t *netif, const gnrc_netapi_opt_t *opt)

Sets an option from the network interface.

Use gnrc_netif_set_from_netdev() to just set options from gnrc_netif_t::dev.

Parameters
[in]netifThe network interface.
[in]optThe option parameters.
Returns
Number of bytes written to gnrc_netif_t::dev.
-EOVERFLOW, if data_len is greater than the allotted space in gnrc_netif_t::dev or gnrc_netif_t.
-ENOTSUP, if opt is not supported to be set.
Any negative error code reported by gnrc_netif_t::dev.

Definition at line 283 of file netif.h.


The documentation for this struct was generated from the following file: