📄 iphlpapi.pas
字号:
{$ELSE}
var
GetIpStatistics: function (var pStats: MIB_IPSTATS): DWORD; stdcall;
{$EXTERNALSYM GetIpStatistics}
GetIcmpStatistics: function (var pStats: MIB_ICMP): DWORD; stdcall;
{$EXTERNALSYM GetIcmpStatistics}
GetTcpStatistics: function (var pStats: MIB_TCPSTATS): DWORD; stdcall;
{$EXTERNALSYM GetTcpStatistics}
GetUdpStatistics: function (var pStats: MIB_UDPSTATS): DWORD; stdcall;
{$EXTERNALSYM GetUdpStatistics}
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
// //
// 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 //
// //
//////////////////////////////////////////////////////////////////////////////
{$IFNDEF IPHLPAPI_DYNLINK}
function SetIfEntry(const pIfRow: MIB_IFROW): DWORD; stdcall;
{$EXTERNALSYM SetIfEntry}
{$ELSE}
var
SetIfEntry: function (const pIfRow: MIB_IFROW): DWORD; stdcall;
{$EXTERNALSYM SetIfEntry}
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
// //
// 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, the complete MIB_IPFORWARDROW structure must be specified //
// //
//////////////////////////////////////////////////////////////////////////////
{$IFNDEF IPHLPAPI_DYNLINK}
function CreateIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD; stdcall;
{$EXTERNALSYM CreateIpForwardEntry}
function SetIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD; stdcall;
{$EXTERNALSYM SetIpForwardEntry}
function DeleteIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD; stdcall;
{$EXTERNALSYM DeleteIpForwardEntry}
{$ELSE}
var
CreateIpForwardEntry: function (const pRoute: MIB_IPFORWARDROW): DWORD; stdcall;
{$EXTERNALSYM CreateIpForwardEntry}
SetIpForwardEntry: function (const pRoute: MIB_IPFORWARDROW): DWORD; stdcall;
{$EXTERNALSYM SetIpForwardEntry}
DeleteIpForwardEntry: function (const pRoute: MIB_IPFORWARDROW): DWORD; stdcall;
{$EXTERNALSYM DeleteIpForwardEntry}
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
// //
// Used to set the ipForwarding to ON or OFF (currently only ON->OFF is //
// allowed) and to set the defaultTTL. If only one of the fields needs to //
// be modified and the other needs to be the same as before the other field //
// needs to be set to MIB_USE_CURRENT_TTL or MIB_USE_CURRENT_FORWARDING as //
// the case may be //
// //
//////////////////////////////////////////////////////////////////////////////
{$IFNDEF IPHLPAPI_DYNLINK}
function SetIpStatistics(const pIpStats: MIB_IPSTATS): DWORD; stdcall;
{$EXTERNALSYM SetIpStatistics}
{$ELSE}
var
SetIpStatistics: function (const pIpStats: MIB_IPSTATS): DWORD; stdcall;
{$EXTERNALSYM SetIpStatistics}
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
// //
// Used to set the defaultTTL. //
// //
//////////////////////////////////////////////////////////////////////////////
{$IFNDEF IPHLPAPI_DYNLINK}
function SetIpTTL(nTTL: UINT): DWORD; stdcall;
{$EXTERNALSYM SetIpTTL}
{$ELSE}
SetIpTTL: function (nTTL: UINT): DWORD; stdcall;
{$EXTERNALSYM SetIpTTL}
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
// //
// Used to create, modify or delete an ARP entry. In all cases the dwIndex //
// dwAddr field MUST BE SPECIFIED. //
// For a set, the complete MIB_IPNETROW structure must be specified //
// //
//////////////////////////////////////////////////////////////////////////////
{$IFNDEF IPHLPAPI_DYNLINK}
function CreateIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD; stdcall;
{$EXTERNALSYM CreateIpNetEntry}
function SetIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD; stdcall;
{$EXTERNALSYM SetIpNetEntry}
function DeleteIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD; stdcall;
{$EXTERNALSYM DeleteIpNetEntry}
function FlushIpNetTable(dwIfIndex: DWORD): DWORD; stdcall;
{$EXTERNALSYM FlushIpNetTable}
{$ELSE}
var
CreateIpNetEntry: function (const pArpEntry: MIB_IPNETROW): DWORD; stdcall;
{$EXTERNALSYM CreateIpNetEntry}
SetIpNetEntry: function (const pArpEntry: MIB_IPNETROW): DWORD; stdcall;
{$EXTERNALSYM SetIpNetEntry}
DeleteIpNetEntry: function (const pArpEntry: MIB_IPNETROW): DWORD; stdcall;
{$EXTERNALSYM DeleteIpNetEntry}
FlushIpNetTable: function (dwIfIndex: DWORD): DWORD; stdcall;
{$EXTERNALSYM FlushIpNetTable}
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
// //
// Used to create or delete a Proxy ARP entry. The dwIndex is the index of //
// the interface on which to PARP for the dwAddress. If the interface is //
// of a type that doesnt support ARP, e.g. PPP, then the call will fail //
// //
//////////////////////////////////////////////////////////////////////////////
{$IFNDEF IPHLPAPI_DYNLINK}
function CreateProxyArpEntry(dwAddress, dwMask, dwIfIndex: DWORD): DWORD; stdcall;
{$EXTERNALSYM CreateProxyArpEntry}
function DeleteProxyArpEntry(dwAddress, dwMask, dwIfIndex: DWORD): DWORD; stdcall;
{$EXTERNALSYM DeleteProxyArpEntry}
{$ELSE}
var
CreateProxyArpEntry: function (dwAddress, dwMask, dwIfIndex: DWORD): DWORD; stdcall;
{$EXTERNALSYM CreateProxyArpEntry}
DeleteProxyArpEntry: function (dwAddress, dwMask, dwIfIndex: DWORD): DWORD; stdcall;
{$EXTERNALSYM DeleteProxyArpEntry}
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
// //
// Used to set the state of a TCP Connection. The only state that it can be //
// set to is MIB_TCP_STATE_DELETE_TCB. The complete MIB_TCPROW structure //
// MUST BE SPECIFIED //
// //
//////////////////////////////////////////////////////////////////////////////
{$IFNDEF IPHLPAPI_DYNLINK}
function SetTcpEntry(const pTcpRow: MIB_TCPROW): DWORD; stdcall;
{$EXTERNALSYM SetTcpEntry}
function GetInterfaceInfo(pIfTable: PIP_INTERFACE_INFO; var dwOutBufLen: ULONG): DWORD; stdcall;
{$EXTERNALSYM GetInterfaceInfo}
function GetUniDirectionalAdapterInfo(pIPIfInfo: PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS;
var dwOutBufLen: ULONG): DWORD; stdcall;
{$EXTERNALSYM GetUniDirectionalAdapterInfo(OUT PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo}
{$ELSE}
var
SetTcpEntry: function (const pTcpRow: MIB_TCPROW): DWORD; stdcall;
{$EXTERNALSYM SetTcpEntry}
GetInterfaceInfo: function (pIfTable: PIP_INTERFACE_INFO; var dwOutBufLen: ULONG): DWORD; stdcall;
{$EXTERNALSYM GetInterfaceInfo}
GetUniDirectionalAdapterInfo: function (pIPIfInfo: PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS;
var dwOutBufLen: ULONG): DWORD; stdcall;
{$EXTERNALSYM GetUniDirectionalAdapterInfo(OUT PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo}
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
// //
// Gets the "best" outgoing interface for the specified destination address //
// //
//////////////////////////////////////////////////////////////////////////////
{$IFNDEF IPHLPAPI_DYNLINK}
function GetBestInterface(dwDestAddr: IPAddr; var pdwBestIfIndex: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetBestInterface}
{$ELSE}
var
GetBestInterface: function (dwDestAddr: IPAddr; var pdwBestIfIndex: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetBestInterface}
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
// //
// Gets the best (longest matching prefix) route for the given destination //
// If the source address is also specified (i.e. is not 0x00000000), and //
// there are multiple "best" routes to the given destination, the returned //
// route will be one that goes out over the interface which has an address //
// that matches the source address //
// //
//////////////////////////////////////////////////////////////////////////////
{$IFNDEF IPHLPAPI_DYNLINK}
function GetBestRoute(dwDestAddr, dwSourceAddr: DWORD; pBestRoute: PMIB_IPFORWARDROW): DWORD; stdcall;
{$EXTERNALSYM GetBestRoute}
function NotifyAddrChange(var Handle: THandle; overlapped: POVERLAPPED): DWORD; stdcall;
{$EXTERNALSYM NotifyAddrChange}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -