|
Open Model Railroad Network (OpenMRN)
|
Static class for constants and utilities related to the TCP transport protocol. More...
#include <IfTcpImpl.hxx>
Public Types | |
| enum | { FLAGS_OPENLCB_MSG = 0x8000 , FLAGS_CHAINING = 0x4000 , FLAGS_RESVD1_ZERO_CHECK = 0x3000 , FLAGS_FRAGMENT_NOT_FIRST = 0x0800 , FLAGS_FRAGMENT_NOT_LAST = 0x0400 , FLAGS_RESVD2_IGNORED = 0x03FF , HDR_FLAG_OFS = 0 , HDR_SIZE_OFS = 2 , HDR_GATEWAY_OFS = 2 + 3 , HDR_SIZE_END = HDR_GATEWAY_OFS , HDR_TIMESTAMP_OFS = 2 + 3 + 6 , HDR_LEN = 2 + 3 + 6 + 6 , MSG_MTI_OFS = 0 , MSG_SRC_OFS = 2 , MSG_DST_OFS = 2 + 6 , MSG_ADR_PAYLOAD_OFS = 2 + 6 + 6 , MSG_GLOBAL_PAYLOAD_OFS = MSG_DST_OFS , MIN_MESSAGE_SIZE = MSG_GLOBAL_PAYLOAD_OFS + HDR_LEN , MIN_ADR_MESSAGE_SIZE = MSG_ADR_PAYLOAD_OFS + HDR_LEN , ABS_MTI_OFS = HDR_LEN + MSG_MTI_OFS } |
Static Public Member Functions | |
| static void | render_tcp_message (const GenMessage &msg, NodeID gateway_node_id, long long sequence, string *tgt) |
| Renders a TCP message into a single buffer, ready to transmit. | |
| static int | get_tcp_message_len (const void *data, size_t len) |
| Guesses the length of a tcp message from looking at the prefix of the payload. | |
| static bool | parse_tcp_message (const string &src, GenMessage *tgt) |
| Parses a TCP message format (from binary payload) into a general OpenLCB message. | |
| static unsigned | guess_priority (const string &tcp_payload) |
Static Public Attributes | |
| static const char | MDNS_PROTOCOL_TCP [] = "_tcp" |
| Protocol to be used for mDNS broadcast. | |
| static const char | MDNS_SERVICE_NAME_HUB [] = "_openlcb-hub" |
| base name of the mDNS Service Name for mDNS broadcast as a hub | |
| static const char | MDNS_SERVICE_NAME_HUB_TCP [] = "_openlcb-hub._tcp" |
| complete mDNS broadcast name for a TCP hub | |
| static const char | MDNS_SERVICE_NAME_GRIDCONNECT_CAN [] = "_openlcb-can" |
| base name of the mDNS Service Name for mDNS broadcast as a client | |
| static const char | MDNS_SERVICE_NAME_GRIDCONNECT_CAN_TCP [] = "_openlcb-can._tcp" |
| complete mDNS broadcast name for a TCP GridConnect protocol client | |
Private Member Functions | |
| TcpDefs () | |
| No usable constructor; this is a static-only class. | |
| TcpDefs () | |
| Nobody can construct this class. | |
| DISALLOW_COPY_AND_ASSIGN (TcpDefs) | |
Static class for constants and utilities related to the TCP transport protocol.
Definition at line 47 of file IfTcpImpl.hxx.
| anonymous enum |
Definition at line 185 of file IfTcpImpl.hxx.
|
inlinestatic |
Guesses the length of a tcp message from looking at the prefix of the payload.
| data | is the prefix of the incoming stream. |
| len | is the number of available bytes in this prefix. |
Definition at line 96 of file IfTcpImpl.hxx.
|
inlinestatic |
| tcp_payload | is a message holding a TCP protocol frame. |
Definition at line 175 of file IfTcpImpl.hxx.
|
inlinestatic |
Parses a TCP message format (from binary payload) into a general OpenLCB message.
| src | the rendered TCP message. |
| tgt | the output generic message |
Definition at line 117 of file IfTcpImpl.hxx.
|
inlinestatic |
Renders a TCP message into a single buffer, ready to transmit.
| msg | is the OpenLCB message to render. |
| gateway_node_id | will be populated into the message header as the message source (last sending node ID). |
| sequence | is a 48-bit millisecond value that's monotonic. |
| target | is the buffer into which to render the message. |
Definition at line 56 of file IfTcpImpl.hxx.
|
static |
Protocol to be used for mDNS broadcast.
Definition at line 46 of file TcpDefs.hxx.
|
static |
base name of the mDNS Service Name for mDNS broadcast as a client
Definition at line 52 of file TcpDefs.hxx.
|
static |
complete mDNS broadcast name for a TCP GridConnect protocol client
Definition at line 54 of file TcpDefs.hxx.
|
static |
base name of the mDNS Service Name for mDNS broadcast as a hub
Definition at line 48 of file TcpDefs.hxx.
|
static |
complete mDNS broadcast name for a TCP hub
Definition at line 50 of file TcpDefs.hxx.