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

#include <gremlin.hpp>

Collaboration diagram for openvpn::Gremlin::SendRecvQueue:
[legend]

Public Member Functions

 SendRecvQueue (openvpn_io::io_context &io_context, const Config::Ptr &conf_arg, const bool tcp_arg)
 
template<class F >
void send_queue (F &&func_arg)
 
template<class F >
void recv_queue (F &&func_arg)
 
void maybe_corrupt_data (Buffer &buf, const size_t opcode_offset)
 Maybe flip one bit in an outgoing data-channel packet so the peer's AEAD/HMAC authentication fails.
 
size_t send_size () const
 
size_t recv_size () const
 
void stop ()
 

Private Member Functions

bool flip (const unsigned int prob)
 

Private Attributes

Config::Ptr conf
 
MTRand ri
 
DelayedQueue::Ptr send
 
DelayedQueue::Ptr recv
 
bool tcp
 

Detailed Description

Definition at line 158 of file gremlin.hpp.

Constructor & Destructor Documentation

◆ SendRecvQueue()

openvpn::Gremlin::SendRecvQueue::SendRecvQueue ( openvpn_io::io_context &  io_context,
const Config::Ptr conf_arg,
const bool  tcp_arg 
)
inline

Definition at line 161 of file gremlin.hpp.

Member Function Documentation

◆ flip()

bool openvpn::Gremlin::SendRecvQueue::flip ( const unsigned int  prob)
inlineprivate

Definition at line 232 of file gremlin.hpp.

Here is the caller graph for this function:

◆ maybe_corrupt_data()

void openvpn::Gremlin::SendRecvQueue::maybe_corrupt_data ( Buffer buf,
const size_t  opcode_offset 
)
inline

Maybe flip one bit in an outgoing data-channel packet so the peer's AEAD/HMAC authentication fails.

Non-data packets are left alone so the TLS handshake can complete. Corruption fires with 1-in-N probability where N is the send_corrupt_probability configured on the gremlin Config; if that value is 0, the function is a no-op.

Parameters
bufBuffer to mutate in place.
opcode_offsetByte index of the OpenVPN opcode in buf (0 for UDP, 2 for TCP because of the 2-byte length prefix prepended by PacketStream).

Definition at line 199 of file gremlin.hpp.

◆ recv_queue()

template<class F >
void openvpn::Gremlin::SendRecvQueue::recv_queue ( F &&  func_arg)
inline

Definition at line 179 of file gremlin.hpp.

◆ recv_size()

size_t openvpn::Gremlin::SendRecvQueue::recv_size ( ) const
inline

Definition at line 220 of file gremlin.hpp.

◆ send_queue()

template<class F >
void openvpn::Gremlin::SendRecvQueue::send_queue ( F &&  func_arg)
inline

Definition at line 172 of file gremlin.hpp.

◆ send_size()

size_t openvpn::Gremlin::SendRecvQueue::send_size ( ) const
inline

Definition at line 215 of file gremlin.hpp.

◆ stop()

void openvpn::Gremlin::SendRecvQueue::stop ( )
inline

Definition at line 225 of file gremlin.hpp.

Member Data Documentation

◆ conf

Config::Ptr openvpn::Gremlin::SendRecvQueue::conf
private

Definition at line 240 of file gremlin.hpp.

◆ recv

DelayedQueue::Ptr openvpn::Gremlin::SendRecvQueue::recv
private

Definition at line 243 of file gremlin.hpp.

◆ ri

MTRand openvpn::Gremlin::SendRecvQueue::ri
private

Definition at line 241 of file gremlin.hpp.

◆ send

DelayedQueue::Ptr openvpn::Gremlin::SendRecvQueue::send
private

Definition at line 242 of file gremlin.hpp.

◆ tcp

bool openvpn::Gremlin::SendRecvQueue::tcp
private

Definition at line 244 of file gremlin.hpp.


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