OpenVPN
options_parse.c File Reference
#include <string.h>
#include "options.h"
#include "options_util.h"
#include "push.h"
Include dependency graph for options_parse.c:

Go to the source code of this file.

Data Structures

struct  in_src

Macros

#define IS_TYPE_FP   1
#define IS_TYPE_BUF   2

Functions

static void bypass_doubledash (char **p)
static bool space (char c)
int parse_line (const char *line, char *p[], const int n, const char *file, const int line_num, msglvl_t msglevel, struct gc_arena *gc)
static bool in_src_get (const struct in_src *is, char *line, const int size)
static char * read_inline_file (struct in_src *is, const char *close_tag, int *num_lines, struct gc_arena *gc)
static int check_inline_file (struct in_src *is, char *p[], struct gc_arena *gc)
static int check_inline_file_via_fp (FILE *fp, char *p[], struct gc_arena *gc)
static int check_inline_file_via_buf (struct buffer *multiline, char *p[], struct gc_arena *gc)
void read_config_file (struct options *options, const char *file, int level, const char *top_file, const int top_line, const msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
void read_config_string (const char *prefix, struct options *options, const char *config, const msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
void parse_argv (struct options *options, const int argc, char *argv[], const msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
bool apply_push_options (struct context *c, struct options *options, struct buffer *buf, uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es, bool is_update)
void options_server_import (struct options *o, const char *filename, msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
void options_string_import (struct options *options, const char *config, const msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)

Macro Definition Documentation

◆ IS_TYPE_BUF

#define IS_TYPE_BUF   2

Definition at line 228 of file options_parse.c.

Referenced by check_inline_file_via_buf(), and in_src_get().

◆ IS_TYPE_FP

#define IS_TYPE_FP   1

Definition at line 227 of file options_parse.c.

Referenced by check_inline_file_via_fp(), and in_src_get().

Function Documentation

◆ apply_push_options()

bool apply_push_options ( struct context * c,
struct options * options,
struct buffer * buf,
uint64_t permission_mask,
uint64_t * option_types_found,
struct env_set * es,
bool is_update )

Definition at line 511 of file options_parse.c.

◆ bypass_doubledash()

void bypass_doubledash ( char ** p)
static

Definition at line 35 of file options_parse.c.

Referenced by read_config_file(), and read_config_string().

◆ check_inline_file()

int check_inline_file ( struct in_src * is,
char * p[],
struct gc_arena * gc )
static

◆ check_inline_file_via_buf()

int check_inline_file_via_buf ( struct buffer * multiline,
char * p[],
struct gc_arena * gc )
static

Definition at line 338 of file options_parse.c.

References check_inline_file(), gc, IS_TYPE_BUF, in_src::multiline, in_src::type, and in_src::u.

Referenced by read_config_string().

◆ check_inline_file_via_fp()

int check_inline_file_via_fp ( FILE * fp,
char * p[],
struct gc_arena * gc )
static

Definition at line 329 of file options_parse.c.

References check_inline_file(), in_src::fp, gc, IS_TYPE_FP, in_src::type, and in_src::u.

Referenced by read_config_file().

◆ in_src_get()

bool in_src_get ( const struct in_src * is,
char * line,
const int size )
static

◆ options_server_import()

void options_server_import ( struct options * o,
const char * filename,
msglvl_t msglevel,
const uint64_t permission_mask,
uint64_t * option_types_found,
struct env_set * es )

Definition at line 579 of file options_parse.c.

References D_PUSH, msg, and read_config_file().

Referenced by multi_client_connect_post().

◆ options_string_import()

void options_string_import ( struct options * options,
const char * config,
const msglvl_t msglevel,
const uint64_t permission_mask,
uint64_t * option_types_found,
struct env_set * es )

◆ parse_argv()

void parse_argv ( struct options * options,
const int argc,
char * argv[],
const msglvl_t msglevel,
const uint64_t permission_mask,
uint64_t * option_types_found,
struct env_set * es )

Definition at line 449 of file options_parse.c.

References add_option(), CLEAR, MAX_PARMS, msg, and usage().

Referenced by openvpn_main().

◆ parse_line()

int parse_line ( const char * line,
char * p[],
const int n,
const char * file,
const int line_num,
msglvl_t msglevel,
struct gc_arena * gc )

◆ read_config_file()

void read_config_file ( struct options * options,
const char * file,
int level,
const char * top_file,
const int top_line,
const msglvl_t msglevel,
const uint64_t permission_mask,
uint64_t * option_types_found,
struct env_set * es )

◆ read_config_string()

void read_config_string ( const char * prefix,
struct options * options,
const char * config,
const msglvl_t msglevel,
const uint64_t permission_mask,
uint64_t * option_types_found,
struct env_set * es )

◆ read_inline_file()

char * read_inline_file ( struct in_src * is,
const char * close_tag,
int * num_lines,
struct gc_arena * gc )
static

◆ space()

bool space ( char c)
inlinestatic

Definition at line 44 of file options_parse.c.

Referenced by parse_line().