|
Open Model Railroad Network (OpenMRN)
|
Frame handler that assembles incoming datagram fragments into a single datagram message. More...
Public Types | |
| enum | { CAN_FILTER , CAN_MASK } |
Public Types inherited from TypedStateFlow< MessageType, Base > | |
| typedef Base::Action | Action |
| Allows using Action without having StateFlowBase:: prefix in front of it. | |
Public Types inherited from FlowInterface< MessageType > | |
| typedef MessageType | message_type |
| Stores the message template type for external reference. | |
Public Member Functions | |
| CanDatagramParser (IfCan *iface) | |
| Action | entry () override |
| Handler callback for incoming frames. | |
| Action | send_rejection () |
| Sends a datagram rejection. | |
| Action | datagram_complete () |
| Requests the datagram in buf_, dstNode_ etc... to be sent to the AsyncIf for processing. | |
Public Member Functions inherited from openlcb::CanFrameStateFlow | |
| CanFrameStateFlow (IfCan *service) | |
| IfCan * | if_can () |
Public Member Functions inherited from StateFlow< Buffer< CanMessageData >, QList< 1 > > | |
| StateFlow (Service *service) | |
| Constructor. | |
Public Member Functions inherited from TypedStateFlow< MessageType, Base > | |
| TypedStateFlow (Service *service) | |
| Constructor. | |
| virtual | ~TypedStateFlow () |
| Destructor. | |
| void | send (MessageType *msg, unsigned priority=UINT_MAX) OVERRIDE |
| Sends a message to the state flow for processing. | |
Public Member Functions inherited from FlowInterface< MessageType > | |
| virtual Pool * | pool () |
| virtual MessageType * | type_helper () |
| This function is never user in the code, but GDB can use it to infer the correct message types. | |
| MessageType * | alloc () |
| Synchronously allocates a message buffer from the pool of this flow. | |
| void | alloc_async (Executable *target) |
| Asynchronously allocates a message buffer from the pool of this flow. | |
Private Attributes | |
| DatagramPayload | localBuffer_ |
| A local buffer that owns the datagram payload bytes after we took the entry from the pending buffers map. | |
| Node * | dstNode_ |
| NodeHandle | dst_ |
| unsigned short | srcAlias_: 12 |
| uint16_t | errorCode_ |
| If non-zero, contains a Rejection error code and the datagram should not be forwarded to the upper layer in this case. | |
| StlMap< uint64_t, DatagramPayload > | pendingBuffers_ |
| Open datagram buffers. | |
Additional Inherited Members | |
Static Public Member Functions inherited from FlowInterface< MessageType > | |
| static MessageType * | cast_alloc (QMember *entry) |
| Down casts and initializes an asynchronous allocation result to the appropriate flow's buffer type. | |
Protected Member Functions inherited from TypedStateFlow< MessageType, Base > | |
| void | release () OVERRIDE |
| Unrefs the current buffer. | |
| void | return_buffer () |
| For state flows that are operated using invoke_subflow_and_wait this is a way to hand back the buffer to the caller. | |
| MessageType * | message () |
| MessageType * | transfer_message () |
| Releases ownership of the current message. | |
Frame handler that assembles incoming datagram fragments into a single datagram message.
(That is, datagrams addressed to local nodes.)
Definition at line 131 of file DatagramCan.cxx.
| anonymous enum |
Definition at line 134 of file DatagramCan.cxx.
| openlcb::CanDatagramParser::CanDatagramParser | ( | IfCan * | iface | ) |
Definition at line 369 of file DatagramCan.cxx.
| openlcb::CanDatagramParser::~CanDatagramParser | ( | ) |
Definition at line 386 of file DatagramCan.cxx.
|
inline |
Requests the datagram in buf_, dstNode_ etc... to be sent to the AsyncIf for processing.
The lock_ is held and must be released. entry is the dispatcher.
Definition at line 301 of file DatagramCan.cxx.
|
inlineoverridevirtual |
Handler callback for incoming frames.
Frames came out of order or more than one datagram is being sent to the same dst.
Implements TypedStateFlow< MessageType, Base >.
Definition at line 148 of file DatagramCan.cxx.
|
inline |
Sends a datagram rejection.
The lock_ is held and must be released. entry is an If::addressed write flow. errorCode_ != 0.
Definition at line 286 of file DatagramCan.cxx.
|
private |
Definition at line 331 of file DatagramCan.cxx.
|
private |
Definition at line 330 of file DatagramCan.cxx.
|
private |
If non-zero, contains a Rejection error code and the datagram should not be forwarded to the upper layer in this case.
Definition at line 335 of file DatagramCan.cxx.
|
private |
A local buffer that owns the datagram payload bytes after we took the entry from the pending buffers map.
Definition at line 328 of file DatagramCan.cxx.
|
private |
Open datagram buffers.
Keyed by (dstid | srcid), value is a datagram payload. When a payload is finished, it should be moved into the final datagram message using swap() to avoid memory copies. @TODO(balazs.racz) we need some kind of timeout-based release mechanism in here.
Definition at line 342 of file DatagramCan.cxx.
|
private |
Definition at line 332 of file DatagramCan.cxx.