freebsd-nq/usr.sbin/ppp/tun.h
Brian Somers 6a6b4bbb08 Abstract data read from and written to the tun device,
allowing for a possible header on the front of all packets.
In OpenBSD, there's a structure containing the address
family here.
If we're building under OpenBSD, set up the ``flags'' part
of struct tuninfo (not there under FreeBSD) so that we config
the interface as POINTOPOINT.
Prefix prototypes with ``extern'' in os.c for consistency.

These changes are cosmetic under FreeBSD, but allow ppp to
build & work under OpenBSD (bar the srandomdev() stuff,
the inclusing of <net/if_var.h> and some Makefile symantecs).
1997-11-16 22:15:11 +00:00

17 lines
399 B
C

struct tun_data {
#ifdef __OpenBSD__
struct tunnel_header head;
#endif
u_char data[MAX_MRU];
};
#ifdef __OpenBSD__
#define tun_fill_header(f,proto) do { (f).head.tun_af = (proto); } while (0)
#define tun_check_header(f,proto) ((f).head.tun_af == (proto))
#else
#define tun_fill_header(f,proto) do { } while (0)
#define tun_check_header(f,proto) (1)
#endif
extern void tun_configure(int, int);