if_disc.c (8876) | if_disc.c (10429) |
---|---|
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 * From: @(#)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 * From: @(#)if_loop.c 8.1 (Berkeley) 6/10/93 |
34 * $Id: if_disc.c,v 1.3 1995/03/20 19:20:39 wollman Exp $ | 34 * $Id: if_disc.c,v 1.4 1995/05/30 08:08:01 rgrimes Exp $ |
35 */ 36 37/* 38 * Discard interface driver for protocol testing and timing. 39 * (Based on the loopback.) 40 */ 41 42#include <sys/param.h> --- 32 unchanged lines hidden (view full) --- 75#include "bpfilter.h" 76 77#ifdef TINY_DSMTU 78#define DSMTU (1024+512) 79#else 80#define DSMTU 65532 81#endif 82 | 35 */ 36 37/* 38 * Discard interface driver for protocol testing and timing. 39 * (Based on the loopback.) 40 */ 41 42#include <sys/param.h> --- 32 unchanged lines hidden (view full) --- 75#include "bpfilter.h" 76 77#ifdef TINY_DSMTU 78#define DSMTU (1024+512) 79#else 80#define DSMTU 65532 81#endif 82 |
83static void discattach __P((caddr_t udata)); 84PSEUDO_SET(discattach, if_disc); 85 |
|
83static struct ifnet dsif; 84static int dsoutput(struct ifnet *, struct mbuf *, struct sockaddr *, 85 struct rtentry *); 86static int dsioctl(struct ifnet *, int, caddr_t); 87 88/* ARGSUSED */ 89static void | 86static struct ifnet dsif; 87static int dsoutput(struct ifnet *, struct mbuf *, struct sockaddr *, 88 struct rtentry *); 89static int dsioctl(struct ifnet *, int, caddr_t); 90 91/* ARGSUSED */ 92static void |
90discattach(void) | 93discattach(udata) 94 caddr_t udata; |
91{ 92 register struct ifnet *ifp = &dsif; 93 94 ifp->if_name = "ds"; 95 ifp->if_mtu = DSMTU; 96 ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST; 97 ifp->if_ioctl = dsioctl; 98 ifp->if_output = dsoutput; 99 ifp->if_type = IFT_LOOP; 100 ifp->if_hdrlen = 0; 101 ifp->if_addrlen = 0; 102 if_attach(ifp); 103#if NBPFILTER > 0 104 bpfattach(&ifp->if_bpf, ifp, DLT_NULL, sizeof(u_int)); 105#endif 106} 107 | 95{ 96 register struct ifnet *ifp = &dsif; 97 98 ifp->if_name = "ds"; 99 ifp->if_mtu = DSMTU; 100 ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST; 101 ifp->if_ioctl = dsioctl; 102 ifp->if_output = dsoutput; 103 ifp->if_type = IFT_LOOP; 104 ifp->if_hdrlen = 0; 105 ifp->if_addrlen = 0; 106 if_attach(ifp); 107#if NBPFILTER > 0 108 bpfattach(&ifp->if_bpf, ifp, DLT_NULL, sizeof(u_int)); 109#endif 110} 111 |
108PSEUDO_SET(discattach, if_disc); 109 | |
110static int 111dsoutput(ifp, m, dst, rt) 112 struct ifnet *ifp; 113 register struct mbuf *m; 114 struct sockaddr *dst; 115 register struct rtentry *rt; 116{ 117 int s, isr; --- 103 unchanged lines hidden --- | 112static int 113dsoutput(ifp, m, dst, rt) 114 struct ifnet *ifp; 115 register struct mbuf *m; 116 struct sockaddr *dst; 117 register struct rtentry *rt; 118{ 119 int s, isr; --- 103 unchanged lines hidden --- |