To obtain ip address

Post Reply
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

To obtain ip address

Post by MarcoBoschi »

Hi,

I need a function that if I pass mac address it returns to to me ip address.
Is there anything?

Thanks in advance

marco
Marco Boschi
info@marcoboschi.it
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: To obtain ip address

Post by ukoenig »

Hello Marco,

I think, this Tool will work for You ( Freeware )

Name2Ip2Mac

Image

http://www.softpedia.com/progDownload/N ... -4226.html

another one :

http://www.freewarezoom.com/archives/ip-sniffer

is a converter you can use on your PC for IP, MAC adresses and names.
Converts very fast:- ComputerNames into IpAddress or MacAddress- IpAddress into ComputerNames or MacAddressNote:
Some antivirus and antispyware programs flag Name2Ip2Mac as being infected/malware,
although the application is perfectly safe and does not pose a threat to your system...

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: To obtain ip address

Post by MarcoBoschi »

Uwe,
thanks!
I was thinking about a function included in my program.
it is not essential but it would be nice.

Marco
Marco Boschi
info@marcoboschi.it
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: To obtain ip address

Post by ADutheil »

Is the function below OK for you?

FUNCTION ChkIp( cMac )
LOCAL nMacs := fCreate( "macs.bat" )
LOCAL cBuff := ""
LOCAL lRetu := .F.

fWrite( nMacs, "arp -a >macs.lst" )
fClose( nMacs )
ShellExecute( 0, "open", "macs.bat",,, )
IF ( nMacs := fOpen( "macs.lst" ) ) > 0
WHILE hb_fReadLine( nMacs, @cBuff ) = 0
IF upper( cMac ) $ upper( cBuff )
msgInfo( "IP FOUND" + CRLF + allTrim( subStr( cBuff, 1, at( cMac, cBuff ) - 1 ) ) )
lRetu := .T.
EXIT
ENDIF
ENDDO
fClose( nMacs )
ELSE
msgStop( "UNABLE TO OPEN FILE MACS.LST" )
ENDIF
fErase( "macs.bat" )
fErase( "macs.lst" )
IF !lRetu
msgStop( "MAC " + cMac + CRLF + "IP NOT FOUND!" )
ENDIF
RETURN ( lRetu )

The cMac param must be sent as xx-xx-xx-xx-xx-xx
Regards,

André Dutheil
FWH 13.04 HB 3.2 BCC 5.82 MinGW 4.5.2 MSVS 10
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: To obtain ip address

Post by MarcoBoschi »

Ok Very good!
Many thanks
Marco Boschi
info@marcoboschi.it
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: To obtain ip address

Post by James Bott »

André,

Good job thinking outside the box. I like it!

Regards,
James
Post Reply