reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
net_common.h
Go to the documentation of this file.
1
182
183#ifndef NET_COMMON_H
184#define NET_COMMON_H
185
193#define FED_COM_BUFFER_SIZE 256u
194
202#define ADDRESS_QUERY_RETRY_INTERVAL MSEC(250)
203
215#define DELAY_START SEC(1)
216
219
220// These message types will be encoded in an unsigned char,
221// so the magnitude must not exceed 255. Note that these are
222// listed in increasing numerical order starting from 0 interleaved
223// with decreasing numerical order starting from 255 (so that they
224// can be listed in a logical order here even as the design evolves).
225
233#define MSG_TYPE_REJECT 0
234
241#define MSG_TYPE_ACK 255
242
252#define MSG_TYPE_UDP_PORT 254
253
273#define MSG_TYPE_FED_IDS 1
274
276
288#define MSG_TYPE_FED_NONCE 100
289
305#define MSG_TYPE_RTI_RESPONSE 101
306
320#define MSG_TYPE_FED_RESPONSE 102
321
326#define NONCE_LENGTH 8
327
332#define SHA256_HMAC_LENGTH 32
333
342#define MSG_TYPE_TIMESTAMP 2
343
348#define MSG_TYPE_TIMESTAMP_LENGTH (1 + sizeof(int64_t))
349
362#define MSG_TYPE_MESSAGE 3
363
368#define MSG_TYPE_RESIGN 4
369
385#define MSG_TYPE_TAGGED_MESSAGE 5
386
404#define MSG_TYPE_NEXT_EVENT_TAG 6
405
416#define MSG_TYPE_TAG_ADVANCE_GRANT 7
417
428#define MSG_TYPE_PROVISIONAL_TAG_ADVANCE_GRANT 8
429
438#define MSG_TYPE_LATEST_TAG_CONFIRMED 9
439
441
462#define MSG_TYPE_STOP_REQUEST 10
463
468#define MSG_TYPE_STOP_REQUEST_LENGTH (1 + sizeof(instant_t) + sizeof(microstep_t))
469
478#define ENCODE_STOP_REQUEST(buffer, time, microstep) \
479 do { \
480 buffer[0] = MSG_TYPE_STOP_REQUEST; \
481 encode_int64(time, &(buffer[1])); \
482 encode_int32((int32_t)microstep, &(buffer[1 + sizeof(instant_t)])); \
483 } while (0)
484
493#define MSG_TYPE_STOP_REQUEST_REPLY 11
494
499#define MSG_TYPE_STOP_REQUEST_REPLY_LENGTH (1 + sizeof(instant_t) + sizeof(microstep_t))
500
509#define ENCODE_STOP_REQUEST_REPLY(buffer, time, microstep) \
510 do { \
511 buffer[0] = MSG_TYPE_STOP_REQUEST_REPLY; \
512 encode_int64(time, &(buffer[1])); \
513 encode_int32((int32_t)microstep, &(buffer[1 + sizeof(instant_t)])); \
514 } while (0)
515
525#define MSG_TYPE_STOP_GRANTED 12
526
531#define MSG_TYPE_STOP_GRANTED_LENGTH (1 + sizeof(instant_t) + sizeof(microstep_t))
532
541#define ENCODE_STOP_GRANTED(buffer, time, microstep) \
542 do { \
543 buffer[0] = MSG_TYPE_STOP_GRANTED; \
544 encode_int64(time, &(buffer[1])); \
545 encode_int32((int32_t)microstep, &(buffer[1 + sizeof(instant_t)])); \
546 } while (0)
547
549
557#define MSG_TYPE_ADDRESS_QUERY 13
558
571#define MSG_TYPE_ADDRESS_QUERY_REPLY 14
572
584#define MSG_TYPE_ADDRESS_ADVERTISEMENT 15
585
598#define MSG_TYPE_P2P_SENDING_FED_ID 16
599
610#define MSG_TYPE_P2P_MESSAGE 17
611
629#define MSG_TYPE_P2P_TAGGED_MESSAGE 18
630
632
638#define MSG_TYPE_CLOCK_SYNC_T1 19
639
646#define MSG_TYPE_CLOCK_SYNC_T3 20
647
654#define MSG_TYPE_CLOCK_SYNC_T4 21
655
668#define MSG_TYPE_CLOCK_SYNC_CODED_PROBE 22
669
682#define MSG_TYPE_PORT_ABSENT 23
683
711#define MSG_TYPE_NEIGHBOR_STRUCTURE 24
712
717#define MSG_TYPE_NEIGHBOR_STRUCTURE_HEADER_SIZE 9
718
723#define MSG_TYPE_FAILED 25
724
737#define MSG_TYPE_DOWNSTREAM_NEXT_EVENT_TAG 26
738
741
747#define FEDERATION_ID_DOES_NOT_MATCH 1
748
754#define FEDERATE_ID_IN_USE 2
755
761#define FEDERATE_ID_OUT_OF_RANGE 3
762
768#define UNEXPECTED_MESSAGE 4
769
775#define WRONG_SERVER 5
776
782#define HMAC_DOES_NOT_MATCH 6
783
789#define RTI_NOT_EXECUTED_WITH_AUTH 7
790
791#endif /* NET_COMMON_H */