It looks like FreeBSD is missing a manual page for macros defined in sys/sys/socket.h[1]. The man page is present for example in Linux as cmsg(3)[2] and in OpenBSD as CMSG_DATA[3]. [1]: https://github.com/freebsd/freebsd/blob/master/sys/sys/socket.h#L532 [2]: http://man7.org/linux/man-pages/man3/cmsg.3.html [3]: https://man.openbsd.org/CMSG_DATA.3
There's also a nice blog post[1] about FreeBSD SCTP ancillary data by Tsvetomir Dimitrov. [1]: http://petanode.com/blog/posts/sctp-freebsd-ancillary-data.html
Created attachment 192820 [details] Patch adding a CMSG_DATA.3 manual page Here's a manual page for CMSG_DATA based on an OpenBSD one. It looks like it does not need much tweaking as the presented information are true on FreeBSD as well. I've added cross references to related manpages and RFCs. I am not sure about the example though. It does not define all the required variables. I may try to make more descriptive and complete.
Created attachment 192846 [details] Patch adding a CMSG_DATA.3 manual page (revision: 1) Changes: - Add CMSG_DATA.3 to Makefile. - Update example: - Consolidate examples into one working, compile-and-run example. - Remove an unneeded iovec structure. Nothing is sent using msg_iov buffers so there's it's a good idea to remove them completely. It makes the example less confusing.
Code review: https://reviews.freebsd.org/D15215
A commit references this bug: Author: 0mp Date: Sun Aug 19 17:42:51 UTC 2018 New revision: 338060 URL: https://svnweb.freebsd.org/changeset/base/338060 Log: Document socket control message routines for ancillary data access (CMSG_DATA). PR: 227777 Reviewed by: bcr, eadler Approved by: mat (mentor), manpages (bcr) Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D15215 Changes: head/lib/libc/sys/recv.2 head/lib/libc/sys/send.2 head/lib/libc/sys/socket.2 head/share/man/man3/CMSG_DATA.3 head/share/man/man3/Makefile head/share/man/man4/ip.4 head/share/man/man4/ip6.4 head/share/man/man4/unix.4