1/* $NetBSD: if_gre.h,v 1.13 2003/11/10 08:51:52 wiz Exp $ */ |
2/* $FreeBSD: head/sys/net/if_gre.h 125020 2004-01-26 12:21:59Z sobomax $ */ |
3 4/* 5 * Copyright (c) 1998 The NetBSD Foundation, Inc. 6 * All rights reserved 7 * 8 * This code is derived from software contributed to The NetBSD Foundation 9 * by Heiko W.Rupp <hwr@pilhuhn.de> 10 * --- 7 unchanged lines hidden (view full) --- 18 * documentation and/or other materials provided with the distribution. 19 * 3. All advertising materials mentioning features or use of this software 20 * must display the following acknowledgement: 21 * This product includes software developed by the NetBSD 22 * Foundation, Inc. and its contributors. 23 * 4. Neither the name of The NetBSD Foundation nor the names of its 24 * contributors may be used to endorse or promote products derived 25 * from this software without specific prior written permission. |
26 * |
27 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 28 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 29 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 30 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 31 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN --- 18 unchanged lines hidden (view full) --- 53 struct in_addr g_dst; /* destination address of gre packets */ 54 struct route route; /* routing entry that determines, where a 55 encapsulated packet should go */ 56 u_char g_proto; /* protocol of encapsulator */ 57 58 const struct encaptab *encap; /* encapsulation cookie */ 59 60 int called; /* infinite recursion preventer */ |
61}; |
62 63 64struct gre_h { 65 u_int16_t flags; /* GRE flags */ |
66 u_int16_t ptype; /* protocol type of payload typically |
67 Ether protocol type*/ |
68/* 69 * from here on: fields are optional, presence indicated by flags |
70 * 71 u_int_16 checksum checksum (one-complements of GRE header 72 and payload 73 Present if (ck_pres | rt_pres == 1). 74 Valid if (ck_pres == 1). 75 u_int_16 offset offset from start of routing filed to 76 first octet of active SRE (see below). 77 Present if (ck_pres | rt_pres == 1). --- 35 unchanged lines hidden (view full) --- 113 114/* 115 * gre_sre defines a Source route Entry. These are needed if packets 116 * should be routed over more than one tunnel hop by hop 117 */ 118struct gre_sre { 119 u_int16_t sre_family; /* address family */ 120 u_char sre_offset; /* offset to first octet of active entry */ |
121 u_char sre_length; /* number of octets in the SRE. |
122 sre_lengthl==0 -> last entry. */ 123 u_char *sre_rtinfo; /* the routing information */ 124}; 125 126struct greioctl { 127 int unit; 128 struct in_addr addr; 129}; --- 16 unchanged lines hidden (view full) --- 146#define MOB_H_SIZ_S (sizeof(struct mobile_h) - sizeof(u_int32_t)) 147#define MOB_H_SIZ_L (sizeof(struct mobile_h)) 148#define MOB_H_SBIT 0x0080 149 150#define GRE_TTL 30 151 152#endif /* _KERNEL */ 153 |
154/* 155 * ioctls needed to manipulate the interface |
156 */ 157 158#define GRESADDRS _IOW('i', 101, struct ifreq) |
159#define GRESADDRD _IOW('i', 102, struct ifreq) |
160#define GREGADDRS _IOWR('i', 103, struct ifreq) 161#define GREGADDRD _IOWR('i', 104, struct ifreq) 162#define GRESPROTO _IOW('i' , 105, struct ifreq) 163#define GREGPROTO _IOWR('i', 106, struct ifreq) 164 165#ifdef _KERNEL 166LIST_HEAD(gre_softc_head, gre_softc); 167extern struct gre_softc_head gre_softc_list; 168 169u_int16_t gre_in_cksum(u_int16_t *, u_int); 170#endif /* _KERNEL */ 171 172#endif |