1/* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */
2
3/*
4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
5 * Nottingham University 1987.
6 *
7 * This source may be freely distributed, however I would be interested
8 * in any changes that are made.
9 *
10 * This driver takes packets off the IP i/f and hands them up to a
11 * user process to have its wicked way with. This driver has it's
12 * roots in a similar driver written by Phil Cockcroft (formerly) at
13 * UCL. This driver is based much more on read/write/poll mode of
14 * operation though.
15 *
16 * $FreeBSD: head/sys/net/if_tun.c 66067 2000-09-19 10:28:44Z phk $
17 */
18
19#include "opt_inet.h"
20
21#include <sys/param.h>
22#include <sys/proc.h>
23#include <sys/systm.h>
24#include <sys/mbuf.h>
--- 99 unchanged lines hidden (view full) ---
124static void
125tuncreate(dev)
126 dev_t dev;
127{
128 struct tun_softc *sc;
129 struct ifnet *ifp;
130
131 dev = make_dev(&tun_cdevsw, minor(dev),
132 UID_UUCP, GID_DIALER, 0600, "tun%d", dev2unit(dev));
133
134 MALLOC(sc, struct tun_softc *, sizeof(*sc), M_TUN, M_WAITOK);
135 bzero(sc, sizeof *sc);
136 sc->tun_flags = TUN_INITED;
137
138 ifp = &sc->tun_if;
139 ifp->if_unit = dev2unit(dev);
140 ifp->if_name = "tun";
141 ifp->if_mtu = TUNMTU;
142 ifp->if_ioctl = tunifioctl;
143 ifp->if_output = tunoutput;
144 ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
145 ifp->if_type = IFT_PPP;
146 ifp->if_snd.ifq_maxlen = ifqmaxlen;
147 ifp->if_softc = sc;
--- 596 unchanged lines hidden ---
2
3/*
4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
5 * Nottingham University 1987.
6 *
7 * This source may be freely distributed, however I would be interested
8 * in any changes that are made.
9 *
10 * This driver takes packets off the IP i/f and hands them up to a
11 * user process to have its wicked way with. This driver has it's
12 * roots in a similar driver written by Phil Cockcroft (formerly) at
13 * UCL. This driver is based much more on read/write/poll mode of
14 * operation though.
15 *
16 * $FreeBSD: head/sys/net/if_tun.c 66067 2000-09-19 10:28:44Z phk $
17 */
18
19#include "opt_inet.h"
20
21#include <sys/param.h>
22#include <sys/proc.h>
23#include <sys/systm.h>
24#include <sys/mbuf.h>
--- 99 unchanged lines hidden (view full) ---
124static void
125tuncreate(dev)
126 dev_t dev;
127{
128 struct tun_softc *sc;
129 struct ifnet *ifp;
130
131 dev = make_dev(&tun_cdevsw, minor(dev),
132 UID_UUCP, GID_DIALER, 0600, "tun%d", dev2unit(dev));
133
134 MALLOC(sc, struct tun_softc *, sizeof(*sc), M_TUN, M_WAITOK);
135 bzero(sc, sizeof *sc);
136 sc->tun_flags = TUN_INITED;
137
138 ifp = &sc->tun_if;
139 ifp->if_unit = dev2unit(dev);
140 ifp->if_name = "tun";
141 ifp->if_mtu = TUNMTU;
142 ifp->if_ioctl = tunifioctl;
143 ifp->if_output = tunoutput;
144 ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
145 ifp->if_type = IFT_PPP;
146 ifp->if_snd.ifq_maxlen = ifqmaxlen;
147 ifp->if_softc = sc;
--- 596 unchanged lines hidden ---