1/* 2 * Copyright (C) 1999-2000 by Maksim Yevmenkin <m_evmenkin@yahoo.com> 3 * 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 * BASED ON: 27 * ------------------------------------------------------------------------- 28 * 29 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> 30 * Nottingham University 1987. 31 */ 32 33/* |
34 * $FreeBSD: head/sys/net/if_tap.c 66067 2000-09-19 10:28:44Z phk $ |
35 * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $ 36 */ 37 38#include "opt_inet.h" 39 40#include <sys/param.h> 41#include <sys/conf.h> 42#include <sys/filedesc.h> --- 163 unchanged lines hidden (view full) --- 206 207 /* allocate driver storage and create device */ 208 MALLOC(tp, struct tap_softc *, sizeof(*tp), M_TAP, M_WAITOK); 209 bzero(tp, sizeof(*tp)); 210 211 /* select device: tap or vmnet */ 212 if (minor(dev) & VMNET_DEV_MASK) { 213 name = VMNET; |
214 unit = dev2unit(dev) & 0xff; |
215 tp->tap_flags |= TAP_VMNET; 216 } 217 else { 218 name = TAP; |
219 unit = dev2unit(dev); |
220 } 221 222 tp->tap_dev = make_dev(&tap_cdevsw, minor(dev), UID_ROOT, GID_WHEEL, 223 0600, "%s%d", name, unit); 224 tp->tap_dev->si_drv1 = dev->si_drv1 = tp; 225 226 /* generate fake MAC address: 00 bd xx xx xx unit_no */ 227 macaddr_hi = htons(0x00bd); --- 597 unchanged lines hidden --- |