os_if.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    os_if.h
00006  *
00007  *  sockets local interfaces
00008  *
00009  *  $Id: os_if.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_NET_OS_IF_H
00017 #define ACE_OS_INCLUDE_NET_OS_IF_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 #if !defined (ACE_LACKS_NET_IF_H)
00028    // This part if to avoid STL name conflict with the map structure
00029    // in net/if.h.
00030 #  if defined (ACE_HAS_STL_MAP_CONFLICT)
00031 #    define map _Resource_Allocation_Map_
00032 #  endif /* ACE_HAS_STL_MAP_CONFLICT */
00033    extern "C" {
00034 #  include /**/ <net/if.h>
00035    }
00036 #  if defined (ACE_HAS_STL_MAP_CONFLICT)
00037 #    undef map
00038 #  endif /* ACE_HAS_STL_MAP_CONFLICT */
00039 #  if defined (HPUX) && defined (IOR)
00040    /* HP-UX 11.11 defines IOR in /usr/include/pa/inline.h
00041       and we don't want that definition.  See IOP_IORC.h.
00042       Thanks to Torsten Kopper <tkue_0931@fastmail.fm> for this patch.*/
00043 #    undef IOR
00044 #  endif /* HPUX && IOR */
00045 #endif /* !ACE_LACKS_NET_IF_H */
00046 
00047 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00048 #  include /**/ <ws2tcpip.h>
00049 #endif /* ACE_HAS_WINSOCK2 */
00050 
00051 // Place all additions (especially function declarations) within extern "C" {}
00052 #ifdef __cplusplus
00053 extern "C"
00054 {
00055 #endif /* __cplusplus */
00056 
00057 #if defined (ACE_HAS_BROKEN_IF_HEADER)
00058    struct ifafilt;
00059 #endif /* ACE_HAS_BROKEN_IF_HEADER */
00060 
00061 #if defined (ACE_LACKS_IFREQ)
00062 struct  ifreq {
00063 #define IFNAMSIZ        16
00064         char    ifr_name[IFNAMSIZ];             /* if name, e.g. "en0" */
00065         union {
00066                 struct  sockaddr ifru_addr;
00067                 struct  sockaddr ifru_dstaddr;
00068                 struct  sockaddr ifru_broadaddr;
00069                 short   ifru_flags;
00070                 int     ifru_metric;
00071                 int     ifru_mtu;
00072                 int     ifru_phys;
00073                 int     ifru_media;
00074                 caddr_t ifru_data;
00075                 int     (*ifru_tap)(struct ifnet *, struct ether_header *, struct mbuf *);
00076         } ifr_ifru;
00077 #define ifr_addr        ifr_ifru.ifru_addr      /* address */
00078 #define ifr_dstaddr     ifr_ifru.ifru_dstaddr   /* other end of p-to-p link */
00079 #define ifr_broadaddr   ifr_ifru.ifru_broadaddr /* broadcast address */
00080 #define ifr_flags       ifr_ifru.ifru_flags     /* flags */
00081 #define ifr_metric      ifr_ifru.ifru_metric    /* metric */
00082 #define ifr_mtu         ifr_ifru.ifru_mtu       /* mtu */
00083 #define ifr_phys        ifr_ifru.ifru_phys      /* physical wire */
00084 #define ifr_media       ifr_ifru.ifru_media     /* physical media */
00085 #define ifr_data        ifr_ifru.ifru_data      /* for use by interface */
00086 #define ifr_tap         ifr_ifru.ifru_tap       /* tap function */
00087 };
00088 #endif /* ACE_LACKS_IFREQ */
00089 
00090 #if defined (ACE_LACKS_IFCONF)
00091 struct  ifconf {
00092         int     ifc_len;
00093         union {
00094                 caddr_t ifcu_buf;
00095                 struct  ifreq *ifcu_req;
00096         } ifc_ifcu;
00097 #define ifc_buf ifc_ifcu.ifcu_buf       /* buffer address */
00098 #define ifc_req ifc_ifcu.ifcu_req       /* array of structures returned */
00099         };
00100 #endif /* ACE_LACKS_IFCONF */
00101 
00102 #if !defined (IFF_UP)
00103 # define IFF_UP 0x1
00104 #endif /* IFF_UP */
00105 
00106 #if !defined (IFF_LOOPBACK)
00107 # define IFF_LOOPBACK 0x8
00108 #endif /* IFF_LOOPBACK */
00109 
00110 #if !defined (IFF_BROADCAST)
00111 # define IFF_BROADCAST 0x2
00112 #endif /* IFF_BROADCAST */
00113 
00114 #ifdef __cplusplus
00115 }
00116 #endif /* __cplusplus */
00117 
00118 #include /**/ "ace/post.h"
00119 #endif /* ACE_OS_INCLUDE_NET_OS_IF_H */

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