Unit IPHlpAPI

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Ultibo IP Helper Interface unit

This unit provides a subset of the Windows IP Helper API functions for querying and managing configuration of the TCP/IP transport and associated protocols.

Note: Not all functions are currently implemented, more will be added as they are required.

Constants



[Expand]
IP helper specific constants MAX_ADAPTER_*


[Expand]
MIB operation status MIB_IF_OPER_STATUS_*


[Expand]
MIB type MIB_IF_TYPE_*


[Expand]
MIB admin status MIB_IF_ADMIN_STATUS_*


[Expand]
MIB TCP MIB_TCP_*


[Expand]
MIB TCP state MIB_TCP_STATE_*


[Expand]
MIB current MIB_USE_CURRENT_*


[Expand]
MIB IP MIB_IP_*


[Expand]
MIB IP route type MIB_IPROUTE_*


[Expand]
MIB IP protocol MIB_IPPROTO_*


[Expand]
MIB IP network type MIB_IPNET_*


Type definitions



IP address

IPAddr = Cardinal; An IP address

IP mask

IPMask = Cardinal; An IP netmask

IP status

IP_STATUS = Cardinal; Status code returned from IP APIs

MIB if number

[Expand]

TMibIfnumber = MIB_IFNUMBER;

PMibIfnumber = PMIB_IFNUMBER;

PMIB_IFNUMBER = ^MIB_IFNUMBER;

MIB_IFNUMBER = record

MIB if row

[Expand]

TMibIfRow = MIB_IFROW;

PMibIfRow = PMIB_IFROW;

PMIB_IFROW = ^MIB_IFROW;

MIB_IFROW = record

MIB if table

[Expand]

TMibIftable = MIB_IFTABLE;

PMibIftable = PMIB_IFTABLE;

PMIB_IFTABLE = ^MIB_IFTABLE;

MIB_IFTABLE = record

MIB ICMP statistics

[Expand]

TMibIcmpStats = MIBICMPSTATS;

PMibIcmpStats = ^TMibIcmpStats;

MIBICMPSTATS = record

MIB ICMP information

[Expand]

TMibIcmpInfo = MIBICMPINFO;

PMibIcmpInfo = ^TMibIcmpInfo;

MIBICMPINFO = record

MIB ICMP

[Expand]

TMibIcmp = MIB_ICMP;

PMibIcmp = PMIB_ICMP;

PMIB_ICMP = ^MIB_ICMP;

MIB_ICMP = record

MIB UDP statistics

[Expand]

TMibUdpStats = MIB_UDPSTATS;

PMibUdpStats = PMIB_UDPSTATS;

PMIB_UDPSTATS = ^MIB_UDPSTATS;

MIB_UDPSTATS = record

MIB UDP row

[Expand]

TMibUdpRow = MIB_UDPROW;

PMibUdpRow = PMIB_UDPROW;

PMIB_UDPROW = ^MIB_UDPROW;

MIB_UDPROW = record

MIB UDP table

[Expand]

TMibUdpTable = MIB_UDPTABLE;

PMibUdpTable = PMIB_UDPTABLE;

PMIB_UDPTABLE = ^MIB_UDPTABLE;

MIB_UDPTABLE = record

MIB TCP statistics

[Expand]

TMibTcpStats = MIB_TCPSTATS;

PMibTcpStats = PMIB_TCPSTATS;

PMIB_TCPSTATS = ^MIB_TCPSTATS;

MIB_TCPSTATS = record

MIB TCP row

[Expand]

TMibTcpRow = MIB_TCPROW;

PMibTcpRow = PMIB_TCPROW;

PMIB_TCPROW = ^MIB_TCPROW;

MIB_TCPROW = record

MIB TCP table

[Expand]

TMibTcpTable = MIB_TCPTABLE;

PMibTcpTable = PMIB_TCPTABLE;

PMIB_TCPTABLE = ^MIB_TCPTABLE;

MIB_TCPTABLE = record

MIB IP statistics

[Expand]

TMibIpStats = MIB_IPSTATS;

PMibIpStats = PMIB_IPSTATS;

PMIB_IPSTATS = ^MIB_IPSTATS;

MIB_IPSTATS = record

MIB IP address row

[Expand]

TMibIpAddrRow = MIB_IPADDRROW;

PMibIpAddrRow = PMIB_IPADDRROW;

PMIB_IPADDRROW = ^MIB_IPADDRROW;

MIB_IPADDRROW = record

MIB IP address table

[Expand]

TMibIpAddrTable = MIB_IPADDRTABLE;

PMibIpAddrTable = PMIB_IPADDRTABLE;

PMIB_IPADDRTABLE = ^MIB_IPADDRTABLE;

MIB_IPADDRTABLE = record

MIB IP forward number

[Expand]

TMibIpForwardNumber = MIB_IPFORWARDNUMBER;

PMibIpForwardNumber = PMIB_IPFORWARDNUMBER;

PMIB_IPFORWARDNUMBER = ^MIB_IPFORWARDNUMBER;

MIB_IPFORWARDNUMBER = record

MIB IP forward row

[Expand]

TMibIpForwardRow = MIB_IPFORWARDROW;

PMibIpForwardRow = PMIB_IPFORWARDROW;

PMIB_IPFORWARDROW = ^MIB_IPFORWARDROW;

MIB_IPFORWARDROW = record

MIB IP forward table

[Expand]

TMibIpForwardTable = MIB_IPFORWARDTABLE;

PMibIpForwardTable = PMIB_IPFORWARDTABLE;

PMIB_IPFORWARDTABLE = ^MIB_IPFORWARDTABLE;

MIB_IPFORWARDTABLE = record

MIB IP net row

[Expand]

TMibIpNetRow = MIB_IPNETROW;

PMibIpNetRow = PMIB_IPNETROW;

PMIB_IPNETROW = ^MIB_IPNETROW;

MIB_IPNETROW = record

MIB IP net table

[Expand]

TMibIpNetTable = MIB_IPNETTABLE;

PMibIpNetTable = PMIB_IPNETTABLE;

PMIB_IPNETTABLE = ^MIB_IPNETTABLE;

MIB_IPNETTABLE = record

IP adapter index map

[Expand]

TIpAdapterIndexMap = IP_ADAPTER_INDEX_MAP;

PIpAdapterIndexMap = PIP_ADAPTER_INDEX_MAP;

PIP_ADAPTER_INDEX_MAP = ^IP_ADAPTER_INDEX_MAP;

IP_ADAPTER_INDEX_MAP = record

IP interface info

[Expand]

TIpInterfaceInfo = IP_INTERFACE_INFO;

PIpInterfaceInfo = PIP_INTERFACE_INFO;

PIP_INTERFACE_INFO = ^IP_INTERFACE_INFO;

IP_INTERFACE_INFO = record

IP unidirectional adapter address

[Expand]

TIpUnidirectionalAdapterAddress = IP_UNIDIRECTIONAL_ADAPTER_ADDRESS;

PIpUnidirectionalAdapterAddress = PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS;

PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS = ^IP_UNIDIRECTIONAL_ADAPTER_ADDRESS;

IP_UNIDIRECTIONAL_ADAPTER_ADDRESS = record

IP address string

[Expand]

TIpAddressString = IP_ADDRESS_STRING;

PIpAddressString = PIP_MASK_STRING;

PIP_ADDRESS_STRING = ^IP_ADDRESS_STRING;

IP_MASK_STRING = IP_ADDRESS_STRING;

PIP_MASK_STRING = ^IP_MASK_STRING;

IP_ADDRESS_STRING = record

IP addr string

[Expand]

TIpAddrString = IP_ADDR_STRING;

PIpAddrString = PIP_ADDR_STRING;

PIP_ADDR_STRING = ^IP_ADDR_STRING;

IP_ADDR_STRING = record

IP adapter information

[Expand]

TIpAdapterInfo = IP_ADAPTER_INFO;

PIpAdapterInfo = PIP_ADAPTER_INFO;

PIP_ADAPTER_INFO = ^IP_ADAPTER_INFO;

IP_ADAPTER_INFO = record

IP per adapter information

[Expand]

TIpPerAdapterInfo = IP_PER_ADAPTER_INFO;

PIpPerAdapterInfo = PIP_PER_ADAPTER_INFO;

PIP_PER_ADAPTER_INFO = ^IP_PER_ADAPTER_INFO;

IP_PER_ADAPTER_INFO = record

Fixed information

[Expand]

TFixedInfo = FIXED_INFO;

PFixedInfo = PFIXED_INFO;

PFIXED_INFO = ^FIXED_INFO;

FIXED_INFO = record


Public variables


None defined

Function declarations



Initialization functions

[Expand]
function IPHelperStart:Boolean;
Description: Initialize and start the Winsock2 provider


[Expand]
function IPHelperStop:Boolean;
Description: Terminate and stop the Winsock2 provider


Helper functions

[Expand]
function IPHelperConvertError(Status:Integer):DWORD;
Description: Convert a Winsock2 error to an error code


IP helper functions

[Expand]
function GetNumberOfInterfaces(var pdwNumIf: DWORD): DWORD;
Description: To be documented


[Expand]
function GetIfEntry(pIfRow: PMIB_IFROW): DWORD;
Description: To be documented


[Expand]
function GetIfTable(pIfTable: PMIB_IFTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: To be documented


[Expand]
function GetIpAddrTable(pIpAddrTable: PMIB_IPADDRTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: To be documented


[Expand]
function GetIpNetTable(pIpNetTable: PMIB_IPNETTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: To be documented


[Expand]
function GetIpForwardTable(pIpForwardTable: PMIB_IPFORWARDTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: To be documented


[Expand]
function GetTcpTable(pTcpTable: PMIB_TCPTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: To be documented


[Expand]
function GetUdpTable(pUdpTable: PMIB_UDPTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: To be documented


[Expand]
function GetIpStatistics(var pStats: MIB_IPSTATS): DWORD;
Description: To be documented


[Expand]
function GetIcmpStatistics(var pStats: MIB_ICMP): DWORD;
Description: To be documented


[Expand]
function GetTcpStatistics(var pStats: MIB_TCPSTATS): DWORD;
Description: To be documented


[Expand]
function GetUdpStatistics(var pStats: MIB_UDPSTATS): DWORD;
Description: To be documented


[Expand]
function SetIfEntry(const pIfRow: MIB_IFROW): DWORD;
Description: To be documented


[Expand]
function CreateIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD;
Description: To be documented


[Expand]
function SetIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD;
Description: To be documented


[Expand]
function DeleteIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD;
Description: To be documented


[Expand]
function SetIpStatistics(const pIpStats: MIB_IPSTATS): DWORD;
Description: To be documented


[Expand]
function SetIpTTL(nTTL: UINT): DWORD;
Description: To be documented


[Expand]
function CreateIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD;
Description: To be documented


[Expand]
function SetIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD;
Description: To be documented


[Expand]
function DeleteIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD;
Description: To be documented


[Expand]
function FlushIpNetTable(dwIfIndex: DWORD): DWORD;
Description: To be documented


[Expand]
function CreateProxyArpEntry(dwAddress, dwMask, dwIfIndex: DWORD): DWORD;
Description: To be documented


[Expand]
function DeleteProxyArpEntry(dwAddress, dwMask, dwIfIndex: DWORD): DWORD;
Description: To be documented


[Expand]
function SetTcpEntry(const pTcpRow: MIB_TCPROW): DWORD;
Description: To be documented


[Expand]
function GetInterfaceInfo(pIfTable: PIP_INTERFACE_INFO; var dwOutBufLen: DWORD): DWORD;
Description: To be documented


[Expand]
function GetUniDirectionalAdapterInfo(pIPIfInfo: PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS; var dwOutBufLen: DWORD): DWORD;
Description: To be documented


[Expand]
function GetBestInterface(dwDestAddr: IPAddr; var pdwBestIfIndex: DWORD): DWORD;
Description: To be documented


[Expand]
function GetBestRoute(dwDestAddr, dwSourceAddr: DWORD; pBestRoute: PMIB_IPFORWARDROW): DWORD;
Description: To be documented


[Expand]
function NotifyAddrChange(var Handle: THandle; overlapped: POVERLAPPED): DWORD;
Description: To be documented


[Expand]
function NotifyRouteChange(var Handle: THandle; overlapped: POVERLAPPED): DWORD;
Description: To be documented


[Expand]
function GetAdapterIndex(AdapterName: LPWSTR; var IfIndex: DWORD): DWORD;
Description: To be documented


[Expand]
function AddIPAddress(Address: IPAddr; IpMask: IPMask; IfIndex: DWORD; var NTEContext, NTEInstance: DWORD): DWORD;
Description: To be documented


[Expand]
function DeleteIPAddress(NTEContext: DWORD): DWORD;
Description: To be documented


[Expand]
function GetNetworkParams(pFixedInfo: PFIXED_INFO; var pOutBufLen: DWORD): DWORD;
Description: To be documented


[Expand]
function GetAdaptersInfo(pAdapterInfo: PIP_ADAPTER_INFO; var pOutBufLen: DWORD): DWORD;
Description: To be documented


[Expand]
function GetPerAdapterInfo(IfIndex: DWORD; pPerAdapterInfo: PIP_PER_ADAPTER_INFO; var pOutBufLen: DWORD): DWORD;
Description: To be documented


[Expand]
function IpReleaseAddress(const AdapterInfo: IP_ADAPTER_INDEX_MAP): DWORD;
Description: To be documented


[Expand]
function IpRenewAddress(const AdapterInfo: IP_ADAPTER_INDEX_MAP): DWORD;
Description: To be documented


[Expand]
function SendARP(const DestIP, SrcIP: IPAddr; pMacAddr: PDWORD; var PhyAddrLen: DWORD): DWORD;
Description: To be documented


[Expand]
function GetRTTAndHopCount(DestIpAddress: IPAddr; var HopCount: DWORD; MaxHops: DWORD; var RTT: DWORD): BOOL;
Description: To be documented


[Expand]
function GetFriendlyIfIndex(IfIndex: DWORD): DWORD;
Description: To be documented


[Expand]
function EnableRouter(var pHandle: THandle; pOverlapped: POVERLAPPED): DWORD;
Description: To be documented


[Expand]
function UnenableRouter(pOverlapped: POVERLAPPED; lpdwEnableCount: LPDWORD): DWORD;
Description: To be documented


IP helper helper functions

[Expand]
function MIBIFOperStatusToString(AValue:DWORD):String;
Description: To be documented


[Expand]
function MIBIFTypeToString(AValue:DWORD):String;
Description: To be documented


[Expand]
function MIBIFAdminStatusToString(AValue:DWORD):String;
Description: To be documented


[Expand]
function MIBTCPRTOToString(AValue:DWORD):String;
Description: To be documented


[Expand]
function MIBTCPStateToString(AValue:DWORD):String;
Description: To be documented


[Expand]
function MIBIPForwardingToString(AValue:DWORD):String;
Description: To be documented


[Expand]
function MIBIPRouteTypeToString(AValue:DWORD):String;
Description: To be documented


[Expand]
function MIBIPProtoToString(AValue:DWORD):String;
Description: To be documented


[Expand]
function MIBIPNetTypeToString(AValue:DWORD):String;
Description: To be documented


Return to Unit Reference