tun.h revision 50479
152845Sphk/*-
252845Sphk * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org>
352845Sphk * All rights reserved.
452845Sphk *
552845Sphk * Redistribution and use in source and binary forms, with or without
652845Sphk * modification, are permitted provided that the following conditions
752845Sphk * are met:
852845Sphk * 1. Redistributions of source code must retain the above copyright
952845Sphk *    notice, this list of conditions and the following disclaimer.
1052845Sphk * 2. Redistributions in binary form must reproduce the above copyright
1152845Sphk *    notice, this list of conditions and the following disclaimer in the
1252845Sphk *    documentation and/or other materials provided with the distribution.
1352845Sphk *
1452845Sphk * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1552845Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1652845Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1752845Sphk * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1852845Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1952845Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2052845Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2152845Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2252845Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2352845Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2452845Sphk * SUCH DAMAGE.
2552845Sphk *
2652845Sphk * $FreeBSD: head/usr.sbin/ppp/tun.h 50479 1999-08-28 01:35:59Z peter $
2752845Sphk */
2852845Sphk
2952845Sphkstruct tun_data {
3052845Sphk#ifdef __OpenBSD__
3152845Sphk  u_int32_t head;
32116189Sobrien#endif
3352845Sphk  u_char data[MAX_MRU];
3452845Sphk};
35116189Sobrien
36116189Sobrien#ifdef __OpenBSD__
37116189Sobrien#define tun_fill_header(f,proto) do { (f).head = htonl(proto); } while (0)
3852845Sphk#define tun_check_header(f,proto) ((f).head == htonl(proto))
3952845Sphk#else
4052845Sphk#define tun_fill_header(f,proto) do { } while (0)
41114216Skan#define tun_check_header(f,proto) (1)
4252845Sphk#endif
4352845Sphk
4452845Sphkstruct bundle;
4552845Sphk
4652845Sphkextern void tun_configure(struct bundle *, int);
4752845Sphk