if_gif.c (198357) | if_gif.c (207369) |
---|---|
1/* $FreeBSD: head/sys/net/if_gif.c 198357 2009-10-22 06:17:04Z brueffer $ */ | 1/* $FreeBSD: head/sys/net/if_gif.c 207369 2010-04-29 11:52:42Z bz $ */ |
2/* $KAME: if_gif.c,v 1.87 2001/10/19 08:50:27 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 79 unchanged lines hidden (view full) --- 89 90#define GIFNAME "gif" 91 92/* 93 * gif_mtx protects the global gif_softc_list. 94 */ 95static struct mtx gif_mtx; 96static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); | 2/* $KAME: if_gif.c,v 1.87 2001/10/19 08:50:27 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 79 unchanged lines hidden (view full) --- 89 90#define GIFNAME "gif" 91 92/* 93 * gif_mtx protects the global gif_softc_list. 94 */ 95static struct mtx gif_mtx; 96static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); |
97 | |
98static VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list); | 97static VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list); |
99 | |
100#define V_gif_softc_list VNET(gif_softc_list) 101 | 98#define V_gif_softc_list VNET(gif_softc_list) 99 |
102#ifdef INET 103VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; 104#define V_ip_gif_ttl VNET(ip_gif_ttl) 105#endif 106#ifdef INET6 107VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM; 108#define V_ip6_gif_hlim VNET(ip6_gif_hlim) 109#endif 110 | |
111void (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af); 112void (*ng_gif_input_orphan_p)(struct ifnet *ifp, struct mbuf *m, int af); 113void (*ng_gif_attach_p)(struct ifnet *ifp); 114void (*ng_gif_detach_p)(struct ifnet *ifp); 115 116static void gif_start(struct ifnet *); 117static int gif_clone_create(struct if_clone *, int, caddr_t); 118static void gif_clone_destroy(struct ifnet *); --- 11 unchanged lines hidden (view full) --- 130 * Since, setting a large value to this macro with a careless configuration 131 * may introduce system crash, we don't allow any nestings by default. 132 * If you need to configure nested gif tunnels, you can define this macro 133 * in your kernel configuration file. However, if you do so, please be 134 * careful to configure the tunnels so that it won't make a loop. 135 */ 136#define MAX_GIF_NEST 1 137#endif | 100void (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af); 101void (*ng_gif_input_orphan_p)(struct ifnet *ifp, struct mbuf *m, int af); 102void (*ng_gif_attach_p)(struct ifnet *ifp); 103void (*ng_gif_detach_p)(struct ifnet *ifp); 104 105static void gif_start(struct ifnet *); 106static int gif_clone_create(struct if_clone *, int, caddr_t); 107static void gif_clone_destroy(struct ifnet *); --- 11 unchanged lines hidden (view full) --- 119 * Since, setting a large value to this macro with a careless configuration 120 * may introduce system crash, we don't allow any nestings by default. 121 * If you need to configure nested gif tunnels, you can define this macro 122 * in your kernel configuration file. However, if you do so, please be 123 * careful to configure the tunnels so that it won't make a loop. 124 */ 125#define MAX_GIF_NEST 1 126#endif |
138 | |
139static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST; 140#define V_max_gif_nesting VNET(max_gif_nesting) | 127static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST; 128#define V_max_gif_nesting VNET(max_gif_nesting) |
141 | |
142SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW, 143 &VNET_NAME(max_gif_nesting), 0, "Max nested tunnels"); 144 | 129SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW, 130 &VNET_NAME(max_gif_nesting), 0, "Max nested tunnels"); 131 |
145#ifdef INET6 146SYSCTL_DECL(_net_inet6_ip6); 147SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_RW, 148 &VNET_NAME(ip6_gif_hlim), 0, ""); 149#endif 150 | |
151/* 152 * By default, we disallow creation of multiple tunnels between the same 153 * pair of addresses. Some applications require this functionality so 154 * we allow control over this check here. 155 */ 156#ifdef XBONEHACK 157static VNET_DEFINE(int, parallel_tunnels) = 1; 158#else 159static VNET_DEFINE(int, parallel_tunnels) = 0; 160#endif 161#define V_parallel_tunnels VNET(parallel_tunnels) | 132/* 133 * By default, we disallow creation of multiple tunnels between the same 134 * pair of addresses. Some applications require this functionality so 135 * we allow control over this check here. 136 */ 137#ifdef XBONEHACK 138static VNET_DEFINE(int, parallel_tunnels) = 1; 139#else 140static VNET_DEFINE(int, parallel_tunnels) = 0; 141#endif 142#define V_parallel_tunnels VNET(parallel_tunnels) |
162 | |
163SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, parallel_tunnels, CTLFLAG_RW, 164 &VNET_NAME(parallel_tunnels), 0, "Allow parallel tunnels?"); 165 166/* copy from src/sys/net/if_ethersubr.c */ 167static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = 168 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 169#ifndef ETHER_IS_BROADCAST 170#define ETHER_IS_BROADCAST(addr) \ --- 873 unchanged lines hidden --- | 143SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, parallel_tunnels, CTLFLAG_RW, 144 &VNET_NAME(parallel_tunnels), 0, "Allow parallel tunnels?"); 145 146/* copy from src/sys/net/if_ethersubr.c */ 147static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = 148 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 149#ifndef ETHER_IS_BROADCAST 150#define ETHER_IS_BROADCAST(addr) \ --- 873 unchanged lines hidden --- |