NAME

  tst_getaddrinfo_2 - A non-zero value is returned upon error


PURPOSE

  To check that a non-zero value should be returned upon error.


SYNOPSIS

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


TEST PROCEDURE

  1. Both of the nodename and servname arguments are null pointer
  2. Check A: A non-zero value should be returned
  3. Both of the nodename and servname arguments are null-terminated strings
  4. Check B: A non-zero value should be returned
  5. The servname argument is not invalid
  6. Check C: A non-zero value should be returned


NOTE

  None


REFERENCE

  RFC 3493
  6.1 Protocol-Independent Nodename and Service Name Translation
    The getaddrinfo() function translates the name of a service location
    (for example, a host name) and/or a service name and returns a set of
    socket addresses and associated information to be used in creating a
    socket with which to address the specified service.
    The nodename and servname arguments are either null pointers or
    pointers to null-terminated strings.  One or both of these two
    arguments must be a non-null pointer.
    The format of a valid name depends on the address family or families.
    If a specific family is not given and the name could be interpreted
    as valid within multiple supported families, the implementation will
    attempt to resolve the name in all supported families and, in absence
    of errors, one or more results shall be returned.
    If the nodename argument is not null, it can be a descriptive name or
    can be an address string.  If the specified address family is
    AF_INET, AF_INET6, or AF_UNSPEC, valid descriptive names include host
    names. If the specified address family is AF_INET or AF_UNSPEC,
    address strings using Internet standard dot notation as specified in
    inet_addr() are valid.  If the specified address family is AF_INET6
    or AF_UNSPEC, standard IPv6 text forms described in inet_pton() are
    valid.
    If nodename is not null, the requested service location is named by
    nodename; otherwise, the requested service location is local to the
    caller.
    If servname is null, the call shall return network-level addresses
    for the specified nodename.  If servname is not null, it is a null-
    terminated character string identifying the requested service.  This
    can be either a descriptive name or a numeric representation suitable
    for use with the address family or families.  If the specified
    address family is AF_INET, AF_INET6 or AF_UNSPEC, the service can be
    specified as a string specifying a decimal port number.
    If the argument hints is not null, it refers to a structure
    containing input values that may direct the operation by providing
    options and by limiting the returned information to a specific socket
    type, address family and/or protocol.  In this hints structure every
    member other than ai_flags, ai_family, ai_socktype and ai_protocol
    shall be set to zero or a null pointer.  A value of AF_UNSPEC for
    ai_family means that the caller shall accept any address family.  A
    value of zero for ai_socktype means that the caller shall accept any
    socket type.  A value of zero for ai_protocol means that the caller
    shall accept any protocol.  If hints is a null pointer, the behavior
    shall be as if it referred to a structure containing the value zero
    for the ai_flags, ai_socktype and ai_protocol fields, and AF_UNSPEC
    for the ai_family field.
    Note:
    1. If the caller handles only TCP and not UDP, for example, then the
       ai_protocol member of the hints structure should be set to
       IPPROTO_TCP when getaddrinfo() is called.
    2. If the caller handles only IPv4 and not IPv6, then the ai_family
       member of the hints structure should be set to AF_INET when
       getaddrinfo() is called.