Extracts data items of various sizes in the data portion of the option.
The inet6_opt_get_val subroutine extracts data items of various sizes in the data portion of the option. It is expected that each field is aligned on its natural boundaries, but the subroutine will not rely on the alignment.
Item | Description |
---|---|
databuf | Pointer to the data content returned by inet6_opt_next() or inet6_opt_find(). |
offset | Specifies where in the data portion of the option the value should be extracted. The first byte after the option type and length is accessed by specifying an offset of 0. |
val | Pointer to the destination for the extracted data. |
vallen | Specifies the size of the data content to be extracted. |
The inet6_opt_get_val subroutine returns the offset for the next field (that is, offset + vallen), which can be used when extracting option content with multiple fields.