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
To obtain ip address
- MarcoBoschi
- Posts: 925
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
To obtain ip address
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
Re: To obtain ip address
Hello Marco,
I think, this Tool will work for You ( Freeware )
Name2Ip2Mac
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
I think, this Tool will work for You ( Freeware )
Name2Ip2Mac
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
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- MarcoBoschi
- Posts: 925
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: To obtain ip address
Uwe,
thanks!
I was thinking about a function included in my program.
it is not essential but it would be nice.
Marco
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
info@marcoboschi.it
Re: To obtain ip address
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
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
André Dutheil
FWH 13.04 HB 3.2 BCC 5.82 MinGW 4.5.2 MSVS 10
- MarcoBoschi
- Posts: 925
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: To obtain ip address
André,
Good job thinking outside the box. I like it!
Regards,
James
Good job thinking outside the box. I like it!
Regards,
James