if_loop.c (71862) | if_loop.c (77843) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)if_loop.c 8.1 (Berkeley) 6/10/93 | 1/* 2 * Copyright (c) 1982, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)if_loop.c 8.1 (Berkeley) 6/10/93 |
34 * $FreeBSD: head/sys/net/if_loop.c 71862 2001-01-31 07:58:58Z peter $ | 34 * $FreeBSD: head/sys/net/if_loop.c 77843 2001-06-06 22:17:08Z peter $ |
35 */ 36 37/* 38 * Loopback interface driver for protocol testing and timing. 39 */ 40 41#include "opt_atalk.h" 42#include "opt_inet.h" --- 53 unchanged lines hidden (view full) --- 96#ifdef TINY_LOMTU 97#define LOMTU (1024+512) 98#elif defined(LARGE_LOMTU) 99#define LOMTU 131072 100#else 101#define LOMTU 16384 102#endif 103 | 35 */ 36 37/* 38 * Loopback interface driver for protocol testing and timing. 39 */ 40 41#include "opt_atalk.h" 42#include "opt_inet.h" --- 53 unchanged lines hidden (view full) --- 96#ifdef TINY_LOMTU 97#define LOMTU (1024+512) 98#elif defined(LARGE_LOMTU) 99#define LOMTU 131072 100#else 101#define LOMTU 16384 102#endif 103 |
104static int nloop; | 104static int nloop = 1; |
105 106struct ifnet *loif; /* Used externally */ 107 108static MALLOC_DEFINE(M_LO, "lo", "Loopback Interface"); 109 110struct lo_softc { 111 struct ifnet sc_if; /* network-visible interface */ 112 LIST_ENTRY(lo_softc) sc_next; --- 61 unchanged lines hidden (view full) --- 174 175static int 176loop_modevent(module_t mod, int type, void *data) 177{ 178 int i; 179 180 switch (type) { 181 case MOD_LOAD: | 105 106struct ifnet *loif; /* Used externally */ 107 108static MALLOC_DEFINE(M_LO, "lo", "Loopback Interface"); 109 110struct lo_softc { 111 struct ifnet sc_if; /* network-visible interface */ 112 LIST_ENTRY(lo_softc) sc_next; --- 61 unchanged lines hidden (view full) --- 174 175static int 176loop_modevent(module_t mod, int type, void *data) 177{ 178 int i; 179 180 switch (type) { 181 case MOD_LOAD: |
182 TUNABLE_INT_FETCH("net.nloop", 1, nloop); | 182 TUNABLE_INT_FETCH("net.nloop", &nloop); |
183 if (nloop < 1) /* sanity check */ 184 nloop = 1; 185 for (i = 0; i < nloop; i++) 186 locreate(i); 187 break; 188 case MOD_UNLOAD: 189 printf("loop module unload - not possible for this module type\n"); 190 return EINVAL; --- 267 unchanged lines hidden --- | 183 if (nloop < 1) /* sanity check */ 184 nloop = 1; 185 for (i = 0; i < nloop; i++) 186 locreate(i); 187 break; 188 case MOD_UNLOAD: 189 printf("loop module unload - not possible for this module type\n"); 190 return EINVAL; --- 267 unchanged lines hidden --- |