1
votes

What type of RAW socket is required to send Gratuitous ARP request and receive ARP reply packet on VC++.

int s = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ARP));

what should be the corresponding code for Windows?

2
I need to generate Gratuitous ARP request to check an IP-Address which is not in the subnets of the interfaces of my computer, exists or not. SendArp() can't do this.Shikhar Bhargava

2 Answers

1
votes

I've been trying to figure out the same thing. But it appears you just can't do this in windows: in windows you can only construct Internet layer packets, but ARP is in Link layer. So if you really have to do this, you'll need to use winPcap I think.

1
votes

yes. windows does not allow you to send RAW traffic on top if ethernet, but it is possible to send RAW ethernet traffic.

So, if you construct your own ethernet headers, it is possible to send ARP packets.