Adds one component of the option content to the options header.
Format
#include <in6.h>
int inet6_opt_set_val ( void *databuf, size_t offset, void
*val int vallen );
1 – Arguments
databuf
Points to a buffer that contains an extension header. This is a
pointer returned by a call to inet6_opt_append().
offset
Specifies the location in the data portion of the option into
which to insert the data. You can access the first byte after the
option type and length by specifying the offset of 0 (zero).
val
Points to the data to be inserted.
vallen
Specifies the length of the data, in bytes, to be inserted.
2 – Description
This function copies data items at the location val into a data
buffer databuf beginning at offset. In addition, it returns the
offset for the next data field to assist you in composing content
that has multiple fields.
Make sure that each field is aligned on its natural boundaries.
3 – Return Values
x Upon successful completion, the inet6_opt_set_
val() function returns the offset for the next
field in the data buffer.
-1 Failure