|
Open Model Railroad Network (OpenMRN)
|
Static constants and functions related to the Datagram protocol. More...
#include <DatagramDefs.hxx>
Public Types | |
| enum | Protocol { LOG_REQUEST = 0x01 , LOG_REPLY = 0x02 , CONFIGURATION = 0x20 , REMOTE_BUTTON = 0x21 , DISPLAY_PROTOCOL = 0x28 , TRAIN_CONTROL = 0x30 } |
| All known datagram protocols. More... | |
| enum | { MAX_SIZE = 72 } |
| Various public datagram constants. More... | |
| enum | Flag { FLAGS_NONE = 0x00 , REPLY_PENDING = 0x80 , TIMEOUT_NONE = 0x00 , TIMEOUT_2 = 0x01 , TIMEOUT_4 = 0x02 , TIMEOUT_8 = 0x03 , TIMEOUT_16 = 0x04 , TIMEOUT_32 = 0x05 , TIMEOUT_64 = 0x06 , TIMEOUT_128 = 0x07 , TIMEOUT_256 = 0x08 , TIMEOUT_512 = 0x09 , TIMEOUT_1024 = 0x0A , TIMEOUT_2048 = 0x0B , TIMEOUT_4096 = 0x0C , TIMEOUT_8192 = 0x0D , TIMEOUT_16384 = 0x0E , TIMEOUT_32768 = 0x0F , TIMEOUT_MASK = 0x0F } |
| Possible flags for a successful receipt (received okay) of a Datagram. More... | |
| enum | Error { RESEND_OK = 0x2000 , TRANSPORT_ERROR = 0x6000 , BUFFER_UNAVAILABLE = 0x2020 , OUT_OF_ORDER = 0x2040 , PERMANENT_ERROR = 0x1000 , SRC_NOT_PERMITTED = 0x1020 , NOT_ACCEPTED = 0x1040 , UNIMPLEMENTED = 0x1080 , INVALID_ARGUMENTS = 0x1010 } |
| Possible error codes for a rejected datagram. More... | |
Static Public Member Functions | |
| static bool | resend_ok (uint16_t error) |
| We can try to resend the datagram. | |
| static bool | transport_error (uint16_t error) |
| Transport error occurred. | |
| static bool | buffer_unavailable (uint16_t error) |
| Buffer unavailable error occurred. | |
| static unsigned int | protocol_size (uint64_t protocol) |
| Determine if the protocol ID is represented by one, two, or six bytes. | |
Private Types | |
| enum | { PROTOCOL_SIZE_2 = 0xE0 , PROTOCOL_SIZE_6 = 0xF0 , PROTOCOL_SIZE_MASK = 0xF0 } |
| Constants used by the protocol_size function. More... | |
Private Member Functions | |
| DatagramDefs () | |
| Do not instantiate this class, ever. | |
Static constants and functions related to the Datagram protocol.
Definition at line 43 of file DatagramDefs.hxx.
| anonymous enum |
Various public datagram constants.
| Enumerator | |
|---|---|
| MAX_SIZE | maximum size in bytes of a datagram |
Definition at line 57 of file DatagramDefs.hxx.
|
private |
Constants used by the protocol_size function.
| Enumerator | |
|---|---|
| PROTOCOL_SIZE_2 | possible return value for protocol_size |
| PROTOCOL_SIZE_6 | possible return value for protocol_size |
| PROTOCOL_SIZE_MASK | mask used when determining protocol size |
Definition at line 144 of file DatagramDefs.hxx.
Possible error codes for a rejected datagram.
| Enumerator | |
|---|---|
| RESEND_OK | We can try to resend the datagram. |
| TRANSPORT_ERROR | Transport error occurred. |
| BUFFER_UNAVAILABLE | Buffer unavailable error occurred. |
| OUT_OF_ORDER | Out of order error occurred. |
| PERMANENT_ERROR | Permanent error occurred. |
| SRC_NOT_PERMITTED | Source not permitted error occurred. |
| NOT_ACCEPTED | Destination node does not accept datagrams of any kind. |
| UNIMPLEMENTED | NON_STANDARD The feature or command requested is not implemented by the target node. |
| INVALID_ARGUMENTS | NON_STANDARD Invalid or unparseable arguments. |
Definition at line 92 of file DatagramDefs.hxx.
Possible flags for a successful receipt (received okay) of a Datagram.
Definition at line 65 of file DatagramDefs.hxx.
All known datagram protocols.
| Enumerator | |
|---|---|
| LOG_REQUEST | request a placement into the log |
| LOG_REPLY | reply to a LOG_REQUEST |
| CONFIGURATION | configuration message |
| REMOTE_BUTTON | remote button input |
| DISPLAY_PROTOCOL | place on display |
| TRAIN_CONTROL | operation of mobile nodes |
Definition at line 46 of file DatagramDefs.hxx.
|
inlinestatic |
Buffer unavailable error occurred.
| error | error number |
Definition at line 127 of file DatagramDefs.hxx.
|
inlinestatic |
Determine if the protocol ID is represented by one, two, or six bytes.
| _protocol | protocol ID to interrogate |
Definition at line 136 of file DatagramDefs.hxx.
|
inlinestatic |
We can try to resend the datagram.
| error | error number |
Definition at line 109 of file DatagramDefs.hxx.
|
inlinestatic |
Transport error occurred.
| error | error number |
Definition at line 118 of file DatagramDefs.hxx.