inet6_option_append()

Append an IPv6 hop-by-hop or destination option to an ancillary data object

Synopsis:

#include <netinet/in.h>

int inet6_option_append(struct cmsghdr *cmsg, 
                        const u_int8_t *typep, 
                        int multx, 
                        int plusy);

Arguments:

cmsg
A pointer to the cmsghdr structure that must have been initialized by inet6_option_init().
typep
A pointer to the 8-bit option type. It's assumed that this field is immediately followed by the 8-bit option data length field, which is then followed by the option data. You must initialize these three fields (the type-length-value, or TLV) before calling this function.

The option type must have a value from 2 to 255, inclusive. (0 and 1 are reserved for the Pad1 and PadN options, respectively.)

The option data length must be between 0 and 255, inclusive, and is the length of the option data that follows.

multx
The value x in the alignment term xn + y. It must have a value of 1, 2, 4, or 8.
plusy
The value y in the alignment term xn + y. It must have a value between 0 and 7, inclusive.

Library:

libsocket

Use the -l socket option to qcc to link against this library.

Description:

This inet6_option_append() function appends a hop-by-hop option or a destination option to an ancillary data object that has been initialized by inet6_option_init().

Returns:

0
Success.
-1
An error has occurred.

Classification:

RFC 2292

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

inet6_option_alloc(), inet6_option_find(), inet6_option_init(), inet6_option_next(), inet6_option_space()

W. Stevens and M. Thomas, Advanced Sockets API for IPv6, RFC 2292, February 1998. Contains examples.

S. Deering and R. Hinden, Internet Protocol, Version 6 (IPv6) Specification, RFC 2460, December 1998.