IPHLPAPI(IP Helper API) functions

Headers


#include <winsock2.h>
#include <iphlpapi.h>

Library

  • WS2_32.lib
  • IPHLPAPI.lib

Adapter Configuration


DWORD
GetAdapterIndex(
  LPWSTR AdapterName,
  PULONG IfIndex
);

DWORD WINAPI
GetAdaptersAddresses(
  ULONG Family,
  DWORD Flags,
  PVOID Reserved,
  PIP_ADAPTER_ADDRESSES pAdapterAddresses,
  PULONG pOutBufLen
);

DWORD
GetAdaptersInfo(
  PIP_ADAPTER_INFO pAdapterInfo,
  PULONG pOutBufLen
);

DWORD
GetPerAdapterInfo(
  ULONG IfIndex,
  PIP_PER_ADAPTER_INFO pPerAdapterInfo,
  PULONG pOutBufLen
);

DWORD
GetUniDirectionalAdapterInfo(
  PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo,
  PULONG dwOutBufLen
);

ARP


DWORD
CreateIpNetEntry(
  PMIB_IPNETROW pArpEntry
);

DWORD
CreateProxyArpEntry(
  DWORD dwAddress,
  DWORD dwMask,
  DWORD dwIfIndex
);

DWORD
DeleteIpNetEntry(
  PMIB_IPNETROW pArpEntry
);

DWORD
DeleteProxyArpEntry(
  DWORD dwAddress,
  DWORD dwMask,
  DWORD dwIfIndex
);

DWORD
FlushIpNetTable(
  DWORD dwIfIndex
);

DWORD
GetIpNetTable(
  PMIB_IPNETTABLE pIpNetTable,
  PULONG pdwSize,
  BOOL bOrder
);

DWORD
SendARP(
  IPAddr DestIP,
  IPAddr SrcIP,
  PULONG pMacAddr,
  PULONG PhyAddrLen
);

DWORD
SetIpNetEntry(
  PMIB_IPNETROW pArpEntry
);

Network Interface


DWORD
GetFriendlyIfIndex(
  DWORD IfIndex
);

DWORD
GetIfEntry(
  PMIB_IFROW pIfRow
);

DWORD
GetIfTable(
  PMIB_IFTABLE pIfTable,
  PULONG pdwSize,
  BOOL bOrder
);

DWORD
GetInterfaceInfo(
  PIP_INTERFACE_INFO pIfTable,
  PULONG dwOutBufLen
);

DWORD
GetNumberOfInterfaces(
  PDWORD pdwNumIf
);

DWORD
SetIfEntry(
  PMIB_IFROW pIfRow
);

IP, ICMP


DWORD
GetIcmpStatistics(
  PMIB_ICMP pStats
);

DWORD
GetIpStatistics(
  PMIB_IPSTATS pStats
);

BOOL
IcmpCloseHandle(
  HANDLE IcmpHandle
);

HANDLE
IcmpCreateFile(void);

DWORD
IcmpParseReplies(
  LPVOID ReplyBuffer,
  DWORD ReplySize
);

DWORD
IcmpSendEcho(
  HANDLE IcmpHandle,
  IPAddr DestinationAddress,
  LPVOID RequestData,
  WORD RequestSize,
  PIP_OPTION_INFORMATION RequestOptions,
  LPVOID ReplyBuffer,
  DWORD ReplySize,
  DWORD Timeout
);

DWORD
IcmpSendEcho2(
  HANDLE IcmpHandle,
  HANDLE Event,
  FARPROC ApcRoutine,
  PVOID ApcContext,
  IPAddr DestinationAddress,
  LPVOID RequestData,
  WORD RequestSize,
  PIP_OPTION_INFORMATION RequestOptions,
  LPVOID ReplyBuffer,
  DWORD ReplySize,
  DWORD Timeout
);

DWORD
SetIpStatistics(
  PMIB_IPSTATS pIpStats
);

DWORD
SetIpTTL(
  UINT nTTL
);

IP address configuration


DWORD
AddIPAddress(
  IPAddr Address,
  IPMask IpMask,
  DWORD IfIndex,
  PULONG NTEContext,
  PULONG NTEInstance
);

DWORD
DeleteIPAddress(
  ULONG NTEContext
);

DWORD
GetIpAddrTable(
  PMIB_IPADDRTABLE pIpAddrTable,
  PULONG pdwSize,
  BOOL bOrder
);

DWORD
IpReleaseAddress(
  PIP_ADAPTER_INDEX_MAP AdapterInfo
);

DWORD
IpRenewAddress(
  PIP_ADAPTER_INDEX_MAP AdapterInfo
);

Network configuration


DWORD
GetNetworkParams(
  PFIXED_INFO pFixedInfo,
  PULONG pOutBufLen
);

Notification


DWORD
NotifyAddrChange(
  PHANDLE Handle,
  LPOVERLAPPED overlapped
);

DWORD
NotifyRouteChange(
  PHANDLE Handle,
  LPOVERLAPPED overlapped
);

Routing


DWORD
CreateIpForwardEntry(
  PMIB_IPFORWARDROW pRoute
);

DWORD
DeleteIpForwardEntry(
  PMIB_IPFORWARDROW pRoute
);

DWORD WINAPI
EnableRouter(
  HANDLE* pHandle,
  OVERLAPPED* pOverlapped
);

DWORD
GetBestInterface(
  IPAddr dwDestAddr,
  PDWORD pdwBestIfIndex
);

DWORD
GetBestRoute(
  DWORD dwDestAddr,
  DWORD dwSourceAddr,
  PMIB_IPFORWARDROW pBestRoute
);

DWORD
GetIpForwardTable(
  PMIB_IPFORWARDTABLE pIpForwardTable,
  PULONG pdwSize,
  BOOL bOrder
);

BOOL
GetRTTAndHopCount(
  IPAddr DestIpAddress,
  PULONG HopCount,
  ULONG MaxHops,
  PULONG RTT
);

DWORD
SetIpForwardEntry(
  PMIB_IPFORWARDROW pRoute
);

DWORD WINAPI
UnenableRouter(
  OVERLAPPED* pOverlapped,
  LPDWORD lpdwEnableCount
);

TCP, UDP


DWORD
GetExtendedTcpTable(
  PVOID pTcpTable,
  PDWORD pdwSize,
  BOOL bOrder,
  ULONG ulAf,
  TCP_TABLE_CLASS TableClass,
  ULONG Reserved
);

DWORD
GetExtendedUdpTable(
  PVOID pUdpTable,
  PDWORD pdwSize,
  BOOL bOrder,
  ULONG ulAf,
  UDP_TABLE_CLASS TableClass,
  ULONG Reserved
);

DWORD
GetOwnerModuleFromTcpEntry(
  PMIB_TCPROW_OWNER_MODULE pTcpEntry,
  TCPIP_OWNER_MODULE_INFO_CLASS Class,
  PVOID Buffer,
  PDWORD pdwSize
);

DWORD
GetOwnerModuleFromTcp6Entry(
  PMIB_TCP6ROW_OWNER_MODULE pTcpEntry,
  TCPIP_OWNER_MODULE_INFO_CLASS Class,
  PVOID Buffer,
  PDWORD pdwSize
);

DWORD
GetOwnerModuleFromUdpEntry(
  PMIB_UDPROW_OWNER_MODULE pUdpEntry,
  TCPIP_OWNER_MODULE_INFO_CLASS Class,
  PVOID Buffer,
  PDWORD pdwSize
);

DWORD
GetOwnerModuleFromUdp6Entry(
  PMIB_UDP6ROW_OWNER_MODULE pUdpEntry,
  TCPIP_OWNER_MODULE_INFO_CLASS Class,
  PVOID Buffer,
  PDWORD pdwSize
);

DWORD
GetTcpStatistics(
  PMIB_TCPSTATS pStats
);

DWORD
GetTcpTable(
  PMIB_TCPTABLE pTcpTable,
  PDWORD pdwSize,
  BOOL bOrder
);

DWORD
SetTcpEntry(
  PMIB_TCPROW pTcpRow
);

DWORD
GetUdpStatistics(
  PMIB_UDPSTATS pStats
);

DWORD
GetUdpTable(
  PMIB_UDPTABLE pUdpTable,
  PDWORD pdwSize,
  BOOL bOrder
);

'NativeCode > api' 카테고리의 다른 글

winsock 자신의 아이피 알아내기  (0) 2010.03.19
Winsock 상대방 아이피, 포트 알아내기  (0) 2010.03.19
CSocket 과 CAsyncSocket에서 Thread문제  (0) 2010.03.19
HTTP 긁어오기 (소스파일 有)  (0) 2010.03.19
FTP  (0) 2010.03.19

+ Recent posts