Jump to content

How to use the DllCall to adjust the function of use the IP Helper API?


nybb
 Share

Recommended Posts

GetIpNetTable The function can withdraw originally on board all ARP form item of.Use its method and previous articles in the usage of function is very similar, you also must use it twice, acquire the size of buffer for the first time, but acquire the actual ARP form for the second time.This reflects to shoot the form to point out in several way.Its structure is as follows:

typedef struct _MIB_IPNETTABLE {

DWORD dwNumEntries; //Several size

MIB_IPNETROW table[ANY_SIZE]; //Several oneself

} MIB_IPNETTABLE, *PMIB_IPNETTABLE;

But MIB_IPNETROW Of definition:

typedef struct _MIB_IPNETROW {

DWORD dwIndex; // The network connects the oscular index number

DWORD dwPhysAddrLen; // Physics address length

BYTE bPhysAddr[MAXLEN_PHYSADDR]; // Physics address

DWORD dwAddr; // Address of IP

DWORD dwType; // ARP type

} MIB_IPNETROW, *PMIB_IPNETROW;

How does this function of the top use the au3 dllcall to adjust to use?

Use the dllcall adjusts the address of Mac that obtains this machine and the long range host with the function of SendArp

DllCall ("iphlpapi.dll", "int", "SendARP","int", $iIP,"int", 0,"ptr", DllStructGetPtr($LMAC),"ptr", DllStructGetPtr($LMACSize))

According to adjust of top with prototype of SendARP of method and underneath according to my comprehension I always at try to adjust to use to other functions of iphlpapi.dll

如 GetIpNetTable,DeleteIpNetEntry,SetIpNetEntry,CreateIpNetEntry The heads were all tired to fry, the bitterness is to can not find the method...

Hope the superior give help

DWORD SendARP(

IPAddr DestIP, // Purpose IP address

IPAddr SrcIP, // The source IP address, the eligibility parameter, fills it 0 will not have problems

PULONG pMacAddr, // Physics address of return

PULONG PhyAddrLen // The length of the physics address

);

Link to comment
Share on other sites

I detect some language problems:

1: You are not coding in the AutoIT language

2: Your language expressions do not compute/translate into very readable English.

What are you trying to do? What are you trying to achieve?

Link to comment
Share on other sites

GetIpNetTable The function can withdraw originally on board all ARP form item of.Use its method and previous articles in the usage of function is very similar, you also must use it twice, acquire the size of buffer for the first time, but acquire the actual ARP form for the second time.This reflects to shoot the form to point out in several way.Its structure is as follows:

...

I have written some IP helper functions several months ago. They include:

GetAdapterInfo()

SendArp()

IsReachable()

AddStaticRoute()

DeleteStaticRoute()

GetIfEntry()

inet_addr()

GetPublicIP()

GetLocationInfo()

The file is attached below.

iphelper.au3

NOTE: It is unsupported, not fully tested and barely documented. Use at your own risk.

Maybe I will write a full UDF from this, only if I had some more spare time left..

Regards,

-Sven

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...