iphlpapi 라이브러리의 msdn 소스 입니다.
굉장히 좋네요. 
NIC 이름과 설명 뿐만 아니라 아이피 NDIS 버젼등등 많은 정보가 나옵니다. 





Bloger: moltak.net

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

printf, scanf 함수 포맷 문자열  (0) 2010.07.07
IP, TCP, UDP, ICMP Checksum 계산  (0) 2010.07.05
SendARP  (0) 2010.07.03
[팁] Heap 메모리 검증하기.. | VC++ 일반  (0) 2010.05.09
WSAGetLastError()  (0) 2010.04.06

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
ULONG   ulMACAddr[2],
ulSize = 6;
LPBYTE pBuffer;

if (SendARP(inet_addr(_T("207.219.70.31")), 0,
ulMACAddr, &ulSize) == NO_ERROR)
{
pBuffer = (LPBYTE) ulMACAddr;

// access the address one byte at a time m_strText.Format("%02X:%02X:%02X:%02X:%02X:%02X\r\n",
pBuffer[0],
pBuffer[1],
pBuffer[2],
pBuffer[3],
pBuffer[4],
pBuffer[5]);

m_edit1.ReplaceSel(m_strText);
}
#include <IPHlpApi.h> 를 잊지 말아야할것

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

HTTPS GET - Download HTML from HTTPS URL  (0) 2010.03.19
CkLibrary  (1) 2010.03.19
Event  (0) 2010.03.19
Deadlock 4가지 조건  (0) 2010.03.19
Synchronization Function  (0) 2010.03.19

+ Recent posts