redirect_traffic function

This commit is contained in:
Dimitri Lozeve 2016-06-03 11:03:25 +02:00
parent 9c19bba5ec
commit a7ac904e54
2 changed files with 55 additions and 0 deletions

17
arp.h
View file

@ -60,4 +60,21 @@ int send_arp_reply(int sockfd, int ifindex, struct sockaddr_in *sender_ip, unsig
int listen_arp_frame(int sockfd, struct ether_arp *result);
struct args {
unsigned char macaddr1[6];
unsigned char macaddr2[6];
struct sockaddr_in ip_addr1;
struct sockaddr_in ip_addr2;
};
/* Redirects all ethernet traffic from one address to another.
args: struct args, which contains the hardware and protocol
addresses of the targets.
Never returns (killed when the main thread terminates).
*/
void *redirect_traffic(void *args);
#endif /* ARP_H_ */