"Fossies" - the Fresh Open Source Software Archive

Member "vpnc-0.5.3/tap-win32.h" (19 Nov 2008, 3532 Bytes) of package /linux/privat/old/vpnc-0.5.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "tap-win32.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  *  This file has been borrowed from the Win32 OpenVPN Tap driver
    3  *  (common.h is the original file name).
    4  *
    5  *  TAP-Win32 -- A kernel driver to provide virtual tap device functionality
    6  *               on Windows.  Originally derived from the CIPE-Win32
    7  *               project by Damion K. Wilson, with extensive modifications by
    8  *               James Yonan.
    9  *
   10  *  All source code which derives from the CIPE-Win32 project is
   11  *  Copyright (C) Damion K. Wilson, 2003, and is released under the
   12  *  GPL version 2 (see below).
   13  *
   14  *  All other source code is Copyright (C) 2002-2005 OpenVPN Solutions LLC,
   15  *  and is released under the GPL version 2 (see below).
   16  *
   17  *  This program is free software; you can redistribute it and/or modify
   18  *  it under the terms of the GNU General Public License version 2
   19  *  as published by the Free Software Foundation.
   20  *
   21  *  This program is distributed in the hope that it will be useful,
   22  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   23  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   24  *  GNU General Public License for more details.
   25  *
   26  *  You should have received a copy of the GNU General Public License
   27  *  along with this program (see the file COPYING included with this
   28  *  distribution); if not, write to the Free Software Foundation, Inc.,
   29  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   30  */
   31 
   32 /* ===============================================
   33     This file is included both by OpenVPN and
   34     the TAP-Win32 driver and contains definitions
   35     common to both.
   36    =============================================== */
   37 
   38 /* =============
   39     TAP IOCTLs
   40    ============= */
   41 
   42 #define TAP_CONTROL_CODE(request,method) \
   43   CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)
   44 
   45 /* Present in 8.1 */
   46 
   47 #define TAP_IOCTL_GET_MAC               TAP_CONTROL_CODE (1, METHOD_BUFFERED)
   48 #define TAP_IOCTL_GET_VERSION           TAP_CONTROL_CODE (2, METHOD_BUFFERED)
   49 #define TAP_IOCTL_GET_MTU               TAP_CONTROL_CODE (3, METHOD_BUFFERED)
   50 #define TAP_IOCTL_GET_INFO              TAP_CONTROL_CODE (4, METHOD_BUFFERED)
   51 #define TAP_IOCTL_CONFIG_POINT_TO_POINT TAP_CONTROL_CODE (5, METHOD_BUFFERED)
   52 #define TAP_IOCTL_SET_MEDIA_STATUS      TAP_CONTROL_CODE (6, METHOD_BUFFERED)
   53 #define TAP_IOCTL_CONFIG_DHCP_MASQ      TAP_CONTROL_CODE (7, METHOD_BUFFERED)
   54 #define TAP_IOCTL_GET_LOG_LINE          TAP_CONTROL_CODE (8, METHOD_BUFFERED)
   55 #define TAP_IOCTL_CONFIG_DHCP_SET_OPT   TAP_CONTROL_CODE (9, METHOD_BUFFERED)
   56 
   57 /* Added in 8.2 */
   58 
   59 /* obsoletes TAP_IOCTL_CONFIG_POINT_TO_POINT */
   60 #define TAP_IOCTL_CONFIG_TUN            TAP_CONTROL_CODE (10, METHOD_BUFFERED)
   61 
   62 /* =================
   63     Registry keys
   64    ================= */
   65 
   66 #define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
   67 
   68 #define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
   69 
   70 /* ======================
   71     Filesystem prefixes
   72    ====================== */
   73 
   74 #define USERMODEDEVICEDIR "\\\\.\\Global\\"
   75 #define SYSDEVICEDIR      "\\Device\\"
   76 #define USERDEVICEDIR     "\\DosDevices\\Global\\"
   77 #define TAPSUFFIX         ".tap"
   78 
   79 /* =========================================================
   80     TAP_COMPONENT_ID -- These strings defines the TAP driver
   81     types -- different component IDs can reside in the system
   82     simultaneously.
   83    ========================================================= */
   84 
   85 static const char* TAP_COMPONENT_ID[] = { "tap0901", "tap0801", NULL };