now over to the code:
ULONG DestMacAddr[2];
ULONG PhysicalLength = 6;
IPAddr destination = inet_addr(target.c_str());
IPAddr source = inet_addr(host.c_str());
SendARP(destination, source, DestMacAddr, &PhysicalLength);
unsigned char mac[6];
BYTE *bMacAddr = (BYTE *) & DestMacAddr;
for (int p = 0; p < (int) PhysicalLength; p++)
{
mac[p] = (char)bMacAddr[p];
}
printf("DestMacAddr: %.2X:%.2X:%.2X:%.2X:%.2X:%.2X \n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
btw i checked and the strings host and target are correct.
i would be very gratefull for advice, help and tips.

New Topic/Question
Reply



MultiQuote



|