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
info@marcoboschi.it
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

Uwe,
thanks!
I was thinking about a function included in my program.
it is not essential but it would be nice.
Marco
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
Ok Very good!
Many thanks
André,
Good job thinking outside the box. I like it!
Regards,
James