NAME

  tst_hop_by_hop_setopt_tcp - Set the Hop-by-Hop Options using setsockopt()


PURPOSE

  To check that set Hop-by-Hop options using setsockopt().


SYNOPSIS

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


TEST PROCEDURE

  1. Create an IPv6 socket
  2. Set Hop-by-Hop options header with NULL data pointer
  3. Check A: Fail to set and return error EINVAL or EFAULT
  4. Set Hop-by-Hop options header with larger length
  5. Check B: Fail to set and return error EINVAL
  6. Set Hop-by-Hop options header with bad option
  7. Check C: Fail to set and return error EINVAL
  8. Set Hop-by-Hop options header with valid option
  9. Check D: Set Hop-by-Hop options header success


NOTE

  None


REFERENCE

  RFC 3542
  8.2.  Sending Hop-by-Hop Options
    To send a Hop-by-Hop options header, the application specifies the
    header either as ancillary data in a call to sendmsg() or using
    setsockopt().
    The application can remove any sticky Hop-by-Hop options header by
    calling setsockopt() for IPV6_HOPOPTS with a zero option length.
    All the Hop-by-Hop options must be specified by a single ancillary
    data object.  The cmsg_level member is set to IPPROTO_IPV6 and the
    cmsg_type member is set to IPV6_HOPOPTS.  The option is normally
    constructed using the inet6_opt_init(), inet6_opt_append(),
    inet6_opt_finish(), and inet6_opt_set_val() functions, described in
    Section 10.
    Additional errors may be possible from sendmsg() and setsockopt() if
    the specified option is in error.