OpenVPN
|
#include "syshead.h"
#include "dco.h"
#include "tun.h"
#include "crypto.h"
#include "ssl_common.h"
#include "openvpn.h"
#include <bcrypt.h>
#include <winsock2.h>
#include <ws2tcpip.h>
Go to the source code of this file.
Functions | |
struct tuntap | create_dco_handle (const char *devname, struct gc_arena *gc) |
bool | ovpn_dco_init (int mode, dco_context_t *dco) |
int | open_tun_dco (struct tuntap *tt, openvpn_net_ctx_t *ctx, const char *dev) |
static void | dco_wait_ready (DWORD idx) |
void | dco_start_tun (struct tuntap *tt) |
static void | dco_connect_wait (HANDLE handle, OVERLAPPED *ov, int timeout, struct signal_info *sig_info) |
void | dco_create_socket (HANDLE handle, struct addrinfo *remoteaddr, bool bind_local, struct addrinfo *bind, int timeout, struct signal_info *sig_info) |
int | dco_new_peer (dco_context_t *dco, unsigned int peerid, int sd, struct sockaddr *localaddr, struct sockaddr *remoteaddr, struct in_addr *remote_in4, struct in6_addr *remote_in6) |
int | dco_del_peer (dco_context_t *dco, unsigned int peerid) |
int | dco_set_peer (dco_context_t *dco, unsigned int peerid, int keepalive_interval, int keepalive_timeout, int mss) |
int | dco_new_key (dco_context_t *dco, unsigned int peerid, int keyid, dco_key_slot_t slot, const uint8_t *encrypt_key, const uint8_t *encrypt_iv, const uint8_t *decrypt_key, const uint8_t *decrypt_iv, const char *ciphername) |
int | dco_del_key (dco_context_t *dco, unsigned int peerid, dco_key_slot_t slot) |
int | dco_swap_keys (dco_context_t *dco, unsigned int peer_id) |
bool | dco_available (int msglevel) |
const char * | dco_version_string (struct gc_arena *gc) |
int | dco_do_read (dco_context_t *dco) |
int | dco_get_peer_stats_multi (dco_context_t *dco, struct multi_context *m) |
int | dco_get_peer_stats (struct context *c) |
void | dco_event_set (dco_context_t *dco, struct event_set *es, void *arg) |
const char * | dco_get_supported_ciphers () |
Definition at line 45 of file dco_win.c.
References tun_open_device(), tuntap::windows_driver, and WINDOWS_DRIVER_DCO.
Referenced by create_socket_dco_win().
|
static |
Definition at line 107 of file dco_win.c.
References get_signal(), M_ERR, M_ERRNO, M_NONFATAL, management_sleep(), msg, register_signal(), and signal_info::signal_received.
Referenced by dco_create_socket().
void dco_create_socket | ( | HANDLE | handle, |
struct addrinfo * | remoteaddr, | ||
bool | bind_local, | ||
struct addrinfo * | bind, | ||
int | timeout, | ||
struct signal_info * | sig_info | ||
) |
Definition at line 159 of file dco_win.c.
References _OVPN_NEW_PEER::Addr4, _OVPN_NEW_PEER::Addr6, addr_family_name(), ASSERT, bind_local(), D_DCO_DEBUG, dco_connect_wait(), _OVPN_NEW_PEER::Local, M_ERR, M_FATAL, msg, OVPN_IOCTL_NEW_PEER, OVPN_PROTO_TCP, OVPN_PROTO_UDP, _OVPN_NEW_PEER::Proto, and _OVPN_NEW_PEER::Remote.
Referenced by create_socket_dco_win().
int dco_del_key | ( | dco_context_t * | dco, |
unsigned int | peerid, | ||
dco_key_slot_t | slot | ||
) |
int dco_del_peer | ( | dco_context_t * | dco, |
unsigned int | peerid | ||
) |
Definition at line 257 of file dco_win.c.
References D_DCO_DEBUG, M_ERRNO, M_WARN, msg, and OVPN_IOCTL_DEL_PEER.
int dco_do_read | ( | dco_context_t * | dco | ) |
void dco_event_set | ( | dco_context_t * | dco, |
struct event_set * | es, | ||
void * | arg | ||
) |
Definition at line 462 of file dco_win.c.
References ASSERT.
Referenced by io_wait_dowork(), and multi_tcp_wait().
int dco_get_peer_stats | ( | struct context * | c | ) |
Definition at line 433 of file dco_win.c.
References context::c1, context::c2, context_2::dco_read_bytes, context_2::dco_write_bytes, tuntap::hand, M_ERRNO, M_WARN, msg, OVPN_IOCTL_GET_STATS, _OVPN_STATS::TransportBytesReceived, _OVPN_STATS::TransportBytesSent, context_2::tun_read_bytes, context_2::tun_write_bytes, _OVPN_STATS::TunBytesReceived, _OVPN_STATS::TunBytesSent, context_1::tuntap, and tuntap_defined().
Referenced by check_inactivity_timeout(), man_persist_client_stats(), management_check_bytecount(), and print_status().
int dco_get_peer_stats_multi | ( | dco_context_t * | dco, |
struct multi_context * | m | ||
) |
Definition at line 426 of file dco_win.c.
Referenced by multi_print_status(), and setenv_stats().
const char* dco_get_supported_ciphers | ( | ) |
Definition at line 469 of file dco_win.c.
References status.
Referenced by options_postprocess_setdefault_ncpciphers().
int dco_new_key | ( | dco_context_t * | dco, |
unsigned int | peerid, | ||
int | keyid, | ||
dco_key_slot_t | slot, | ||
const uint8_t * | encrypt_key, | ||
const uint8_t * | encrypt_iv, | ||
const uint8_t * | decrypt_key, | ||
const uint8_t * | decrypt_iv, | ||
const char * | ciphername | ||
) |
Definition at line 295 of file dco_win.c.
References ASSERT, cipher_kt_key_size(), _OVPN_CRYPTO_DATA::CipherAlg, D_DCO_DEBUG, _OVPN_CRYPTO_DATA::Decrypt, _OVPN_CRYPTO_DATA::Encrypt, _OVPN_KEY_DIRECTION::Key, _OVPN_CRYPTO_DATA::KeyId, _OVPN_KEY_DIRECTION::KeyLen, _OVPN_CRYPTO_DATA::KeySlot, M_ERR, msg, _OVPN_KEY_DIRECTION::NonceTail, OVPN_IOCTL_NEW_KEY, and _OVPN_CRYPTO_DATA::PeerId.
int dco_new_peer | ( | dco_context_t * | dco, |
unsigned int | peerid, | ||
int | sd, | ||
struct sockaddr * | localaddr, | ||
struct sockaddr * | remoteaddr, | ||
struct in_addr * | remote_in4, | ||
struct in6_addr * | remote_in6 | ||
) |
Definition at line 248 of file dco_win.c.
References D_DCO_DEBUG, and msg.
int dco_set_peer | ( | dco_context_t * | dco, |
unsigned int | peerid, | ||
int | keepalive_interval, | ||
int | keepalive_timeout, | ||
int | mss | ||
) |
Definition at line 272 of file dco_win.c.
References D_DCO_DEBUG, _OVPN_SET_PEER::KeepaliveInterval, _OVPN_SET_PEER::KeepaliveTimeout, M_ERRNO, M_WARN, msg, _OVPN_SET_PEER::MSS, and OVPN_IOCTL_SET_PEER.
Referenced by multi_client_setup_dco_initial(), and p2p_set_dco_keepalive().
void dco_start_tun | ( | struct tuntap * | tt | ) |
Definition at line 84 of file dco_win.c.
References tuntap::adapter_index, D_DCO_DEBUG, tuntap::dco, dco_wait_ready(), tuntap::hand, M_ERR, msg, and OVPN_IOCTL_START_VPN.
Referenced by init_tun_post().
int dco_swap_keys | ( | dco_context_t * | dco, |
unsigned int | peer_id | ||
) |
Definition at line 345 of file dco_win.c.
References D_DCO_DEBUG, M_ERR, msg, and OVPN_IOCTL_SWAP_KEYS.
const char* dco_version_string | ( | struct gc_arena * | gc | ) |
Definition at line 387 of file dco_win.c.
References alloc_buf_gc(), BSTR, buf_printf(), _OVPN_VERSION::Major, _OVPN_VERSION::Minor, OVPN_IOCTL_GET_VERSION, and _OVPN_VERSION::Patch.
Referenced by show_dco_version().
|
static |
Definition at line 69 of file dco_win.c.
References D_DCO_DEBUG, and msg.
Referenced by dco_start_tun().
int open_tun_dco | ( | struct tuntap * | tt, |
openvpn_net_ctx_t * | ctx, | ||
const char * | dev | ||
) |
bool ovpn_dco_init | ( | int | mode, |
dco_context_t * | dco | ||
) |
Definition at line 56 of file dco_win.c.
Referenced by do_open_tun().