Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

IPHlpApi.h

Go to the documentation of this file.
00001 /*++
00002 
00003 Copyright (c) 1997-1999  Microsoft Corporation
00004 
00005 Module Name:
00006 
00007     public\sdk\inc\iphlpapi.h
00008 
00009 Abstract:
00010     Header file for functions to interact with the IP Stack for MIB-II and
00011     related functionality
00012 
00013 Revision History:
00014     Amritansh Raghav    Created
00015     NK Srinivas         Added
00016 
00017 --*/
00018 
00019 #ifndef __IPHLPAPI_H__
00020 #define __IPHLPAPI_H__
00021 
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00030 //////////////////////////////////////////////////////////////////////////////
00031 //                                                                          //
00032 // IPRTRMIB.H has the definitions of the strcutures used to set and get     //
00033 // information                                                              //
00034 //                                                                          //
00035 //////////////////////////////////////////////////////////////////////////////
00036 
00037 #include <iprtrmib.h>
00038 #include <ipexport.h>
00039 #include <iptypes.h>
00040 
00041 //////////////////////////////////////////////////////////////////////////////
00042 //                                                                          //
00043 // The GetXXXTable APIs take a buffer and a size of buffer.  If the buffer  //
00044 // is not large enough, they APIs return ERROR_INSUFFICIENT_BUFFER  and     //
00045 // *pdwSize is the required buffer size                                     //
00046 // The bOrder is a BOOLEAN, which if TRUE sorts the table according to      //
00047 // MIB-II (RFC XXXX)                                                        //
00048 //                                                                          //
00049 //////////////////////////////////////////////////////////////////////////////
00050 
00051 
00052 //////////////////////////////////////////////////////////////////////////////
00053 //                                                                          //
00054 // Retrieves the number of interfaces in the system. These include LAN and  //
00055 // WAN interfaces                                                           //
00056 //                                                                          //
00057 //////////////////////////////////////////////////////////////////////////////
00058 
00059 
00060 DWORD
00061 WINAPI
00062 GetNumberOfInterfaces(
00063     OUT PDWORD  pdwNumIf
00064     );
00065 
00066 //////////////////////////////////////////////////////////////////////////////
00067 //                                                                          //
00068 // Gets the MIB-II ifEntry                                                  //
00069 // The dwIndex field of the MIB_IFROW should be set to the index of the     //
00070 // interface being queried                                                  //
00071 //                                                                          //
00072 //////////////////////////////////////////////////////////////////////////////
00073 
00074 DWORD
00075 WINAPI
00076 GetIfEntry(
00077     IN OUT PMIB_IFROW   pIfRow
00078     );
00079 
00080 //////////////////////////////////////////////////////////////////////////////
00081 //                                                                          //
00082 // Gets the MIB-II IfTable                                                  //
00083 //                                                                          //
00084 //////////////////////////////////////////////////////////////////////////////
00085 
00086 DWORD
00087 WINAPI
00088 GetIfTable(
00089     OUT    PMIB_IFTABLE pIfTable,
00090     IN OUT PULONG       pdwSize,
00091     IN     BOOL         bOrder
00092     );
00093 
00094 //////////////////////////////////////////////////////////////////////////////
00095 //                                                                          //
00096 // Gets the Interface to IP Address mapping                                 //
00097 //                                                                          //
00098 //////////////////////////////////////////////////////////////////////////////
00099 
00100 DWORD
00101 WINAPI
00102 GetIpAddrTable(
00103     OUT    PMIB_IPADDRTABLE pIpAddrTable,
00104     IN OUT PULONG           pdwSize,
00105     IN     BOOL             bOrder
00106     );
00107 
00108 //////////////////////////////////////////////////////////////////////////////
00109 //                                                                          //
00110 // Gets the current IP Address to Physical Address (ARP) mapping            //
00111 //                                                                          //
00112 //////////////////////////////////////////////////////////////////////////////
00113 
00114 DWORD
00115 WINAPI
00116 GetIpNetTable(
00117     OUT    PMIB_IPNETTABLE pIpNetTable,
00118     IN OUT PULONG          pdwSize,
00119     IN     BOOL            bOrder
00120     );
00121 
00122 //////////////////////////////////////////////////////////////////////////////
00123 //                                                                          //
00124 // Gets the IP Routing Table  (RFX XXXX)                                    //
00125 //                                                                          //
00126 //////////////////////////////////////////////////////////////////////////////
00127 
00128 DWORD
00129 WINAPI
00130 GetIpForwardTable(
00131     OUT    PMIB_IPFORWARDTABLE pIpForwardTable,
00132     IN OUT PULONG              pdwSize,
00133     IN     BOOL                bOrder
00134     );
00135 
00136 //////////////////////////////////////////////////////////////////////////////
00137 //                                                                          //
00138 // Gets TCP Connection/UDP Listener Table                                   //
00139 //                                                                          //
00140 //////////////////////////////////////////////////////////////////////////////
00141 
00142 DWORD
00143 WINAPI
00144 GetTcpTable(
00145     OUT    PMIB_TCPTABLE pTcpTable,
00146     IN OUT PDWORD        pdwSize,
00147     IN     BOOL          bOrder
00148     );
00149 
00150 DWORD
00151 WINAPI
00152 GetUdpTable(
00153     OUT    PMIB_UDPTABLE pUdpTable,
00154     IN OUT PDWORD        pdwSize,
00155     IN     BOOL          bOrder
00156     );
00157 
00158 
00159 //////////////////////////////////////////////////////////////////////////////
00160 //                                                                          //
00161 // Gets IP/ICMP/TCP/UDP Statistics                                          //
00162 //                                                                          //
00163 //////////////////////////////////////////////////////////////////////////////
00164 
00165 DWORD
00166 WINAPI
00167 GetIpStatistics(
00168     OUT  PMIB_IPSTATS   pStats
00169     );
00170 
00171 DWORD
00172 WINAPI
00173 GetIcmpStatistics(
00174     OUT PMIB_ICMP   pStats
00175     );
00176 
00177 
00178 DWORD
00179 WINAPI
00180 GetTcpStatistics(
00181     OUT PMIB_TCPSTATS   pStats
00182     );
00183 
00184 DWORD
00185 WINAPI
00186 GetUdpStatistics(
00187     OUT PMIB_UDPSTATS   pStats
00188     );
00189 
00190 //////////////////////////////////////////////////////////////////////////////
00191 //                                                                          //
00192 // Used to set the ifAdminStatus on an interface.  The only fields of the   //
00193 // MIB_IFROW that are relevant are the dwIndex (index of the interface      //
00194 // whose status needs to be set) and the dwAdminStatus which can be either  //
00195 // MIB_IF_ADMIN_STATUS_UP or MIB_IF_ADMIN_STATUS_DOWN                       //
00196 //                                                                          //
00197 //////////////////////////////////////////////////////////////////////////////
00198 
00199 DWORD
00200 WINAPI
00201 SetIfEntry(
00202     IN PMIB_IFROW pIfRow
00203     );
00204 
00205 //////////////////////////////////////////////////////////////////////////////
00206 //                                                                          //
00207 // Used to create, modify or delete a route.  In all cases the              //
00208 // dwForwardIfIndex, dwForwardDest, dwForwardMask, dwForwardNextHop and     //
00209 // dwForwardPolicy MUST BE SPECIFIED. Currently dwForwardPolicy is unused   //
00210 // and MUST BE 0.                                                           //
00211 // For a set, the complete MIB_IPFORWARDROW structure must be specified     //
00212 //                                                                          //
00213 //////////////////////////////////////////////////////////////////////////////
00214 
00215 DWORD
00216 WINAPI
00217 CreateIpForwardEntry(
00218     IN PMIB_IPFORWARDROW pRoute
00219     );
00220 
00221 DWORD
00222 WINAPI
00223 SetIpForwardEntry(
00224     IN PMIB_IPFORWARDROW pRoute
00225     );
00226 
00227 DWORD
00228 WINAPI
00229 DeleteIpForwardEntry(
00230     IN PMIB_IPFORWARDROW pRoute
00231     );
00232 
00233 //////////////////////////////////////////////////////////////////////////////
00234 //                                                                          //
00235 // Used to set the ipForwarding to ON or OFF (currently only ON->OFF is     //
00236 // allowed) and to set the defaultTTL.  If only one of the fields needs to  //
00237 // be modified and the other needs to be the same as before the other field //
00238 // needs to be set to MIB_USE_CURRENT_TTL or MIB_USE_CURRENT_FORWARDING as  //
00239 // the case may be                                                          //
00240 //                                                                          //
00241 //////////////////////////////////////////////////////////////////////////////
00242 
00243 
00244 DWORD
00245 WINAPI
00246 SetIpStatistics(
00247     IN PMIB_IPSTATS pIpStats
00248     );
00249 
00250 //////////////////////////////////////////////////////////////////////////////
00251 //                                                                          //
00252 // Used to set the defaultTTL.                                              //
00253 //                                                                          //
00254 //////////////////////////////////////////////////////////////////////////////
00255 
00256 DWORD
00257 WINAPI
00258 SetIpTTL(
00259     UINT nTTL
00260     );
00261 
00262 //////////////////////////////////////////////////////////////////////////////
00263 //                                                                          //
00264 // Used to create, modify or delete an ARP entry.  In all cases the dwIndex //
00265 // dwAddr field MUST BE SPECIFIED.                                          //
00266 // For a set, the complete MIB_IPNETROW structure must be specified         //
00267 //                                                                          //
00268 //////////////////////////////////////////////////////////////////////////////
00269 
00270 DWORD
00271 WINAPI
00272 CreateIpNetEntry(
00273     IN PMIB_IPNETROW    pArpEntry
00274     );
00275 
00276 DWORD
00277 WINAPI
00278 SetIpNetEntry(
00279     IN PMIB_IPNETROW    pArpEntry
00280     );
00281 
00282 DWORD
00283 WINAPI
00284 DeleteIpNetEntry(
00285     IN PMIB_IPNETROW    pArpEntry
00286     );
00287 
00288 DWORD
00289 WINAPI
00290 FlushIpNetTable(
00291     IN DWORD   dwIfIndex
00292     );
00293 
00294 
00295 //////////////////////////////////////////////////////////////////////////////
00296 //                                                                          //
00297 // Used to create or delete a Proxy ARP entry. The dwIndex is the index of  //
00298 // the interface on which to PARP for the dwAddress.  If the interface is   //
00299 // of a type that doesnt support ARP, e.g. PPP, then the call will fail     //
00300 //                                                                          //
00301 //////////////////////////////////////////////////////////////////////////////
00302 
00303 DWORD
00304 WINAPI
00305 CreateProxyArpEntry(
00306     IN  DWORD   dwAddress,
00307     IN  DWORD   dwMask,
00308     IN  DWORD   dwIfIndex
00309     );
00310 
00311 DWORD
00312 WINAPI
00313 DeleteProxyArpEntry(
00314     IN  DWORD   dwAddress,
00315     IN  DWORD   dwMask,
00316     IN  DWORD   dwIfIndex
00317     );
00318 
00319 //////////////////////////////////////////////////////////////////////////////
00320 //                                                                          //
00321 // Used to set the state of a TCP Connection. The only state that it can be //
00322 // set to is MIB_TCP_STATE_DELETE_TCB.  The complete MIB_TCPROW structure   //
00323 // MUST BE SPECIFIED                                                        //
00324 //                                                                          //
00325 //////////////////////////////////////////////////////////////////////////////
00326 
00327 DWORD
00328 WINAPI
00329 SetTcpEntry(
00330     IN PMIB_TCPROW pTcpRow
00331     );
00332 
00333 
00334 DWORD
00335 WINAPI
00336 GetInterfaceInfo(
00337     IN PIP_INTERFACE_INFO pIfTable,
00338     OUT PULONG            dwOutBufLen
00339     );
00340 
00341 DWORD
00342 WINAPI
00343 GetUniDirectionalAdapterInfo(OUT PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo,
00344                  OUT PULONG dwOutBufLen
00345                  );
00346 
00347 //////////////////////////////////////////////////////////////////////////////
00348 //                                                                          //
00349 // Gets the "best" outgoing interface for the specified destination address //
00350 //                                                                          //
00351 //////////////////////////////////////////////////////////////////////////////
00352 
00353 DWORD
00354 WINAPI
00355 GetBestInterface(
00356     IN  IPAddr  dwDestAddr,
00357     OUT PDWORD  pdwBestIfIndex
00358     );
00359 
00360 //////////////////////////////////////////////////////////////////////////////
00361 //                                                                          //
00362 // Gets the best (longest matching prefix) route for the given destination  //
00363 // If the source address is also specified (i.e. is not 0x00000000), and    //
00364 // there are multiple "best" routes to the given destination, the returned  //
00365 // route will be one that goes out over the interface which has an address  //
00366 // that matches the source address                                          //
00367 //                                                                          //
00368 //////////////////////////////////////////////////////////////////////////////
00369 
00370 DWORD
00371 WINAPI
00372 GetBestRoute(
00373     IN  DWORD               dwDestAddr,
00374     IN  DWORD               dwSourceAddr, OPTIONAL
00375     OUT PMIB_IPFORWARDROW   pBestRoute
00376     );
00377 
00378 DWORD
00379 WINAPI
00380 NotifyAddrChange(
00381     OUT PHANDLE      Handle,
00382     IN  LPOVERLAPPED overlapped
00383     );
00384 
00385 
00386 DWORD
00387 WINAPI
00388 NotifyRouteChange(
00389     OUT PHANDLE      Handle,
00390     IN  LPOVERLAPPED overlapped
00391     );
00392 
00393 
00394 DWORD
00395 WINAPI
00396 GetAdapterIndex(
00397     IN LPWSTR  AdapterName,
00398     OUT PULONG IfIndex
00399     );
00400 
00401 DWORD
00402 WINAPI
00403 AddIPAddress(
00404     IPAddr  Address,
00405     IPMask  IpMask,
00406     DWORD   IfIndex,
00407     PULONG  NTEContext,
00408     PULONG  NTEInstance
00409     );
00410 
00411 DWORD
00412 WINAPI
00413 DeleteIPAddress(
00414     ULONG NTEContext
00415     );
00416 
00417 DWORD
00418 WINAPI
00419 GetNetworkParams(
00420     PFIXED_INFO pFixedInfo, PULONG pOutBufLen
00421     );
00422 
00423 DWORD
00424 WINAPI
00425 GetAdaptersInfo(
00426     PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen
00427     );
00428 
00429 DWORD
00430 WINAPI
00431 GetPerAdapterInfo(
00432     ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen
00433     );
00434 
00435 DWORD
00436 WINAPI
00437 IpReleaseAddress(
00438     PIP_ADAPTER_INDEX_MAP  AdapterInfo
00439     );
00440 
00441 
00442 DWORD
00443 WINAPI
00444 IpRenewAddress(
00445     PIP_ADAPTER_INDEX_MAP  AdapterInfo
00446     );
00447 
00448 DWORD
00449 WINAPI
00450 SendARP(
00451     IPAddr DestIP,
00452     IPAddr SrcIP,
00453     PULONG pMacAddr,
00454     PULONG  PhyAddrLen
00455     );
00456 
00457 BOOL
00458 WINAPI
00459 GetRTTAndHopCount(
00460     IPAddr DestIpAddress,
00461     PULONG HopCount,
00462     ULONG  MaxHops,
00463     PULONG RTT
00464     );
00465 
00466 DWORD
00467 WINAPI
00468 GetFriendlyIfIndex(
00469     DWORD IfIndex
00470     );
00471 
00472 DWORD
00473 WINAPI
00474 EnableRouter(
00475     HANDLE* pHandle,
00476     OVERLAPPED* pOverlapped
00477     );
00478 
00479 DWORD
00480 WINAPI
00481 UnenableRouter(
00482     OVERLAPPED* pOverlapped,
00483     LPDWORD lpdwEnableCount OPTIONAL
00484     );
00485 
00486 #ifdef __cplusplus
00487 }
00488 #endif
00489 
00490 #endif //__IPHLPAPI_H__
00491 
00492 

Generated on Sun May 14 14:51:19 2006 by  doxygen 1.4.2