xref: /freebsd/sbin/ipf/iplang/iplang.h (revision 7899f917b1c0ea178f1d2be0cfb452086d079d23)
1 
2 /*
3  * Copyright (C) 2012 by Darren Reed.
4  *
5  * See the IPFILTER.LICENCE file for details on licencing.
6  */
7 typedef	struct iface {
8 	int	if_MTU;
9 	char	*if_name;
10 	struct	in_addr	if_addr;
11 	struct	ether_addr	if_eaddr;
12 	struct	iface *if_next;
13 	int	if_fd;
14 } iface_t;
15 
16 
17 typedef	struct	send	{
18 	struct	iface	*snd_if;
19 	struct	in_addr	snd_gw;
20 } send_t;
21 
22 
23 typedef	struct	arp	{
24 	struct	in_addr	arp_addr;
25 	struct	ether_addr	arp_eaddr;
26 	struct	arp *arp_next;
27 } arp_t;
28 
29 
30 typedef	struct	aniphdr	{
31 	union	{
32 		ip_t		*ahu_ip;
33 		char		*ahu_data;
34 		tcphdr_t	*ahu_tcp;
35 		udphdr_t	*ahu_udp;
36 		icmphdr_t	*ahu_icmp;
37 	} ah_un;
38 	int	ah_optlen;
39 	int	ah_lastopt;
40 	int	ah_p;
41 	size_t	ah_len;
42 	struct	aniphdr	*ah_next;
43 	struct	aniphdr	*ah_prev;
44 } aniphdr_t;
45 
46 #define	ah_ip	ah_un.ahu_ip
47 #define	ah_data	ah_un.ahu_data
48 #define	ah_tcp	ah_un.ahu_tcp
49 #define	ah_udp	ah_un.ahu_udp
50 #define	ah_icmp	ah_un.ahu_icmp
51 
52 extern	int	get_arpipv4(char *, char *);
53 
54