Main index | Section 3 | Options |
#include <netinet/in.h>
The type argument is the 8-bit option type.
After inet6_opt_append() has been called, the application can use the buffer pointed to by databufp directly, or use inet6_opt_set_val() to specify the data to be contained in the option.
Option types of 0 and 1 are reserved for the Pad1 and PadN options. All other values from 2 through 255 may be used by applications.
The length of the option data is contained in an 8-bit value and so may contain any value from 0 through 255.
The align parameter must have a value of 1, 2, 4, or 8 and cannot exceed the value of len. The alignment values represent no alignment, 16 bit, 32 bit and 64 bit alignments, respectively.
If the extension header is too small to contain the proper padding then an error of -1 is returned to the caller.
The caller should ensure that each field is aligned on its natural boundaries as described in Appendix B of RFC2460.
The function returns the offset for the next field which is calculated as offset + vallen and is used when composing options with multiple fields.
It is expected that each field is aligned on its natural boundaries as described in Appendix B of RFC2460.
The function returns the offset for the next field by calculating offset + vallen which can be used when extracting option content with multiple fields. Robust receivers must verify alignment before calling this function.
KAME also provides examples in the advapitest directory of its kit.
RFC3542, Advanced Sockets API for IPv6, October 2002.
, , , ,RFC2460, Internet Protocol, Version 6 (IPv6) Specification, December 1998.
, ,INET6_OPT_INIT (3) | August 1, 2021 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology. | ” |
— The Unix Haters' handbook |