1 #ifndef DOIPSERVERMODEL_H
2 #define DOIPSERVERMODEL_H
18 class IConnectionContext;
126 LOG_DOIP_DEBUG(
"Diagnostic message received on DefaultDoIPServerModel");
134 LOG_DOIP_DEBUG(
"Diagnostic notification on DefaultDoIPServerModel");
#define LOG_DOIP_DEBUG(...)
Represents a complete DoIP message with internal ByteArray representation.
Interface between DoIPServerStateMachine and DoIPConnection.
uint16_t DoIPAddress
Represents a 16-bit DoIP address consisting of high and low significant bytes.
std::function< void(IConnectionContext &, DoIPDiagnosticAck)> ServerModelDiagnosticNotificationHandler
std::optional< DoIPNegativeDiagnosticAck > DoIPDiagnosticAck
Alias for diagnostic acknowledgment type.
std::function< void(const ByteArray &response, DoIPDownstreamResult result)> ServerModelDownstreamResponseHandler
Callback for downstream response notification.
DoIPDownstreamResult
Result of a downstream request initiation.
std::function< DoIPDownstreamResult(IConnectionContext &ctx, const DoIPMessage &msg, ServerModelDownstreamResponseHandler callback)> ServerModelDownstreamHandler
Callback for downstream (subnet) request handling.
DoIPCloseReason
Reason for connection closure.
std::unique_ptr< DoIPServerModel > UniqueServerModelPtr
std::function< void(IConnectionContext &, DoIPCloseReason)> ServerModelCloseHandler
std::function< void(IConnectionContext &)> ServerModelOpenHandler
std::function< DoIPDiagnosticAck(IConnectionContext &, const DoIPMessage &)> ServerModelDiagnosticHandler
A dynamic array of bytes with utility methods for network protocol handling.
Default DoIP Server Model with no-op callbacks.
~DefaultDoIPServerModel()
DoIP Server Model - Configuration and callbacks for a DoIP server connection.
ServerModelDiagnosticHandler onDiagnosticMessage
Called when a diagnostic message is received (for local handling)
bool hasDownstreamHandler() const
Check if downstream forwarding is enabled.
DoIPAddress serverAddress
The logical address of this DoIP server.
ServerModelDownstreamHandler onDownstreamRequest
Called when a diagnostic message should be forwarded downstream.
ServerModelOpenHandler onOpenConnection
Called when the connection is being opened.
ServerModelDiagnosticNotificationHandler onDiagnosticNotification
Called after a diagnostic ACK/NACK was sent to the client.
ServerModelCloseHandler onCloseConnection
Called when the connection is being closed.