56 unsigned prio = priority();
59 if (prio >= (1 << 16))
61 prio =
message()->data()->priority();
69 if (!
message()->data()->has_flag_dst(
75 unsigned loopback_prio =
message()->data()->priority();
77 return release_and_exit();
88#define ADD_STRING_SIZE(_str, _max) \
92 size_t len = strlen((_str)); \
93 size += len > (_max) ? (_max) : len; \
98#define INSERT_STRING(_str, _max) \
102 size_t len = strlen((_str)); \
103 len = len > (_max) ? (_max) : len; \
104 memcpy(pos, (_str), len); \
119 static char ident[8+40+40+20+20+62+63];
123 ADD_STRING_SIZE(MANUFACTURER, 40);
124 ADD_STRING_SIZE(model, 40);
125 ADD_STRING_SIZE(HARDWARE_REV, 20);
126 ADD_STRING_SIZE(SOFTWARE_REV, 20);
127 ADD_STRING_SIZE(userName, 62);
128 ADD_STRING_SIZE(userDescription, 63);
130 pos[0] = SIMPLE_NODE_IDENT_VERSION_A;
133 INSERT_STRING(MANUFACTURER, 40);
134 INSERT_STRING(model, 40);
135 INSERT_STRING(HARDWARE_REV, 20);
136 INSERT_STRING(SOFTWARE_REV, 20);
138 pos[0] = SIMPLE_NODE_IDENT_VERSION_B;
141 INSERT_STRING(userName, 62);
142 INSERT_STRING(userDescription, 63);
144 for (
int index = 0; size; )
146 size_t segment_size = size > 6 ? 6 : size;
147 Buffer *buffer = buffer_alloc(6);
148 memcpy(buffer->start(), ident + index, segment_size);
149 buffer->advance(segment_size);
151 size -= segment_size;
152 index += segment_size;
159void Node::protocol_support_reply(NodeHandle dst)
164 uint64_t protocols = PROTOCOL_IDENTIFICATION |
167 SIMPLE_NODE_INFORMATION |
168 MEMORY_CONFIGURATION |
171 Buffer *buffer = buffer_alloc(6);
172 uint8_t *bytes = (uint8_t*)buffer->start();
174 bytes[0] = (protocols >> 40) & 0xff;
175 bytes[1] = (protocols >> 32) & 0xff;
176 bytes[2] = (protocols >> 24) & 0xff;
177 bytes[3] = (protocols >> 16) & 0xff;
178 bytes[4] = (protocols >> 8) & 0xff;
179 bytes[5] = (protocols >> 0) & 0xff;
#define STATE(_fn)
Turns a function name into an argument to be supplied to functions expecting a state.
Base class for all QMember types that hold data in an expandable format.
Return type for a state flow callback.
void send(MessageType *msg, unsigned priority=UINT_MAX) OVERRIDE
Sends a message to the state flow for processing.
MessageType * transfer_message()
Releases ownership of the current message.
MessageDispatchFlow * dispatcher()
virtual Node * lookup_local_node_handle(NodeHandle handle)
Looks up a node ID in the local nodes' registry.
virtual Action send_to_local_node()
This state is called when an addressed message's destination is a node that is local to this interfac...
Action global_entry()
Global write flows should return to this state AFTER sending the message to the hardware.
virtual Action send_finished()
Virtual method called after the send is completed, i.e., all the frames are generated and sent to the...
GenMessage * nmsg()
Implementations shall call this function when they are done with sending the packet.
Action addressed_entry()
Addressed write flows should call this state BEFORE sending to the hardware.
virtual Action send_to_hardware()=0
This function will be called (on the main executor) to initiate sending this message to the hardware.
@ MTI_IDENT_INFO_REPLY
node identity reply
@ MTI_PROTOCOL_SUPPORT_REPLY
reply with supported protocols
@ WAIT_FOR_LOCAL_LOOPBACK
Specifies that the stack should wait for the local loopback processing before invoking the done notif...
Node * dstNode
If the destination node is local, this value is non-NULL.
Container of both a NodeID and NodeAlias.