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

#include <compress.hpp>

Public Types

enum  Type {
  NONE , COMP_STUB , COMP_STUBv2 , ANY ,
  ANY_LZO , LZO , LZO_SWAP , LZO_STUB ,
  LZ4 , LZ4v2 , SNAPPY
}
 

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (compressor_unavailable)
 
 CompressContext ()
 
 CompressContext (const Type t, const bool asym)
 
Type type () const
 
bool asym () const
 
unsigned int extra_payload_bytes () const
 
Compress::Ptr new_compressor (const Frame::Ptr &frame, const SessionStats::Ptr &stats)
 
const char * peer_info_string () const
 
const char * peer_info_string_v1 () const
 
const char * options_string () const
 
const char * str () const
 
const char * method_to_string () const
 

Static Public Member Functions

static bool compressor_available (const Type t)
 
static Type parse_method (const std::string &method)
 
static Type stub (const Type t)
 
static bool is_any_stub (const Type t)
 
static void init_static ()
 

Private Attributes

Type type_ = NONE
 
bool asym_ = false
 

Detailed Description

Definition at line 147 of file compress.hpp.

Member Enumeration Documentation

◆ Type

Enumerator
NONE 
COMP_STUB 
COMP_STUBv2 
ANY 
ANY_LZO 
LZO 
LZO_SWAP 
LZO_STUB 
LZ4 
LZ4v2 
SNAPPY 

Definition at line 150 of file compress.hpp.

Constructor & Destructor Documentation

◆ CompressContext() [1/2]

openvpn::CompressContext::CompressContext ( )
inline

Definition at line 167 of file compress.hpp.

◆ CompressContext() [2/2]

openvpn::CompressContext::CompressContext ( const Type  t,
const bool  asym 
)
inline

Definition at line 171 of file compress.hpp.

Member Function Documentation

◆ asym()

bool openvpn::CompressContext::asym ( ) const
inline

Definition at line 183 of file compress.hpp.

◆ compressor_available()

static bool openvpn::CompressContext::compressor_available ( const Type  t)
inlinestatic

Definition at line 237 of file compress.hpp.

Here is the caller graph for this function:

◆ extra_payload_bytes()

unsigned int openvpn::CompressContext::extra_payload_bytes ( ) const
inline

Definition at line 188 of file compress.hpp.

Here is the caller graph for this function:

◆ init_static()

static void openvpn::CompressContext::init_static ( )
inlinestatic

Definition at line 523 of file compress.hpp.

Here is the caller graph for this function:

◆ is_any_stub()

static bool openvpn::CompressContext::is_any_stub ( const Type  t)
inlinestatic

Checks if the compression type is one of the available stub modes

Parameters
tThe CompressContext::Type value
Returns
Returns true if the type is one of the *_STUB{,v2} types, otherwise false.

Definition at line 510 of file compress.hpp.

Here is the caller graph for this function:

◆ method_to_string()

const char * openvpn::CompressContext::method_to_string ( ) const
inline

Definition at line 444 of file compress.hpp.

◆ new_compressor()

Compress::Ptr openvpn::CompressContext::new_compressor ( const Frame::Ptr frame,
const SessionStats::Ptr stats 
)
inline

Definition at line 202 of file compress.hpp.

◆ OPENVPN_SIMPLE_EXCEPTION()

openvpn::CompressContext::OPENVPN_SIMPLE_EXCEPTION ( compressor_unavailable  )

◆ options_string()

const char * openvpn::CompressContext::options_string ( ) const
inline

Definition at line 393 of file compress.hpp.

Here is the caller graph for this function:

◆ parse_method()

static Type openvpn::CompressContext::parse_method ( const std::string &  method)
inlinestatic

Definition at line 469 of file compress.hpp.

Here is the caller graph for this function:

◆ peer_info_string()

const char * openvpn::CompressContext::peer_info_string ( ) const
inline

Definition at line 280 of file compress.hpp.

Here is the caller graph for this function:

◆ peer_info_string_v1()

const char * openvpn::CompressContext::peer_info_string_v1 ( ) const
inline

Definition at line 342 of file compress.hpp.

◆ str()

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

Definition at line 413 of file compress.hpp.

Here is the caller graph for this function:

◆ stub()

static Type openvpn::CompressContext::stub ( const Type  t)
inlinestatic

Definition at line 491 of file compress.hpp.

Here is the caller graph for this function:

◆ type()

Type openvpn::CompressContext::type ( ) const
inline

Definition at line 179 of file compress.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ asym_

bool openvpn::CompressContext::asym_ = false
private

Definition at line 532 of file compress.hpp.

◆ type_

Type openvpn::CompressContext::type_ = NONE
private

Definition at line 531 of file compress.hpp.


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