141edb306SCy Schubert 241edb306SCy Schubert /* 341edb306SCy Schubert * Copyright (C) 2012 by Darren Reed. 441edb306SCy Schubert * 541edb306SCy Schubert * See the IPFILTER.LICENCE file for details on licencing. 641edb306SCy Schubert */ 741edb306SCy Schubert typedef struct iface { 841edb306SCy Schubert int if_MTU; 941edb306SCy Schubert char *if_name; 1041edb306SCy Schubert struct in_addr if_addr; 1141edb306SCy Schubert struct ether_addr if_eaddr; 1241edb306SCy Schubert struct iface *if_next; 1341edb306SCy Schubert int if_fd; 1441edb306SCy Schubert } iface_t; 1541edb306SCy Schubert 1641edb306SCy Schubert 1741edb306SCy Schubert typedef struct send { 1841edb306SCy Schubert struct iface *snd_if; 1941edb306SCy Schubert struct in_addr snd_gw; 2041edb306SCy Schubert } send_t; 2141edb306SCy Schubert 2241edb306SCy Schubert 2341edb306SCy Schubert typedef struct arp { 2441edb306SCy Schubert struct in_addr arp_addr; 2541edb306SCy Schubert struct ether_addr arp_eaddr; 2641edb306SCy Schubert struct arp *arp_next; 2741edb306SCy Schubert } arp_t; 2841edb306SCy Schubert 2941edb306SCy Schubert 3041edb306SCy Schubert typedef struct aniphdr { 3141edb306SCy Schubert union { 3241edb306SCy Schubert ip_t *ahu_ip; 3341edb306SCy Schubert char *ahu_data; 3441edb306SCy Schubert tcphdr_t *ahu_tcp; 3541edb306SCy Schubert udphdr_t *ahu_udp; 3641edb306SCy Schubert icmphdr_t *ahu_icmp; 3741edb306SCy Schubert } ah_un; 3841edb306SCy Schubert int ah_optlen; 3941edb306SCy Schubert int ah_lastopt; 4041edb306SCy Schubert int ah_p; 4141edb306SCy Schubert size_t ah_len; 4241edb306SCy Schubert struct aniphdr *ah_next; 4341edb306SCy Schubert struct aniphdr *ah_prev; 4441edb306SCy Schubert } aniphdr_t; 4541edb306SCy Schubert 4641edb306SCy Schubert #define ah_ip ah_un.ahu_ip 4741edb306SCy Schubert #define ah_data ah_un.ahu_data 4841edb306SCy Schubert #define ah_tcp ah_un.ahu_tcp 4941edb306SCy Schubert #define ah_udp ah_un.ahu_udp 5041edb306SCy Schubert #define ah_icmp ah_un.ahu_icmp 5141edb306SCy Schubert 5241edb306SCy Schubert extern int get_arpipv4(char *, char *); 5341edb306SCy Schubert 54