Zephyr API 3.6.99
Loading...
Searching...
No Matches
sockaddr_nm Struct Reference

struct sockaddr_nm - The sockaddr structure for NET_MGMT sockets More...

#include <socket_net_mgmt.h>

Data Fields

sa_family_t nm_family
 AF_NET_MGMT address family.
 
int nm_ifindex
 Network interface related to this address.
 
uintptr_t nm_pid
 Thread id or similar that is used to separate the different sockets.
 
uint32_t nm_mask
 net_mgmt mask
 

Detailed Description

struct sockaddr_nm - The sockaddr structure for NET_MGMT sockets

Similar concepts are used as in Linux AF_NETLINK. The NETLINK name is not used in order to avoid confusion between Zephyr and Linux as the implementations are different.

The socket domain (address family) is AF_NET_MGMT, and the type of socket is either SOCK_RAW or SOCK_DGRAM, because this is a datagram-oriented service.

The protocol (protocol type) selects for which feature the socket is used.

When used with bind(), the nm_pid field of the sockaddr_nm can be filled with the calling thread' own id. The nm_pid serves here as the local address of this net_mgmt socket. The application is responsible for picking a unique integer value to fill in nm_pid.

Field Documentation

◆ nm_family

sa_family_t sockaddr_nm::nm_family

AF_NET_MGMT address family.

◆ nm_ifindex

int sockaddr_nm::nm_ifindex

Network interface related to this address.

◆ nm_mask

uint32_t sockaddr_nm::nm_mask

net_mgmt mask

◆ nm_pid

uintptr_t sockaddr_nm::nm_pid

Thread id or similar that is used to separate the different sockets.

Application can decide how the pid is constructed.


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