Home Download Documentation Development Community Support
NOTE: This documentation is for version 0.1-alpha of nanomsg, but the latest released version is 1.1.5. Please see the documentation for 1.1.5 for the most up-to-date information.


#include <nanomsg/nn.h>

struct nn_cmsghdr *NN_CMSG_FIRSTHDR(struct nn_msghdr *hdr);

struct nn_cmsghdr *NN_CMSG_NXTHDR(struct nn_msghdr *hdr, struct nn_cmsghdr *cmsg);

unsigned char *NN_CMSG_DATA(struct nn_cmsghdr *cmsg);

size_t NN_CMSG_SPACE(size_t len);

size_t NN_CMSG_LEN(size_t len);


NN_CMSG_FIRSTHDR returns a pointer to the first nn_cmsghdr in the control buffer in the supplied nn_msghdr structure.

NN_CMSG_NXTHDR returns the next nn_cmsghdr after the supplied nn_cmsghdr. Returns NULL if there isn’t enough space in the buffer.

NN_CMSG_DATA returns a pointer to the data associated with supplied nn_cmsghdr.

NN_CMSG_SPACE returns the number of bytes occupied by nn_cmsghdr with payload of the specified length.

NN_CMSG_LEN returns the value to store in the cmsg_len member of the cmsghdr structure, taking into account any necessary alignment.



Martin Sustrik <>

"nanomsg" is a trademark of Garrett D'Amore.