PageRenderTime 26ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/lb/system/posix/netinet/in.d

http://github.com/LaMaisonOrchard/lb
D | 189 lines | 5 code | 3 blank | 181 comment | 0 complexity | b1b3bf04a61e45dfbe47ce1974329bbc MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. /****************************************************************************
  2. Copyright (C) 2010 David W Orchard (david@errol.org.uk)
  3. This file is part of the [lb] librray set,
  4. [lb] is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Leser General Public License as published by
  6. the Free Software Foundation, either version 2 of the License, or
  7. (at your option) any later version.
  8. Foobar is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with Foobar. If not, see <http://www.gnu.org/licenses/>.
  14. *****************************************************************************/
  15. import std.stdio;
  16. unittest
  17. {
  18. writeln(__FILE__ ~ " - Not implemented");
  19. }
  20. /*
  21. The <netinet/in.h> header shall define the following types:
  22. in_port_t
  23. Equivalent to the type uint16_t as defined in <inttypes.h> .
  24. in_addr_t
  25. Equivalent to the type uint32_t as defined in <inttypes.h> .
  26. The sa_family_t type shall be defined as described in <sys/socket.h>.
  27. The uint8_t and uint32_t type shall be defined as described in <inttypes.h>. Inclusion of the <netinet/in.h> header may also make visible all symbols from <inttypes.h> and <sys/socket.h>.
  28. The <netinet/in.h> header shall define the in_addr structure that includes at least the following member:
  29. in_addr_t s_addr
  30. The <netinet/in.h> header shall define the sockaddr_in structure that includes at least the following members:
  31. sa_family_t sin_family AF_INET.
  32. in_port_t sin_port Port number.
  33. struct in_addr sin_addr IP address.
  34. The sin_port and sin_addr members shall be in network byte order.
  35. The sockaddr_in structure is used to store addresses for the Internet address family. Values of this type shall be cast by applications to struct sockaddr for use with socket functions.
  36. [IP6] [Option Start] The <netinet/in.h> header shall define the in6_addr structure that contains at least the following member:
  37. uint8_t s6_addr[16]
  38. This array is used to contain a 128-bit IPv6 address, stored in network byte order.
  39. The <netinet/in.h> header shall define the sockaddr_in6 structure that includes at least the following members:
  40. sa_family_t sin6_family AF_INET6.
  41. in_port_t sin6_port Port number.
  42. uint32_t sin6_flowinfo IPv6 traffic class and flow information.
  43. struct in6_addr sin6_addr IPv6 address.
  44. uint32_t sin6_scope_id Set of interfaces for a scope.
  45. The sin6_port and sin6_addr members shall be in network byte order.
  46. The sockaddr_in6 structure shall be set to zero by an application prior to using it, since implementations are free to have additional, implementation-defined fields in sockaddr_in6.
  47. The sin6_scope_id field is a 32-bit integer that identifies a set of interfaces as appropriate for the scope of the address carried in the sin6_addr field. For a link scope sin6_addr, the application shall ensure that sin6_scope_id is a link index. For a site scope sin6_addr, the application shall ensure that sin6_scope_id is a site index. The mapping of sin6_scope_id to an interface or set of interfaces is implementation-defined.
  48. The <netinet/in.h> header shall declare the following external variable:
  49. const struct in6_addr in6addr_any
  50. This variable is initialized by the system to contain the wildcard IPv6 address. The <netinet/in.h> header also defines the IN6ADDR_ANY_INIT macro. This macro must be constant at compile time and can be used to initialize a variable of type struct in6_addr to the IPv6 wildcard address.
  51. The <netinet/in.h> header shall declare the following external variable:
  52. const struct in6_addr in6addr_loopback
  53. This variable is initialized by the system to contain the loopback IPv6 address. The <netinet/in.h> header also defines the IN6ADDR_LOOPBACK_INIT macro. This macro must be constant at compile time and can be used to initialize a variable of type struct in6_addr to the IPv6 loopback address.
  54. The <netinet/in.h> header shall define the ipv6_mreq structure that includes at least the following members:
  55. struct in6_addr ipv6mr_multiaddr IPv6 multicast address.
  56. unsigned ipv6mr_interface Interface index.
  57. [Option End]
  58. The <netinet/in.h> header shall define the following macros for use as values of the level argument of getsockopt() and setsockopt():
  59. IPPROTO_IP
  60. Internet protocol.
  61. IPPROTO_IPV6
  62. [IP6] [Option Start] Internet Protocol Version 6. [Option End]
  63. IPPROTO_ICMP
  64. Control message protocol.
  65. IPPROTO_RAW
  66. [RS] [Option Start] Raw IP Packets Protocol. [Option End]
  67. IPPROTO_TCP
  68. Transmission control protocol.
  69. IPPROTO_UDP
  70. User datagram protocol.
  71. The <netinet/in.h> header shall define the following macros for use as destination addresses for connect(), sendmsg(), and sendto():
  72. INADDR_ANY
  73. IPv4 local host address.
  74. INADDR_BROADCAST
  75. IPv4 broadcast address.
  76. The <netinet/in.h> header shall define the following macro to help applications declare buffers of the proper size to store IPv4 addresses in string form:
  77. INET_ADDRSTRLEN
  78. 16. Length of the string form for IP.
  79. The htonl(), htons(), ntohl(), and ntohs() functions shall be available as defined in <arpa/inet.h>. Inclusion of the <netinet/in.h> header may also make visible all symbols from <arpa/inet.h>.
  80. [IP6] [Option Start] The <netinet/in.h> header shall define the following macro to help applications declare buffers of the proper size to store IPv6 addresses in string form:
  81. INET6_ADDRSTRLEN
  82. 46. Length of the string form for IPv6.
  83. The <netinet/in.h> header shall define the following macros, with distinct integer values, for use in the option_name argument in the getsockopt() or setsockopt() functions at protocol level IPPROTO_IPV6:
  84. IPV6_JOIN_GROUP
  85. Join a multicast group.
  86. IPV6_LEAVE_GROUP
  87. Quit a multicast group.
  88. IPV6_MULTICAST_HOPS
  89. Multicast hop limit.
  90. IPV6_MULTICAST_IF
  91. Interface to use for outgoing multicast packets.
  92. IPV6_MULTICAST_LOOP
  93. Multicast packets are delivered back to the local application.
  94. IPV6_UNICAST_HOPS
  95. Unicast hop limit.
  96. IPV6_V6ONLY
  97. Restrict AF_INET6 socket to IPv6 communications only.
  98. The <netinet/in.h> header shall define the following macros that test for special IPv6 addresses. Each macro is of type int and takes a single argument of type const struct in6_addr *:
  99. IN6_IS_ADDR_UNSPECIFIED
  100. Unspecified address.
  101. IN6_IS_ADDR_LOOPBACK
  102. Loopback address.
  103. IN6_IS_ADDR_MULTICAST
  104. Multicast address.
  105. IN6_IS_ADDR_LINKLOCAL
  106. Unicast link-local address.
  107. IN6_IS_ADDR_SITELOCAL
  108. Unicast site-local address.
  109. IN6_IS_ADDR_V4MAPPED
  110. IPv4 mapped address.
  111. IN6_IS_ADDR_V4COMPAT
  112. IPv4-compatible address.
  113. IN6_IS_ADDR_MC_NODELOCAL
  114. Multicast node-local address.
  115. IN6_IS_ADDR_MC_LINKLOCAL
  116. Multicast link-local address.
  117. IN6_IS_ADDR_MC_SITELOCAL
  118. Multicast site-local address.
  119. IN6_IS_ADDR_MC_ORGLOCAL
  120. Multicast organization-local address.
  121. IN6_IS_ADDR_MC_GLOBAL
  122. Multicast global address.
  123. */