OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::ProtoStackBase< PACKET, PARENT > Class Template Reference

#include <protostack.hpp>

Collaboration diagram for openvpn::ProtoStackBase< PACKET, PARENT >:
[legend]

Public Types

enum  NetSendType { NET_SEND_SSL , NET_SEND_RAW , NET_SEND_ACK , NET_SEND_RETRANSMIT }
 
typedef reliable::id_t id_t
 
typedef ReliableSendTemplate< PACKET > ReliableSend
 
typedef ReliableRecvTemplate< PACKET > ReliableRecv
 

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (proto_stack_invalidated)
 
 OPENVPN_SIMPLE_EXCEPTION (unknown_status_from_ssl_layer)
 
 ProtoStackBase (SSLFactoryAPI &ssl_factory, TimePtr now_arg, const Time::Duration &tls_timeout_arg, const Frame::Ptr &frame, const SessionStats::Ptr &stats_arg, bool psid_cookie_mode)
 
void start_handshake ()
 
uint32_t get_tls_warnings () const
 
bool net_recv (PACKET &&pkt)
 
void app_send (BufferPtr &&buf)
 
void raw_send (PACKET &&pkt)
 
void flush ()
 
void send_pending_acks ()
 
void retransmit ()
 
Time next_retransmit () const
 
bool ssl_started () const
 
bool invalidated () const
 
Error::Type invalidation_reason () const
 
void invalidate (const Error::Type reason)
 
std::string ssl_handshake_details () const
 
void export_key_material (OpenVPNStaticKey &key, const std::string &label) const
 
const AuthCert::Ptrauth_cert () const
 

Static Public Attributes

static constexpr size_t ovpn_sending_window = 6
 
static constexpr size_t ovpn_receiving_window = ReliableAck::maximum_acks_ack_v1
 

Protected Attributes

TimePtr now
 
ReliableRecv rel_recv
 
ReliableSend rel_send
 
ReliableAck xmit_acks {}
 

Private Member Functions

PARENT & parent ()
 
void send_pending_ssl_ciphertext_packets ()
 If there are any pending SSL ciphertext packets, encapsulate and send them out.
 
void send_pending_ssl_ciphertext_packets_nothrow () noexcept
 A version of send_pending_ssl_ciphertext_packets() that guarantees no exceptions.
 
void down_stack_app ()
 
void down_stack_raw ()
 
bool up_stack (PACKET &recv)
 
void up_sequenced ()
 
void update_retransmit ()
 
void error (const Error::Type reason)
 

Private Attributes

const Time::Duration tls_timeout
 
SSLAPI::Ptr ssl_
 
Frame::Ptr frame_
 
int up_stack_reentry_level = 0
 
bool invalidated_ = false
 
Error::Type invalidation_reason_ = Error::SUCCESS
 
bool ssl_started_ = false
 
Time next_retransmit_ = Time::infinite()
 
BufferPtr to_app_buf
 
PACKET ack_send_buf
 
std::deque< BufferPtrapp_write_queue
 
std::deque< PACKET > raw_write_queue
 
SessionStats::Ptr stats
 

Detailed Description

template<typename PACKET, typename PARENT>
class openvpn::ProtoStackBase< PACKET, PARENT >

Definition at line 68 of file protostack.hpp.

Member Typedef Documentation

◆ id_t

template<typename PACKET , typename PARENT >
typedef reliable::id_t openvpn::ProtoStackBase< PACKET, PARENT >::id_t

Definition at line 74 of file protostack.hpp.

◆ ReliableRecv

template<typename PACKET , typename PARENT >
typedef ReliableRecvTemplate<PACKET> openvpn::ProtoStackBase< PACKET, PARENT >::ReliableRecv

Definition at line 76 of file protostack.hpp.

◆ ReliableSend

template<typename PACKET , typename PARENT >
typedef ReliableSendTemplate<PACKET> openvpn::ProtoStackBase< PACKET, PARENT >::ReliableSend

Definition at line 75 of file protostack.hpp.

Member Enumeration Documentation

◆ NetSendType

template<typename PACKET , typename PARENT >
enum openvpn::ProtoStackBase::NetSendType
Enumerator
NET_SEND_SSL 
NET_SEND_RAW 
NET_SEND_ACK 
NET_SEND_RETRANSMIT 

Definition at line 81 of file protostack.hpp.

Constructor & Destructor Documentation

◆ ProtoStackBase()

template<typename PACKET , typename PARENT >
openvpn::ProtoStackBase< PACKET, PARENT >::ProtoStackBase ( SSLFactoryAPI ssl_factory,
TimePtr  now_arg,
const Time::Duration &  tls_timeout_arg,
const Frame::Ptr frame,
const SessionStats::Ptr stats_arg,
bool  psid_cookie_mode 
)
inline

Definition at line 89 of file protostack.hpp.

Member Function Documentation

◆ app_send()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::app_send ( BufferPtr &&  buf)
inline

Definition at line 134 of file protostack.hpp.

◆ auth_cert()

template<typename PACKET , typename PARENT >
const AuthCert::Ptr & openvpn::ProtoStackBase< PACKET, PARENT >::auth_cert ( ) const
inline

Definition at line 260 of file protostack.hpp.

◆ down_stack_app()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::down_stack_app ( )
inlineprivate

Definition at line 358 of file protostack.hpp.

Here is the caller graph for this function:

◆ down_stack_raw()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::down_stack_raw ( )
inlineprivate

Definition at line 398 of file protostack.hpp.

Here is the caller graph for this function:

◆ error()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::error ( const Error::Type  reason)
inlineprivate

Definition at line 515 of file protostack.hpp.

Here is the caller graph for this function:

◆ export_key_material()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::export_key_material ( OpenVPNStaticKey key,
const std::string &  label 
) const
inline

Definition at line 254 of file protostack.hpp.

◆ flush()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::flush ( )
inline

Definition at line 152 of file protostack.hpp.

◆ get_tls_warnings()

template<typename PACKET , typename PARENT >
uint32_t openvpn::ProtoStackBase< PACKET, PARENT >::get_tls_warnings ( ) const
inline

Definition at line 117 of file protostack.hpp.

◆ invalidate()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::invalidate ( const Error::Type  reason)
inline

Definition at line 239 of file protostack.hpp.

Here is the caller graph for this function:

◆ invalidated()

template<typename PACKET , typename PARENT >
bool openvpn::ProtoStackBase< PACKET, PARENT >::invalidated ( ) const
inline

Definition at line 227 of file protostack.hpp.

Here is the caller graph for this function:

◆ invalidation_reason()

template<typename PACKET , typename PARENT >
Error::Type openvpn::ProtoStackBase< PACKET, PARENT >::invalidation_reason ( ) const
inline

Definition at line 233 of file protostack.hpp.

◆ net_recv()

template<typename PACKET , typename PARENT >
bool openvpn::ProtoStackBase< PACKET, PARENT >::net_recv ( PACKET &&  pkt)
inline

Definition at line 124 of file protostack.hpp.

◆ next_retransmit()

template<typename PACKET , typename PARENT >
Time openvpn::ProtoStackBase< PACKET, PARENT >::next_retransmit ( ) const
inline

Definition at line 212 of file protostack.hpp.

◆ OPENVPN_SIMPLE_EXCEPTION() [1/2]

template<typename PACKET , typename PARENT >
openvpn::ProtoStackBase< PACKET, PARENT >::OPENVPN_SIMPLE_EXCEPTION ( proto_stack_invalidated  )

◆ OPENVPN_SIMPLE_EXCEPTION() [2/2]

template<typename PACKET , typename PARENT >
openvpn::ProtoStackBase< PACKET, PARENT >::OPENVPN_SIMPLE_EXCEPTION ( unknown_status_from_ssl_layer  )

◆ parent()

template<typename PACKET , typename PARENT >
PARENT & openvpn::ProtoStackBase< PACKET, PARENT >::parent ( )
inlineprivate

Definition at line 312 of file protostack.hpp.

Here is the caller graph for this function:

◆ raw_send()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::raw_send ( PACKET &&  pkt)
inline

Definition at line 143 of file protostack.hpp.

◆ retransmit()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::retransmit ( )
inline

Definition at line 181 of file protostack.hpp.

◆ send_pending_acks()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::send_pending_acks ( )
inline

Definition at line 163 of file protostack.hpp.

◆ send_pending_ssl_ciphertext_packets()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::send_pending_ssl_ciphertext_packets ( )
inlineprivate

If there are any pending SSL ciphertext packets, encapsulate and send them out.

Definition at line 318 of file protostack.hpp.

Here is the caller graph for this function:

◆ send_pending_ssl_ciphertext_packets_nothrow()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::send_pending_ssl_ciphertext_packets_nothrow ( )
inlineprivatenoexcept

A version of send_pending_ssl_ciphertext_packets() that guarantees no exceptions.

Definition at line 346 of file protostack.hpp.

Here is the caller graph for this function:

◆ ssl_handshake_details()

template<typename PACKET , typename PARENT >
std::string openvpn::ProtoStackBase< PACKET, PARENT >::ssl_handshake_details ( ) const
inline

Definition at line 249 of file protostack.hpp.

◆ ssl_started()

template<typename PACKET , typename PARENT >
bool openvpn::ProtoStackBase< PACKET, PARENT >::ssl_started ( ) const
inline

Definition at line 221 of file protostack.hpp.

◆ start_handshake()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::start_handshake ( )
inline

Definition at line 107 of file protostack.hpp.

◆ up_sequenced()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::up_sequenced ( )
inlineprivate

Definition at line 439 of file protostack.hpp.

Here is the caller graph for this function:

◆ up_stack()

template<typename PACKET , typename PARENT >
bool openvpn::ProtoStackBase< PACKET, PARENT >::up_stack ( PACKET &  recv)
inlineprivate

Definition at line 425 of file protostack.hpp.

Here is the caller graph for this function:

◆ update_retransmit()

template<typename PACKET , typename PARENT >
void openvpn::ProtoStackBase< PACKET, PARENT >::update_retransmit ( )
inlineprivate

Definition at line 510 of file protostack.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ ack_send_buf

template<typename PACKET , typename PARENT >
PACKET openvpn::ProtoStackBase< PACKET, PARENT >::ack_send_buf
private

Definition at line 532 of file protostack.hpp.

◆ app_write_queue

template<typename PACKET , typename PARENT >
std::deque<BufferPtr> openvpn::ProtoStackBase< PACKET, PARENT >::app_write_queue
private

Definition at line 533 of file protostack.hpp.

◆ frame_

template<typename PACKET , typename PARENT >
Frame::Ptr openvpn::ProtoStackBase< PACKET, PARENT >::frame_
private

Definition at line 525 of file protostack.hpp.

◆ invalidated_

template<typename PACKET , typename PARENT >
bool openvpn::ProtoStackBase< PACKET, PARENT >::invalidated_ = false
private

Definition at line 527 of file protostack.hpp.

◆ invalidation_reason_

template<typename PACKET , typename PARENT >
Error::Type openvpn::ProtoStackBase< PACKET, PARENT >::invalidation_reason_ = Error::SUCCESS
private

Definition at line 528 of file protostack.hpp.

◆ next_retransmit_

template<typename PACKET , typename PARENT >
Time openvpn::ProtoStackBase< PACKET, PARENT >::next_retransmit_ = Time::infinite()
private

Definition at line 530 of file protostack.hpp.

◆ now

template<typename PACKET , typename PARENT >
TimePtr openvpn::ProtoStackBase< PACKET, PARENT >::now
protected

Definition at line 538 of file protostack.hpp.

◆ ovpn_receiving_window

template<typename PACKET , typename PARENT >
constexpr size_t openvpn::ProtoStackBase< PACKET, PARENT >::ovpn_receiving_window = ReliableAck::maximum_acks_ack_v1
staticconstexpr

Definition at line 72 of file protostack.hpp.

◆ ovpn_sending_window

template<typename PACKET , typename PARENT >
constexpr size_t openvpn::ProtoStackBase< PACKET, PARENT >::ovpn_sending_window = 6
staticconstexpr

Definition at line 71 of file protostack.hpp.

◆ raw_write_queue

template<typename PACKET , typename PARENT >
std::deque<PACKET> openvpn::ProtoStackBase< PACKET, PARENT >::raw_write_queue
private

Definition at line 534 of file protostack.hpp.

◆ rel_recv

template<typename PACKET , typename PARENT >
ReliableRecv openvpn::ProtoStackBase< PACKET, PARENT >::rel_recv
protected

Definition at line 539 of file protostack.hpp.

◆ rel_send

template<typename PACKET , typename PARENT >
ReliableSend openvpn::ProtoStackBase< PACKET, PARENT >::rel_send
protected

Definition at line 540 of file protostack.hpp.

◆ ssl_

template<typename PACKET , typename PARENT >
SSLAPI::Ptr openvpn::ProtoStackBase< PACKET, PARENT >::ssl_
private

Definition at line 524 of file protostack.hpp.

◆ ssl_started_

template<typename PACKET , typename PARENT >
bool openvpn::ProtoStackBase< PACKET, PARENT >::ssl_started_ = false
private

Definition at line 529 of file protostack.hpp.

◆ stats

template<typename PACKET , typename PARENT >
SessionStats::Ptr openvpn::ProtoStackBase< PACKET, PARENT >::stats
private

Definition at line 535 of file protostack.hpp.

◆ tls_timeout

template<typename PACKET , typename PARENT >
const Time::Duration openvpn::ProtoStackBase< PACKET, PARENT >::tls_timeout
private

Definition at line 523 of file protostack.hpp.

◆ to_app_buf

template<typename PACKET , typename PARENT >
BufferPtr openvpn::ProtoStackBase< PACKET, PARENT >::to_app_buf
private

Definition at line 531 of file protostack.hpp.

◆ up_stack_reentry_level

template<typename PACKET , typename PARENT >
int openvpn::ProtoStackBase< PACKET, PARENT >::up_stack_reentry_level = 0
private

Definition at line 526 of file protostack.hpp.

◆ xmit_acks

template<typename PACKET , typename PARENT >
ReliableAck openvpn::ProtoStackBase< PACKET, PARENT >::xmit_acks {}
protected

Definition at line 541 of file protostack.hpp.


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