OpenVPN
options_util.h
Go to the documentation of this file.
1/*
2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single TCP/UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
6 * packet compression.
7 *
8 * Copyright (C) 2002-2025 OpenVPN Inc <sales@openvpn.net>
9 * Copyright (C) 2010-2021 Sentyron B.V. <openvpn@sentyron.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2
13 * as published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef OPTIONS_UTIL_H_
25#define OPTIONS_UTIL_H_
26
27#include "options.h"
28
29const char *parse_auth_failed_temp(struct options *o, const char *reason);
30
31
34bool valid_integer(const char *str, bool positive);
35
40int positive_atoi(const char *str, msglvl_t msglevel);
41
51bool positive_atoll(const char *str, int64_t *value, const char *name, msglvl_t msglevel);
52
57int atoi_warn(const char *str, msglvl_t msglevel);
58
68bool atoi_constrained(const char *str, int *value, const char *name, int min, int max,
69 msglvl_t msglevel);
70
79bool apply_pull_filter(const struct options *o, char *line);
80
109bool check_push_update_option_flags(char *line, int *i, unsigned int *flags);
110
111#endif /* ifndef OPTIONS_UTIL_H_ */
unsigned int msglvl_t
Definition error.h:77
bool check_push_update_option_flags(char *line, int *i, unsigned int *flags)
Checks the formatting and validity of options inside push-update messages.
int atoi_warn(const char *str, msglvl_t msglevel)
Converts a str to an integer if the string can be represented as an integer number.
int positive_atoi(const char *str, msglvl_t msglevel)
Converts a str to a positive number if the string represents a postive integer number.
bool positive_atoll(const char *str, int64_t *value, const char *name, msglvl_t msglevel)
Converts a str to an integer if the string can be represented as an integer number and is >= 0.
bool apply_pull_filter(const struct options *o, char *line)
Filter an option line by all pull filters.
const char * parse_auth_failed_temp(struct options *o, const char *reason)
bool valid_integer(const char *str, bool positive)
Checks if the string is a valid integer by checking if it can be converted to an integer.
bool atoi_constrained(const char *str, int *value, const char *name, int min, int max, msglvl_t msglevel)
Converts a str to an integer if the string can be represented as an integer number and is between min...