NAME

  tst_inet6_opt_get_val - Extracts data items of various sizes in the data portion of the option


PURPOSE

  To check that inet6_opt_get_val() can be used to extract data items
  of various sizes in the data portion of the option.


SYNOPSIS

  ./tst_inet6_opt_get_val [-tooloption ...]
    -tooloption : v6api tool option


TEST PROCEDURE

  1. Calculate the needed buffer size
  2. Check A: Function inet6_opt_init() return a valid buffer size
  3. Append option to extension header with valid parameters
  4. Check B: The value of option type, option length is correct
  5. Inserts data items of various sizes
  6. Check C: return length is correct and data set correctly
  7. Extracts data items of various sizes in the data portion of the option
  8. Check D: return length is correct and data get correctly


NOTE

  None


REFERENCE

  RFC 3493
  10.7.  inet6_opt_get_val
      int inet6_opt_get_val(void *databuf, int offset, void *val,
                            socklen_t vallen);
    Databuf should be a pointer returned by inet6_opt_next() or
    inet6_opt_find().  This function extracts data items of various sizes
    in the data portion of the option.  Val should point to the
    destination for the extracted data.  Offset specifies from 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 zero.
    It is expected that each field is aligned on its natural boundaries
    as described in Appendix B of [RFC-2460], but the function must not
    rely on the alignment.
    The function returns the offset for the next field (i.e., offset +
    vallen) which can be used when extracting option content with
    multiple fields.