diff options
author | brian <brian@FreeBSD.org> | 1997-11-16 22:15:11 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-11-16 22:15:11 +0000 |
commit | 5696a07f36cde36ef7955344c7b33fc5c7c57248 (patch) | |
tree | 766aa7f660926161982f1e79a01aa4827f8022d9 /usr.sbin/ppp/tun.h | |
parent | 0f428e70f1f534b0936e0af7a36d1ad2f7e76775 (diff) | |
download | FreeBSD-src-5696a07f36cde36ef7955344c7b33fc5c7c57248.zip FreeBSD-src-5696a07f36cde36ef7955344c7b33fc5c7c57248.tar.gz |
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).
Diffstat (limited to 'usr.sbin/ppp/tun.h')
-rw-r--r-- | usr.sbin/ppp/tun.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/usr.sbin/ppp/tun.h b/usr.sbin/ppp/tun.h new file mode 100644 index 0000000..bc495e1 --- /dev/null +++ b/usr.sbin/ppp/tun.h @@ -0,0 +1,16 @@ +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); |