OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::Protocol Class Reference

#include <protocol.hpp>

Public Types

enum  Type {
  NONE , UDPv4 , TCPv4 , UDPv6 ,
  TCPv6 , TLSv4 , TLSv6 , UnixStream ,
  UnixDGram , NamedPipe , UDP , TCP ,
  TLS
}
 
enum  AllowSuffix { NO_SUFFIX , CLIENT_SUFFIX , SERVER_SUFFIX }
 

Public Member Functions

 Protocol ()
 
 Protocol (const Type t)
 
Type operator() () const
 
bool defined () const
 
void reset ()
 
bool is_udp () const
 
bool is_tcp () const
 
bool is_tls () const
 
bool is_reliable () const
 
bool is_ipv4 () const
 
bool is_ipv6 () const
 
bool is_unix () const
 
bool is_named_pipe () const
 
bool is_local () const
 
bool operator== (const Protocol &other) const
 
bool operator!= (const Protocol &other) const
 
bool transport_match (const Protocol &other) const
 
unsigned int extra_transport_bytes () const
 
void mod_addr_version (const IP::Addr::Version ip_version)
 
int transport_proto () const
 
const char * str () const
 
const char * protocol_to_string () const
 
const char * occ_str (const bool server) const
 

Static Public Member Functions

static Protocol parse (const std::string &str, const AllowSuffix allow_suffix, const char *title=nullptr)
 
static bool is_local_type (const std::string &str)
 

Static Private Member Functions

static Type parse_type (const std::string &str, const AllowSuffix allow_suffix)
 

Private Attributes

Type type_
 

Detailed Description

Definition at line 25 of file protocol.hpp.

Member Enumeration Documentation

◆ AllowSuffix

Enumerator
NO_SUFFIX 
CLIENT_SUFFIX 
SERVER_SUFFIX 

Definition at line 45 of file protocol.hpp.

◆ Type

Enumerator
NONE 
UDPv4 
TCPv4 
UDPv6 
TCPv6 
TLSv4 
TLSv6 
UnixStream 
UnixDGram 
NamedPipe 
UDP 
TCP 
TLS 

Definition at line 28 of file protocol.hpp.

Constructor & Destructor Documentation

◆ Protocol() [1/2]

openvpn::Protocol::Protocol ( )
inline

Definition at line 52 of file protocol.hpp.

◆ Protocol() [2/2]

openvpn::Protocol::Protocol ( const Type  t)
inlineexplicit

Definition at line 56 of file protocol.hpp.

Member Function Documentation

◆ defined()

bool openvpn::Protocol::defined ( ) const
inline

Definition at line 65 of file protocol.hpp.

Here is the caller graph for this function:

◆ extra_transport_bytes()

unsigned int openvpn::Protocol::extra_transport_bytes ( ) const
inline

Definition at line 127 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_ipv4()

bool openvpn::Protocol::is_ipv4 ( ) const
inline

Definition at line 91 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_ipv6()

bool openvpn::Protocol::is_ipv6 ( ) const
inline

Definition at line 95 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_local()

bool openvpn::Protocol::is_local ( ) const
inline

Definition at line 107 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_local_type()

static bool openvpn::Protocol::is_local_type ( const std::string &  str)
inlinestatic

Definition at line 174 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_named_pipe()

bool openvpn::Protocol::is_named_pipe ( ) const
inline

Definition at line 103 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_reliable()

bool openvpn::Protocol::is_reliable ( ) const
inline

Definition at line 87 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_tcp()

bool openvpn::Protocol::is_tcp ( ) const
inline

Definition at line 79 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_tls()

bool openvpn::Protocol::is_tls ( ) const
inline

Definition at line 83 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_udp()

bool openvpn::Protocol::is_udp ( ) const
inline

Definition at line 75 of file protocol.hpp.

Here is the caller graph for this function:

◆ is_unix()

bool openvpn::Protocol::is_unix ( ) const
inline

Definition at line 99 of file protocol.hpp.

Here is the caller graph for this function:

◆ mod_addr_version()

void openvpn::Protocol::mod_addr_version ( const IP::Addr::Version  ip_version)
inline

Definition at line 132 of file protocol.hpp.

Here is the caller graph for this function:

◆ occ_str()

const char * openvpn::Protocol::occ_str ( const bool  server) const
inline

Definition at line 284 of file protocol.hpp.

Here is the caller graph for this function:

◆ operator!=()

bool openvpn::Protocol::operator!= ( const Protocol other) const
inline

Definition at line 117 of file protocol.hpp.

◆ operator()()

Type openvpn::Protocol::operator() ( ) const
inline

Definition at line 60 of file protocol.hpp.

◆ operator==()

bool openvpn::Protocol::operator== ( const Protocol other) const
inline

Definition at line 112 of file protocol.hpp.

◆ parse()

static Protocol openvpn::Protocol::parse ( const std::string &  str,
const AllowSuffix  allow_suffix,
const char *  title = nullptr 
)
inlinestatic

Definition at line 157 of file protocol.hpp.

Here is the caller graph for this function:

◆ parse_type()

static Type openvpn::Protocol::parse_type ( const std::string &  str,
const AllowSuffix  allow_suffix 
)
inlinestaticprivate

Definition at line 306 of file protocol.hpp.

Here is the caller graph for this function:

◆ protocol_to_string()

const char * openvpn::Protocol::protocol_to_string ( ) const
inline

Definition at line 247 of file protocol.hpp.

Here is the caller graph for this function:

◆ reset()

void openvpn::Protocol::reset ( )
inline

Definition at line 70 of file protocol.hpp.

◆ str()

const char * openvpn::Protocol::str ( ) const
inline

Definition at line 212 of file protocol.hpp.

Here is the caller graph for this function:

◆ transport_match()

bool openvpn::Protocol::transport_match ( const Protocol other) const
inline

Definition at line 122 of file protocol.hpp.

Here is the caller graph for this function:

◆ transport_proto()

int openvpn::Protocol::transport_proto ( ) const
inline

Definition at line 185 of file protocol.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ type_

Type openvpn::Protocol::type_
private

Definition at line 369 of file protocol.hpp.


The documentation for this class was generated from the following file: