Unit IPHlpAPI

From Ultibo.org
Revision as of 03:54, 6 November 2025 by Ultibo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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



IP helper specific constants MAX_ADAPTER_*
MAX_INTERFACE_NAME_LEN = 256;  
IPRTRMGR_PID = 10000;  
ANY_SIZE = 1;  
 
MAX_ADAPTER_NAME = 128;  
 
MAX_ADAPTER_DESCRIPTION_LENGTH = 128;  
MAX_ADAPTER_NAME_LENGTH = 256;  
MAX_ADAPTER_ADDRESS_LENGTH = 8;  
DEFAULT_MINIMUM_ENTITIES = 32;  
MAX_HOSTNAME_LEN = 128;  
MAX_DOMAIN_NAME_LEN = 128;  
MAX_SCOPE_ID_LEN = 256;  
 
MAXLEN_IFDESCR = 256;  
MAXLEN_PHYSADDR = 8;  


MIB operation status MIB_IF_OPER_STATUS_*
MIB_IF_OPER_STATUS_NON_OPERATIONAL = 0;  
MIB_IF_OPER_STATUS_UNREACHABLE = 1;  
MIB_IF_OPER_STATUS_DISCONNECTED = 2;  
MIB_IF_OPER_STATUS_CONNECTING = 3;  
MIB_IF_OPER_STATUS_CONNECTED = 4;  
MIB_IF_OPER_STATUS_OPERATIONAL = 5;  


MIB type MIB_IF_TYPE_*
MIB_IF_TYPE_OTHER = 1;  
MIB_IF_TYPE_ETHERNET = 6;  
MIB_IF_TYPE_TOKENRING = 9;  
MIB_IF_TYPE_FDDI = 15;  
MIB_IF_TYPE_PPP = 23;  
MIB_IF_TYPE_LOOPBACK = 24;  
MIB_IF_TYPE_SLIP = 28;  
MIB_IF_TYPE_IEEE80211 = 71;  
 
IF_TYPE_OTHER = MIB_IF_TYPE_OTHER;  
IF_TYPE_ETHERNET_CSMACD = MIB_IF_TYPE_ETHERNET;  
IF_TYPE_ISO88025_TOKENRING = MIB_IF_TYPE_TOKENRING;  
IF_TYPE_FDDI = MIB_IF_TYPE_FDDI;  
IF_TYPE_PPP = MIB_IF_TYPE_PPP;  
IF_TYPE_SOFTWARE_LOOPBACK = MIB_IF_TYPE_LOOPBACK;  
IF_TYPE_SLIP = MIB_IF_TYPE_SLIP;  
IF_TYPE_ATM = 37;  
IF_TYPE_IEEE80211 = MIB_IF_TYPE_IEEE80211;  
IF_TYPE_TUNNEL = 131;  
IF_TYPE_IEEE1394 = 144;  
IF_TYPE_IEEE80216_WMAN = 237;  
IF_TYPE_WWANPP = 243;  
IF_TYPE_WWANPP2 = 244;  


MIB admin status MIB_IF_ADMIN_STATUS_*
MIB_IF_ADMIN_STATUS_UP = 1;  
MIB_IF_ADMIN_STATUS_DOWN = 2;  
MIB_IF_ADMIN_STATUS_TESTING = 3;  


MIB TCP MIB_TCP_*
MIB_TCP_RTO_OTHER = 1;  
MIB_TCP_RTO_CONSTANT = 2;  
MIB_TCP_RTO_RSRE = 3;  
MIB_TCP_RTO_VANJ = 4;  
MIB_TCP_MAXCONN_DYNAMIC = DWORD(-1);  


MIB TCP state MIB_TCP_STATE_*
MIB_TCP_STATE_CLOSED = 1;  
MIB_TCP_STATE_LISTEN = 2;  
MIB_TCP_STATE_SYN_SENT = 3;  
MIB_TCP_STATE_SYN_RCVD = 4;  
MIB_TCP_STATE_ESTAB = 5;  
MIB_TCP_STATE_FIN_WAIT1 = 6;  
MIB_TCP_STATE_FIN_WAIT2 = 7;  
MIB_TCP_STATE_CLOSE_WAIT = 8;  
MIB_TCP_STATE_CLOSING = 9;  
MIB_TCP_STATE_LAST_ACK = 10;  
MIB_TCP_STATE_TIME_WAIT = 11;  
MIB_TCP_STATE_DELETE_TCB = 12;  


MIB current MIB_USE_CURRENT_*
MIB_USE_CURRENT_TTL = DWORD(-1);  
MIB_USE_CURRENT_FORWARDING = DWORD(-1);  


MIB IP MIB_IP_*
MIB_IP_FORWARDING = 1;  
MIB_IP_NOT_FORWARDING = 2;  


MIB IP route type MIB_IPROUTE_*
MIB_IPROUTE_TYPE_OTHER = 1;  
MIB_IPROUTE_TYPE_INVALID = 2;  
MIB_IPROUTE_TYPE_DIRECT = 3;  
MIB_IPROUTE_TYPE_INDIRECT = 4;  
MIB_IPROUTE_METRIC_UNUSED = DWORD(-1);  


MIB IP protocol MIB_IPPROTO_*
MIB_IPPROTO_OTHER = 1;  
MIB_IPPROTO_LOCAL = 2;  
MIB_IPPROTO_NETMGMT = 3;  
MIB_IPPROTO_ICMP = 4;  
MIB_IPPROTO_EGP = 5;  
MIB_IPPROTO_GGP = 6;  
MIB_IPPROTO_HELLO = 7;  
MIB_IPPROTO_RIP = 8;  
MIB_IPPROTO_IS_IS = 9;  
MIB_IPPROTO_ES_IS = 10;  
MIB_IPPROTO_CISCO = 11;  
MIB_IPPROTO_BBN = 12;  
MIB_IPPROTO_OSPF = 13;  
MIB_IPPROTO_BGP = 14;  
MIB_IPPROTO_NT_AUTOSTATIC = 10002;  
MIB_IPPROTO_NT_STATIC = 10006;  
MIB_IPPROTO_NT_STATIC_NON_DOD = 10007;  


MIB IP network type MIB_IPNET_*
MIB_IPNET_TYPE_OTHER = 1;  
MIB_IPNET_TYPE_INVALID = 2;  
MIB_IPNET_TYPE_DYNAMIC = 3;  
MIB_IPNET_TYPE_STATIC = 4;  


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

TMibIfnumber = MIB_IFNUMBER;

PMibIfnumber = PMIB_IFNUMBER;

PMIB_IFNUMBER = ^MIB_IFNUMBER;

MIB_IFNUMBER = record

dwValue: DWORD;  

MIB if row

TMibIfRow = MIB_IFROW;

PMibIfRow = PMIB_IFROW;

PMIB_IFROW = ^MIB_IFROW;

MIB_IFROW = record

wszName: array [0..MAX_INTERFACE_NAME_LEN - 1] of WideChar;  
dwIndex: DWORD;  
dwType: DWORD;  
dwMtu: DWORD;  
dwSpeed: DWORD;  
dwPhysAddrLen: DWORD;  
bPhysAddr: array [0..MAXLEN_PHYSADDR - 1] of Byte;  
dwAdminStatus: DWORD;  
dwOperStatus: DWORD;  
dwLastChange: DWORD;  
dwInOctets: DWORD;  
dwInUcastPkts: DWORD;  
dwInNUcastPkts: DWORD;  
dwInDiscards: DWORD;  
dwInErrors: DWORD;  
dwInUnknownProtos: DWORD;  
dwOutOctets: DWORD;  
dwOutUcastPkts: DWORD;  
dwOutNUcastPkts: DWORD;  
dwOutDiscards: DWORD;  
dwOutErrors: DWORD;  
dwOutQLen: DWORD;  
dwDescrLen: DWORD;  
bDescr: array[0..MAXLEN_IFDESCR - 1] of Byte;  

MIB if table

TMibIftable = MIB_IFTABLE;

PMibIftable = PMIB_IFTABLE;

PMIB_IFTABLE = ^MIB_IFTABLE;

MIB_IFTABLE = record

dwNumEntries: DWORD;  
table: array [0..ANY_SIZE - 1] of MIB_IFROW;  

MIB ICMP statistics

TMibIcmpStats = MIBICMPSTATS;

PMibIcmpStats = ^TMibIcmpStats;

MIBICMPSTATS = record

dwMsgs: DWORD;  
dwErrors: DWORD;  
dwDestUnreachs: DWORD;  
dwTimeExcds: DWORD;  
dwParmProbs: DWORD;  
dwSrcQuenchs: DWORD;  
dwRedirects: DWORD;  
dwEchos: DWORD;  
dwEchoReps: DWORD;  
dwTimestamps: DWORD;  
dwTimestampReps: DWORD;  
dwAddrMasks: DWORD;  
dwAddrMaskReps: DWORD;  

MIB ICMP information

TMibIcmpInfo = MIBICMPINFO;

PMibIcmpInfo = ^TMibIcmpInfo;

MIBICMPINFO = record

icmpInStats: MIBICMPSTATS;  
icmpOutStats: MIBICMPSTATS;  

MIB ICMP

TMibIcmp = MIB_ICMP;

PMibIcmp = PMIB_ICMP;

PMIB_ICMP = ^MIB_ICMP;

MIB_ICMP = record

stats: MIBICMPINFO;  

MIB UDP statistics

TMibUdpStats = MIB_UDPSTATS;

PMibUdpStats = PMIB_UDPSTATS;

PMIB_UDPSTATS = ^MIB_UDPSTATS;

MIB_UDPSTATS = record

dwInDatagrams: DWORD;  
dwNoPorts: DWORD;  
dwInErrors: DWORD;  
dwOutDatagrams: DWORD;  
dwNumAddrs: DWORD;  

MIB UDP row

TMibUdpRow = MIB_UDPROW;

PMibUdpRow = PMIB_UDPROW;

PMIB_UDPROW = ^MIB_UDPROW;

MIB_UDPROW = record

dwLocalAddr: DWORD;  
dwLocalPort: DWORD;  

MIB UDP table

TMibUdpTable = MIB_UDPTABLE;

PMibUdpTable = PMIB_UDPTABLE;

PMIB_UDPTABLE = ^MIB_UDPTABLE;

MIB_UDPTABLE = record

dwNumEntries: DWORD;  
table: array [0..ANY_SIZE - 1] of MIB_UDPROW;  

MIB TCP statistics

TMibTcpStats = MIB_TCPSTATS;

PMibTcpStats = PMIB_TCPSTATS;

PMIB_TCPSTATS = ^MIB_TCPSTATS;

MIB_TCPSTATS = record

dwRtoAlgorithm: DWORD;  
dwRtoMin: DWORD;  
dwRtoMax: DWORD;  
dwMaxConn: DWORD;  
dwActiveOpens: DWORD;  
dwPassiveOpens: DWORD;  
dwAttemptFails: DWORD;  
dwEstabResets: DWORD;  
dwCurrEstab: DWORD;  
dwInSegs: DWORD;  
dwOutSegs: DWORD;  
dwRetransSegs: DWORD;  
dwInErrs: DWORD;  
dwOutRsts: DWORD;  
dwNumConns: DWORD;  

MIB TCP row

TMibTcpRow = MIB_TCPROW;

PMibTcpRow = PMIB_TCPROW;

PMIB_TCPROW = ^MIB_TCPROW;

MIB_TCPROW = record

dwState: DWORD;  
dwLocalAddr: DWORD;  
dwLocalPort: DWORD;  
dwRemoteAddr: DWORD;  
dwRemotePort: DWORD;  

MIB TCP table

TMibTcpTable = MIB_TCPTABLE;

PMibTcpTable = PMIB_TCPTABLE;

PMIB_TCPTABLE = ^MIB_TCPTABLE;

MIB_TCPTABLE = record

dwNumEntries: DWORD;  
table: array [0..ANY_SIZE - 1] of MIB_TCPROW;  

MIB IP statistics

TMibIpStats = MIB_IPSTATS;

PMibIpStats = PMIB_IPSTATS;

PMIB_IPSTATS = ^MIB_IPSTATS;

MIB_IPSTATS = record

dwForwarding: DWORD;  
dwDefaultTTL: DWORD;  
dwInReceives: DWORD;  
dwInHdrErrors: DWORD;  
dwInAddrErrors: DWORD;  
dwForwDatagrams: DWORD;  
dwInUnknownProtos: DWORD;  
dwInDiscards: DWORD;  
dwInDelivers: DWORD;  
dwOutRequests: DWORD;  
dwRoutingDiscards: DWORD;  
dwOutDiscards: DWORD;  
dwOutNoRoutes: DWORD;  
dwReasmTimeout: DWORD;  
dwReasmReqds: DWORD;  
dwReasmOks: DWORD;  
dwReasmFails: DWORD;  
dwFragOks: DWORD;  
dwFragFails: DWORD;  
dwFragCreates: DWORD;  
dwNumIf: DWORD;  
dwNumAddr: DWORD;  
dwNumRoutes: DWORD;  

MIB IP address row

TMibIpAddrRow = MIB_IPADDRROW;

PMibIpAddrRow = PMIB_IPADDRROW;

PMIB_IPADDRROW = ^MIB_IPADDRROW;

MIB_IPADDRROW = record

dwAddr: DWORD;  
dwIndex: DWORD;  
dwMask: DWORD;  
dwBCastAddr: DWORD;  
dwReasmSize: DWORD;  
unused1: Word;  
unused2: Word;  

MIB IP address table

TMibIpAddrTable = MIB_IPADDRTABLE;

PMibIpAddrTable = PMIB_IPADDRTABLE;

PMIB_IPADDRTABLE = ^MIB_IPADDRTABLE;

MIB_IPADDRTABLE = record

dwNumEntries: DWORD;  
table: array [0..ANY_SIZE - 1] of MIB_IPADDRROW;  

MIB IP forward number

TMibIpForwardNumber = MIB_IPFORWARDNUMBER;

PMibIpForwardNumber = PMIB_IPFORWARDNUMBER;

PMIB_IPFORWARDNUMBER = ^MIB_IPFORWARDNUMBER;

MIB_IPFORWARDNUMBER = record

dwValue: DWORD;  

MIB IP forward row

TMibIpForwardRow = MIB_IPFORWARDROW;

PMibIpForwardRow = PMIB_IPFORWARDROW;

PMIB_IPFORWARDROW = ^MIB_IPFORWARDROW;

MIB_IPFORWARDROW = record

dwForwardDest: DWORD;  
dwForwardMask: DWORD;  
dwForwardPolicy: DWORD;  
dwForwardNextHop: DWORD;  
dwForwardIfIndex: DWORD;  
dwForwardType: DWORD;  
dwForwardProto: DWORD;  
dwForwardAge: DWORD;  
dwForwardNextHopAS: DWORD;  
dwForwardMetric1: DWORD;  
dwForwardMetric2: DWORD;  
dwForwardMetric3: DWORD;  
dwForwardMetric4: DWORD;  
dwForwardMetric5: DWORD;  

MIB IP forward table

TMibIpForwardTable = MIB_IPFORWARDTABLE;

PMibIpForwardTable = PMIB_IPFORWARDTABLE;

PMIB_IPFORWARDTABLE = ^MIB_IPFORWARDTABLE;

MIB_IPFORWARDTABLE = record

dwNumEntries: DWORD;  
table: array [0..ANY_SIZE - 1] of MIB_IPFORWARDROW;  

MIB IP net row

TMibIpNetRow = MIB_IPNETROW;

PMibIpNetRow = PMIB_IPNETROW;

PMIB_IPNETROW = ^MIB_IPNETROW;

MIB_IPNETROW = record

dwIndex: DWORD;  
dwPhysAddrLen: DWORD;  
bPhysAddr: array [0..MAXLEN_PHYSADDR - 1] of BYTE;  
dwAddr: DWORD;  
dwType: DWORD;  

MIB IP net table

TMibIpNetTable = MIB_IPNETTABLE;

PMibIpNetTable = PMIB_IPNETTABLE;

PMIB_IPNETTABLE = ^MIB_IPNETTABLE;

MIB_IPNETTABLE = record

dwNumEntries: DWORD;  
table: array [0..ANY_SIZE - 1] of MIB_IPNETROW;  

IP adapter index map

TIpAdapterIndexMap = IP_ADAPTER_INDEX_MAP;

PIpAdapterIndexMap = PIP_ADAPTER_INDEX_MAP;

PIP_ADAPTER_INDEX_MAP = ^IP_ADAPTER_INDEX_MAP;

IP_ADAPTER_INDEX_MAP = record

Index: ULONG;  
Name: array [0..MAX_ADAPTER_NAME - 1] of WideChar;  

IP interface info

TIpInterfaceInfo = IP_INTERFACE_INFO;

PIpInterfaceInfo = PIP_INTERFACE_INFO;

PIP_INTERFACE_INFO = ^IP_INTERFACE_INFO;

IP_INTERFACE_INFO = record

NumAdapters: Longint;  
Adapter: array [0..0] of IP_ADAPTER_INDEX_MAP;  

IP unidirectional adapter address

TIpUnidirectionalAdapterAddress = IP_UNIDIRECTIONAL_ADAPTER_ADDRESS;

PIpUnidirectionalAdapterAddress = PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS;

PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS = ^IP_UNIDIRECTIONAL_ADAPTER_ADDRESS;

IP_UNIDIRECTIONAL_ADAPTER_ADDRESS = record

NumAdapters: ULONG;  
Address: array [0..0] of IPAddr;  

IP address string

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

S: array [0..15] of Char;  

IP addr string

TIpAddrString = IP_ADDR_STRING;

PIpAddrString = PIP_ADDR_STRING;

PIP_ADDR_STRING = ^IP_ADDR_STRING;

IP_ADDR_STRING = record

Next: PIP_ADDR_STRING;  
IpAddress: IP_ADDRESS_STRING;  
IpMask: IP_MASK_STRING;  
Context: DWORD;  

IP adapter information

TIpAdapterInfo = IP_ADAPTER_INFO;

PIpAdapterInfo = PIP_ADAPTER_INFO;

PIP_ADAPTER_INFO = ^IP_ADAPTER_INFO;

IP_ADAPTER_INFO = record

Next: PIP_ADAPTER_INFO;  
ComboIndex: DWORD;  
AdapterName: array [0..MAX_ADAPTER_NAME_LENGTH + 3] of Char;  
Description: array [0..MAX_ADAPTER_DESCRIPTION_LENGTH + 3] of Char;  
AddressLength: UINT;  
Address: array [0..MAX_ADAPTER_ADDRESS_LENGTH - 1] of BYTE;  
Index: DWORD;  
Type_: UINT;  
DhcpEnabled: UINT;  
CurrentIpAddress: PIP_ADDR_STRING;  
IpAddressList: IP_ADDR_STRING;  
GatewayList: IP_ADDR_STRING;  
DhcpServer: IP_ADDR_STRING;  
HaveWins: BOOL;  
PrimaryWinsServer: IP_ADDR_STRING;  
SecondaryWinsServer: IP_ADDR_STRING;  
LeaseObtained: time_t;  
LeaseExpires: time_t;  

IP per adapter information

TIpPerAdapterInfo = IP_PER_ADAPTER_INFO;

PIpPerAdapterInfo = PIP_PER_ADAPTER_INFO;

PIP_PER_ADAPTER_INFO = ^IP_PER_ADAPTER_INFO;

IP_PER_ADAPTER_INFO = record

AutoconfigEnabled: UINT;  
AutoconfigActive: UINT;  
CurrentDnsServer: PIP_ADDR_STRING;  
DnsServerList: IP_ADDR_STRING;  

Fixed information

TFixedInfo = FIXED_INFO;

PFixedInfo = PFIXED_INFO;

PFIXED_INFO = ^FIXED_INFO;

FIXED_INFO = record

HostName: array [0..MAX_HOSTNAME_LEN + 3] of Char;  
DomainName: array[0..MAX_DOMAIN_NAME_LEN + 3] of Char;  
CurrentDnsServer: PIP_ADDR_STRING;  
DnsServerList: IP_ADDR_STRING;  
NodeType: UINT;  
ScopeId: array [0..MAX_SCOPE_ID_LEN + 3] of Char;  
EnableRouting: UINT;  
EnableProxy: UINT;  
EnableDns: UINT;  


Public variables


None defined

Function declarations



Initialization functions

function IPHelperStart:Boolean;
Description: Initialize and start the Winsock2 provider
Note Only called internally by IP Helper functions


function IPHelperStop:Boolean;
Description: Terminate and stop the Winsock2 provider
Note Only called internally by IP Helper functions


Helper functions

function IPHelperConvertError(Status:Integer):DWORD;
Description: Convert a Winsock2 error to an error code
Note None documented


IP helper functions

function GetNumberOfInterfaces(var pdwNumIf: DWORD): DWORD;
Description: Retrieve the number of interfaces on the local computer
Note See the Windows IP Helper documentation for additional information


function GetIfEntry(pIfRow: PMIB_IFROW): DWORD;
Description: Retrieve information for the specified interface on the local computer
Note See the Windows IP Helper documentation for additional information


function GetIfTable(pIfTable: PMIB_IFTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: Retrieve the MIB-II interface table
Note See the Windows IP Helper documentation for additional information


function GetIpAddrTable(pIpAddrTable: PMIB_IPADDRTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: Retrieve the interface to IPv4 address mapping table
Note See the Windows IP Helper documentation for additional information


function GetIpNetTable(pIpNetTable: PMIB_IPNETTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: Retrieve the IPv4 to physical address mapping table
Note See the Windows IP Helper documentation for additional information


function GetIpForwardTable(pIpForwardTable: PMIB_IPFORWARDTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: Retrieve the IPv4 routing table
Note See the Windows IP Helper documentation for additional information


function GetTcpTable(pTcpTable: PMIB_TCPTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: Retrieve the IPv4 TCP connection table
Note See the Windows IP Helper documentation for additional information


function GetUdpTable(pUdpTable: PMIB_UDPTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD;
Description: Retrieve the IPv4 User Datagram Protocol (UDP) listener table
Note See the Windows IP Helper documentation for additional information


function GetIpStatistics(var pStats: MIB_IPSTATS): DWORD;
Description: Retrieve the IP statistics for the current computer
Note See the Windows IP Helper documentation for additional information


function GetIcmpStatistics(var pStats: MIB_ICMP): DWORD;
Description: Retrieve the Internet Control Message Protocol (ICMP) for IPv4 statistics for the local computer
Note See the Windows IP Helper documentation for additional information


function GetTcpStatistics(var pStats: MIB_TCPSTATS): DWORD;
Description: Retrieve the TCP statistics for the local computer
Note See the Windows IP Helper documentation for additional information


function GetUdpStatistics(var pStats: MIB_UDPSTATS): DWORD;
Description: Retrieve the User Datagram Protocol (UDP) statistics for the local computer
Note See the Windows IP Helper documentation for additional information


function SetIfEntry(const pIfRow: MIB_IFROW): DWORD;
Description: Set the administrative status of an interface
Note See the Windows IP Helper documentation for additional information


function CreateIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD;
Description: Create a route in the local computer's IPv4 routing table
Note See the Windows IP Helper documentation for additional information


function SetIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD;
Description: Modify an existing route in the local computer's IPv4 routing table
Note See the Windows IP Helper documentation for additional information


function DeleteIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD;
Description: Delete an existing route in the local computer's IPv4 routing table
Note See the Windows IP Helper documentation for additional information


function SetIpStatistics(const pIpStats: MIB_IPSTATS): DWORD;
Description: Toggle IP forwarding on or off and set the default time-to-live (TTL) value for the local computer
Note See the Windows IP Helper documentation for additional information


function SetIpTTL(nTTL: UINT): DWORD;
Description: Set the default time-to-live (TTL) value for the local computer
Note See the Windows IP Helper documentation for additional information


function CreateIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD;
Description: Create an Address Resolution Protocol (ARP) entry in the ARP table on the local computer
Note See the Windows IP Helper documentation for additional information


function SetIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD;
Description: Modify an existing ARP entry in the ARP table on the local computer
Note See the Windows IP Helper documentation for additional information


function DeleteIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD;
Description: Delete an ARP entry from the ARP table on the local computer
Note See the Windows IP Helper documentation for additional information


function FlushIpNetTable(dwIfIndex: DWORD): DWORD;
Description: Delete all ARP entries for the specified interface from the ARP table on the local computer
Note See the Windows IP Helper documentation for additional information


function CreateProxyArpEntry(dwAddress, dwMask, dwIfIndex: DWORD): DWORD;
Description: Create a Proxy Address Resolution Protocol (PARP) entry on the local computer for the specified IPv4 address
Note See the Windows IP Helper documentation for additional information


function DeleteProxyArpEntry(dwAddress, dwMask, dwIfIndex: DWORD): DWORD;
Description: Delete the PARP entry on the local computer specified by the dwAddress and dwIfIndex parameters
Note See the Windows IP Helper documentation for additional information


function SetTcpEntry(const pTcpRow: MIB_TCPROW): DWORD;
Description: Set the state of a TCP connection
Note See the Windows IP Helper documentation for additional information


function GetInterfaceInfo(pIfTable: PIP_INTERFACE_INFO; var dwOutBufLen: DWORD): DWORD;
Description: Obtain the list of the network interface adapters with IPv4 enabled on the local system
Note See the Windows IP Helper documentation for additional information


function GetUniDirectionalAdapterInfo(pIPIfInfo: PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS; var dwOutBufLen: DWORD): DWORD;
Description: Retrieve information about the unidirectional adapters installed on the local computer
Note See the Windows IP Helper documentation for additional information


function GetBestInterface(dwDestAddr: IPAddr; var pdwBestIfIndex: DWORD): DWORD;
Description: Retrieve the index of the interface that has the best route to the specified IPv4 address
Note See the Windows IP Helper documentation for additional information


function GetBestRoute(dwDestAddr, dwSourceAddr: DWORD; pBestRoute: PMIB_IPFORWARDROW): DWORD;
Description: Retrieve the best route to the specified destination IP address
Note See the Windows IP Helper documentation for additional information


function NotifyAddrChange(var Handle: THandle; overlapped: POVERLAPPED): DWORD;
Description: Cause a notification to be sent to the caller whenever a change occurs in the table that maps IPv4 addresses to interfaces
Note See the Windows IP Helper documentation for additional information


function NotifyRouteChange(var Handle: THandle; overlapped: POVERLAPPED): DWORD;
Description: Cause a notification to be sent to the caller whenever a change occurs in the IPv4 routing table
Note See the Windows IP Helper documentation for additional information


function GetAdapterIndex(AdapterName: LPWSTR; var IfIndex: DWORD): DWORD;
Description: Obtain the index of an adapter, given its name
Note See the Windows IP Helper documentation for additional information


function AddIPAddress(Address: IPAddr; IpMask: IPMask; IfIndex: DWORD; var NTEContext, NTEInstance: DWORD): DWORD;
Description: Add the specified IPv4 address to the specified adapter
Note See the Windows IP Helper documentation for additional information


function DeleteIPAddress(NTEContext: DWORD): DWORD;
Description: Delete an IP address previously added using AddIPAddress
Note See the Windows IP Helper documentation for additional information


function GetNetworkParams(pFixedInfo: PFIXED_INFO; var pOutBufLen: DWORD): DWORD;
Description: Retrieve network parameters for the local computer
Note See the Windows IP Helper documentation for additional information


function GetAdaptersInfo(pAdapterInfo: PIP_ADAPTER_INFO; var pOutBufLen: DWORD): DWORD;
Description: Retrieve adapter information for the local computer
Note See the Windows IP Helper documentation for additional information


function GetPerAdapterInfo(IfIndex: DWORD; pPerAdapterInfo: PIP_PER_ADAPTER_INFO; var pOutBufLen: DWORD): DWORD;
Description: Retrieve information about the adapter corresponding to the specified interface
Note See the Windows IP Helper documentation for additional information


function IpReleaseAddress(const AdapterInfo: IP_ADAPTER_INDEX_MAP): DWORD;
Description: Release an IPv4 address previously obtained through the Dynamic Host Configuration Protocol (DHCP)
Note See the Windows IP Helper documentation for additional information


function IpRenewAddress(const AdapterInfo: IP_ADAPTER_INDEX_MAP): DWORD;
Description: Renew a lease on an IPv4 address previously obtained through Dynamic Host Configuration Protocol (DHCP)
Note See the Windows IP Helper documentation for additional information


function SendARP(const DestIP, SrcIP: IPAddr; pMacAddr: PDWORD; var PhyAddrLen: DWORD): DWORD;
Description: Sends an Address Resolution Protocol (ARP) request to obtain the physical address that corresponds to the specified destination IPv4 address
Note See the Windows IP Helper documentation for additional information


function GetRTTAndHopCount(DestIpAddress: IPAddr; var HopCount: DWORD; MaxHops: DWORD; var RTT: DWORD): BOOL;
Description: Determine the round-trip time (RTT) and hop count to the specified destination
Note See the Windows IP Helper documentation for additional information


function GetFriendlyIfIndex(IfIndex: DWORD): DWORD;
Description: Take an interface index and return a backward-compatible interface index
Note See the Windows IP Helper documentation for additional information


function EnableRouter(var pHandle: THandle; pOverlapped: POVERLAPPED): DWORD;
Description: Turn on IPv4 forwarding on the local computer
Note See the Windows IP Helper documentation for additional information


function UnenableRouter(pOverlapped: POVERLAPPED; lpdwEnableCount: LPDWORD): DWORD;
Description: Turn off IPv4 forwarding on the local computer
Note See the Windows IP Helper documentation for additional information


IP helper helper functions

function MIBIFOperStatusToString(AValue:DWORD):String;
Description: To be documented
Note None documented


function MIBIFTypeToString(AValue:DWORD):String;
Description: To be documented
Note None documented


function MIBIFAdminStatusToString(AValue:DWORD):String;
Description: To be documented
Note None documented


function MIBTCPRTOToString(AValue:DWORD):String;
Description: To be documented
Note None documented


function MIBTCPStateToString(AValue:DWORD):String;
Description: To be documented
Note None documented


function MIBIPForwardingToString(AValue:DWORD):String;
Description: To be documented
Note None documented


function MIBIPRouteTypeToString(AValue:DWORD):String;
Description: To be documented
Note None documented


function MIBIPProtoToString(AValue:DWORD):String;
Description: To be documented
Note None documented


function MIBIPNetTypeToString(AValue:DWORD):String;
Description: To be documented
Note None documented


Return to Unit Reference