OpenVPN
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
interactive.c File Reference
#include "service.h"
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <userenv.h>
#include <accctrl.h>
#include <aclapi.h>
#include <stdio.h>
#include <sddl.h>
#include <shellapi.h>
#include <mstcpip.h>
#include <inttypes.h>
#include <versionhelpers.h>
#include "openvpn-msg.h"
#include "validate.h"
#include "wfp_block.h"
#include "ring_buffer.h"
Include dependency graph for interactive.c:

Go to the source code of this file.

Data Structures

struct  STARTUP_DATA
 
struct  _list_item
 
struct  wfp_block_data_t
 
struct  ring_buffer_maps_t
 
union  pipe_message_t
 

Macros

#define IO_TIMEOUT   2000 /*ms*/
 
#define ERROR_OPENVPN_STARTUP   0x20000000
 
#define ERROR_STARTUP_DATA   0x20000001
 
#define ERROR_MESSAGE_DATA   0x20000002
 
#define ERROR_MESSAGE_TYPE   0x20000003
 
#define RDNS_TIMEOUT   600 /* seconds to wait for the semaphore */
 
#define TUN_IOCTL_REGISTER_RINGS   CTL_CODE(51820U, 0x970U, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
 

Typedefs

typedef struct _list_item list_item_t
 
typedef list_item_tundo_lists_t[_undo_type_max]
 
typedef BOOL(* match_fn_t) (LPVOID item, LPVOID ctx)
 

Enumerations

enum  undo_type_t {
  address, route, wfp_block, undo_dns4,
  undo_dns6, undo_domain, undo_ring_buffer, undo_wins,
  _undo_type_max
}
 
enum  async_op_t { peek, read, write }
 

Functions

static DWORD AddListItem (list_item_t **pfirst, LPVOID data)
 
static LPVOID RemoveListItem (list_item_t **pfirst, match_fn_t match, LPVOID ctx)
 
static HANDLE CloseHandleEx (LPHANDLE handle)
 
static void OvpnUnmapViewOfFile (struct tun_ring **ring)
 
static void UnmapRingBuffer (ring_buffer_maps_t *ring_buffer_maps)
 
static HANDLE InitOverlapped (LPOVERLAPPED overlapped)
 
static BOOL ResetOverlapped (LPOVERLAPPED overlapped)
 
static DWORD AsyncPipeOp (async_op_t op, HANDLE pipe, LPVOID buffer, DWORD size, DWORD count, LPHANDLE events)
 
static DWORD PeekNamedPipeAsync (HANDLE pipe, DWORD count, LPHANDLE events)
 
static DWORD ReadPipeAsync (HANDLE pipe, LPVOID buffer, DWORD size, DWORD count, LPHANDLE events)
 
static DWORD WritePipeAsync (HANDLE pipe, LPVOID data, DWORD size, DWORD count, LPHANDLE events)
 
static VOID ReturnProcessId (HANDLE pipe, DWORD pid, DWORD count, LPHANDLE events)
 
static VOID ReturnError (HANDLE pipe, DWORD error, LPCWSTR func, DWORD count, LPHANDLE events)
 
static VOID ReturnLastError (HANDLE pipe, LPCWSTR func)
 
static BOOL ValidateOptions (HANDLE pipe, const WCHAR *workdir, const WCHAR *options, WCHAR *errmsg, DWORD capacity)
 
static BOOL GetStartupData (HANDLE pipe, STARTUP_DATA *sud)
 
static VOID FreeStartupData (STARTUP_DATA *sud)
 
static SOCKADDR_INET sockaddr_inet (short family, inet_address_t *addr)
 
static DWORD InterfaceLuid (const char *iface_name, PNET_LUID luid)
 
static DWORD ConvertInterfaceNameToIndex (const wchar_t *ifname, NET_IFINDEX *index)
 
static BOOL CmpAddress (LPVOID item, LPVOID address)
 
static DWORD DeleteAddress (PMIB_UNICASTIPADDRESS_ROW addr_row)
 
static DWORD HandleAddressMessage (address_message_t *msg, undo_lists_t *lists)
 
static BOOL CmpRoute (LPVOID item, LPVOID route)
 
static DWORD DeleteRoute (PMIB_IPFORWARD_ROW2 fwd_row)
 
static DWORD HandleRouteMessage (route_message_t *msg, undo_lists_t *lists)
 
static DWORD HandleFlushNeighborsMessage (flush_neighbors_message_t *msg)
 
static void BlockDNSErrHandler (DWORD err, const char *msg)
 
static BOOL CmpAny (LPVOID item, LPVOID any)
 
static DWORD DeleteWfpBlock (const wfp_block_message_t *msg, undo_lists_t *lists)
 
static DWORD AddWfpBlock (const wfp_block_message_t *msg, undo_lists_t *lists)
 
static DWORD HandleWfpBlockMessage (const wfp_block_message_t *msg, undo_lists_t *lists)
 
static DWORD ExecCommand (const WCHAR *argv0, const WCHAR *cmdline, DWORD timeout)
 
static DWORD WINAPI RegisterDNS (LPVOID unused)
 
static DWORD HandleRegisterDNSMessage (void)
 
static DWORD netsh_dns_cmd (const wchar_t *action, const wchar_t *proto, const wchar_t *if_name, const wchar_t *addr)
 Run the command: netsh interface $proto $action dns $if_name $addr [validate=no]. More...
 
static DWORD netsh_wins_cmd (const wchar_t *action, const wchar_t *if_name, const wchar_t *addr)
 Run the command: netsh interface ip $action wins $if_name [static] $addr. More...
 
static DWORD wmic_nicconfig_cmd (const wchar_t *action, const NET_IFINDEX if_index, const wchar_t *data)
 Run command: wmic nicconfig (InterfaceIndex=$if_index) call $action ($data) More...
 
static DWORD DeleteDNS (short family, wchar_t *if_name)
 
static DWORD AddDNS (short family, wchar_t *if_name, wchar_t *addr)
 
static BOOL CmpWString (LPVOID item, LPVOID str)
 
static DWORD SetDNSDomain (const wchar_t *if_name, const char *domain, undo_lists_t *lists)
 Set interface specific DNS domain suffix. More...
 
static DWORD HandleDNSConfigMessage (const dns_cfg_message_t *msg, undo_lists_t *lists)
 
static DWORD HandleWINSConfigMessage (const wins_cfg_message_t *msg, undo_lists_t *lists)
 
static DWORD HandleEnableDHCPMessage (const enable_dhcp_message_t *dhcp)
 
static DWORD OvpnDuplicateHandle (HANDLE ovpn_proc, HANDLE orig_handle, HANDLE *new_handle)
 
static DWORD DuplicateAndMapRing (HANDLE ovpn_proc, HANDLE orig_handle, struct tun_ring **ring)
 
static DWORD HandleRegisterRingBuffers (const register_ring_buffers_message_t *rrb, HANDLE ovpn_proc, undo_lists_t *lists)
 
static DWORD HandleMTUMessage (const set_mtu_message_t *mtu)
 
static VOID HandleMessage (HANDLE pipe, HANDLE ovpn_proc, DWORD bytes, DWORD count, LPHANDLE events, undo_lists_t *lists)
 
static VOID Undo (undo_lists_t *lists)
 
static DWORD WINAPI RunOpenvpn (LPVOID p)
 
static DWORD WINAPI ServiceCtrlInteractive (DWORD ctrl_code, DWORD event, LPVOID data, LPVOID ctx)
 
static HANDLE CreateClientPipeInstance (VOID)
 
static DWORD UpdateWaitHandles (LPHANDLE *handles_ptr, LPDWORD count, HANDLE io_event, HANDLE exit_event, list_item_t *threads)
 
static VOID FreeWaitHandles (LPHANDLE h)
 
static BOOL CmpHandle (LPVOID item, LPVOID hnd)
 
VOID WINAPI ServiceStartInteractiveOwn (DWORD dwArgc, LPTSTR *lpszArgv)
 
VOID WINAPI ServiceStartInteractive (DWORD dwArgc, LPTSTR *lpszArgv)
 

Variables

static SERVICE_STATUS_HANDLE service
 
static SERVICE_STATUS status = { .dwServiceType = SERVICE_WIN32_SHARE_PROCESS }
 
static HANDLE exit_event = NULL
 
static settings_t settings
 
static HANDLE rdns_semaphore = NULL
 
openvpn_service_t interactive_service
 

Macro Definition Documentation

◆ ERROR_MESSAGE_DATA

#define ERROR_MESSAGE_DATA   0x20000002

Definition at line 49 of file interactive.c.

◆ ERROR_MESSAGE_TYPE

#define ERROR_MESSAGE_TYPE   0x20000003

Definition at line 50 of file interactive.c.

◆ ERROR_OPENVPN_STARTUP

#define ERROR_OPENVPN_STARTUP   0x20000000

Definition at line 47 of file interactive.c.

◆ ERROR_STARTUP_DATA

#define ERROR_STARTUP_DATA   0x20000001

Definition at line 48 of file interactive.c.

◆ IO_TIMEOUT

#define IO_TIMEOUT   2000 /*ms*/

Definition at line 45 of file interactive.c.

◆ RDNS_TIMEOUT

#define RDNS_TIMEOUT   600 /* seconds to wait for the semaphore */

Definition at line 57 of file interactive.c.

◆ TUN_IOCTL_REGISTER_RINGS

#define TUN_IOCTL_REGISTER_RINGS   CTL_CODE(51820U, 0x970U, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)

Definition at line 59 of file interactive.c.

Typedef Documentation

◆ list_item_t

typedef struct _list_item list_item_t

◆ match_fn_t

typedef BOOL(* match_fn_t) (LPVOID item, LPVOID ctx)

Definition at line 139 of file interactive.c.

◆ undo_lists_t

typedef list_item_t* undo_lists_t[_undo_type_max]

Definition at line 96 of file interactive.c.

Enumeration Type Documentation

◆ async_op_t

enum async_op_t
Enumerator
peek 
read 
write 

Definition at line 216 of file interactive.c.

◆ undo_type_t

Enumerator
address 
route 
wfp_block 
undo_dns4 
undo_dns6 
undo_domain 
undo_ring_buffer 
undo_wins 
_undo_type_max 

Definition at line 85 of file interactive.c.

Function Documentation

◆ AddDNS()

static DWORD AddDNS ( short  family,
wchar_t *  if_name,
wchar_t *  addr 
)
static

Definition at line 1211 of file interactive.c.

References netsh_dns_cmd().

Referenced by HandleDNSConfigMessage().

◆ AddListItem()

static DWORD AddListItem ( list_item_t **  pfirst,
LPVOID  data 
)
static

◆ AddWfpBlock()

static DWORD AddWfpBlock ( const wfp_block_message_t msg,
undo_lists_t lists 
)
static

◆ AsyncPipeOp()

static DWORD AsyncPipeOp ( async_op_t  op,
HANDLE  pipe,
LPVOID  buffer,
DWORD  size,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 223 of file interactive.c.

References CloseHandleEx(), InitOverlapped(), IO_TIMEOUT, peek, and write.

Referenced by PeekNamedPipeAsync(), ReadPipeAsync(), and WritePipeAsync().

◆ BlockDNSErrHandler()

static void BlockDNSErrHandler ( DWORD  err,
const char *  msg 
)
static

Definition at line 760 of file interactive.c.

References M_ERR, msg, and MsgToEventLog().

Referenced by AddWfpBlock().

◆ CloseHandleEx()

static HANDLE CloseHandleEx ( LPHANDLE  handle)
static

◆ CmpAddress()

static BOOL CmpAddress ( LPVOID  item,
LPVOID  address 
)
static

Definition at line 587 of file interactive.c.

References address.

Referenced by HandleAddressMessage().

◆ CmpAny()

static BOOL CmpAny ( LPVOID  item,
LPVOID  any 
)
static

Definition at line 784 of file interactive.c.

Referenced by DeleteWfpBlock(), and HandleRegisterRingBuffers().

◆ CmpHandle()

static BOOL CmpHandle ( LPVOID  item,
LPVOID  hnd 
)
static

Definition at line 2250 of file interactive.c.

Referenced by ServiceStartInteractive().

◆ CmpRoute()

static BOOL CmpRoute ( LPVOID  item,
LPVOID  route 
)
static

Definition at line 665 of file interactive.c.

References route.

Referenced by HandleRouteMessage().

◆ CmpWString()

static BOOL CmpWString ( LPVOID  item,
LPVOID  str 
)
static

Definition at line 1218 of file interactive.c.

Referenced by HandleDNSConfigMessage(), HandleWINSConfigMessage(), and SetDNSDomain().

◆ ConvertInterfaceNameToIndex()

static DWORD ConvertInterfaceNameToIndex ( const wchar_t *  ifname,
NET_IFINDEX *  index 
)
static

Definition at line 569 of file interactive.c.

References M_ERR, and MsgToEventLog().

Referenced by SetDNSDomain().

◆ CreateClientPipeInstance()

static HANDLE CreateClientPipeInstance ( VOID  )
static

Definition at line 2143 of file interactive.c.

References M_SYSERR, MsgToEventLog(), PACKAGE, and service_instance.

Referenced by ServiceStartInteractive().

◆ DeleteAddress()

static DWORD DeleteAddress ( PMIB_UNICASTIPADDRESS_ROW  addr_row)
static

Definition at line 593 of file interactive.c.

Referenced by HandleAddressMessage(), and Undo().

◆ DeleteDNS()

static DWORD DeleteDNS ( short  family,
wchar_t *  if_name 
)
static

Definition at line 1203 of file interactive.c.

References netsh_dns_cmd().

Referenced by HandleDNSConfigMessage(), and Undo().

◆ DeleteRoute()

static DWORD DeleteRoute ( PMIB_IPFORWARD_ROW2  fwd_row)
static

Definition at line 671 of file interactive.c.

Referenced by HandleRouteMessage(), and Undo().

◆ DeleteWfpBlock()

static DWORD DeleteWfpBlock ( const wfp_block_message_t msg,
undo_lists_t lists 
)
static

◆ DuplicateAndMapRing()

static DWORD DuplicateAndMapRing ( HANDLE  ovpn_proc,
HANDLE  orig_handle,
struct tun_ring **  ring 
)
static

Definition at line 1504 of file interactive.c.

References CloseHandleEx(), M_SYSERR, MsgToEventLog(), and OvpnDuplicateHandle().

Referenced by HandleRegisterRingBuffers().

◆ ExecCommand()

static DWORD ExecCommand ( const WCHAR *  argv0,
const WCHAR *  cmdline,
DWORD  timeout 
)
static

◆ FreeStartupData()

static VOID FreeStartupData ( STARTUP_DATA sud)
static

Definition at line 527 of file interactive.c.

References STARTUP_DATA::directory.

Referenced by RunOpenvpn().

◆ FreeWaitHandles()

static VOID FreeWaitHandles ( LPHANDLE  h)
static

Definition at line 2244 of file interactive.c.

Referenced by ServiceStartInteractive().

◆ GetStartupData()

static BOOL GetStartupData ( HANDLE  pipe,
STARTUP_DATA sud 
)
static

◆ HandleAddressMessage()

static DWORD HandleAddressMessage ( address_message_t msg,
undo_lists_t lists 
)
static

◆ HandleDNSConfigMessage()

static DWORD HandleDNSConfigMessage ( const dns_cfg_message_t msg,
undo_lists_t lists 
)
static

◆ HandleEnableDHCPMessage()

static DWORD HandleEnableDHCPMessage ( const enable_dhcp_message_t dhcp)
static

Definition at line 1451 of file interactive.c.

References ExecCommand(), and get_win_sys_path().

Referenced by HandleMessage().

◆ HandleFlushNeighborsMessage()

static DWORD HandleFlushNeighborsMessage ( flush_neighbors_message_t msg)
static

Definition at line 749 of file interactive.c.

References msg.

Referenced by HandleMessage().

◆ HandleMessage()

static VOID HandleMessage ( HANDLE  pipe,
HANDLE  ovpn_proc,
DWORD  bytes,
DWORD  count,
LPHANDLE  events,
undo_lists_t lists 
)
static

◆ HandleMTUMessage()

static DWORD HandleMTUMessage ( const set_mtu_message_t mtu)
static

◆ HandleRegisterDNSMessage()

static DWORD HandleRegisterDNSMessage ( void  )
static

Definition at line 1014 of file interactive.c.

References RegisterDNS().

Referenced by HandleMessage().

◆ HandleRegisterRingBuffers()

static DWORD HandleRegisterRingBuffers ( const register_ring_buffers_message_t rrb,
HANDLE  ovpn_proc,
undo_lists_t lists 
)
static

◆ HandleRouteMessage()

static DWORD HandleRouteMessage ( route_message_t msg,
undo_lists_t lists 
)
static

◆ HandleWfpBlockMessage()

static DWORD HandleWfpBlockMessage ( const wfp_block_message_t msg,
undo_lists_t lists 
)
static

Definition at line 890 of file interactive.c.

References AddWfpBlock(), DeleteWfpBlock(), msg, and msg_add_wfp_block.

Referenced by HandleMessage().

◆ HandleWINSConfigMessage()

static DWORD HandleWINSConfigMessage ( const wins_cfg_message_t msg,
undo_lists_t lists 
)
static

◆ InitOverlapped()

static HANDLE InitOverlapped ( LPOVERLAPPED  overlapped)
static

Definition at line 194 of file interactive.c.

Referenced by AsyncPipeOp(), and ServiceStartInteractive().

◆ InterfaceLuid()

static DWORD InterfaceLuid ( const char *  iface_name,
PNET_LUID  luid 
)
static

Definition at line 551 of file interactive.c.

References status, and utf8to16().

Referenced by get_default_gateway_ipv6(), HandleAddressMessage(), and HandleRouteMessage().

◆ netsh_dns_cmd()

static DWORD netsh_dns_cmd ( const wchar_t *  action,
const wchar_t *  proto,
const wchar_t *  if_name,
const wchar_t *  addr 
)
static

Run the command: netsh interface $proto $action dns $if_name $addr [validate=no].

Parameters
action"delete" or "add"
proto"ipv6" or "ip"
if_name"name_of_interface"
addrIPv4 (for proto = ip) or IPv6 address as a string

If addr is null and action = "delete" all addresses are deleted.

Definition at line 1049 of file interactive.c.

References ExecCommand(), and get_win_sys_path().

Referenced by AddDNS(), and DeleteDNS().

◆ netsh_wins_cmd()

static DWORD netsh_wins_cmd ( const wchar_t *  action,
const wchar_t *  if_name,
const wchar_t *  addr 
)
static

Run the command: netsh interface ip $action wins $if_name [static] $addr.

Parameters
action"delete", "add" or "set"
if_name"name_of_interface"
addrIPv4 address as a string

If addr is null and action = "delete" all addresses are deleted. if action = "set" then "static" is added before $addr

Definition at line 1108 of file interactive.c.

References ExecCommand(), and get_win_sys_path().

Referenced by HandleWINSConfigMessage(), and Undo().

◆ OvpnDuplicateHandle()

static DWORD OvpnDuplicateHandle ( HANDLE  ovpn_proc,
HANDLE  orig_handle,
HANDLE *  new_handle 
)
static

Definition at line 1489 of file interactive.c.

References M_SYSERR, and MsgToEventLog().

Referenced by DuplicateAndMapRing(), and HandleRegisterRingBuffers().

◆ OvpnUnmapViewOfFile()

static void OvpnUnmapViewOfFile ( struct tun_ring **  ring)
static

Definition at line 177 of file interactive.c.

Referenced by UnmapRingBuffer().

◆ PeekNamedPipeAsync()

static DWORD PeekNamedPipeAsync ( HANDLE  pipe,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 287 of file interactive.c.

References AsyncPipeOp(), and peek.

Referenced by GetStartupData(), and RunOpenvpn().

◆ ReadPipeAsync()

static DWORD ReadPipeAsync ( HANDLE  pipe,
LPVOID  buffer,
DWORD  size,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 293 of file interactive.c.

References AsyncPipeOp(), and read.

Referenced by GetStartupData(), and HandleMessage().

◆ RegisterDNS()

static DWORD WINAPI RegisterDNS ( LPVOID  unused)
static

◆ RemoveListItem()

static LPVOID RemoveListItem ( list_item_t **  pfirst,
match_fn_t  match,
LPVOID  ctx 
)
static

◆ ResetOverlapped()

static BOOL ResetOverlapped ( LPOVERLAPPED  overlapped)
static

Definition at line 203 of file interactive.c.

Referenced by ServiceStartInteractive().

◆ ReturnError()

static VOID ReturnError ( HANDLE  pipe,
DWORD  error,
LPCWSTR  func,
DWORD  count,
LPHANDLE  events 
)
static

◆ ReturnLastError()

static VOID ReturnLastError ( HANDLE  pipe,
LPCWSTR  func 
)
static

Definition at line 359 of file interactive.c.

References exit_event, and ReturnError().

Referenced by GetStartupData(), and RunOpenvpn().

◆ ReturnProcessId()

static VOID ReturnProcessId ( HANDLE  pipe,
DWORD  pid,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 305 of file interactive.c.

References msg, and WritePipeAsync().

Referenced by RunOpenvpn().

◆ RunOpenvpn()

static DWORD WINAPI RunOpenvpn ( LPVOID  p)
static

◆ ServiceCtrlInteractive()

static DWORD WINAPI ServiceCtrlInteractive ( DWORD  ctrl_code,
DWORD  event,
LPVOID  data,
LPVOID  ctx 
)
static

Definition at line 2119 of file interactive.c.

References exit_event, ReportStatusToSCMgr(), service, and status.

Referenced by ServiceStartInteractive().

◆ ServiceStartInteractive()

VOID WINAPI ServiceStartInteractive ( DWORD  dwArgc,
LPTSTR *  lpszArgv 
)

◆ ServiceStartInteractiveOwn()

VOID WINAPI ServiceStartInteractiveOwn ( DWORD  dwArgc,
LPTSTR *  lpszArgv 
)

Definition at line 2257 of file interactive.c.

References ServiceStartInteractive(), and status.

Referenced by _tmain().

◆ SetDNSDomain()

static DWORD SetDNSDomain ( const wchar_t *  if_name,
const char *  domain,
undo_lists_t lists 
)
static

Set interface specific DNS domain suffix.

Parameters
if_namename of the interface
domaina single domain name
listspointer to the undo lists. If NULL undo lists are not altered. Will delete the currently set value if domain is empty.

Definition at line 1232 of file interactive.c.

References AddListItem(), CmpWString(), ConvertInterfaceNameToIndex(), RemoveListItem(), undo_domain, utf8to16(), and wmic_nicconfig_cmd().

Referenced by HandleDNSConfigMessage(), and Undo().

◆ sockaddr_inet()

static SOCKADDR_INET sockaddr_inet ( short  family,
inet_address_t addr 
)
static

Definition at line 534 of file interactive.c.

References inet_address_t::ipv4, and inet_address_t::ipv6.

Referenced by HandleAddressMessage(), and HandleRouteMessage().

◆ Undo()

static VOID Undo ( undo_lists_t lists)
static

◆ UnmapRingBuffer()

static void UnmapRingBuffer ( ring_buffer_maps_t ring_buffer_maps)
static

◆ UpdateWaitHandles()

static DWORD UpdateWaitHandles ( LPHANDLE *  handles_ptr,
LPDWORD  count,
HANDLE  io_event,
HANDLE  exit_event,
list_item_t threads 
)
static

Definition at line 2194 of file interactive.c.

References _list_item::data, exit_event, _list_item::next, and pos().

Referenced by ServiceStartInteractive().

◆ ValidateOptions()

static BOOL ValidateOptions ( HANDLE  pipe,
const WCHAR *  workdir,
const WCHAR *  options,
WCHAR *  errmsg,
DWORD  capacity 
)
static

Definition at line 370 of file interactive.c.

References CheckOption(), IsOption(), settings_t::ovpn_admin_group, and settings.

Referenced by RunOpenvpn().

◆ wmic_nicconfig_cmd()

static DWORD wmic_nicconfig_cmd ( const wchar_t *  action,
const NET_IFINDEX  if_index,
const wchar_t *  data 
)
static

Run command: wmic nicconfig (InterfaceIndex=$if_index) call $action ($data)

Parameters
if_index"index of interface"
actione.g., "SetDNSDomain"
datadata if required for action
  • a single word for SetDNSDomain, empty or NULL to delete
  • comma separated values for a list

Definition at line 1164 of file interactive.c.

References ExecCommand(), and get_win_sys_path().

Referenced by SetDNSDomain().

◆ WritePipeAsync()

static DWORD WritePipeAsync ( HANDLE  pipe,
LPVOID  data,
DWORD  size,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 299 of file interactive.c.

References AsyncPipeOp(), and write.

Referenced by HandleMessage(), ReturnError(), and ReturnProcessId().

Variable Documentation

◆ exit_event

HANDLE exit_event = NULL
static

◆ interactive_service

openvpn_service_t interactive_service
Initial value:
= {
TEXT(PACKAGE_NAME "ServiceInteractive"),
TEXT(PACKAGE_NAME " Interactive Service"),
SERVICE_AUTO_START
}

Definition at line 61 of file interactive.c.

Referenced by _tmain(), and ServiceStartInteractive().

◆ rdns_semaphore

HANDLE rdns_semaphore = NULL
static

Definition at line 56 of file interactive.c.

Referenced by RegisterDNS(), and ServiceStartInteractive().

◆ service

SERVICE_STATUS_HANDLE service
static

◆ settings

settings_t settings
static

Definition at line 55 of file interactive.c.

Referenced by AddWfpBlock(), RunOpenvpn(), ServiceStartInteractive(), and ValidateOptions().

◆ status

SERVICE_STATUS status = { .dwServiceType = SERVICE_WIN32_SHARE_PROCESS }
static

Definition at line 53 of file interactive.c.

Referenced by add_route(), add_route_ipapi(), add_route_ipv6(), bio_write_post(), check_for_client_reason(), check_status(), close_tun(), CmdRemoveServices(), dco_get_supported_ciphers(), del_route_ipapi(), delete_route(), delete_temp_addresses(), dhcp_release_by_adapter_index(), dhcp_renew_by_adapter_index(), do_open_tun(), do_preresolve(), do_preresolve_host(), do_route_ipv6_service(), establish_http_proxy_passthru(), exec_command(), fork_to_self(), get_adapter_info_list(), get_console_input_win32(), get_default_gateway_ipv6(), get_device_instance_id_interface(), get_interface_info_list(), get_openvpn_reg_value(), get_pa_var(), get_panel_reg(), get_per_adapter_info(), get_special_addr(), get_tap_reg(), get_windows_routing_table(), getaddr(), GetOpenvpnSettings(), GetRegString(), helper_client_server(), in_extra_dispatch(), in_src_get(), incoming_push_message(), init_route(), InterfaceLuid(), io_wait_dowork(), link_socket_write_win32(), man_block(), man_client_deny(), man_client_kill(), man_connect(), man_kill(), man_proxy(), man_remote(), man_send_cc_message(), man_settings_init(), man_standalone_event_loop(), management_callback_remote_entry_get(), management_callback_send_cc_message(), management_io(), multi_get_create_instance_udp(), multi_process_io_udp(), multi_tcp_wait(), net_event_win32_reset_write(), openvpn_connect(), openvpn_exit(), openvpn_getaddrinfo(), openvpn_gettimeofday(), openvpn_plugin_func_v1(), openvpn_plugin_open_v3(), openvpn_popen(), pam_auth(), plugin_call_item(), plugin_call_ssl(), print_sockaddr_ex(), process_io(), read_incoming_link(), read_incoming_tls_ciphertext(), read_incoming_tls_plaintext(), recv_line(), recv_socks_reply(), report_command_status(), ReportStatusToSCMgr(), resolve_bind_local(), resolve_remote(), semaphore_lock(), send_push_options(), send_push_reply(), ServiceCtrlInteractive(), ServiceStartInteractive(), ServiceStartInteractiveOwn(), set_win_sys_path_via_env(), socket_connect(), socket_connection_reset(), socket_listen_accept(), socket_recv_queue(), socket_send_queue(), sockethandle_finalize(), socks_handshake(), socks_username_password_auth(), strerror_win32(), tap_allow_nonadmin_access_handle(), test_adapter_ip_netmask(), tls_pre_decrypt_lite(), tls_process_state(), tun_read_queue(), tun_write_queue(), tun_write_win32(), tunnel_server_tcp(), tuntap_abort(), tuntap_is_dco_win_timeout(), tuntap_set_connected(), tuntap_set_ip_addr(), tuntap_set_ptp(), tuntap_stop(), we_wait(), win32_sleep(), win_get_exe_path(), win_wfp_block(), write_outgoing_tls_ciphertext(), and x_check_status().

PACKAGE_NAME
#define PACKAGE_NAME
Definition: config.h:492
SERVICE_DEPENDENCIES
#define SERVICE_DEPENDENCIES
Definition: service.h:42
interactive
@ interactive
Definition: service.h:54