182cd038dSYoshinobu Inoue /* 282cd038dSYoshinobu Inoue * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 382cd038dSYoshinobu Inoue * All rights reserved. 482cd038dSYoshinobu Inoue * 582cd038dSYoshinobu Inoue * Redistribution and use in source and binary forms, with or without 682cd038dSYoshinobu Inoue * modification, are permitted provided that the following conditions 782cd038dSYoshinobu Inoue * are met: 882cd038dSYoshinobu Inoue * 1. Redistributions of source code must retain the above copyright 982cd038dSYoshinobu Inoue * notice, this list of conditions and the following disclaimer. 1082cd038dSYoshinobu Inoue * 2. Redistributions in binary form must reproduce the above copyright 1182cd038dSYoshinobu Inoue * notice, this list of conditions and the following disclaimer in the 1282cd038dSYoshinobu Inoue * documentation and/or other materials provided with the distribution. 1382cd038dSYoshinobu Inoue * 3. Neither the name of the project nor the names of its contributors 1482cd038dSYoshinobu Inoue * may be used to endorse or promote products derived from this software 1582cd038dSYoshinobu Inoue * without specific prior written permission. 1682cd038dSYoshinobu Inoue * 1782cd038dSYoshinobu Inoue * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 1882cd038dSYoshinobu Inoue * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1982cd038dSYoshinobu Inoue * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2082cd038dSYoshinobu Inoue * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 2182cd038dSYoshinobu Inoue * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2282cd038dSYoshinobu Inoue * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2382cd038dSYoshinobu Inoue * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2482cd038dSYoshinobu Inoue * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2582cd038dSYoshinobu Inoue * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2682cd038dSYoshinobu Inoue * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2782cd038dSYoshinobu Inoue * SUCH DAMAGE. 2882cd038dSYoshinobu Inoue * 2982cd038dSYoshinobu Inoue * $FreeBSD$ 3082cd038dSYoshinobu Inoue */ 3182cd038dSYoshinobu Inoue 3282cd038dSYoshinobu Inoue /* 3382cd038dSYoshinobu Inoue * if_gif.h 3482cd038dSYoshinobu Inoue */ 3582cd038dSYoshinobu Inoue 3682cd038dSYoshinobu Inoue #ifndef _NET_IF_GIF_H_ 3782cd038dSYoshinobu Inoue #define _NET_IF_GIF_H_ 3882cd038dSYoshinobu Inoue 3982cd038dSYoshinobu Inoue #include <netinet/in.h> 4082cd038dSYoshinobu Inoue /* xxx sigh, why route have struct route instead of pointer? */ 4182cd038dSYoshinobu Inoue 4282cd038dSYoshinobu Inoue struct gif_softc { 4382cd038dSYoshinobu Inoue struct ifnet gif_if; /* common area */ 4482cd038dSYoshinobu Inoue struct sockaddr *gif_psrc; /* Physical src addr */ 4582cd038dSYoshinobu Inoue struct sockaddr *gif_pdst; /* Physical dst addr */ 4682cd038dSYoshinobu Inoue union { 4782cd038dSYoshinobu Inoue struct route gifscr_ro; /* xxx */ 4882cd038dSYoshinobu Inoue struct route_in6 gifscr_ro6; /* xxx */ 4982cd038dSYoshinobu Inoue } gifsc_gifscr; 5082cd038dSYoshinobu Inoue int gif_flags; 5182cd038dSYoshinobu Inoue }; 5282cd038dSYoshinobu Inoue 5382cd038dSYoshinobu Inoue #define gif_ro gifsc_gifscr.gifscr_ro 5482cd038dSYoshinobu Inoue #define gif_ro6 gifsc_gifscr.gifscr_ro6 5582cd038dSYoshinobu Inoue 5682cd038dSYoshinobu Inoue #define GIFF_INUSE 0x1 /* gif is in use */ 5782cd038dSYoshinobu Inoue 5882cd038dSYoshinobu Inoue #define GIF_MTU (1280) /* Default MTU */ 5982cd038dSYoshinobu Inoue #define GIF_MTU_MIN (1280) /* Minimum MTU */ 6082cd038dSYoshinobu Inoue #define GIF_MTU_MAX (8192) /* Maximum MTU */ 6182cd038dSYoshinobu Inoue 6282cd038dSYoshinobu Inoue extern int ngif; 6382cd038dSYoshinobu Inoue extern struct gif_softc *gif; 6482cd038dSYoshinobu Inoue 6582cd038dSYoshinobu Inoue /* Prototypes */ 6682cd038dSYoshinobu Inoue void gif_input __P((struct mbuf *, int, struct ifnet *)); 6782cd038dSYoshinobu Inoue int gif_output __P((struct ifnet *, struct mbuf *, 6882cd038dSYoshinobu Inoue struct sockaddr *, struct rtentry *)); 6982cd038dSYoshinobu Inoue int gif_ioctl __P((struct ifnet *, u_long, caddr_t)); 7082cd038dSYoshinobu Inoue 7182cd038dSYoshinobu Inoue #endif /* _NET_IF_GIF_H_ */ 72