[1] | 1 | /** @file
|
---|
| 2 | * VirtualBox - TAP for Windows definitions.
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | /*
|
---|
[2981] | 6 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
[1] | 7 | *
|
---|
| 8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
| 9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
| 10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
[5999] | 11 | * General Public License (GPL) as published by the Free Software
|
---|
| 12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
| 13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
| 14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
| 15 | *
|
---|
| 16 | * The contents of this file may alternatively be used under the terms
|
---|
| 17 | * of the Common Development and Distribution License Version 1.0
|
---|
| 18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
| 19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
| 20 | * CDDL are applicable instead of those of the GPL.
|
---|
| 21 | *
|
---|
| 22 | * You may elect to license modified versions of this file under the
|
---|
| 23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
[1] | 24 | */
|
---|
| 25 |
|
---|
[3632] | 26 | #ifndef ___VBox_tapwin32_h
|
---|
| 27 | #define ___VBox_tapwin32_h
|
---|
[1] | 28 |
|
---|
[505] | 29 | #define TAP_DRIVER_MAJOR_VERSION 8
|
---|
[554] | 30 | #define TAP_DRIVER_MINOR_VERSION 2
|
---|
[1] | 31 |
|
---|
| 32 | //=============
|
---|
| 33 | // TAP IOCTLs
|
---|
| 34 | //=============
|
---|
| 35 |
|
---|
[554] | 36 | #pragma pack(4)
|
---|
[1] | 37 | typedef struct
|
---|
| 38 | {
|
---|
[505] | 39 | ULONG major;
|
---|
| 40 | ULONG minor;
|
---|
| 41 | ULONG debug;
|
---|
[1] | 42 | } TAP_VERSION;
|
---|
| 43 |
|
---|
| 44 | typedef struct
|
---|
| 45 | {
|
---|
| 46 | LONG fConnect;
|
---|
| 47 | } TAP_MEDIASTATUS;
|
---|
| 48 |
|
---|
[554] | 49 | typedef struct
|
---|
| 50 | {
|
---|
| 51 | ULONG cb;
|
---|
| 52 | PVOID pPacket;
|
---|
| 53 | } TAP_SCATTER_GATHER_ITEM;
|
---|
| 54 |
|
---|
| 55 | /** Arbitrary maximum for sanity checks. */
|
---|
| 56 | #define TAP_SCATTER_GATHER_MAX_PACKETS 64
|
---|
| 57 |
|
---|
| 58 | typedef struct
|
---|
| 59 | {
|
---|
| 60 | ULONG cPackets;
|
---|
| 61 | TAP_SCATTER_GATHER_ITEM aPacket[1];
|
---|
| 62 | } TAP_SCATTER_GATHER_LIST, *PTAP_SCATTER_GATHER_LIST;
|
---|
[561] | 63 |
|
---|
| 64 | typedef struct
|
---|
| 65 | {
|
---|
| 66 | ULONG cPackets;
|
---|
| 67 | TAP_SCATTER_GATHER_ITEM aPacket[TAP_SCATTER_GATHER_MAX_PACKETS];
|
---|
| 68 | } TAP_SCATTER_GATHER_LIST_MAX, *PTAP_SCATTER_GATHER_LIST_MAX;
|
---|
| 69 |
|
---|
[554] | 70 | #pragma pack()
|
---|
| 71 |
|
---|
[1] | 72 | #define TAP_CONTROL_CODE(request,method) \
|
---|
| 73 | CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)
|
---|
| 74 |
|
---|
[554] | 75 | #define TAP_IOCTL_GET_MAC TAP_CONTROL_CODE (1, METHOD_BUFFERED)
|
---|
| 76 | #define TAP_IOCTL_GET_VERSION TAP_CONTROL_CODE (2, METHOD_BUFFERED)
|
---|
| 77 | #define TAP_IOCTL_GET_MTU TAP_CONTROL_CODE (3, METHOD_BUFFERED)
|
---|
| 78 | #define TAP_IOCTL_GET_INFO TAP_CONTROL_CODE (4, METHOD_BUFFERED)
|
---|
| 79 | #define TAP_IOCTL_CONFIG_POINT_TO_POINT TAP_CONTROL_CODE (5, METHOD_BUFFERED)
|
---|
| 80 | #define TAP_IOCTL_SET_MEDIA_STATUS TAP_CONTROL_CODE (6, METHOD_BUFFERED)
|
---|
| 81 | #define TAP_IOCTL_CONFIG_DHCP_MASQ TAP_CONTROL_CODE (7, METHOD_BUFFERED)
|
---|
| 82 | #define TAP_IOCTL_GET_LOG_LINE TAP_CONTROL_CODE (8, METHOD_BUFFERED)
|
---|
| 83 | #define TAP_IOCTL_CONFIG_DHCP_SET_OPT TAP_CONTROL_CODE (9, METHOD_BUFFERED)
|
---|
| 84 | /* Starting with version 8.2 */
|
---|
| 85 | #define TAP_IOCTL_TRANSFER_ETHPACKETS TAP_CONTROL_CODE (10, METHOD_BUFFERED)
|
---|
[1] | 86 |
|
---|
| 87 |
|
---|
[3633] | 88 | #endif
|
---|