35#ifndef _OPENLCB_DATAGRAM_HXX_
36#define _OPENLCB_DATAGRAM_HXX_
45struct IncomingDatagram;
98 unsigned priority = UINT_MAX) = 0;
115 PERMANENT_ERROR = 0x1000,
118 TRANSPORT_ERROR = 0x4000,
119 BUFFER_UNAVAILABLE = 0x0020,
120 OUT_OF_ORDER = 0x0040,
122 SOURCE_NOT_PERMITTED = 0x0020,
123 DATAGRAMS_NOT_ACCEPTED = 0x0040,
126 OPERATION_SUCCESS = 0x10000,
127 OPERATION_PENDING = 0x20000,
128 DST_NOT_FOUND = Defs::ERROR_DST_NOT_FOUND,
129 TIMEOUT = Defs::OPENMRN_TIMEOUT,
130 DST_REBOOT = Defs::ERROR_DST_REBOOT,
134 RESPONSE_FLAGS_SHIFT = 24,
135 RESPONSE_CODE_MASK = (1<<RESPONSE_FLAGS_SHIFT) - 1,
136 OK_REPLY_PENDING = (1 << 31),
142 REPLY_PENDING = 0x80,
143 REPLY_TIMEOUT_SEC = 0x1,
144 REPLY_TIMEOUT_MASK = 0xf,
228 Action respond_rejection();
231 uint16_t resultCode_;
Base class for all QMember types that hold data in an expandable format.
Abstract class for message recipients.
Pool of previously allocated, but currently unused, items.
Essentially a "next" pointer container.
Collection of related state machines that pend on incoming messages.
State flow with a given typed input queue.
A type-safe map that allows registration and lookup or per-node handler of a particular message ID.
Strongly typed queue class with asynchronous access.
Base::Action Action
Allows using Action without having StateFlowBase:: prefix in front of it.
Use this class to send datagrams.
virtual void cancel()=0
Requests cancelling the datagram send operation.
uint32_t result()
Returns a bitmask of ResultCodes for the transmission operation.
ResultCodes
Known result codes from the DatagramClient.
virtual void write_datagram(Buffer< GenMessage > *b, unsigned priority=UINT_MAX)=0
Triggers sending a datagram.
Class for routing incoming datagram messages to the datagram handlers.
Action entry() override
Entry into the StateFlow activity.
Action incoming_datagram_allocated()
Registry registry_
Maintains the registered datagram handlers.
Transport-agnostic dispatcher of datagrams.
TypedQAsync< DatagramClient > * client_allocator()
Datagram clients.
TypedQAsync< DatagramClient > clients_
Datagram clients.
If * iface_
Interface on which we are registered.
DatagramDispatcher dispatcher_
Datagram dispatch handler.
Abstract class representing an OpenLCB Interface.
Base class for incoming message handler flows.
Base class for NMRAnet nodes conforming to the asynchronous interface.
long long DATAGRAM_RESPONSE_TIMEOUT_NSEC
Defines how long the datagram client flow should wait for the datagram ack/nack response message.
FlowInterface< Buffer< IncomingDatagram > > DatagramHandler
Base class for datagram handlers.
string Payload
Container that carries the data bytes in an NMRAnet message.
StateFlow< Buffer< IncomingDatagram >, QList< 1 > > DatagramHandlerFlow
Derive datagram handlers that are stateflows from this base class.
Pool *const g_incoming_datagram_allocator
Allocator to be used for Buffer<IncomingDatagram> objects.
Payload DatagramPayload
Contents of a Datagram message.
Message structure for incoming datagram handlers.
DatagramPayload payload
Owned by the current IncomingDatagram object.
Node * dst
Virtual node that the datagram was addressed to.
NodeHandle src
Originator of the incoming datagram.
Container of both a NodeID and NodeAlias.