Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
#include <net_context.h>
Data Fields | |
void * | user_data |
atomic_t | refcount |
struct k_mutex | lock |
struct sockaddr_ptr | local |
struct sockaddr | remote |
struct net_conn_handle * | conn_handler |
net_context_recv_cb_t | recv_cb |
net_context_send_cb_t | send_cb |
net_context_connect_cb_t | connect_cb |
struct { | |
} | options |
uint16_t | proto |
uint16_t | flags |
int8_t | iface |
union { | |
uint8_t ipv6_hop_limit | |
uint8_t ipv4_ttl | |
}; | |
Note that we do not store the actual source IP address in the context because the address is already be set in the network interface struct. If there is no such source address there, the packet cannot be sent anyway. This saves 12 bytes / context in IPv6.
union { ... } net_context::@163 |
IPv6 hop limit or IPv4 ttl for packets sent via this context.
struct net_conn_handle* net_context::conn_handler |
Connection handle
net_context_connect_cb_t net_context::connect_cb |
Connect callback to be called when a connection has been established.
uint16_t net_context::flags |
Flags for the context
int8_t net_context::iface |
Network interface assigned to this context
uint8_t net_context::ipv4_ttl |
uint8_t net_context::ipv6_hop_limit |
struct sockaddr_ptr net_context::local |
Local endpoint address. Note that the values are in network byte order.
struct k_mutex net_context::lock |
Internal lock for protecting this context from multiple access.
struct { ... } net_context::options |
Option values
uint16_t net_context::proto |
Protocol (UDP, TCP or IEEE 802.3 protocol value)
net_context_recv_cb_t net_context::recv_cb |
Receive callback to be called when desired packet has been received.
atomic_t net_context::refcount |
Reference count
struct sockaddr net_context::remote |
Remote endpoint address. Note that the values are in network byte order.
net_context_send_cb_t net_context::send_cb |
Send callback to be called when the packet has been sent successfully.
void* net_context::user_data |
User data.
First member of the structure to let users either have user data associated with a context, or put contexts into a FIFO.