Currently I am working on a research project, let's say we have two computers connected over LAN cable directly with out any switch or router in same sub-network. Both nodes not have IP address currently, Is there any way i can fetch MAC of destination node and vice versa? I have research on this issue but mostly find solution linked with IP. like arping, getmac, nmap etc. but all based on IP. Is there any code using some network socket like PF_PACKET socket or something else which can give idea about how we handle this problem. I have found something about ARP but I am wondering it will not that solution which we hunting for click [here] https://www.lynxbee.com/understanding-arp-basics-and-sending-arp-request-and-receiving-arp-reply-using-c-code-in-linux/
Our application send/receive frame from Layer-2 MAC using PF_PACKET based socket. Right now we can extract MAC address from source NIC interface but for destination MAC address we need some method with out IP layer-3 module communication.
Env: Language C,CentOS 7, kernel v3.10.
Thank you in advance.