NAME

  tst_send_dstopt_data - Send Destination options header by specifies it as ancillary data in a call to sendmsg()


PURPOSE

  To check that send a Destination options header, the application 
  can specifies the header as ancillary data in a call to sendmsg().


SYNOPSIS

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


TEST PROCEDURE

  1. Create an IPv6/UDP socket
  2. Enable socket to receive destination options
  3. Bind socket to address
  4. Send message with the destination option specifying as ancillary data
  5. Receive message on socket
  6. Check A: the destination option is received
  7. Check B: the length and value of destination option is correct


NOTE

  None


REFERENCE

  RFC 3542
  9.2.  Sending Destination Options
    To send a Destination options header, the application specifies it
    either as ancillary data in a call to sendmsg() or using
    setsockopt().
    The application can remove any sticky Destination options header by
    calling setsockopt() for IPV6_RTHDRDSTOPTS/IPV6_DSTOPTS with a zero
    option length.
    This API assumes the ordering about extension headers as described in
    [RFC-2460].  Thus, one set of Destination options can only appear
    before a Routing header, and one set can only appear after a Routing
    header (or in a packet with no Routing header).  Each set can consist
    of one or more options but each set is a single extension header.
    Today all destination options that an application may want to specify
    can be put after (or without) a Routing header.  Thus, applications
    should usually need IPV6_DSTOPTS only and should avoid using
    IPV6_RTHDRDSTOPTS whenever possible.
    When using ancillary data a Destination options header is passed
    between the application and the kernel as follows: The set preceding
    a Routing header are specified with the cmsg_level member set to
    IPPROTO_IPV6 and the cmsg_type member set to IPV6_RTHDRDSTOPTS.  Any
    setsockopt or ancillary data for IPV6_RTHDRDSTOPTS is silently
    ignored when sending packets unless a Routing header is also
    specified.  Note that the "Routing header" here means the one
    specified by this API.  Even when the kernel inserts a routing header
    in its internal routine (e.g., in a mobile IPv6 stack), the
    Destination options header specified by IPV6_RTHDRDSTOPTS will still
    be ignored unless the application explicitly specifies its own
    Routing header.
    The set of Destination options after a Routing header, which are also
    used when no Routing header is present, are specified with the
    cmsg_level member is set to IPPROTO_IPV6 and the cmsg_type member is
    set to IPV6_DSTOPTS.
    The Destination options are 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.