opendnp3  3.0.0
Reference implementation of DNP3 (IEEE-1815)
opendnp3::DefaultListenCallbacks Class Referencefinal

Callback interface invoked when a new connection is accepted. More...

#include <opendnp3/master/DefaultListenCallbacks.h>

Public Member Functions

 DefaultListenCallbacks ()
 
virtual ~DefaultListenCallbacks ()
 
virtual bool AcceptCertificate (uint64_t sessionid, const X509Info &info) override
 Ask user code if the following preverified certificate should be accepted. More...
 
virtual bool AcceptConnection (uint64_t sessionid, const std::string &ipaddress) override
 Ask user code if the following connection should be accepted. More...
 
virtual TimeDuration GetFirstFrameTimeout () override
 return the amount of time the session should wait for the first frame More...
 
virtual void OnCertificateError (uint64_t sessionid, const X509Info &info, int error) override
 Called when a certificate fails verification. More...
 
virtual void OnConnectionClose (uint64_t sessionid, const std::shared_ptr< IMasterSession > &session) override
 Called when a socket closes. More...
 
virtual void OnFirstFrame (uint64_t sessionid, const LinkHeaderFields &header, ISessionAcceptor &acceptor) override
 Called when the first link-layer frame is received for a session. More...
 
- Public Member Functions inherited from opendnp3::IListenCallbacks
virtual ~IListenCallbacks ()
 

Private Member Functions

std::string SessionIdToString (uint64_t id)
 

Detailed Description

Callback interface invoked when a new connection is accepted.

Definition at line 32 of file DefaultListenCallbacks.h.

Constructor & Destructor Documentation

◆ DefaultListenCallbacks()

opendnp3::DefaultListenCallbacks::DefaultListenCallbacks ( )

◆ ~DefaultListenCallbacks()

virtual opendnp3::DefaultListenCallbacks::~DefaultListenCallbacks ( )
inlinevirtual

Definition at line 37 of file DefaultListenCallbacks.h.

Member Function Documentation

◆ AcceptCertificate()

virtual bool opendnp3::DefaultListenCallbacks::AcceptCertificate ( uint64_t  sessionid,
const X509Info info 
)
overridevirtual

Ask user code if the following preverified certificate should be accepted.

Parameters
sessionidIncrementing id used to uniquely identify the session
infoInformation from the x509 certificate
Returns
If true, if the certificate should be accepted, false otherwise.

Implements opendnp3::IListenCallbacks.

◆ AcceptConnection()

virtual bool opendnp3::DefaultListenCallbacks::AcceptConnection ( uint64_t  sessionid,
const std::string &  ipaddress 
)
overridevirtual

Ask user code if the following connection should be accepted.

Parameters
sessionidIncrementing id used to uniquely identify the session
ipaddressThe IP address of the connecting host. Can optionally be used for connection filtering
Returns
If true, the connection is accepted and a link frame parser is created to handle incoming frame data

Implements opendnp3::IListenCallbacks.

◆ GetFirstFrameTimeout()

virtual TimeDuration opendnp3::DefaultListenCallbacks::GetFirstFrameTimeout ( )
overridevirtual

return the amount of time the session should wait for the first frame

Implements opendnp3::IListenCallbacks.

◆ OnCertificateError()

virtual void opendnp3::DefaultListenCallbacks::OnCertificateError ( uint64_t  sessionid,
const X509Info info,
int  error 
)
overridevirtual

Called when a certificate fails verification.

Parameters
sessionidIncrementing id used to uniquely identify the session
infoInformation from the x509 certificate
errorError code with reason for failed verification

Implements opendnp3::IListenCallbacks.

◆ OnConnectionClose()

virtual void opendnp3::DefaultListenCallbacks::OnConnectionClose ( uint64_t  sessionid,
const std::shared_ptr< IMasterSession > &  session 
)
overridevirtual

Called when a socket closes.

Parameters
sessionidIncrementing id used to uniquely identify the session
sessionPossibly NULL shared_ptr to the master session if it was created

Implements opendnp3::IListenCallbacks.

◆ OnFirstFrame()

virtual void opendnp3::DefaultListenCallbacks::OnFirstFrame ( uint64_t  sessionid,
const LinkHeaderFields header,
ISessionAcceptor acceptor 
)
overridevirtual

Called when the first link-layer frame is received for a session.

Implements opendnp3::IListenCallbacks.

◆ SessionIdToString()

std::string opendnp3::DefaultListenCallbacks::SessionIdToString ( uint64_t  id)
private

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