OpenVPN
|
#include <windows.h>
#include <winioctl.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | tun_ring |
Wintun ring buffer See https://github.com/WireGuard/wintun#ring-layout. More... | |
struct | tun_register_rings |
Struct for ring buffers registration See https://github.com/WireGuard/wintun#registering-rings. More... | |
struct | TUN_PACKET_HEADER |
struct | TUN_PACKET |
Macros | |
#define | WINTUN_RING_CAPACITY 0x800000 |
#define | WINTUN_RING_TRAILING_BYTES 0x10000 |
#define | WINTUN_MAX_PACKET_SIZE 0xffff |
#define | WINTUN_PACKET_ALIGN 4 |
#define | TUN_IOCTL_REGISTER_RINGS CTL_CODE(51820U, 0x970U, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) |
Functions | |
static bool | register_ring_buffers (HANDLE device, struct tun_ring *send_ring, struct tun_ring *receive_ring, HANDLE send_tail_moved, HANDLE receive_tail_moved) |
Registers ring buffers used to exchange data between userspace openvpn process and wintun kernel driver, see https://github.com/WireGuard/wintun#registering-rings. More... | |
#define TUN_IOCTL_REGISTER_RINGS CTL_CODE(51820U, 0x970U, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) |
Definition at line 44 of file ring_buffer.h.
#define WINTUN_MAX_PACKET_SIZE 0xffff |
Definition at line 41 of file ring_buffer.h.
#define WINTUN_PACKET_ALIGN 4 |
Definition at line 42 of file ring_buffer.h.
#define WINTUN_RING_CAPACITY 0x800000 |
Definition at line 39 of file ring_buffer.h.
#define WINTUN_RING_TRAILING_BYTES 0x10000 |
Definition at line 40 of file ring_buffer.h.
|
inlinestatic |
Registers ring buffers used to exchange data between userspace openvpn process and wintun kernel driver, see https://github.com/WireGuard/wintun#registering-rings.
device | handle to opened wintun device |
send_ring | pointer to send ring |
receive_ring | pointer to receive ring |
send_tail_moved | event set by wintun to signal openvpn that data is available for reading in send ring |
receive_tail_moved | event set by openvpn to signal wintun that data has been written to receive ring |
Definition at line 98 of file ring_buffer.h.
References tun_register_rings::receive, tun_register_rings::ring, tun_register_rings::ring_size, tun_register_rings::send, tun_register_rings::tail_moved, and TUN_IOCTL_REGISTER_RINGS.
Referenced by HandleRegisterRingBuffers(), and wintun_register_ring_buffer().