mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Merge commit '86cc97e55fe346502462284d2e636a2b3708163e' as 'Sources/OpenVPN3'
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
// OpenVPN -- An application to securely tunnel IP networks
|
||||
// over a single port, with support for SSL/TLS-based
|
||||
// session authentication and key exchange,
|
||||
// packet encryption, packet authentication, and
|
||||
// packet compression.
|
||||
//
|
||||
// Copyright (C) 2012-2017 OpenVPN Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License Version 3
|
||||
// as published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program in the COPYING file.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef OPENVPN_SSL_MSSPARMS_H
|
||||
#define OPENVPN_SSL_MSSPARMS_H
|
||||
|
||||
#include <openvpn/common/options.hpp>
|
||||
#include <openvpn/common/number.hpp>
|
||||
|
||||
namespace openvpn {
|
||||
struct MSSParms
|
||||
{
|
||||
MSSParms() : mssfix(0),
|
||||
mtu(false)
|
||||
{
|
||||
}
|
||||
|
||||
void parse(const OptionList& opt)
|
||||
{
|
||||
const Option *o = opt.get_ptr("mssfix");
|
||||
if (o)
|
||||
{
|
||||
const bool status = parse_number_validate<decltype(mssfix)>(o->get(1, 16),
|
||||
16,
|
||||
576,
|
||||
65535,
|
||||
&mssfix);
|
||||
if (!status)
|
||||
throw option_error("mssfix: parse/range issue");
|
||||
mtu = (o->get_optional(2, 16) == "mtu");
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int mssfix; // standard OpenVPN mssfix parm
|
||||
bool mtu; // consider transport packet overhead in MSS adjustment
|
||||
};
|
||||
|
||||
struct MSSCtrlParms
|
||||
{
|
||||
MSSCtrlParms(const OptionList& opt)
|
||||
{
|
||||
mssfix_ctrl = opt.get_num<decltype(mssfix_ctrl)>("mssfix-ctrl", 1, 1250,
|
||||
256, 65535);
|
||||
}
|
||||
|
||||
unsigned int mssfix_ctrl;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user