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  *  os_in.h,v 1.4 2005/04/11 08:27:21 jwillemsen Exp
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 (IPPORT_RESERVED)
00072 #  define IPPORT_RESERVED       1024
00073 #endif /* !IPPORT_RESERVED */
00074 
00075 #if !defined (IPPORT_USERRESERVED)
00076 #  define IPPORT_USERRESERVED       5000
00077 #endif /* !IPPORT_USERRESERVED */
00078 
00079 // Define INET loopback address constant if it hasn't been defined
00080 // Dotted Decimal 127.0.0.1 == Hexidecimal 0x7f000001
00081 #if !defined (INADDR_LOOPBACK)
00082 #  define INADDR_LOOPBACK ((ACE_UINT32) 0x7f000001)
00083 #endif /* INADDR_LOOPBACK */
00084 
00085 // The INADDR_NONE address is generally 255.255.255.255.
00086 #if !defined (INADDR_NONE)
00087 #  define INADDR_NONE ((ACE_UINT32) 0xffffffff)
00088 #endif /* INADDR_NONE */
00089 
00090 // Define INET string length constants if they haven't been defined
00091 //
00092 // for IPv4 dotted-decimal
00093 #if !defined (INET_ADDRSTRLEN)
00094 #  define INET_ADDRSTRLEN 16
00095 #endif /* INET_ADDRSTRLEN */
00096 //
00097 // for IPv6 hex string
00098 #if !defined (INET6_ADDRSTRLEN)
00099 #  define INET6_ADDRSTRLEN 46
00100 #endif /* INET6_ADDRSTRLEN */
00101 
00102 # if !defined (IP_DROP_MEMBERSHIP)
00103 #   define IP_DROP_MEMBERSHIP 0
00104 # endif /* IP_DROP_MEMBERSHIP */
00105 
00106 # if !defined (IP_ADD_MEMBERSHIP)
00107 #   define IP_ADD_MEMBERSHIP 0
00108 #   define ACE_LACKS_IP_ADD_MEMBERSHIP
00109 # endif /* IP_ADD_MEMBERSHIP */
00110 
00111 # if !defined (IP_DEFAULT_MULTICAST_TTL)
00112 #   define IP_DEFAULT_MULTICAST_TTL 0
00113 # endif /* IP_DEFAULT_MULTICAST_TTL */
00114 
00115 # if !defined (IP_DEFAULT_MULTICAST_LOOP)
00116 #   define IP_DEFAULT_MULTICAST_LOOP 0
00117 # endif /* IP_DEFAULT_MULTICAST_LOOP */
00118 
00119 # if !defined (IP_MULTICAST_IF)
00120 #   define IP_MULTICAST_IF 0
00121 # endif /* IP_MULTICAST_IF */
00122 
00123 # if !defined (IP_MULTICAST_TTL)
00124 #   define IP_MULTICAST_TTL 1
00125 # endif /* IP_MULTICAST_TTL */
00126 
00127 # if !defined (IP_MULTICAST_LOOP)
00128 #   define IP_MULTICAST_LOOP 2
00129 # endif /* IP_MULTICAST_LOOP */
00130 
00131 # if !defined (IP_MAX_MEMBERSHIPS)
00132 #   define IP_MAX_MEMBERSHIPS 0
00133 # endif /* IP_MAX_MEMBERSHIP */
00134 
00135 #ifdef __cplusplus
00136 }
00137 #endif /* __cplusplus */
00138 
00139 #include /**/ "ace/post.h"
00140 #endif /* ACE_OS_INCLUDE_NETINET_OS_IN_H */

Generated on Thu Nov 9 09:41:57 2006 for ACE by doxygen 1.3.6