os_netdb.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    os_netdb.h
00006  *
00007  *  definitions for network database operations
00008  *
00009  *  $Id: os_netdb.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_OS_NETDB_H
00017 #define ACE_OS_INCLUDE_OS_NETDB_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/netinet/os_in.h"
00028 #include "ace/os_include/os_limits.h"
00029 
00030 #if !defined (ACE_LACKS_NETDB_H)
00031 #  if defined (ACE_HAS_STL_QUEUE_CONFLICT)
00032 #    define queue _Queue_
00033 #  endif /* ACE_HAS_STL_QUEUE_CONFLICT */
00034    extern "C" {
00035 #  include /**/ <netdb.h>
00036    }
00037 #  if defined (ACE_HAS_STL_QUEUE_CONFLICT)
00038 #    undef queue
00039 #  endif /* ACE_HAS_STL_QUEUE_CONFLICT */
00040 #endif /* !ACE_LACKS_NETDB_H */
00041 
00042 #if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620)
00043 #  include /**/ <hostLib.h>
00044 #endif /* ACE_VXWORKS */
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_LACKS_HOSTENT)
00053 struct  hostent {
00054         char    *h_name;        /* official name of host */
00055         char    **h_aliases;    /* alias list */
00056         int     h_addrtype;     /* host address type */
00057         int     h_length;       /* length of address */
00058         char    **h_addr_list;  /* list of addresses from name server */
00059 #define h_addr  h_addr_list[0]  /* address, for backward compatibility */
00060 };
00061 #endif /* ACE_LACKS_HOSTENT */
00062 
00063 #if defined (ACE_LACKS_PROTOENT)
00064 struct  protoent {
00065         char    *p_name;        /* official protocol name */
00066         char    **p_aliases;    /* alias list */
00067         int     p_proto;        /* protocol # */
00068 };
00069 #endif /* ACE_LACKS_PROTOENT */
00070 
00071 #if defined (ACE_LACKS_SERVENT)
00072 struct  servent {
00073         char    *s_name;        /* official service name */
00074         char    **s_aliases;    /* alias list */
00075         int     s_port;         /* port # */
00076         char    *s_proto;       /* protocol to use */
00077 };
00078 #endif /* ACE_LACKS_SERVENT */
00079 
00080 #if defined (ACE_HAS_STRUCT_NETDB_DATA)
00081    typedef char ACE_HOSTENT_DATA[sizeof(struct hostent_data)];
00082    typedef char ACE_SERVENT_DATA[sizeof(struct servent_data)];
00083    typedef char ACE_PROTOENT_DATA[sizeof(struct protoent_data)];
00084 #else
00085 #  if !defined ACE_HOSTENT_DATA_SIZE
00086 #    define ACE_HOSTENT_DATA_SIZE (4*1024)
00087 #  endif /*ACE_HOSTENT_DATA_SIZE */
00088 #  if !defined ACE_SERVENT_DATA_SIZE
00089 #    define ACE_SERVENT_DATA_SIZE (4*1024)
00090 #  endif /*ACE_SERVENT_DATA_SIZE */
00091 #  if !defined ACE_PROTOENT_DATA_SIZE
00092 #    define ACE_PROTOENT_DATA_SIZE (2*1024)
00093 #  endif /*ACE_PROTOENT_DATA_SIZE */
00094    typedef char ACE_HOSTENT_DATA[ACE_HOSTENT_DATA_SIZE];
00095    typedef char ACE_SERVENT_DATA[ACE_SERVENT_DATA_SIZE];
00096    typedef char ACE_PROTOENT_DATA[ACE_PROTOENT_DATA_SIZE];
00097 #endif /* ACE_HAS_STRUCT_NETDB_DATA */
00098 
00099 # if !defined(MAXHOSTNAMELEN)
00100 #   define MAXHOSTNAMELEN  HOST_NAME_MAX
00101 # endif /* MAXHOSTNAMELEN */
00102 
00103 #ifdef __cplusplus
00104 }
00105 #endif /* __cplusplus */
00106 
00107 #include /**/ "ace/post.h"
00108 #endif /* ACE_OS_INCLUDE_OS_NETDB_H */

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