nn_cmsg(3compat)
| NN_CMSG(3compat) | NNG Reference Manual | NN_CMSG(3compat) |
NAME
nn_cmsg - message control data (compatible API)
SYNOPSIS
#include <nanomsg/nn.h>
struct nn_cmsghdr {
size_t cmsg_len;
int cmsg_level;
int cmsg_type;
};
DESCRIPTION
The nn_cmsghdr structure describes a block of control data that is associated with a message either sent by nn_sendmsg() or received by nn_recvmsg().
Note
This structure and supporting macros are provided for API
compatibility with legacy libnanomsg. Consider using the relevant
modern API instead.
Each header is followed by cmsg_len bytes of data, plus any padding required to align the structure.
The only defined ancillary data at this time is the protocol headers used by the protocols. This uses cmsg_level set to PROTO_SP and the cmsg_type set to SP_HDR. The actual data for this will vary from depending on the protocol used.
Convenience macros are provided to make working with these fields easier.
struct nn_cmsghdr *NN_CMSG_FIRSTHDR(struct nn_msghdr *hdr)
struct nn_cmsghdr *NN_CMSG_NXTHDR(struct nn_msghdr *hdr, struct nn_cmsghdr *ch)
void *NN_CMSG_DATA(struct nn_cmsghdr *ch)
size_t NN_CMSG_ALIGN(size_t len)
size_t NN_CMSG_SPACE(size_t len)
size_t NN_CMSG_LEN(size_t len)
SEE ALSO
nn_recvmsg(3compat), nn_sendmsg(3compat), nng_compat(3compat), nng(7)
| 2026-05-29 |
