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 Fox Crypto B.V. <openvpn@foxcrypto.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, int msglevel);
41
46int atoi_warn(const char *str, int msglevel);
47
57bool atoi_constrained(const char *str, int *value, const char *name, int min, int max,
58 int msglevel);
59
68bool apply_pull_filter(const struct options *o, char *line);
69
98bool check_push_update_option_flags(char *line, int *i, unsigned int *flags);
99
100#endif /* ifndef OPTIONS_UTIL_H_ */
bool check_push_update_option_flags(char *line, int *i, unsigned int *flags)
Checks the formatting and validity of options inside push-update messages.
bool atoi_constrained(const char *str, int *value, const char *name, int min, int max, int msglevel)
Converts a str to an integer if the string can be represented as an integer number and is between min...
int positive_atoi(const char *str, int msglevel)
Converts a str to a positive number if the string represents a postive integer number.
int atoi_warn(const char *str, int msglevel)
Converts a str to an integer if the string can be represented as an integer number.
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.