Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
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.
 
int net_send_data (struct net_pkt *pkt)
 Send data to network.
 

Detailed Description

Network core library .

Since
1.0
Version
1.0.0

Enumeration Type Documentation

◆ net_verdict

#include <zephyr/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 <zephyr/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 <zephyr/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.