VR-Link API Documentation for HLA 1516
vlInetInterfaceUtils.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00009 #pragma once
00010 
00011 #include <vlutil/vlInet.h>
00012 #include <vlutil/vlInetDevice.h>
00013 #include <vlutil/vlString.h>
00014 #include <vlutil/vlSmartPointers.h>
00015 
00016 #ifndef _WIN32
00017 #include <netinet/if_ether.h>
00018 #include <net/if.h>
00019 #endif // !_WIN32
00020 
00021 #ifdef DtUSE_UTILITIES_NAMESPACE
00022 namespace DtUSE_UTILITIES_NAMESPACE
00023 {
00024 #endif
00025 
00027 namespace DtInetUtils
00028 {
00031 #ifndef _WIN32
00032 #ifdef __linux__
00033 #define DtInet_INET6_PROC_PATH "/proc/net/if_inet6"
00034 #define DtInet_IGMP_PROC_PATH  "/proc/net/igmp"
00035 #define DtInet_IGMP6_PROC_PATH "/proc/net/igmp6"
00036 #endif // LINUX
00037 #endif // !_WIN32
00038 
00040 
00043 typedef std::vector<DtInetDeviceSP> DtHostDeviceList;
00045 
00049 DT_DLL_VLUTIL DtString getLocalHostname();
00050 
00055 DT_DLL_VLUTIL DtHostDeviceList scanInetDevices( bool includeUpOnly, bool preferIpV6 = false );
00056 
00061 DT_DLL_VLUTIL DtHostDeviceList scanBroadcastDevices( bool includeUpOnly, bool preferIpV6 = false );
00062 
00067 DT_DLL_VLUTIL DtHostDeviceList scanMulticastDevices( bool includeUpOnly, bool preferIpV6 = false );
00068 
00072 DT_DLL_VLUTIL DtHostDeviceList scanIpv6Devices( bool includeUpOnly );
00073 
00076 DT_DLL_VLUTIL DtInetDevice* defaultMulticastDevice( );
00077 
00080 DT_DLL_VLUTIL DtInetDevice* defaultBroadcastDevice(bool preferIpv6 = false);
00081 
00082 #ifdef _WIN32
00083 
00084 
00085 
00086 
00087 
00088 DT_DLL_VLUTIL int fetchDeviceInfo( DtInetUtils::DtInetAddrFamily family,
00089                      PIP_ADAPTER_ADDRESSES* adapterInfo, DtString& errorStr );
00095 DT_DLL_VLUTIL int fetchIpv4DeviceAddrInfo( PMIB_IPADDRTABLE* ipv4Addrs,
00096                                            DtString& errorStr );
00097 #else // !_WIN32
00098 #ifdef __solaris__
00099 
00100 
00101 
00102 
00103 
00104 
00105 DT_DLL_VLUTIL int fetchDeviceInfo( DtInetUtils::DtInetAddrFamily type,
00106                                    int sockFd, lifconf* ifc, unsigned int& buffSize,
00107                                    unsigned int& resizeFactor, DtString& errorStr );
00108 
00111 DT_DLL_VLUTIL struct lifreq* findInterfaceByName( const char* ifName, int sock, lifconf* ifc );
00112 DT_DLL_VLUTIL struct lifreq* findInterfaceByAddress( struct in_addr* ipv4Addr, int sock,
00113                                                     lifconf* ifc );
00117 DT_DLL_VLUTIL struct ifreq_in6* findIpv6InterfaceByName( const char* ifName, int sock,
00118                                                           lifconf* ifc );
00119 DT_DLL_VLUTIL struct ifreq_in6* findIpv6InterfaceByAddress( struct in6_addr* ipv6Addr,
00120                                               int sock, lifconf* ifc );
00123 
00129 DT_DLL_VLUTIL int fetchIpv6DeviceInfo( int sockFd, lifconf* ifc, unsigned int& buffSize,
00130                          unsigned int& resizeFactor, DtString& errorStr );
00131 
00132 #else // !SOLARIS
00133 
00134 
00135 
00136 
00137 
00138 
00139 DT_DLL_VLUTIL int fetchDeviceInfo( DtInetUtils::DtInetAddrFamily type,
00140                                    int sockFd, ifconf* ifc, unsigned int& buffSize,
00141                                    unsigned int& resizeFactor, DtString& errorStr );
00142 
00145 DT_DLL_VLUTIL struct ifreq* findInterfaceByName( const char* ifName, int sock, ifconf* ifc );
00146 DT_DLL_VLUTIL struct ifreq* findInterfaceByAddress( struct in_addr* ipv4Addr, int sock,
00147                                       ifconf* ifc );
00151 DT_DLL_VLUTIL struct ifreq_in6* findIpv6InterfaceByName( const char* ifName, int sock,
00152                                            ifconf* ifc );
00153 DT_DLL_VLUTIL struct ifreq_in6* findIpv6InterfaceByAddress( struct in6_addr* ipv6Addr,
00154                                               int sock, ifconf* ifc );
00156 
00157 #if defined(__linux__) || defined(__sgi__)
00158 
00159 
00160 
00161 
00162 
00163 DT_DLL_VLUTIL int fetchIpv6DeviceInfo( int sockFd, ifconf* ifc, unsigned int& buffSize,
00164                          unsigned int& resizeFactor, DtString& errorStr );
00165 #endif // LINUX
00166 
00167 #endif // !SOLARIS
00168 #endif // !_WIN32
00169 
00170 } 
00171 
00172 #ifdef DtUSE_UTILITIES_NAMESPACE
00173 } 
00174 #endif
00175 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)