/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
iphlpapi.h
Abstract:
Header file for functions to interact with the IP Stack for MIB-II and
related functionality
--*/
#ifndef __IPHLPAPI_H__
#define __IPHLPAPI_H__
#if _MSC_VER > 1000
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
//////////////////////////////////////////////////////////////////////////////
// //
// IPRTRMIB.H has the definitions of the strcutures used to set and get //
// information //
// //
//////////////////////////////////////////////////////////////////////////////
#include "iprtrmib.h"
#include "ipexport.h"
#include "iptypes.h"
//////////////////////////////////////////////////////////////////////////////
// //
// The GetXXXTable APIs take a buffer and a size of buffer. If the buffer //
// is not large enough, the APIs return ERROR_INSUFFICIENT_BUFFER and //
// *pdwSize is the required buffer size //
// The bOrder is a BOOLEAN, which if TRUE sorts the table according to //
// MIB-II (RFC XXXX) //
// //
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// //
// Retrieves the number of interfaces in the system. These include LAN and //
// WAN interfaces //
// //
//////////////////////////////////////////////////////////////////////////////
DWORD
WINAPI
GetNumberOfInterfaces(
OUT PDWORD pdwNumIf
);
//////////////////////////////////////////////////////////////////////////////
// //
// Gets the MIB-II ifEntry //
// The dwIndex field of the MIB_IFROW should be set to the index of the //
// interface being queried //
// //
//////////////////////////////////////////////////////////////////////////////
DWORD
WINAPI
GetIfEntry(
IN OUT PMIB_IFROW pIfRow
);
//////////////////////////////////////////////////////////////////////////////
// //
// Gets the MIB-II IfTable //
// //
//////////////////////////////////////////////////////////////////////////////
DWORD
WINAPI
GetIfTable(
OUT PMIB_IFTABLE pIfTable,
IN OUT PULONG pdwSize,
IN BOOL bOrder
);
//////////////////////////////////////////////////////////////////////////////
// //
// Gets the Interface to IP Address mapping //
// //
//////////////////////////////////////////////////////////////////////////////
DWORD
WINAPI
GetIpAddrTable(
OUT PMIB_IPADDRTABLE pIpAddrTable,
IN OUT PULONG pdwSize,
IN BOOL bOrder
);
//////////////////////////////////////////////////////////////////////////////
// //
// Gets the current IP Address to Physical Address (ARP) mapping //
// //
//////////////////////////////////////////////////////////////////////////////
DWORD
WINAPI
GetIpNetTable(
OUT PMIB_IPNETTABLE pIpNetTable,
IN OUT PULONG pdwSize,
IN BOOL bOrder
);
//////////////////////////////////////////////////////////////////////////////
// //
// Gets the IP Routing Table (RFX XXXX) //
// //
//////////////////////////////////////////////////////////////////////////////
DWORD
WINAPI
GetIpForwardTable(
OUT PMIB_IPFORWARDTABLE pIpForwardTable,
IN OUT PULONG pdwSize,
IN BOOL bOrder
);
//////////////////////////////////////////////////////////////////////////////
// //
// Gets TCP Connection/UDP Listener Table //
// //
//////////////////////////////////////////////////////////////////////////////
DWORD
WINAPI
GetTcpTable(
OUT PMIB_TCPTABLE pTcpTable,
IN OUT PDWORD pdwSize,
IN BOOL bOrder
);
DWORD
WINAPI
GetUdpTable(
OUT PMIB_UDPTABLE pUdpTable,
IN OUT PDWORD pdwSize,
IN BOOL bOrder
);
//////////////////////////////////////////////////////////////////////////////
// //
// Gets IP/ICMP/TCP/UDP Statistics //
// //
//////////////////////////////////////////////////////////////////////////////
DWORD
WINAPI
GetIpStatistics(
OUT PMIB_IPSTATS pStats
);
DWORD
WINAPI
GetIpStatisticsEx(
OUT PMIB_IPSTATS pStats,
IN DWORD dwFamily
);
DWORD
WINAPI
GetIcmpStatistics(
OUT PMIB_ICMP pStats
);
DWORD
WINAPI
GetTcpStatistics(
OUT PMIB_TCPSTATS pStats
);
DWORD
WINAPI
GetTcpStatisticsEx(
OUT PMIB_TCPSTATS pStats,
IN DWORD dwFamily
);
DWORD
WINAPI
GetUdpStatistics(
OUT PMIB_UDPSTATS pStats
);
DWORD
WINAPI
GetUdpStatisticsEx(
OUT PMIB_UDPSTATS pStats,
IN DWORD dwFamily
);
//////////////////////////////////////////////////////////////////////////////
// //
// Used to set the ifAdminStatus on an interface. The only fields of the //
// MIB_IFROW that are relevant are the dwIndex (index of the interface //
// whose status needs to be set) and the dwAdminStatus which can be either //
// MIB_IF_ADMIN_STATUS_UP or MIB_IF_ADMIN_STATUS_DOWN //
// //
//////////////////////////////////////////////////////////////////////////////
DWORD
WINAPI
SetIfEntry(
IN PMIB_IFROW pIfRow
);
//////////////////////////////////////////////////////////////////////////////
// //
// Used to create, modify or delete a route. In all cases the //
// dwForwardIfIndex, dwForwardDest, dwForwardMask, dwForwardNextHop and //
// dwForwardPolicy MUST BE SPECIFIED. Currently dwForwardPolicy is unused //
// and MUST BE 0. //
// For a set,
- 1
- 2
前往页