NAME

  tst_hop_by_hop_get - Get Hop-by-Hop Options header which the application specifies


PURPOSE

  Check whether the Hop-by-Hop options header specified by application
  can be get correctly by getsockopt().


SYNOPSIS

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


TEST PROCEDURE

  1. Create an IPv6 socket
  2. Get Hop-by-Hop options header
  3. Check A: Hop-by-Hop options header has a length of zero
  4. Set Hop-by-Hop options header
  5. Get Hop-by-Hop options header
  6. Check B: Hop-by-Hop options header is the same as set
  7. Get Hop-by-Hop options header with NULL data pointer
  8. Check C: Fail to get Hop-by-Hop options header
  9. Get Hop-by-Hop options header with NULL length pointer
  10.Check D: Fail to get Hop-by-Hop options header
  11.Get Hop-by-Hop options header with short length
  12.Check E: Hop-by-Hop options header returned with short length


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.