OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::PsidCookie Class Referenceabstract

Interface to integrate this component into the server implementation. More...

#include <psid_cookie.hpp>

Inheritance diagram for openvpn::PsidCookie:
[legend]
Collaboration diagram for openvpn::PsidCookie:
[legend]

Public Types

enum class  Intercept {
  DECLINE_HANDLING , EARLY_DROP , DROP_1ST , HANDLE_1ST ,
  DROP_2ND , HANDLE_2ND
}
 Values returned by the intercept() function. More...
 
typedef RCPtr< PsidCookiePtr
 
- Public Types inherited from openvpn::RC< thread_unsafe_refcount >
typedef RCPtr< RCPtr
 

Public Member Functions

virtual Intercept intercept (ConstBuffer &pkt_buf, const PsidCookieAddrInfoBase &pcaib)=0
 Called when a potential new client session packet is received.
 
virtual ProtoSessionID get_cookie_psid ()=0
 Get the cookie psid from client's 2nd packet.
 
virtual void provide_psid_cookie_transport (PsidCookieTransportBase::Ptr pctb)=0
 Give this component the transport needed to send the server's HARD_RESET.
 
virtual ~PsidCookie ()=default
 
- 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.
 

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

Interface to integrate this component into the server implementation.

Definition at line 84 of file psid_cookie.hpp.

Member Typedef Documentation

◆ Ptr

Definition at line 87 of file psid_cookie.hpp.

Member Enumeration Documentation

◆ Intercept

enum class openvpn::PsidCookie::Intercept
strong

Values returned by the intercept() function.

These are status values depending upon the action that intercept() took in handling client's 1st and 2nd packets. Early drop indicates that the packet was dropped before determining whether the packet was client's 1st or 2nd.

Enumerator
DECLINE_HANDLING 
EARLY_DROP 
DROP_1ST 
HANDLE_1ST 
DROP_2ND 
HANDLE_2ND 

Definition at line 96 of file psid_cookie.hpp.

Constructor & Destructor Documentation

◆ ~PsidCookie()

virtual openvpn::PsidCookie::~PsidCookie ( )
virtualdefault

Member Function Documentation

◆ get_cookie_psid()

virtual ProtoSessionID openvpn::PsidCookie::get_cookie_psid ( )
pure virtual

Get the cookie psid from client's 2nd packet.

This provides the server's psid (a.k.a, the cookie_psid) as returned by the client in it's 2nd packet. It may only be called after intercept() returns HANDLE_2ND, indicating a valid psid cookie. Further, it may only be called once as it invalidates the internal data source after it sets the return value.

Returns
ProtoSessionID

Implemented in openvpn::PsidCookieImpl.

◆ intercept()

virtual Intercept openvpn::PsidCookie::intercept ( ConstBuffer pkt_buf,
const PsidCookieAddrInfoBase pcaib 
)
pure virtual

Called when a potential new client session packet is received.

Called by the server implementation when it recieves a packet for which it has no state information. Such a packet is potentially a client HARD_RESET or a 2nd client packet returning the psid cookie.

Parameters
pkt_bufThe packet received by the server implementation.
pcaibThe address information as contained in an instance of the class that the server implementation derived from the PsidCookieAddrInfoBase class
Returns
Intercept Status of the packet handling

Implemented in openvpn::PsidCookieImpl.

◆ provide_psid_cookie_transport()

virtual void openvpn::PsidCookie::provide_psid_cookie_transport ( PsidCookieTransportBase::Ptr  pctb)
pure virtual

Give this component the transport needed to send the server's HARD_RESET.

The server implementation must call this method before the intercept() function is asked to handle a packet

Parameters
pctbThe transport capability as provided by the server implementation's object derived from the PsidCookieTransportBase class

Implemented in openvpn::PsidCookieImpl.


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