OpenVPN 3 Core Library
Loading...
Searching...
No Matches
tunmtu.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#ifndef OPENVPN_TUN_TUNMTU_H
13#define OPENVPN_TUN_TUNMTU_H
14
16
17namespace openvpn {
18enum
19{
21};
22
23inline unsigned int parse_tun_mtu(const OptionList &opt, unsigned int default_value)
24{
25 return opt.get_num<unsigned int>("tun-mtu", 1, default_value, 576, 65535);
26}
27
28inline unsigned int parse_tun_mtu_max(const OptionList &opt, unsigned int default_value)
29{
30 return opt.get_num<unsigned int>("tun-mtu-max", 1, default_value, 576, 65535);
31}
32} // namespace openvpn
33
34#endif
T get_num(const std::string &name, const size_t idx, const T default_value) const
Definition options.hpp:1416
Support deferred server-side state creation when client connects.
Definition ovpncli.cpp:95
unsigned int parse_tun_mtu_max(const OptionList &opt, unsigned int default_value)
Definition tunmtu.hpp:28
@ TUN_MTU_DEFAULT
Definition tunmtu.hpp:20
unsigned int parse_tun_mtu(const OptionList &opt, unsigned int default_value)
Definition tunmtu.hpp:23