Experts Guide regarding MAC Address of a remote machine.
-
I am able to get the MAC address of any machine connected in my LAN network . Now How should I extend this app to obtain the MAC address of a remote machine? Experts Guide Regards Black Tiger 007
-
I am able to get the MAC address of any machine connected in my LAN network . Now How should I extend this app to obtain the MAC address of a remote machine? Experts Guide Regards Black Tiger 007
blacktiger007 wrote: How should I extend this app to obtain the MAC address of a remote machine? What do you mean by "remote?" Any machine besides the one running the code is remote. Yes?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
I am able to get the MAC address of any machine connected in my LAN network . Now How should I extend this app to obtain the MAC address of a remote machine? Experts Guide Regards Black Tiger 007
typedef byte SkNetMAC[6];
bool FkNetGetMacA( CkStr SA, SkNetMAC &MAC )
{
if( SA.IsEmpty() ) return(false);#if 1 // get local or remote MAC given an IP using ARP (Win2K+)
ulong rc = 0, ml = sizeof(MAC); IPAddr ip = inet\_addr( SA.PtrSafe(0) ); rc = ::SendARP(ip, 0, (ulong\*)&MAC, &ml);
#else // get local MAC associated with IP by querying adapter info (Win*)
ulong rc = 0, al = 0; IP\_ADAPTER\_INFO \*ai = NULL, \*ac = NULL; IP\_ADDR\_STRING \*ip = NULL; rc = ::GetAdaptersInfo(ai, &al); if( rc != ERROR\_BUFFER\_OVERFLOW ) return(false); ai = (IP\_ADAPTER\_INFO\*)ckMemTemp.Calloc(al); if( !ai ) return(false); rc = ::GetAdaptersInfo(ai, &al); if( rc != ERROR\_SUCCESS ) goto e\_FkNetGetMacA; // there can be a many to one relationship between // ip's and addapters - search adapters for matching IP for( ac = ai; ac; ac = ac->Next ) { for( ip = &ac->IpAddressList; ip; ip = ip->Next ) { if( SA == ip->IpAddress.String ) { FkMemCpy(ac->Address, &MAC, sizeof(MAC)); goto e\_FkNetGetMacA; } } } e\_FkNetGetMacA: ckMemTemp.Free(ai);
#endif
return(true);
}
...cmk Save the whales - collect the whole set
-
I am able to get the MAC address of any machine connected in my LAN network . Now How should I extend this app to obtain the MAC address of a remote machine? Experts Guide Regards Black Tiger 007
Am looking for PHP code to get the Mac address of a machine and I think you got the answer.