Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Network Core Library

Network core library. More...

Enumerations

enum  net_verdict { NET_OK , NET_CONTINUE , NET_DROP }
 Net Verdict. More...
 

Functions

int net_recv_data (struct net_if *iface, struct net_pkt *pkt)
 Called by lower network stack or network device driver when a network packet has been received. The function will push the packet up in the network stack for further processing. More...
 
int net_send_data (struct net_pkt *pkt)
 Send data to network. More...
 

Detailed Description

Network core library.

Enumeration Type Documentation

◆ net_verdict

#include <include/net/net_core.h>

Net Verdict.

Enumerator
NET_OK 

Packet has been taken care of.

NET_CONTINUE 

Packet has not been touched, other part should decide about its fate.

NET_DROP 

Packet must be dropped.

Function Documentation

◆ net_recv_data()

int net_recv_data ( struct net_if iface,
struct net_pkt pkt 
)

#include <include/net/net_core.h>

Called by lower network stack or network device driver when a network packet has been received. The function will push the packet up in the network stack for further processing.

Parameters
ifaceNetwork interface where the packet was received.
pktNetwork packet data.
Returns
0 if ok, <0 if error.

◆ net_send_data()

int net_send_data ( struct net_pkt pkt)

#include <include/net/net_core.h>

Send data to network.

Send data to network. This should not be used normally by applications as it requires that the network packet is properly constructed.

Parameters
pktNetwork packet.
Returns
0 if ok, <0 if error. If <0 is returned, then the caller needs to unref the pkt in order to avoid memory leak.