C# Class WinLib.WinAPI.Iphlpapi

显示文件 Open project: SortByte/Network-Manager

Public Methods

Method Description
AddRoute ( string destination, string prefix, string gateway, string interfaceIndex, string metric, MIB_IPFORWARD_TYPE type = MIB_IPFORWARD_TYPE.MIB_IPROUTE_TYPE_INDIRECT, NL_ROUTE_PROTOCOL protocol = NL_ROUTE_PROTOCOL.MIB_IPPROTO_NETMGMT ) : void

XP - IPv4 Only

DeleteRoute ( string destination, string prefix, string gateway, string interfaceIndex ) : void

XP - IPv4 only

EditRoute ( string destination, string prefix, string gateway, string interfaceIndex, string metric, MIB_IPFORWARD_TYPE type = MIB_IPFORWARD_TYPE.MIB_IPROUTE_TYPE_INDIRECT, NL_ROUTE_PROTOCOL protocol = NL_ROUTE_PROTOCOL.MIB_IPPROTO_NETMGMT ) : void

XP - IPv4 only

GetAdapters ( FAMILY family ) : List
GetDescription ( Enum value ) : string
GetIPSessions ( ) : List
GetMacAddress ( string sDestIP, string sSrcIP = "0.0.0.0" ) : string

Resolves an IPv4 address to a MAC address

GetRoutes ( FAMILY family ) : List

XP - IPv4 Only

Private Methods

Method Description
CreateIpForwardEntry ( IntPtr pRoute ) : uint
CreateIpForwardEntry2 ( IntPtr pRow ) : uint
DeleteIpForwardEntry ( IntPtr pRoute ) : uint
DeleteIpForwardEntry2 ( IntPtr pRow ) : uint
FreeMibTable ( IntPtr Memory ) : uint
GetAdaptersAddresses ( uint Family, uint Flags, IntPtr Reserved, IntPtr pAdapterAddresses, uint &outBufLen ) : ERROR
GetAdaptersInfo ( IntPtr pAdapterInfo, uint &outBufLen ) : ERROR
GetExtendedTcpTable ( IntPtr pTcpTable, int &dwSize, bool bOrder, FAMILY Family, TCP_TABLE_CLASS TableClass, uint Reserved ) : ERROR
GetExtendedUdpTable ( IntPtr pUdpTable, int &dwSize, bool bOrder, FAMILY Family, UDP_TABLE_CLASS TableClass, uint Reserved ) : ERROR
GetIfEntry ( byte &pIfRow ) : uint
GetInterfaceInfo ( byte IP_INTERFACE_INFO, int &size ) : uint
GetIpForwardTable ( IntPtr pIpForwardTable, uint &dwSize, bool bOrder ) : uint
GetIpForwardTable2 ( FAMILY Family, IntPtr &Table ) : uint
IcmpCloseHandle ( IntPtr IcmpHandle ) : bool
IcmpCreateFile ( ) : IntPtr
IcmpSendEcho ( IntPtr IcmpHandle, in_addr DestinationAddress, byte RequestData, ushort RequestSize, IP_OPTION_INFORMATION &RequestOptions, ICMP_ECHO_REPLY &ReplyBuffer, uint ReplySize, uint Timeout ) : uint
IcmpSendEcho ( IntPtr IcmpHandle, in_addr DestinationAddress, byte RequestData, ushort RequestSize, IP_OPTION_INFORMATION &RequestOptions, byte ReplyBuffer, uint ReplySize, uint Timeout ) : uint
IcmpSendEcho ( IntPtr IcmpHandle, in_addr DestinationAddress, byte RequestData, ushort RequestSize, IntPtr pRequestOptions, ICMP_ECHO_REPLY &ReplyBuffer, uint ReplySize, uint Timeout ) : uint
IcmpSendEcho ( IntPtr IcmpHandle, in_addr DestinationAddress, byte RequestData, ushort RequestSize, IntPtr RequestOptions, byte ReplyBuffer, uint ReplySize, uint Timeout ) : uint
InitializeIpForwardEntry ( IntPtr &PMIB_IPFORWARD_ROW2 ) : void
SendARP ( in_addr DestIP, in_addr SrcIP, System.UInt64 &MacAddr, uint &PhyAddrLen ) : ERROR
SetIpForwardEntry ( IntPtr pRoute ) : uint
SetIpForwardEntry2 ( IntPtr pRow ) : uint

Method Details

AddRoute() public static method

XP - IPv4 Only
public static AddRoute ( string destination, string prefix, string gateway, string interfaceIndex, string metric, MIB_IPFORWARD_TYPE type = MIB_IPFORWARD_TYPE.MIB_IPROUTE_TYPE_INDIRECT, NL_ROUTE_PROTOCOL protocol = NL_ROUTE_PROTOCOL.MIB_IPPROTO_NETMGMT ) : void
destination string
prefix string
gateway string
interfaceIndex string
metric string
type MIB_IPFORWARD_TYPE must be set correctly for XP
protocol NL_ROUTE_PROTOCOL
return void

DeleteRoute() public static method

XP - IPv4 only
public static DeleteRoute ( string destination, string prefix, string gateway, string interfaceIndex ) : void
destination string
prefix string
gateway string
interfaceIndex string
return void

EditRoute() public static method

XP - IPv4 only
public static EditRoute ( string destination, string prefix, string gateway, string interfaceIndex, string metric, MIB_IPFORWARD_TYPE type = MIB_IPFORWARD_TYPE.MIB_IPROUTE_TYPE_INDIRECT, NL_ROUTE_PROTOCOL protocol = NL_ROUTE_PROTOCOL.MIB_IPPROTO_NETMGMT ) : void
destination string
prefix string
gateway string
interfaceIndex string
metric string
type MIB_IPFORWARD_TYPE
protocol NL_ROUTE_PROTOCOL
return void

GetAdapters() public static method

public static GetAdapters ( FAMILY family ) : List
family FAMILY
return List

GetDescription() public static method

public static GetDescription ( Enum value ) : string
value System.Enum
return string

GetIPSessions() public static method

public static GetIPSessions ( ) : List
return List

GetMacAddress() public static method

Resolves an IPv4 address to a MAC address
public static GetMacAddress ( string sDestIP, string sSrcIP = "0.0.0.0" ) : string
sDestIP string
sSrcIP string
return string

GetRoutes() public static method

XP - IPv4 Only
public static GetRoutes ( FAMILY family ) : List
family FAMILY
return List