OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY > Class Template Referenceabstract

#include <tcplinkcommon.hpp>

Inheritance diagram for openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >:
[legend]
Collaboration diagram for openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >:
[legend]

Public Types

typedef RCPtr< LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY > > Ptr
 
typedef Protocol protocol
 
typedef PacketStream< std::uint16_t > OpenVPNPacketStream
 
- Public Types inherited from openvpn::TCPTransport::LinkBase
typedef RCPtr< LinkBasePtr
 
- Public Types inherited from openvpn::RC< thread_unsafe_refcount >
typedef RCPtr< RCPtr
 

Public Member Functions

void set_raw_mode (const bool mode)
 
void set_raw_mode_read (const bool mode)
 
void set_raw_mode_write (const bool mode)
 
void set_mutate (const TransportMutateStream::Ptr &mutate_arg)
 
bool send_queue_empty () const
 
void inject (const Buffer &src)
 
void start ()
 
void stop ()
 
void reset_align_adjust (const size_t align_adjust)
 
size_t send_queue_size () const
 
bool send (BufferAllocated &b)
 
void queue_recv (PacketFrom *tcpfrom)
 
- Public Member Functions inherited from openvpn::RC< thread_unsafe_refcount >
 RC () noexcept=default
 
 RC (const RC &)=delete
 
virtual ~RC ()=default
 
RCoperator= (const RC &)=delete
 
olong use_count () const noexcept
 Delegates call to RCImpl and returns the result.
 

Protected Member Functions

 LinkCommon (ReadHandler read_handler_arg, typename Protocol::socket &socket_arg, const size_t send_queue_max_size_arg, const size_t free_list_max_size_arg, const Frame::Context &frame_context_arg, const SessionStats::Ptr &stats_arg)
 
bool is_raw_mode () const
 
bool is_raw_mode_read () const
 
bool is_raw_mode_write () const
 
 LinkCommon ()
 
void queue_send_buffer (BufferPtr &buf)
 
void queue_send ()
 
void handle_send (const openvpn_io::error_code &error, const size_t bytes_sent)
 
bool process_recv_buffer (BufferAllocated &buf)
 
void handle_recv (PacketFrom::SPtr pfp, const openvpn_io::error_code &error, const size_t bytes_recvd)
 
bool put_pktstream (BufferAllocated &buf, BufferAllocated &pkt)
 
void tcp_write_queue_needs_send ()
 

Protected Attributes

Protocol::socket & socket
 
ReadHandler read_handler
 
Frame::Context frame_context
 
SessionStats::Ptr stats
 
const size_t send_queue_max_size
 
const size_t free_list_max_size
 
Queue queue
 
Queue free_list
 
OpenVPNPacketStream pktstream
 
TransportMutateStream::Ptr mutate
 
bool raw_mode_read
 
bool raw_mode_write
 
bool halt = false
 

Private Types

typedef std::deque< BufferPtrQueue
 

Private Member Functions

virtual void recv_buffer (PacketFrom::SPtr &pfp, const size_t bytes_recvd)=0
 
virtual void from_app_send_buffer (BufferPtr &buf)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from openvpn::RC< thread_unsafe_refcount >
static constexpr bool is_thread_safe ()
 Delegates call to RCImpl and returns the result.
 

Detailed Description

template<typename Protocol, typename ReadHandler, bool RAW_MODE_ONLY>
class openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >

Definition at line 47 of file tcplinkcommon.hpp.

Member Typedef Documentation

◆ OpenVPNPacketStream

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
typedef PacketStream<std::uint16_t> openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::OpenVPNPacketStream

Definition at line 54 of file tcplinkcommon.hpp.

◆ protocol

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
typedef Protocol openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::protocol

Definition at line 53 of file tcplinkcommon.hpp.

◆ Ptr

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
typedef RCPtr<LinkCommon<Protocol, ReadHandler, RAW_MODE_ONLY> > openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::Ptr

Definition at line 52 of file tcplinkcommon.hpp.

◆ Queue

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
typedef std::deque<BufferPtr> openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::Queue
private

Definition at line 49 of file tcplinkcommon.hpp.

Constructor & Destructor Documentation

◆ LinkCommon() [1/2]

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::LinkCommon ( ReadHandler  read_handler_arg,
typename Protocol::socket &  socket_arg,
const size_t  send_queue_max_size_arg,
const size_t  free_list_max_size_arg,
const Frame::Context frame_context_arg,
const SessionStats::Ptr stats_arg 
)
inlineprotected

Definition at line 221 of file tcplinkcommon.hpp.

◆ LinkCommon() [2/2]

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::LinkCommon ( )
inlineprotected

Definition at line 266 of file tcplinkcommon.hpp.

Member Function Documentation

◆ from_app_send_buffer()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
virtual void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::from_app_send_buffer ( BufferPtr buf)
privatepure virtual

Implements openvpn::TCPTransport::LinkBase.

Implemented in openvpn::TCPTransport::TCPLink< Protocol, ReadHandler, RAW_MODE_ONLY >.

Here is the caller graph for this function:

◆ handle_recv()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::handle_recv ( PacketFrom::SPtr  pfp,
const openvpn_io::error_code &  error,
const size_t  bytes_recvd 
)
inlineprotected

Definition at line 378 of file tcplinkcommon.hpp.

◆ handle_send()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::handle_send ( const openvpn_io::error_code &  error,
const size_t  bytes_sent 
)
inlineprotected

Definition at line 289 of file tcplinkcommon.hpp.

◆ inject()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::inject ( const Buffer src)
inline

Definition at line 93 of file tcplinkcommon.hpp.

◆ is_raw_mode()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::is_raw_mode ( ) const
inlineprotected

Definition at line 245 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ is_raw_mode_read()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::is_raw_mode_read ( ) const
inlineprotected

Definition at line 250 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ is_raw_mode_write()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::is_raw_mode_write ( ) const
inlineprotected

Definition at line 258 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ process_recv_buffer()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::process_recv_buffer ( BufferAllocated buf)
inlineprotected

Definition at line 334 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ put_pktstream()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::put_pktstream ( BufferAllocated buf,
BufferAllocated pkt 
)
inlineprotected

Definition at line 402 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ queue_recv()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::queue_recv ( PacketFrom tcpfrom)
inline

Definition at line 182 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ queue_send()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::queue_send ( )
inlineprotected

Definition at line 278 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ queue_send_buffer()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::queue_send_buffer ( BufferPtr buf)
inlineprotected

Definition at line 271 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ recv_buffer()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
virtual void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::recv_buffer ( PacketFrom::SPtr pfp,
const size_t  bytes_recvd 
)
privatepure virtual

Implements openvpn::TCPTransport::LinkBase.

Implemented in openvpn::TCPTransport::TCPLink< Protocol, ReadHandler, RAW_MODE_ONLY >.

Here is the caller graph for this function:

◆ reset_align_adjust()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::reset_align_adjust ( const size_t  align_adjust)
inlinevirtual

Implements openvpn::TCPTransport::LinkBase.

Definition at line 122 of file tcplinkcommon.hpp.

◆ send()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::send ( BufferAllocated b)
inlinevirtual

Implements openvpn::TCPTransport::LinkBase.

Definition at line 136 of file tcplinkcommon.hpp.

◆ send_queue_empty()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::send_queue_empty ( ) const
inlinevirtual

Implements openvpn::TCPTransport::LinkBase.

Definition at line 88 of file tcplinkcommon.hpp.

◆ send_queue_size()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
size_t openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::send_queue_size ( ) const
inlinevirtual

Implements openvpn::TCPTransport::LinkBase.

Definition at line 127 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ set_mutate()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::set_mutate ( const TransportMutateStream::Ptr mutate_arg)
inline

Definition at line 83 of file tcplinkcommon.hpp.

◆ set_raw_mode()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::set_raw_mode ( const bool  mode)
inlinevirtual

Implements openvpn::TCPTransport::LinkBase.

Definition at line 61 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ set_raw_mode_read()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::set_raw_mode_read ( const bool  mode)
inline

Definition at line 67 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ set_raw_mode_write()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::set_raw_mode_write ( const bool  mode)
inline

Definition at line 75 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ start()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::start ( )
inlinevirtual

Implements openvpn::TCPTransport::LinkBase.

Definition at line 107 of file tcplinkcommon.hpp.

◆ stop()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::stop ( )
inlinevirtual

Implements openvpn::TCPTransport::LinkBase.

Definition at line 113 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

◆ tcp_write_queue_needs_send()

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
void openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::tcp_write_queue_needs_send ( )
inlineprotected

Definition at line 451 of file tcplinkcommon.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ frame_context

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
Frame::Context openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::frame_context
protected

Definition at line 458 of file tcplinkcommon.hpp.

◆ free_list

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
Queue openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::free_list
protected

Definition at line 463 of file tcplinkcommon.hpp.

◆ free_list_max_size

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
const size_t openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::free_list_max_size
protected

Definition at line 461 of file tcplinkcommon.hpp.

◆ halt

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::halt = false
protected

Definition at line 468 of file tcplinkcommon.hpp.

◆ mutate

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
TransportMutateStream::Ptr openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::mutate
protected

Definition at line 465 of file tcplinkcommon.hpp.

◆ pktstream

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
OpenVPNPacketStream openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::pktstream
protected

Definition at line 464 of file tcplinkcommon.hpp.

◆ queue

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
Queue openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::queue
protected

Definition at line 462 of file tcplinkcommon.hpp.

◆ raw_mode_read

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::raw_mode_read
protected

Definition at line 466 of file tcplinkcommon.hpp.

◆ raw_mode_write

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
bool openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::raw_mode_write
protected

Definition at line 467 of file tcplinkcommon.hpp.

◆ read_handler

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
ReadHandler openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::read_handler
protected

Definition at line 457 of file tcplinkcommon.hpp.

◆ send_queue_max_size

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
const size_t openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::send_queue_max_size
protected

Definition at line 460 of file tcplinkcommon.hpp.

◆ socket

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
Protocol::socket& openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::socket
protected

Definition at line 456 of file tcplinkcommon.hpp.

◆ stats

template<typename Protocol , typename ReadHandler , bool RAW_MODE_ONLY>
SessionStats::Ptr openvpn::TCPTransport::LinkCommon< Protocol, ReadHandler, RAW_MODE_ONLY >::stats
protected

Definition at line 459 of file tcplinkcommon.hpp.


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