opendnp3  3.0.0
Reference implementation of DNP3 (IEEE-1815)
opendnp3::IListenCallbacks Class Referenceabstract

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

#include <opendnp3/master/IListenCallbacks.h>

Public Member Functions

virtual ~IListenCallbacks ()
 
virtual bool AcceptCertificate (uint64_t sessionid, const X509Info &info)=0
 Ask user code if the following preverified certificate should be accepted. More...
 
virtual bool AcceptConnection (uint64_t sessionid, const std::string &ipaddress)=0
 Ask user code if the following connection should be accepted. More...
 
virtual TimeDuration GetFirstFrameTimeout ()=0
 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)=0
 Called when a certificate fails verification. More...
 
virtual void OnConnectionClose (uint64_t sessionid, const std::shared_ptr< IMasterSession > &session)=0
 Called when a socket closes. More...
 
virtual void OnFirstFrame (uint64_t sessionid, const LinkHeaderFields &header, ISessionAcceptor &acceptor)=0
 Called when the first link-layer frame is received for a session. More...
 

Detailed Description

Callback interface invoked when a new connection is accepted.

Definition at line 34 of file IListenCallbacks.h.

Constructor & Destructor Documentation

◆ ~IListenCallbacks()

virtual opendnp3::IListenCallbacks::~IListenCallbacks ( )
inlinevirtual

Definition at line 37 of file IListenCallbacks.h.

Member Function Documentation

◆ AcceptCertificate()

virtual bool opendnp3::IListenCallbacks::AcceptCertificate ( uint64_t  sessionid,
const X509Info info 
)
pure virtual

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.

Implemented in opendnp3::DefaultListenCallbacks.

◆ AcceptConnection()

virtual bool opendnp3::IListenCallbacks::AcceptConnection ( uint64_t  sessionid,
const std::string &  ipaddress 
)
pure virtual

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

Implemented in opendnp3::DefaultListenCallbacks.

◆ GetFirstFrameTimeout()

virtual TimeDuration opendnp3::IListenCallbacks::GetFirstFrameTimeout ( )
pure virtual

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

Implemented in opendnp3::DefaultListenCallbacks.

◆ OnCertificateError()

virtual void opendnp3::IListenCallbacks::OnCertificateError ( uint64_t  sessionid,
const X509Info info,
int  error 
)
pure virtual

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

Implemented in opendnp3::DefaultListenCallbacks.

◆ OnConnectionClose()

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

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

Implemented in opendnp3::DefaultListenCallbacks.

◆ OnFirstFrame()

virtual void opendnp3::IListenCallbacks::OnFirstFrame ( uint64_t  sessionid,
const LinkHeaderFields header,
ISessionAcceptor acceptor 
)
pure virtual

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

Implemented in opendnp3::DefaultListenCallbacks.


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