1 #ifndef ICONNECTIONCONTEXT_H
2 #define ICONNECTIONCONTEXT_H
Represents a complete DoIP message with internal ByteArray representation.
Interface between DoIPServerStateMachine and DoIPConnection.
virtual DoIPCloseReason getCloseReason() const =0
Get the reason why the connection was closed.
virtual DoIPDownstreamResult notifyDownstreamRequest(const DoIPMessage &msg)=0
Forward a diagnostic message to downstream (subnet device)
virtual void notifyConnectionClosed(DoIPCloseReason reason)=0
Notify application that connection is closing.
virtual void notifyDiagnosticAckSent(DoIPDiagnosticAck ack)=0
Notify application that diagnostic ACK/NACK was sent.
virtual DoIPDiagnosticAck notifyDiagnosticMessage(const DoIPMessage &msg)=0
Handle an incoming diagnostic message (application callback)
virtual void setClientAddress(const DoIPAddress &address)=0
Set the active source address after routing activation.
virtual ssize_t sendProtocolMessage(const DoIPMessage &msg)=0
Send a DoIP protocol message to the client.
virtual bool isOpen() const =0
Check if the connection is currently open.
virtual ~IConnectionContext()=default
virtual bool hasDownstreamHandler() const =0
Check if downstream forwarding is available.
virtual void receiveDownstreamResponse(const ByteArray &response, DoIPDownstreamResult result)=0
Receive a response from downstream device.
virtual DoIPAddress getClientAddress() const =0
Get the currently active source address (routed client)
virtual DoIPAddress getServerAddress() const =0
Get the server's logical address.
virtual void closeConnection(DoIPCloseReason reason)=0
Close the TCP connection.
uint16_t DoIPAddress
Represents a 16-bit DoIP address consisting of high and low significant bytes.
std::optional< DoIPNegativeDiagnosticAck > DoIPDiagnosticAck
Alias for diagnostic acknowledgment type.
DoIPDownstreamResult
Result of a downstream request initiation.
DoIPCloseReason
Reason for connection closure.
A dynamic array of bytes with utility methods for network protocol handling.