VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlInetInterfaceUtils.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
9 #pragma once
10 
11 #include <vlutil/vlInet.h>
12 #include <vlutil/vlInetDevice.h>
13 #include <vlutil/vlString.h>
14 #include <vlutil/vlSmartPointers.h>
15 
16 #ifndef _WIN32
17 #include <netinet/if_ether.h>
18 #include <net/if.h>
19 #endif // !_WIN32
20 
21 #ifdef DtUSE_UTILITIES_NAMESPACE
22 namespace DtUSE_UTILITIES_NAMESPACE
23 {
24 #endif
25 
27 namespace DtInetUtils
28 {
31 #ifndef _WIN32
32 #ifdef __linux__
33 #define DtInet_INET6_PROC_PATH "/proc/net/if_inet6"
34 #define DtInet_IGMP_PROC_PATH "/proc/net/igmp"
35 #define DtInet_IGMP6_PROC_PATH "/proc/net/igmp6"
36 #endif // LINUX
37 #endif // !_WIN32
38 
40 
43 typedef std::vector<DtInetDeviceSP> DtHostDeviceList;
45 
50 
55 DT_DLL_VLUTIL DtHostDeviceList scanInetDevices( bool includeUpOnly, bool preferIpV6 = false );
56 
61 DT_DLL_VLUTIL DtHostDeviceList scanBroadcastDevices( bool includeUpOnly, bool preferIpV6 = false );
62 
67 DT_DLL_VLUTIL DtHostDeviceList scanMulticastDevices( bool includeUpOnly, bool preferIpV6 = false );
68 
72 DT_DLL_VLUTIL DtHostDeviceList scanIpv6Devices( bool includeUpOnly );
73 
77 
80 DT_DLL_VLUTIL DtInetDeviceSP defaultBroadcastDevice(bool preferIpv6 = false);
81 
82 #ifdef _WIN32
83 
84 
85 
86 
87 
89  PIP_ADAPTER_ADDRESSES* adapterInfo, DtString& errorStr );
95 DT_DLL_VLUTIL int fetchIpv4DeviceAddrInfo( PMIB_IPADDRTABLE* ipv4Addrs,
96  DtString& errorStr );
97 #else // !_WIN32
98 #ifdef __solaris__
99 
100 
101 
102 
103 
104 
106  int sockFd, lifconf* ifc, unsigned int& buffSize,
107  unsigned int& resizeFactor, DtString& errorStr );
108 
111 DT_DLL_VLUTIL struct lifreq* findInterfaceByName( const char* ifName, int sock, lifconf* ifc );
112 DT_DLL_VLUTIL struct lifreq* findInterfaceByAddress( struct in_addr* ipv4Addr, int sock,
113  lifconf* ifc );
117 DT_DLL_VLUTIL struct ifreq_in6* findIpv6InterfaceByName( const char* ifName, int sock,
118  lifconf* ifc );
119 DT_DLL_VLUTIL struct ifreq_in6* findIpv6InterfaceByAddress( struct in6_addr* ipv6Addr,
120  int sock, lifconf* ifc );
123 
129 DT_DLL_VLUTIL int fetchIpv6DeviceInfo( int sockFd, lifconf* ifc, unsigned int& buffSize,
130  unsigned int& resizeFactor, DtString& errorStr );
131 
132 #else // !SOLARIS
133 
134 
135 
136 
137 
138 
140  int sockFd, ifconf* ifc, unsigned int& buffSize,
141  unsigned int& resizeFactor, DtString& errorStr );
142 
145 DT_DLL_VLUTIL struct ifreq* findInterfaceByName( const char* ifName, int sock, ifconf* ifc );
146 DT_DLL_VLUTIL struct ifreq* findInterfaceByAddress( struct in_addr* ipv4Addr, int sock,
147  ifconf* ifc );
151 DT_DLL_VLUTIL struct ifreq_in6* findIpv6InterfaceByName( const char* ifName, int sock,
152  ifconf* ifc );
153 DT_DLL_VLUTIL struct ifreq_in6* findIpv6InterfaceByAddress( struct in6_addr* ipv6Addr,
154  int sock, ifconf* ifc );
156 
157 #if defined(__linux__) || defined(__sgi__)
158 
159 
160 
161 
162 
163 DT_DLL_VLUTIL int fetchIpv6DeviceInfo( int sockFd, ifconf* ifc, unsigned int& buffSize,
164  unsigned int& resizeFactor, DtString& errorStr );
165 #endif // LINUX
166 
167 #endif // !SOLARIS
168 #endif // !_WIN32
169 
170 }
171 
172 #ifdef DtUSE_UTILITIES_NAMESPACE
173 }
174 #endif
175 

Document ID: Generated on Fri May 15 06:36:13 EDT 2015 from SVN revision 153263
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)