OpenVPN
|
#include "basic.h"
Go to the source code of this file.
Data Structures | |
struct | _query_user |
Configuration setup for declaring what kind of information to ask a user for. More... | |
Macros | |
#define | QUERY_USER_NUMSLOTS 10 |
Functions | |
void | query_user_clear (void) |
Wipes all data put into all of the query_user structs. More... | |
void | query_user_add (char *prompt, size_t prompt_len, char *resp, size_t resp_len, bool echo) |
Adds an item to ask the user for. More... | |
bool | query_user_exec_builtin (void) |
Executes a configured setup, using the built-in method for querying the user. More... | |
static bool | query_user_exec (void) |
Wrapper function enabling query_user_exec() if no alternative methods have been enabled. More... | |
static bool | query_user_SINGLE (char *prompt, size_t prompt_len, char *resp, size_t resp_len, bool echo) |
A plain "make Gert happy" wrapper. More... | |
Variables | |
struct _query_user | query_user [] |
Global variable, declared in console.c. More... | |
void query_user_add | ( | char * | prompt, |
size_t | prompt_len, | ||
char * | resp, | ||
size_t | resp_len, | ||
bool | echo | ||
) |
Adds an item to ask the user for.
prompt | Prompt to display to the user |
prompt_len | Length of the prompt string |
resp | String containing the user response |
resp_len | Length of the response string |
echo | Should the user input be echoed to the user? If False, input will be masked |
Definition at line 57 of file console.c.
References ASSERT, _query_user::echo, _query_user::prompt, _query_user::prompt_len, query_user, QUERY_USER_NUMSLOTS, _query_user::response, and _query_user::response_len.
Referenced by get_user_pass_cr(), and query_user_SINGLE().
void query_user_clear | ( | void | ) |
Wipes all data put into all of the query_user structs.
Definition at line 45 of file console.c.
References CLEAR, query_user, and QUERY_USER_NUMSLOTS.
Referenced by get_user_pass_cr(), and query_user_SINGLE().
|
static |
Wrapper function enabling query_user_exec() if no alternative methods have been enabled.
Definition at line 95 of file console.h.
References query_user_exec_builtin().
Referenced by get_user_pass_cr(), and query_user_SINGLE().
bool query_user_exec_builtin | ( | void | ) |
Executes a configured setup, using the built-in method for querying the user.
This method uses the console/TTY directly.
setup | Pointer to the setup defining what to ask the user |
Executes a configured setup, using the built-in method for querying the user.
Default method for querying user using default stdin/stdout on a console. This needs to be available as a backup interface for the alternative implementations in case they cannot query through their implementation specific methods.
If no alternative implementation is declared, a wrapper in console.h will ensure query_user_exec() will call this function instead.
Definition at line 281 of file console_builtin.c.
References get_console_input(), query_user, QUERY_USER_NUMSLOTS, and _query_user::response.
Referenced by query_user_exec(), test_get_user_pass_authfile_file(), test_get_user_pass_authfile_stdin(), test_get_user_pass_dynamic_challenge(), test_get_user_pass_inline_creds(), test_get_user_pass_needok(), and test_get_user_pass_static_challenge().
|
inlinestatic |
A plain "make Gert happy" wrapper.
Same arguments as @query_user_add
FIXME/TODO: Remove this when refactoring the complete user query process to be called at start-up initialization of OpenVPN.
Definition at line 110 of file console.h.
References _query_user::echo, _query_user::prompt, _query_user::prompt_len, query_user_add(), query_user_clear(), and query_user_exec().
Referenced by get_user_pass_cr().
struct _query_user query_user[] |
Global variable, declared in console.c.
Definition at line 41 of file console.c.
Referenced by query_user_add(), query_user_clear(), query_user_exec_builtin(), test_get_user_pass_authfile_file(), test_get_user_pass_authfile_stdin(), test_get_user_pass_dynamic_challenge(), test_get_user_pass_inline_creds(), test_get_user_pass_needok(), and test_get_user_pass_static_challenge().