OpenVPN
Functions | Variables
main.c File Reference
#include "tap.h"
#include "error.h"
#include <objbase.h>
#include <setupapi.h>
#include <stdio.h>
#include <tchar.h>
Include dependency graph for main.c:

Go to the source code of this file.

Functions

static void usage (void)
 Print the help message. More...
 
static BOOL is_adapter_name_available (LPCTSTR name, struct tap_adapter_node *adapter_list, BOOL log)
 Checks if adapter with given name doesn't already exist. More...
 
static LPTSTR get_unique_adapter_name (LPCTSTR hwid, struct tap_adapter_node *adapter_list)
 Returns unique adapter name based on hwid or NULL if name cannot be generated. More...
 
int __cdecl _tmain (int argc, LPCTSTR argv[])
 Program entry point. More...
 
bool dont_mute (unsigned int flags)
 Check muting filter. More...
 
void x_msg_va (const unsigned int flags, const char *format, va_list arglist)
 

Variables

const TCHAR title_string []
 
static const TCHAR usage_message []
 
static const TCHAR usage_message_create []
 
static const TCHAR usage_message_list []
 
static const TCHAR usage_message_delete []
 

Function Documentation

◆ _tmain()

int __cdecl _tmain ( int  argc,
LPCTSTR  argv[] 
)

◆ dont_mute()

bool dont_mute ( unsigned int  flags)

Check muting filter.

Definition at line 471 of file main.c.

◆ get_unique_adapter_name()

static LPTSTR get_unique_adapter_name ( LPCTSTR  hwid,
struct tap_adapter_node adapter_list 
)
static

Returns unique adapter name based on hwid or NULL if name cannot be generated.

Caller is responsible for freeing it.

Definition at line 158 of file main.c.

References is_adapter_name_available(), and TAP_WIN_COMPONENT_ID.

Referenced by _tmain().

◆ is_adapter_name_available()

static BOOL is_adapter_name_available ( LPCTSTR  name,
struct tap_adapter_node adapter_list,
BOOL  log 
)
static

Checks if adapter with given name doesn't already exist.

Definition at line 131 of file main.c.

References tap_adapter_node::pNext, PRIsLPOLESTR, and PRIsLPTSTR.

Referenced by _tmain(), and get_unique_adapter_name().

◆ usage()

static void usage ( void  )
static

Print the help message.

Definition at line 120 of file main.c.

References title_string, and usage_message.

Referenced by _tmain().

◆ x_msg_va()

void x_msg_va ( const unsigned int  flags,
const char *  format,
va_list  arglist 
)

Definition at line 480 of file main.c.

References M_ERRNO, and PRIsLPTSTR.

Variable Documentation

◆ title_string

const TCHAR title_string[]
Initial value:
=
TEXT(PACKAGE_NAME) TEXT(" ") TEXT(PACKAGE_VERSION)

Definition at line 40 of file main.c.

Referenced by _tmain(), and usage().

◆ usage_message

const TCHAR usage_message[]
static
Initial value:
=
TEXT("%") TEXT(PRIsLPTSTR) TEXT("\n")

Definition at line 44 of file main.c.

Referenced by usage().

◆ usage_message_create

const TCHAR usage_message_create[]
static
Initial value:
=
TEXT("%") TEXT(PRIsLPTSTR) TEXT("\n")

Definition at line 61 of file main.c.

Referenced by _tmain().

◆ usage_message_delete

const TCHAR usage_message_delete[]
static
Initial value:
=
TEXT("%") TEXT(PRIsLPTSTR) TEXT("\n")

Definition at line 105 of file main.c.

Referenced by _tmain().

◆ usage_message_list

const TCHAR usage_message_list[]
static
Initial value:
=
TEXT("%") TEXT(PRIsLPTSTR) TEXT("\n")

Definition at line 86 of file main.c.

Referenced by _tmain().

PRIsLPTSTR
#define PRIsLPTSTR
Definition: basic.h:29
PACKAGE_NAME
#define PACKAGE_NAME
Definition: config.h:492
PACKAGE_VERSION
#define PACKAGE_VERSION
Definition: config.h:504