os_in.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    os_in.h
00006  *
00007  *  Internet address family
00008  *
00009  *  $Id: os_in.h 80826 2008-03-04 14:51:23Z wotte $
00010  *
00011  *  @author Don Hinton <dhinton@dresystems.com>
00012  *  @author This code was originally in various places including ace/OS.h.
00013  */
00014 //=============================================================================
00015 
00016 #ifndef ACE_OS_INCLUDE_NETINET_OS_IN_H
00017 #define ACE_OS_INCLUDE_NETINET_OS_IN_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include /**/ "ace/config-all.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "ace/os_include/os_inttypes.h"
00028 #include "ace/os_include/sys/os_socket.h"
00029 
00030 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00031 #  include /**/ <ws2tcpip.h>
00032 #endif /* ACE_HAS_WINSOCK2 */
00033 
00034 #if !defined (ACE_LACKS_NETINET_IN_H)
00035 #  if defined (ACE_HAS_STL_QUEUE_CONFLICT)
00036 #    define queue _Queue_
00037 #  endif /* ACE_HAS_STL_QUEUE_CONFLICT */
00038    extern "C" {
00039 #  include /**/ <netinet/in.h>
00040    }
00041 #  if defined (ACE_HAS_STL_QUEUE_CONFLICT)
00042 #    undef queue
00043 #  endif /* ACE_HAS_STL_QUEUE_CONFLICT */
00044 #endif /* !ACE_LACKS_NETINET_IN_H */
00045 
00046 // Place all additions (especially function declarations) within extern "C" {}
00047 #ifdef __cplusplus
00048 extern "C"
00049 {
00050 #endif /* __cplusplus */
00051 
00052 # if defined (ACE_HAS_PHARLAP_RT)
00053 #   define ACE_IPPROTO_TCP SOL_SOCKET
00054 # else
00055 #   define ACE_IPPROTO_TCP IPPROTO_TCP
00056 # endif /* ACE_HAS_PHARLAP_RT */
00057 
00058 # if !defined (ACE_HAS_IP_MULTICAST)  &&  defined (ACE_LACKS_IP_ADD_MEMBERSHIP)
00059   // Even if ACE_HAS_IP_MULTICAST is not defined, if IP_ADD_MEMBERSHIP
00060   // is defined, assume that the ip_mreq struct is also defined
00061   // (presumably in netinet/in.h).
00062   struct ip_mreq
00063   {
00064     /// IP multicast address of group
00065     struct in_addr imr_multiaddr;
00066     /// Local IP address of interface
00067     struct in_addr imr_interface;
00068   };
00069 # endif /* ! ACE_HAS_IP_MULTICAST  &&  ACE_LACKS_IP_ADD_MEMBERSHIP */
00070 
00071 # if defined (ACE_LACKS_IN_ADDR)
00072   struct in_addr
00073     {
00074       u_long s_addr;
00075     };
00076 # endif /* ACE_LACKS_IN_ADDR */
00077 
00078 # if defined (ACE_LACKS_SOCKADDR_IN)
00079   struct sockaddr_in
00080   {
00081     short            sin_family;   // e.g. AF_INET
00082     unsigned short   sin_port;     // e.g. htons(3490)
00083     struct in_addr   sin_addr;     // see struct in_addr, below
00084     char             sin_zero[8];  // zero this if you want to
00085   };
00086 # endif /* ACE_LACKS_SOCKADDR_IN */
00087 
00088 # if defined (ACE_LACKS_SOCKADDR_UN)
00089   struct  sockaddr_un {
00090           u_char  sun_len;                /* sockaddr len including null */
00091           u_char  sun_family;             /* AF_UNIX */
00092           char    sun_path[104];          /* path name (gag) */
00093   };
00094 #endif /* ACE_LACKS_SOCKADDR_UN */
00095 
00096 # if defined (ACE_LACKS_IP_MREQ)
00097   struct ip_mreq
00098   {
00099     struct  in_addr imr_multiaddr;  /* IP multicast address of group */
00100     struct  in_addr imr_interface;  /* local IP address of interface */
00101   };
00102 # endif /* ACE_LACKS_IP_MREQ */
00103 
00104 #if !defined (IPPORT_RESERVED)
00105 #  define IPPORT_RESERVED       1024
00106 #endif /* !IPPORT_RESERVED */
00107 
00108 #if !defined (IPPORT_USERRESERVED)
00109 #  define IPPORT_USERRESERVED       5000
00110 #endif /* !IPPORT_USERRESERVED */
00111 
00112 // Define INET loopback address constant if it hasn't been defined
00113 // Dotted Decimal 127.0.0.1 == Hexidecimal 0x7f000001
00114 #if !defined (INADDR_LOOPBACK)
00115 #  define INADDR_LOOPBACK ((ACE_UINT32) 0x7f000001)
00116 #endif /* INADDR_LOOPBACK */
00117 
00118 // The INADDR_NONE address is generally 255.255.255.255.
00119 #if !defined (INADDR_NONE)
00120 #  define INADDR_NONE ((ACE_UINT32) 0xffffffff)
00121 #endif /* INADDR_NONE */
00122 
00123 // Define INET string length constants if they haven't been defined
00124 //
00125 // for IPv4 dotted-decimal
00126 #if !defined (INET_ADDRSTRLEN)
00127 #  define INET_ADDRSTRLEN 16
00128 #endif /* INET_ADDRSTRLEN */
00129 //
00130 // for IPv6 hex string
00131 #if !defined (INET6_ADDRSTRLEN)
00132 #  define INET6_ADDRSTRLEN 46
00133 #endif /* INET6_ADDRSTRLEN */
00134 
00135 # if !defined (IP_DROP_MEMBERSHIP)
00136 #   define IP_DROP_MEMBERSHIP 0
00137 # endif /* IP_DROP_MEMBERSHIP */
00138 
00139 # if !defined (IP_ADD_MEMBERSHIP)
00140 #   define IP_ADD_MEMBERSHIP 0
00141 #   define ACE_LACKS_IP_ADD_MEMBERSHIP
00142 # endif /* IP_ADD_MEMBERSHIP */
00143 
00144 # if !defined (IP_DEFAULT_MULTICAST_TTL)
00145 #   define IP_DEFAULT_MULTICAST_TTL 0
00146 # endif /* IP_DEFAULT_MULTICAST_TTL */
00147 
00148 # if !defined (IP_DEFAULT_MULTICAST_LOOP)
00149 #   define IP_DEFAULT_MULTICAST_LOOP 0
00150 # endif /* IP_DEFAULT_MULTICAST_LOOP */
00151 
00152 # if !defined (IP_MULTICAST_IF)
00153 #   define IP_MULTICAST_IF 0
00154 # endif /* IP_MULTICAST_IF */
00155 
00156 # if !defined (IP_MULTICAST_TTL)
00157 #   define IP_MULTICAST_TTL 1
00158 # endif /* IP_MULTICAST_TTL */
00159 
00160 # if !defined (IP_MULTICAST_LOOP)
00161 #   define IP_MULTICAST_LOOP 2
00162 # endif /* IP_MULTICAST_LOOP */
00163 
00164 # if !defined (IP_MAX_MEMBERSHIPS)
00165 #   define IP_MAX_MEMBERSHIPS 0
00166 # endif /* IP_MAX_MEMBERSHIP */
00167 
00168 # if !defined (IPPROTO_IP)
00169 #   define IPPROTO_IP 0
00170 # endif /* IPPROTO_IP */
00171 
00172 # if !defined (IPPROTO_TCP)
00173 #   define IPPROTO_TCP 6
00174 # endif /* IPPROTO_TCP */
00175 
00176 # if !defined (INADDR_ANY)
00177 #   define INADDR_ANY (u_long)0x00000000
00178 # endif /* INADDR_ANY */
00179 
00180 #ifdef __cplusplus
00181 }
00182 #endif /* __cplusplus */
00183 
00184 #include /**/ "ace/post.h"
00185 #endif /* ACE_OS_INCLUDE_NETINET_OS_IN_H */

Generated on Tue Feb 2 17:18:41 2010 for ACE by  doxygen 1.4.7