summaryrefslogtreecommitdiff
path: root/usr.sbin/ipsend/common/iplang.h
blob: e52fd4be33fe5bffd9d2c49f63c0715677f7c5a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*	$OpenBSD: iplang.h,v 1.2 2001/01/17 06:01:25 fgsch Exp $	*/

/*
 * Copyright (C) 1997-1998 by Darren Reed.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that this notice is preserved and due credit is given
 * to the original author and the contributors.
 */
typedef	struct iface {
	int	if_MTU;
	char	*if_name;
	struct	in_addr	if_addr;
	struct	ether_addr	if_eaddr;
	struct	iface *if_next;
	int	if_fd;
} iface_t;


typedef	struct	send	{
	struct	iface	*snd_if;
	struct	in_addr	snd_gw;
} send_t;


typedef	struct	arp	{
	struct	in_addr	arp_addr;
	struct	ether_addr	arp_eaddr;
	struct	arp *arp_next;
} arp_t;


typedef	struct	aniphdr	{
	union	{
		ip_t		*ahu_ip;
		char		*ahu_data;
		tcphdr_t	*ahu_tcp;
		udphdr_t	*ahu_udp;
		icmphdr_t	*ahu_icmp;
	} ah_un;
	int	ah_optlen;
	int	ah_lastopt;
	int	ah_p;
	size_t	ah_len;
	struct	aniphdr	*ah_next;
	struct	aniphdr	*ah_prev;
} aniphdr_t;

#define	ah_ip	ah_un.ahu_ip
#define	ah_data	ah_un.ahu_data
#define	ah_tcp	ah_un.ahu_tcp
#define	ah_udp	ah_un.ahu_udp
#define	ah_icmp	ah_un.ahu_icmp

extern	int	get_arpipv4 __P((char *, char *));