inet6_opt_set_val()--Insert Data Items into IPv6 Option


  Syntax
  #include <netinet/ip6.h>

  int inet6_opt_set_val(void *data_buffer,
                        socklen_t offset,
                        void *value_buffer,
                        int value_buffer_length)

  Service Program Name: QSOSRV1IP6

  Default Public Authority: *USE

  Threadsafe: Yes

The inet6_opt_set_val() function inserts data items of various sizes into the data portion of the IPv6 option.


Parameters

data_buffer
(Input) Pointer to a buffer where the data portion of the option is to be placed.
The value returned in data_bufferp from inet6_opt_append() can be used here.
offset
(Input) Offset in the data portion of the option to insert the data value.
The first byte after the option type and length is accessed by specifying an offset of zero.
value_buffer
(Input) Pointer to a buffer that contains the data to be inserted.
value_buffer_length
(Input) Length of data to be inserted.

Authorities

No authorization is required.


Return Value

inet6_opt_set_val() returns an integer. Possible values are:


Error Conditions

When inet6_opt_set_val() fails, errno can be set to one of the following:

[EFAULT] Bad address.

The system detected an address that was not valid while attempting to access the buffer pointed to by the data_buffer or value_buffer parameter.

[EINVAL] Parameter not valid.

This error code indicates the following:

  • The offset field contains a value that is not positive.
  • The value_buffer_length field contains a value that is not positive.


Usage Notes

  1. The return value can be used as the offset value in subsequent calls to set information for an option with multiple fields.
  2. The caller must ensure that each field is aligned on its natural boundaries as described in Appendix B of [RFC-2460].

Related Information




API introduced: V6R1

[ Back to top | UNIX-Type APIs | APIs by category ]