NAME

  tst_getprotobyname - Get the new IPv6 protocols as a protoent structure from the protocol name


PURPOSE

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


SYNOPSIS

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


TEST PROCEDURE

  1. Check the define of hop-by-hop options for ipv6, should return
     protocol number as 0
  2. Check the define of ipv6 protocol, should return protocol number
     as 41
  3. Check the define of routing header for ipv6, should return
     protocol number as 43
  4. Check the define of fragment header for ipv6, should return 
     protocol number as 44
  5. Check the define of encapsulating security payload for ipv6, should
     return protocol number as 50
  6. Check the define of authentication header for ipv6, should return
     protocol number as 51
  7. Check the define of icmp for ipv6, should return protocol number
     as 58
  8. Check the define of no next header for ipv6, should return protocol
     number as 59
  9. Check the define of destination options for ipv6, should return 
     protocol number as 60


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