/* arp/arp.h */ #ifndef ARP_H_ #define ARP_H_ #include #include #include #include #include #include #include #include #include #include #include #define DEBUG /* Sends an ARP request sockfd is the file descriptor of the socket to use to send the frame, should be a raw socket (AF_PACKET), which accepts ARP (ETH_P_ALL or ETH_P_ARP) ifindex is the index of the network interface ipaddr is the source IP address macaddr is the source MAC address target_ip is the IP address to be queried via ARP The function returns 0 upon success, EXIT_FAILURE otherwise. */ int send_arp_request(int sockfd, int ifindex, struct sockaddr_in *ipaddr, unsigned char *macaddr, struct in_addr target_ip); #endif /* ARP_H_ */