mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 20:13:05 +02:00
Added Listen::Item::port_offset() method for generating
sequences of port numbers.
This commit is contained in:
parent
df4c095ebe
commit
89ead953b3
@ -32,6 +32,7 @@
|
||||
#include <openvpn/common/hostport.hpp>
|
||||
#include <openvpn/common/number.hpp>
|
||||
#include <openvpn/common/string.hpp>
|
||||
#include <openvpn/common/format.hpp>
|
||||
#include <openvpn/addr/ip.hpp>
|
||||
#include <openvpn/transport/protocol.hpp>
|
||||
|
||||
@ -65,6 +66,13 @@ namespace openvpn {
|
||||
os << " !ssl";
|
||||
return os.str();
|
||||
}
|
||||
|
||||
Item port_offset(const unsigned int offset) const
|
||||
{
|
||||
Item ret(*this);
|
||||
ret.port = openvpn::to_string(HostPort::parse_port(ret.port, "offset") + offset);
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
class List : public std::vector<Item>
|
||||
|
Loading…
Reference in New Issue
Block a user