NAME

  tst_getprotobynumber - Get the new IPv6 protocols as a protoent structure from the protocol number


PURPOSE

  Check whether the common names which are required for the new
  IPv6 protocols is defined in file /etc/protocols.


SYNOPSIS

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


TEST PROCEDURE

  1. Check the define of ipv6 protocol, should return protocol number
     as "ipv6"
  2. Check the define of routing header for ipv6, should return
     protocol name as "ipv6-route"
  3. Check the define of fragment header for ipv6, should return 
     protocol name as "ipv6-frag"
  4. Check the define of encapsulating security payload for ipv6, should
     return protocol name as "esp"
  5. Check the define of authentication header for ipv6, should return
     protocol name as "ah"
  6. Check the define of icmp for ipv6, should return protocol name
     as "ipv6-icmp"
  7. Check the define of no next header for ipv6, should return protocol
     name as "ipv6-nonxt"
  8. Check the define of destination options for ipv6, should return 
     protocol name as "ipv6-opts"


NOTE

  None


REFERENCE

  RFC 3542
  2.4.  Protocols File
    Many hosts provide the file /etc/protocols that contains the names of
    the various IP protocols and their protocol number (e.g., the value
    of the protocol field in the IPv4 header for that protocol, such as 1
    for ICMP).  Some programs then call the function getprotobyname() to
    obtain the protocol value that is then specified as the third
    argument to the socket() function.  For example, the Ping program
    contains code of the form
      struct protoent  *proto;
      proto = getprotobyname("icmp");
      s = socket(AF_INET, SOCK_RAW, proto->p_proto);
    Common names are required for the new IPv6 protocols in this file, to
    provide portability of applications that call the getprotoXXX()
    functions.
    We define the following protocol names with the values shown.  These
    are taken under http://www.iana.org/numbers.html.
      hopopt           0    # hop-by-hop options for ipv6
      ipv6            41    # ipv6
      ipv6-route      43    # routing header for ipv6
      ipv6-frag       44    # fragment header for ipv6
      esp             50    # encapsulating security payload for ipv6
      ah              51    # authentication header for ipv6
      ipv6-icmp       58    # icmp for ipv6
      ipv6-nonxt      59    # no next header for ipv6
      ipv6-opts       60    # destination options for ipv6