Engage Engine API  1.243.9083
Loading...
Searching...
No Matches
ConfigurationObjects.h
Go to the documentation of this file.
1//
2// Copyright (c) 2019 Rally Tactical Systems, Inc.
3// All rights reserved.
4//
5
20#ifndef ConfigurationObjects_h
21#define ConfigurationObjects_h
22
23#include "Platform.h"
24#include "EngageConstants.h"
25
26#include <iostream>
27#include <cstddef>
28#include <cstdint>
29#include <chrono>
30#include <vector>
31#include <string>
32
33#include <nlohmann/json.hpp>
34
35#ifndef WIN32
36 #pragma GCC diagnostic push
37 #pragma GCC diagnostic ignored "-Wunused-function"
38#endif
39
40#if !defined(ENGAGE_IGNORE_COMPILER_UNUSED_WARNING)
41 #if defined(__GNUC__)
42 #define ENGAGE_IGNORE_COMPILER_UNUSED_WARNING __attribute__((unused))
43 #else
44 #define ENGAGE_IGNORE_COMPILER_UNUSED_WARNING
45 #endif
46#endif // ENGAGE_IGNORE_COMPILER_UNUSED_WARNING
47
48// We'll use a different namespace depending on whether we're building the RTS core code
49// or if this is being included in an app-land project.
50#if defined(RTS_CORE_BUILD)
51namespace ConfigurationObjects
52#else
53namespace AppConfigurationObjects
54#endif
55{
56 static const char *ENGAGE_CONFIGURATION_OBJECT_ATTACHED_OBJECT = "_attached";
57
58 //-----------------------------------------------------------
59 #pragma pack(push, 1)
60 typedef struct _DataSeriesHeader_t
61 {
76 uint8_t t;
77
81 uint32_t ts;
82
95 uint8_t it;
96
105 uint8_t im;
106
110 uint8_t vt;
111
115 uint8_t ss;
117
118 typedef struct _DataElementUint8_t
119 {
120 uint8_t ofs;
121 uint8_t val;
123
125 {
126 uint8_t ofs;
127 uint16_t val;
129
131 {
132 uint8_t ofs;
133 uint32_t val;
135
137 {
138 uint8_t ofs;
139 uint64_t val;
141 #pragma pack(pop)
142
143 typedef enum
144 {
145 invalid = 0,
146 uint8 = 1,
147 uint16 = 2,
148 uint32 = 3,
149 uint64 = 4
150 } DataSeriesValueType_t;
151
157 typedef enum
158 {
159 unknown = 0,
160 heartRate = 1,
161 skinTemp = 2,
162 coreTemp = 3,
163 hydration = 4,
164 bloodOxygenation = 5,
165 fatigueLevel = 6,
166 taskEffectiveness = 7
167 } HumanBiometricsTypes_t;
168
169 //-----------------------------------------------------------
170
171 static FILE *_internalFileOpener(const char *fn, const char *mode)
172 {
173 FILE *fp = nullptr;
174
175 #ifndef WIN32
176 fp = fopen(fn, mode);
177 #else
178 if(fopen_s(&fp, fn, mode) != 0)
179 {
180 fp = nullptr;
181 }
182 #endif
183
184 return fp;
185 }
186
187 #define JSON_SERIALIZED_CLASS(_cn) \
188 class _cn; \
189 static void to_json(nlohmann::json& j, const _cn& p); \
190 static void from_json(const nlohmann::json& j, _cn& p);
191
192 #define IMPLEMENT_JSON_DOCUMENTATION(_cn) \
193 public: \
194 static void document(const char *path = nullptr) \
195 { \
196 _cn example; \
197 example.initForDocumenting(); \
198 std::string theJson = example.serialize(3); \
199 std::cout << "------------------------------------------------" << std::endl \
200 << #_cn << std::endl \
201 << theJson << std::endl \
202 << "------------------------------------------------" << std::endl; \
203 \
204 if(path != nullptr && path[0] != 0) \
205 { \
206 std::string fn = path; \
207 fn.append("/"); \
208 fn.append(#_cn); \
209 fn.append(".json"); \
210 \
211 FILE *fp = _internalFileOpener(fn.c_str(), "wt");\
212 \
213 if(fp != nullptr) \
214 { \
215 fputs(theJson.c_str(), fp); \
216 fclose(fp); \
217 } \
218 else \
219 { \
220 std::cout << "ERROR: Cannot write to " << fn << std::endl; \
221 } \
222 } \
223 } \
224 static const char *className() \
225 { \
226 return #_cn; \
227 }
228
229 #define IMPLEMENT_JSON_SERIALIZATION() \
230 public: \
231 bool deserialize(const char *s) \
232 { \
233 try \
234 { \
235 if(s != nullptr && s[0] != 0) \
236 { \
237 from_json(nlohmann::json::parse(s), *this); \
238 } \
239 else \
240 { \
241 return false; \
242 } \
243 } \
244 catch(...) \
245 { \
246 return false; \
247 } \
248 return true; \
249 } \
250 \
251 std::string serialize(const int indent = -1) \
252 { \
253 try \
254 { \
255 nlohmann::json j; \
256 to_json(j, *this); \
257 return j.dump(indent); \
258 } \
259 catch(...) \
260 { \
261 return std::string("{}"); \
262 } \
263 }
264
265 #define IMPLEMENT_WRAPPED_JSON_SERIALIZATION(_cn) \
266 public: \
267 std::string serializeWrapped(const int indent = -1) \
268 { \
269 try \
270 { \
271 nlohmann::json j; \
272 to_json(j, *this); \
273 \
274 std::string rc; \
275 char firstChar[2]; \
276 firstChar[0] = #_cn[0]; \
277 firstChar[1] = 0; \
278 firstChar[0] = tolower(firstChar[0]); \
279 rc.assign("{\""); \
280 rc.append(firstChar); \
281 rc.append((#_cn) + 1); \
282 rc.append("\":"); \
283 rc.append(j.dump(indent)); \
284 rc.append("}"); \
285 \
286 return rc; \
287 } \
288 catch(...) \
289 { \
290 return std::string("{}"); \
291 } \
292 }
293
294 #define TOJSON_IMPL(__var) \
295 {#__var, p.__var}
296
297 #define FROMJSON_IMPL_SIMPLE(__var) \
298 getOptional(#__var, p.__var, j)
299
300 #define FROMJSON_IMPL(__var, __type, __default) \
301 getOptional<__type>(#__var, p.__var, j, __default)
302
303 #define TOJSON_BASE_IMPL() \
304 to_json(j, (ConfigurationObjectBase&)p)
305
306 #define FROMJSON_BASE_IMPL() \
307 from_json(j, (ConfigurationObjectBase&)p);
308
309
310 //-----------------------------------------------------------
311 static std::string EMPTY_STRING;
312
313 template<class T>
314 static void getOptional(const char *name, T& v, const nlohmann::json& j, T def)
315 {
316 try
317 {
318 if(j.contains(name))
319 {
320 j.at(name).get_to(v);
321 }
322 else
323 {
324 v = def;
325 }
326 }
327 catch(...)
328 {
329 v = def;
330 }
331 }
332
333 template<class T>
334 static void getOptional(const char *name, T& v, const nlohmann::json& j)
335 {
336 try
337 {
338 if(j.contains(name))
339 {
340 j.at(name).get_to(v);
341 }
342 }
343 catch(...)
344 {
345 }
346 }
347
348 template<class T>
349 static void getOptionalWithIndicator(const char *name, T& v, const nlohmann::json& j, T def, bool *wasFound)
350 {
351 try
352 {
353 if(j.contains(name))
354 {
355 j.at(name).get_to(v);
356 *wasFound = true;
357 }
358 else
359 {
360 v = def;
361 *wasFound = false;
362 }
363 }
364 catch(...)
365 {
366 v = def;
367 *wasFound = false;
368 }
369 }
370
371 template<class T>
372 static void getOptionalWithIndicator(const char *name, T& v, const nlohmann::json& j, bool *wasFound)
373 {
374 try
375 {
376 if(j.contains(name))
377 {
378 j.at(name).get_to(v);
379 *wasFound = true;
380 }
381 else
382 {
383 *wasFound = false;
384 }
385 }
386 catch(...)
387 {
388 *wasFound = false;
389 }
390 }
391
393 {
394 public:
396 {
397 _documenting = false;
398 }
399
401 {
402 }
403
404 virtual void initForDocumenting()
405 {
406 _documenting = true;
407 }
408
409 virtual std::string toString()
410 {
411 return std::string("");
412 }
413
414 inline virtual bool isDocumenting() const
415 {
416 return _documenting;
417 }
418
419 nlohmann::json _attached;
420
421 protected:
422 bool _documenting;
423 };
424
425 static void to_json(nlohmann::json& j, const ConfigurationObjectBase& p)
426 {
427 try
428 {
429 if(p._attached != nullptr)
430 {
431 j[ENGAGE_CONFIGURATION_OBJECT_ATTACHED_OBJECT] = p._attached;
432 }
433 }
434 catch(...)
435 {
436 }
437 }
438 static void from_json(const nlohmann::json& j, ConfigurationObjectBase& p)
439 {
440 try
441 {
442 if(j.contains(ENGAGE_CONFIGURATION_OBJECT_ATTACHED_OBJECT))
443 {
444 p._attached = j.at(ENGAGE_CONFIGURATION_OBJECT_ATTACHED_OBJECT);
445 }
446 }
447 catch(...)
448 {
449 }
450 }
451
452
453 //-----------------------------------------------------------
454 JSON_SERIALIZED_CLASS(FipsCryptoSettings)
456 {
457 IMPLEMENT_JSON_SERIALIZATION()
458 IMPLEMENT_JSON_DOCUMENTATION(FipsCryptoSettings)
459
460 public:
463
465 std::string path;
466
468 bool debug;
469
471 {
472 clear();
473 }
474
475 void clear()
476 {
477 enabled = false;
478 path.clear();
479 debug = false;
480 }
481
482 virtual void initForDocumenting()
483 {
484 clear();
485 }
486 };
487
488 static void to_json(nlohmann::json& j, const FipsCryptoSettings& p)
489 {
490 j = nlohmann::json{
491 TOJSON_IMPL(enabled),
492 TOJSON_IMPL(path),
493 TOJSON_IMPL(debug)
494 };
495 }
496 static void from_json(const nlohmann::json& j, FipsCryptoSettings& p)
497 {
498 p.clear();
499 FROMJSON_IMPL_SIMPLE(enabled);
500 FROMJSON_IMPL_SIMPLE(path);
501 FROMJSON_IMPL_SIMPLE(debug);
502 }
503
504
505 //-----------------------------------------------------------
506 JSON_SERIALIZED_CLASS(WatchdogSettings)
508 {
509 IMPLEMENT_JSON_SERIALIZATION()
510 IMPLEMENT_JSON_DOCUMENTATION(WatchdogSettings)
511
512 public:
515
518
521
524
527
529 {
530 clear();
531 }
532
533 void clear()
534 {
535 enabled = true;
536 intervalMs = 5000;
537 hangDetectionMs = 2000;
538 abortOnHang = true;
539 slowExecutionThresholdMs = 100;
540 }
541
542 virtual void initForDocumenting()
543 {
544 clear();
545 }
546 };
547
548 static void to_json(nlohmann::json& j, const WatchdogSettings& p)
549 {
550 j = nlohmann::json{
551 TOJSON_IMPL(enabled),
552 TOJSON_IMPL(intervalMs),
553 TOJSON_IMPL(hangDetectionMs),
554 TOJSON_IMPL(abortOnHang),
555 TOJSON_IMPL(slowExecutionThresholdMs)
556 };
557 }
558 static void from_json(const nlohmann::json& j, WatchdogSettings& p)
559 {
560 p.clear();
561 getOptional<bool>("enabled", p.enabled, j, true);
562 getOptional<int>("intervalMs", p.intervalMs, j, 5000);
563 getOptional<int>("hangDetectionMs", p.hangDetectionMs, j, 2000);
564 getOptional<bool>("abortOnHang", p.abortOnHang, j, true);
565 getOptional<int>("slowExecutionThresholdMs", p.slowExecutionThresholdMs, j, 100);
566 }
567
568
569 //-----------------------------------------------------------
570 JSON_SERIALIZED_CLASS(FileRecordingRequest)
572 {
573 IMPLEMENT_JSON_SERIALIZATION()
574 IMPLEMENT_JSON_DOCUMENTATION(FileRecordingRequest)
575
576 public:
577 std::string id;
578 std::string fileName;
579 uint32_t maxMs;
580
582 {
583 clear();
584 }
585
586 void clear()
587 {
588 id.clear();
589 fileName.clear();
590 maxMs = 60000;
591 }
592
593 virtual void initForDocumenting()
594 {
595 clear();
596 id = "1-2-3-4-5-6-7-8-9";
597 fileName = "/tmp/test.wav";
598 maxMs = 10000;
599 }
600 };
601
602 static void to_json(nlohmann::json& j, const FileRecordingRequest& p)
603 {
604 j = nlohmann::json{
605 TOJSON_IMPL(id),
606 TOJSON_IMPL(fileName),
607 TOJSON_IMPL(maxMs)
608 };
609 }
610 static void from_json(const nlohmann::json& j, FileRecordingRequest& p)
611 {
612 p.clear();
613 j.at("id").get_to(p.id);
614 j.at("fileName").get_to(p.fileName);
615 getOptional<uint32_t>("maxMs", p.maxMs, j, 60000);
616 }
617
618
619 //-----------------------------------------------------------
620 JSON_SERIALIZED_CLASS(Feature)
622 {
623 IMPLEMENT_JSON_SERIALIZATION()
624 IMPLEMENT_JSON_DOCUMENTATION(Feature)
625
626 public:
627 std::string id;
628 std::string name;
629 std::string description;
630 std::string comments;
631 int count;
632 int used; // NOTE: Ignored during deserialization!
633
634 Feature()
635 {
636 clear();
637 }
638
639 void clear()
640 {
641 id.clear();
642 name.clear();
643 description.clear();
644 comments.clear();
645 count = 0;
646 used = 0;
647 }
648
649 virtual void initForDocumenting()
650 {
651 clear();
652 id = "{af9540d1-3e86-4fa6-8b80-e26daecb61ab}";
653 name = "A sample feature";
654 description = "This is an example of a feature";
655 comments = "These are comments for this feature";
656 count = 42;
657 used = 16;
658 }
659 };
660
661 static void to_json(nlohmann::json& j, const Feature& p)
662 {
663 j = nlohmann::json{
664 TOJSON_IMPL(id),
665 TOJSON_IMPL(name),
666 TOJSON_IMPL(description),
667 TOJSON_IMPL(comments),
668 TOJSON_IMPL(count),
669 TOJSON_IMPL(used)
670 };
671 }
672 static void from_json(const nlohmann::json& j, Feature& p)
673 {
674 p.clear();
675 j.at("id").get_to(p.id);
676 getOptional("name", p.name, j);
677 getOptional("description", p.description, j);
678 getOptional("comments", p.comments, j);
679 getOptional("count", p.count, j, 0);
680
681 // NOTE: Not deserialized!
682 //getOptional("used", p.used, j, 0);
683 }
684
685
686 //-----------------------------------------------------------
687 JSON_SERIALIZED_CLASS(Featureset)
689 {
690 IMPLEMENT_JSON_SERIALIZATION()
691 IMPLEMENT_JSON_DOCUMENTATION(Featureset)
692
693 public:
694 std::string signature;
695 bool lockToDeviceId;
696 std::vector<Feature> features;
697
698 Featureset()
699 {
700 clear();
701 }
702
703 void clear()
704 {
705 signature.clear();
706 lockToDeviceId = false;
707 features.clear();
708 }
709
710 virtual void initForDocumenting()
711 {
712 clear();
713 signature = "c39df3f36c6444e686e47e70fc45cf91e6ed2d8de62d4a1e89f507d567ff48aaabb1a70e54b44377b46fc4a1a2e319e5b77e4abffc444db98f8eb55d709aad5f";
714 lockToDeviceId = false;
715 }
716 };
717
718 static void to_json(nlohmann::json& j, const Featureset& p)
719 {
720 j = nlohmann::json{
721 TOJSON_IMPL(signature),
722 TOJSON_IMPL(lockToDeviceId),
723 TOJSON_IMPL(features)
724 };
725 }
726 static void from_json(const nlohmann::json& j, Featureset& p)
727 {
728 p.clear();
729 getOptional("signature", p.signature, j);
730 getOptional<bool>("lockToDeviceId", p.lockToDeviceId, j, false);
731 getOptional<std::vector<Feature>>("features", p.features, j);
732 }
733
734
735 //-----------------------------------------------------------
736 JSON_SERIALIZED_CLASS(Agc)
746 {
747 IMPLEMENT_JSON_SERIALIZATION()
748 IMPLEMENT_JSON_DOCUMENTATION(Agc)
749
750 public:
753
756
759
762
765
768
769 Agc()
770 {
771 clear();
772 }
773
774 void clear()
775 {
776 enabled = false;
777 minLevel = 0;
778 maxLevel = 255;
779 compressionGainDb = 25;
780 enableLimiter = false;
781 targetLevelDb = 3;
782 }
783 };
784
785 static void to_json(nlohmann::json& j, const Agc& p)
786 {
787 j = nlohmann::json{
788 TOJSON_IMPL(enabled),
789 TOJSON_IMPL(minLevel),
790 TOJSON_IMPL(maxLevel),
791 TOJSON_IMPL(compressionGainDb),
792 TOJSON_IMPL(enableLimiter),
793 TOJSON_IMPL(targetLevelDb)
794 };
795 }
796 static void from_json(const nlohmann::json& j, Agc& p)
797 {
798 p.clear();
799 getOptional<bool>("enabled", p.enabled, j, false);
800 getOptional<int>("minLevel", p.minLevel, j, 0);
801 getOptional<int>("maxLevel", p.maxLevel, j, 255);
802 getOptional<int>("compressionGainDb", p.compressionGainDb, j, 25);
803 getOptional<bool>("enableLimiter", p.enableLimiter, j, false);
804 getOptional<int>("targetLevelDb", p.targetLevelDb, j, 3);
805 }
806
807
808 //-----------------------------------------------------------
809 JSON_SERIALIZED_CLASS(RtpPayloadTypeTranslation)
819 {
820 IMPLEMENT_JSON_SERIALIZATION()
821 IMPLEMENT_JSON_DOCUMENTATION(RtpPayloadTypeTranslation)
822
823 public:
825 uint16_t external;
826
828 uint16_t engage;
829
831 {
832 clear();
833 }
834
835 void clear()
836 {
837 external = 0;
838 engage = 0;
839 }
840
841 bool matches(const RtpPayloadTypeTranslation& other)
842 {
843 return ( (external == other.external) && (engage == other.engage) );
844 }
845 };
846
847 static void to_json(nlohmann::json& j, const RtpPayloadTypeTranslation& p)
848 {
849 j = nlohmann::json{
850 TOJSON_IMPL(external),
851 TOJSON_IMPL(engage)
852 };
853 }
854 static void from_json(const nlohmann::json& j, RtpPayloadTypeTranslation& p)
855 {
856 p.clear();
857 getOptional<uint16_t>("external", p.external, j);
858 getOptional<uint16_t>("engage", p.engage, j);
859 }
860
861 //-----------------------------------------------------------
862 JSON_SERIALIZED_CLASS(NetworkInterfaceDevice)
864 {
865 IMPLEMENT_JSON_SERIALIZATION()
866 IMPLEMENT_JSON_DOCUMENTATION(NetworkInterfaceDevice)
867
868 public:
869 std::string name;
870 std::string friendlyName;
871 std::string description;
872 int family;
873 std::string address;
874 bool available;
875 bool isLoopback;
876 bool supportsMulticast;
877 std::string hardwareAddress;
878
880 {
881 clear();
882 }
883
884 void clear()
885 {
886 name.clear();
887 friendlyName.clear();
888 description.clear();
889 family = -1;
890 address.clear();
891 available = false;
892 isLoopback = false;
893 supportsMulticast = false;
894 hardwareAddress.clear();
895 }
896
897 virtual void initForDocumenting()
898 {
899 clear();
900 name = "en0";
901 friendlyName = "Wi-Fi";
902 description = "A wi-fi adapter";
903 family = 1;
904 address = "127.0.0.1";
905 available = true;
906 isLoopback = true;
907 supportsMulticast = false;
908 hardwareAddress = "DE:AD:BE:EF:01:02:03";
909 }
910 };
911
912 static void to_json(nlohmann::json& j, const NetworkInterfaceDevice& p)
913 {
914 j = nlohmann::json{
915 TOJSON_IMPL(name),
916 TOJSON_IMPL(friendlyName),
917 TOJSON_IMPL(description),
918 TOJSON_IMPL(family),
919 TOJSON_IMPL(address),
920 TOJSON_IMPL(available),
921 TOJSON_IMPL(isLoopback),
922 TOJSON_IMPL(supportsMulticast),
923 TOJSON_IMPL(hardwareAddress)
924 };
925 }
926 static void from_json(const nlohmann::json& j, NetworkInterfaceDevice& p)
927 {
928 p.clear();
929 getOptional("name", p.name, j);
930 getOptional("friendlyName", p.friendlyName, j);
931 getOptional("description", p.description, j);
932 getOptional("family", p.family, j, -1);
933 getOptional("address", p.address, j);
934 getOptional("available", p.available, j, false);
935 getOptional("isLoopback", p.isLoopback, j, false);
936 getOptional("supportsMulticast", p.supportsMulticast, j, false);
937 getOptional("hardwareAddress", p.hardwareAddress, j);
938 }
939
940 //-----------------------------------------------------------
941 JSON_SERIALIZED_CLASS(ListOfNetworkInterfaceDevice)
943 {
944 IMPLEMENT_JSON_SERIALIZATION()
945 IMPLEMENT_JSON_DOCUMENTATION(ListOfNetworkInterfaceDevice)
946
947 public:
948 std::vector<NetworkInterfaceDevice> list;
949
951 {
952 clear();
953 }
954
955 void clear()
956 {
957 list.clear();
958 }
959 };
960
961 static void to_json(nlohmann::json& j, const ListOfNetworkInterfaceDevice& p)
962 {
963 j = nlohmann::json{
964 TOJSON_IMPL(list)
965 };
966 }
967 static void from_json(const nlohmann::json& j, ListOfNetworkInterfaceDevice& p)
968 {
969 p.clear();
970 getOptional<std::vector<NetworkInterfaceDevice>>("list", p.list, j);
971 }
972
973
974 //-----------------------------------------------------------
975 JSON_SERIALIZED_CLASS(RtpHeader)
985 {
986 IMPLEMENT_JSON_SERIALIZATION()
987 IMPLEMENT_JSON_DOCUMENTATION(RtpHeader)
988
989 public:
990
992 int pt;
993
995 bool marker;
996
998 uint16_t seq;
999
1001 uint32_t ssrc;
1002
1004 uint32_t ts;
1005
1006 RtpHeader()
1007 {
1008 clear();
1009 }
1010
1011 void clear()
1012 {
1013 pt = -1;
1014 marker = false;
1015 seq = 0;
1016 ssrc = 0;
1017 ts = 0;
1018 }
1019
1020 virtual void initForDocumenting()
1021 {
1022 clear();
1023 pt = 0;
1024 marker = false;
1025 seq = 123;
1026 ssrc = 12345678;
1027 ts = 87654321;
1028 }
1029 };
1030
1031 static void to_json(nlohmann::json& j, const RtpHeader& p)
1032 {
1033 if(p.pt != -1)
1034 {
1035 j = nlohmann::json{
1036 TOJSON_IMPL(pt),
1037 TOJSON_IMPL(marker),
1038 TOJSON_IMPL(seq),
1039 TOJSON_IMPL(ssrc),
1040 TOJSON_IMPL(ts)
1041 };
1042 }
1043 }
1044 static void from_json(const nlohmann::json& j, RtpHeader& p)
1045 {
1046 p.clear();
1047 getOptional<int>("pt", p.pt, j, -1);
1048 getOptional<bool>("marker", p.marker, j, false);
1049 getOptional<uint16_t>("seq", p.seq, j, 0);
1050 getOptional<uint32_t>("ssrc", p.ssrc, j, 0);
1051 getOptional<uint32_t>("ts", p.ts, j, 0);
1052 }
1053
1054 //-----------------------------------------------------------
1055 JSON_SERIALIZED_CLASS(BlobInfo)
1065 {
1066 IMPLEMENT_JSON_SERIALIZATION()
1067 IMPLEMENT_JSON_DOCUMENTATION(BlobInfo)
1068
1069 public:
1073 typedef enum
1074 {
1076 bptUndefined = 0,
1077
1079 bptAppTextUtf8 = 1,
1080
1082 bptJsonTextUtf8 = 2,
1083
1085 bptAppBinary = 3,
1086
1088 bptEngageBinaryHumanBiometrics = 4,
1089
1091 bptAppMimeMessage = 5,
1092
1094 bptEngageInternal = 42
1095 } PayloadType_t;
1096
1098 size_t size;
1099
1101 std::string source;
1102
1104 std::string target;
1105
1108
1111
1112 BlobInfo()
1113 {
1114 clear();
1115 }
1116
1117 void clear()
1118 {
1119 size = 0;
1120 source.clear();
1121 target.clear();
1122 rtpHeader.clear();
1123 payloadType = PayloadType_t::bptUndefined;
1124 }
1125
1126 virtual void initForDocumenting()
1127 {
1128 clear();
1129 rtpHeader.initForDocumenting();
1130 }
1131 };
1132
1133 static void to_json(nlohmann::json& j, const BlobInfo& p)
1134 {
1135 j = nlohmann::json{
1136 TOJSON_IMPL(size),
1137 TOJSON_IMPL(source),
1138 TOJSON_IMPL(target),
1139 TOJSON_IMPL(rtpHeader),
1140 TOJSON_IMPL(payloadType)
1141 };
1142 }
1143 static void from_json(const nlohmann::json& j, BlobInfo& p)
1144 {
1145 p.clear();
1146 getOptional<size_t>("size", p.size, j, 0);
1147 getOptional<std::string>("source", p.source, j, EMPTY_STRING);
1148 getOptional<std::string>("target", p.target, j, EMPTY_STRING);
1149 getOptional<RtpHeader>("rtpHeader", p.rtpHeader, j);
1150 getOptional<BlobInfo::PayloadType_t>("payloadType", p.payloadType, j, BlobInfo::PayloadType_t::bptUndefined);
1151 }
1152
1153
1154 //-----------------------------------------------------------
1155 JSON_SERIALIZED_CLASS(TxAudioUri)
1168 {
1169 IMPLEMENT_JSON_SERIALIZATION()
1170 IMPLEMENT_JSON_DOCUMENTATION(TxAudioUri)
1171
1172 public:
1174 std::string uri;
1175
1178
1179 TxAudioUri()
1180 {
1181 clear();
1182 }
1183
1184 void clear()
1185 {
1186 uri.clear();
1187 repeatCount = 0;
1188 }
1189
1190 virtual void initForDocumenting()
1191 {
1192 }
1193 };
1194
1195 static void to_json(nlohmann::json& j, const TxAudioUri& p)
1196 {
1197 j = nlohmann::json{
1198 TOJSON_IMPL(uri),
1199 TOJSON_IMPL(repeatCount)
1200 };
1201 }
1202 static void from_json(const nlohmann::json& j, TxAudioUri& p)
1203 {
1204 p.clear();
1205 getOptional<std::string>("uri", p.uri, j, EMPTY_STRING);
1206 getOptional<int>("repeatCount", p.repeatCount, j, 0);
1207 }
1208
1209
1210 //-----------------------------------------------------------
1211 JSON_SERIALIZED_CLASS(AdvancedTxParams)
1224 {
1225 IMPLEMENT_JSON_SERIALIZATION()
1226 IMPLEMENT_JSON_DOCUMENTATION(AdvancedTxParams)
1227
1228 public:
1229
1231 uint16_t flags;
1232
1234 uint8_t priority;
1235
1238
1241
1243 std::string alias;
1244
1246 bool muted;
1247
1249 uint32_t txId;
1250
1253
1256
1259
1261 {
1262 clear();
1263 }
1264
1265 void clear()
1266 {
1267 flags = 0;
1268 priority = 0;
1269 subchannelTag = 0;
1270 includeNodeId = false;
1271 alias.clear();
1272 muted = false;
1273 txId = 0;
1274 audioUri.clear();
1275 aliasSpecializer = 0;
1276 receiverRxMuteForAliasSpecializer = false;
1277 }
1278
1279 virtual void initForDocumenting()
1280 {
1281 }
1282 };
1283
1284 static void to_json(nlohmann::json& j, const AdvancedTxParams& p)
1285 {
1286 j = nlohmann::json{
1287 TOJSON_IMPL(flags),
1288 TOJSON_IMPL(priority),
1289 TOJSON_IMPL(subchannelTag),
1290 TOJSON_IMPL(includeNodeId),
1291 TOJSON_IMPL(alias),
1292 TOJSON_IMPL(muted),
1293 TOJSON_IMPL(txId),
1294 TOJSON_IMPL(audioUri),
1295 TOJSON_IMPL(aliasSpecializer),
1296 TOJSON_IMPL(receiverRxMuteForAliasSpecializer)
1297 };
1298 }
1299 static void from_json(const nlohmann::json& j, AdvancedTxParams& p)
1300 {
1301 p.clear();
1302 getOptional<uint16_t>("flags", p.flags, j, 0);
1303 getOptional<uint8_t>("priority", p.priority, j, 0);
1304 getOptional<uint16_t>("subchannelTag", p.subchannelTag, j, 0);
1305 getOptional<bool>("includeNodeId", p.includeNodeId, j, false);
1306 getOptional<std::string>("alias", p.alias, j, EMPTY_STRING);
1307 getOptional<bool>("muted", p.muted, j, false);
1308 getOptional<uint32_t>("txId", p.txId, j, 0);
1309 getOptional<TxAudioUri>("audioUri", p.audioUri, j);
1310 getOptional<uint16_t>("aliasSpecializer", p.aliasSpecializer, j, 0);
1311 getOptional<bool>("receiverRxMuteForAliasSpecializer", p.receiverRxMuteForAliasSpecializer, j, false);
1312 }
1313
1314 //-----------------------------------------------------------
1315 JSON_SERIALIZED_CLASS(Identity)
1328 {
1329 IMPLEMENT_JSON_SERIALIZATION()
1330 IMPLEMENT_JSON_DOCUMENTATION(Identity)
1331
1332 public:
1340 std::string nodeId;
1341
1343 std::string userId;
1344
1346 std::string displayName;
1347
1349 std::string avatar;
1350
1351 Identity()
1352 {
1353 clear();
1354 }
1355
1356 void clear()
1357 {
1358 nodeId.clear();
1359 userId.clear();
1360 displayName.clear();
1361 avatar.clear();
1362 }
1363
1364 virtual void initForDocumenting()
1365 {
1366 }
1367 };
1368
1369 static void to_json(nlohmann::json& j, const Identity& p)
1370 {
1371 j = nlohmann::json{
1372 TOJSON_IMPL(nodeId),
1373 TOJSON_IMPL(userId),
1374 TOJSON_IMPL(displayName),
1375 TOJSON_IMPL(avatar)
1376 };
1377 }
1378 static void from_json(const nlohmann::json& j, Identity& p)
1379 {
1380 p.clear();
1381 getOptional<std::string>("nodeId", p.nodeId, j);
1382 getOptional<std::string>("userId", p.userId, j);
1383 getOptional<std::string>("displayName", p.displayName, j);
1384 getOptional<std::string>("avatar", p.avatar, j);
1385 }
1386
1387
1388 //-----------------------------------------------------------
1389 JSON_SERIALIZED_CLASS(Location)
1402 {
1403 IMPLEMENT_JSON_SERIALIZATION()
1404 IMPLEMENT_JSON_DOCUMENTATION(Location)
1405
1406 public:
1407 constexpr static double INVALID_LOCATION_VALUE = -999.999;
1408
1410 uint32_t ts;
1411
1413 double latitude;
1414
1417
1419 double altitude;
1420
1423
1425 double speed;
1426
1427 Location()
1428 {
1429 clear();
1430 }
1431
1432 void clear()
1433 {
1434 ts = 0;
1435 latitude = INVALID_LOCATION_VALUE;
1436 longitude = INVALID_LOCATION_VALUE;
1437 altitude = INVALID_LOCATION_VALUE;
1438 direction = INVALID_LOCATION_VALUE;
1439 speed = INVALID_LOCATION_VALUE;
1440 }
1441
1442 virtual void initForDocumenting()
1443 {
1444 clear();
1445
1446 ts = 123456;
1447 latitude = 123.456;
1448 longitude = 456.789;
1449 altitude = 123;
1450 direction = 1;
1451 speed = 1234;
1452 }
1453 };
1454
1455 static void to_json(nlohmann::json& j, const Location& p)
1456 {
1457 if(p.latitude != Location::INVALID_LOCATION_VALUE && p.longitude != Location::INVALID_LOCATION_VALUE)
1458 {
1459 j = nlohmann::json{
1460 TOJSON_IMPL(latitude),
1461 TOJSON_IMPL(longitude),
1462 };
1463
1464 if(p.ts != 0) j["ts"] = p.ts;
1465 if(p.altitude != Location::INVALID_LOCATION_VALUE) j["altitude"] = p.altitude;
1466 if(p.speed != Location::INVALID_LOCATION_VALUE) j["speed"] = p.speed;
1467 if(p.direction != Location::INVALID_LOCATION_VALUE) j["direction"] = p.direction;
1468 }
1469 }
1470 static void from_json(const nlohmann::json& j, Location& p)
1471 {
1472 p.clear();
1473 getOptional<uint32_t>("ts", p.ts, j, 0);
1474 j.at("latitude").get_to(p.latitude);
1475 j.at("longitude").get_to(p.longitude);
1476 getOptional<double>("altitude", p.altitude, j, Location::INVALID_LOCATION_VALUE);
1477 getOptional<double>("direction", p.direction, j, Location::INVALID_LOCATION_VALUE);
1478 getOptional<double>("speed", p.speed, j, Location::INVALID_LOCATION_VALUE);
1479 }
1480
1481 //-----------------------------------------------------------
1482 JSON_SERIALIZED_CLASS(Power)
1493 {
1494 IMPLEMENT_JSON_SERIALIZATION()
1495 IMPLEMENT_JSON_DOCUMENTATION(Power)
1496
1497 public:
1498
1511
1525
1528
1529 Power()
1530 {
1531 clear();
1532 }
1533
1534 void clear()
1535 {
1536 source = 0;
1537 state = 0;
1538 level = 0;
1539 }
1540
1541 virtual void initForDocumenting()
1542 {
1543 }
1544 };
1545
1546 static void to_json(nlohmann::json& j, const Power& p)
1547 {
1548 if(p.source != 0 && p.state != 0 && p.level != 0)
1549 {
1550 j = nlohmann::json{
1551 TOJSON_IMPL(source),
1552 TOJSON_IMPL(state),
1553 TOJSON_IMPL(level)
1554 };
1555 }
1556 }
1557 static void from_json(const nlohmann::json& j, Power& p)
1558 {
1559 p.clear();
1560 getOptional<int>("source", p.source, j, 0);
1561 getOptional<int>("state", p.state, j, 0);
1562 getOptional<int>("level", p.level, j, 0);
1563 }
1564
1565
1566 //-----------------------------------------------------------
1567 JSON_SERIALIZED_CLASS(Connectivity)
1578 {
1579 IMPLEMENT_JSON_SERIALIZATION()
1580 IMPLEMENT_JSON_DOCUMENTATION(Connectivity)
1581
1582 public:
1596 int type;
1597
1600
1603
1604 Connectivity()
1605 {
1606 clear();
1607 }
1608
1609 void clear()
1610 {
1611 type = 0;
1612 strength = 0;
1613 rating = 0;
1614 }
1615
1616 virtual void initForDocumenting()
1617 {
1618 clear();
1619
1620 type = 1;
1621 strength = 2;
1622 rating = 3;
1623 }
1624 };
1625
1626 static void to_json(nlohmann::json& j, const Connectivity& p)
1627 {
1628 if(p.type != 0)
1629 {
1630 j = nlohmann::json{
1631 TOJSON_IMPL(type),
1632 TOJSON_IMPL(strength),
1633 TOJSON_IMPL(rating)
1634 };
1635 }
1636 }
1637 static void from_json(const nlohmann::json& j, Connectivity& p)
1638 {
1639 p.clear();
1640 getOptional<int>("type", p.type, j, 0);
1641 getOptional<int>("strength", p.strength, j, 0);
1642 getOptional<int>("rating", p.rating, j, 0);
1643 }
1644
1645
1646 //-----------------------------------------------------------
1647 JSON_SERIALIZED_CLASS(PresenceDescriptorGroupItem)
1658 {
1659 IMPLEMENT_JSON_SERIALIZATION()
1660 IMPLEMENT_JSON_DOCUMENTATION(PresenceDescriptorGroupItem)
1661
1662 public:
1664 std::string groupId;
1665
1667 std::string alias;
1668
1670 uint16_t status;
1671
1673 {
1674 clear();
1675 }
1676
1677 void clear()
1678 {
1679 groupId.clear();
1680 alias.clear();
1681 status = 0;
1682 }
1683
1684 virtual void initForDocumenting()
1685 {
1686 groupId = "{123-456}";
1687 alias = "MYALIAS";
1688 status = 0;
1689 }
1690 };
1691
1692 static void to_json(nlohmann::json& j, const PresenceDescriptorGroupItem& p)
1693 {
1694 j = nlohmann::json{
1695 TOJSON_IMPL(groupId),
1696 TOJSON_IMPL(alias),
1697 TOJSON_IMPL(status)
1698 };
1699 }
1700 static void from_json(const nlohmann::json& j, PresenceDescriptorGroupItem& p)
1701 {
1702 p.clear();
1703 getOptional<std::string>("groupId", p.groupId, j);
1704 getOptional<std::string>("alias", p.alias, j);
1705 getOptional<uint16_t>("status", p.status, j);
1706 }
1707
1708
1709 //-----------------------------------------------------------
1710 JSON_SERIALIZED_CLASS(PresenceDescriptor)
1721 {
1722 IMPLEMENT_JSON_SERIALIZATION()
1723 IMPLEMENT_JSON_DOCUMENTATION(PresenceDescriptor)
1724
1725 public:
1726
1732 bool self;
1733
1739 uint32_t ts;
1740
1746 uint32_t nextUpdate;
1747
1750
1752 std::string comment;
1753
1767 uint32_t disposition;
1768
1770 std::vector<PresenceDescriptorGroupItem> groupAliases;
1771
1774
1776 std::string custom;
1777
1780
1783
1786
1788 {
1789 clear();
1790 }
1791
1792 void clear()
1793 {
1794 self = false;
1795 ts = 0;
1796 nextUpdate = 0;
1797 identity.clear();
1798 comment.clear();
1799 disposition = 0;
1800 groupAliases.clear();
1801 location.clear();
1802 custom.clear();
1803 announceOnReceive = false;
1804 connectivity.clear();
1805 power.clear();
1806 }
1807
1808 virtual void initForDocumenting()
1809 {
1810 clear();
1811
1812 self = true;
1813 ts = 123;
1814 nextUpdate = 0;
1815 identity.initForDocumenting();
1816 comment = "This is a comment";
1817 disposition = 123;
1818
1819 PresenceDescriptorGroupItem gi;
1820 gi.initForDocumenting();
1821 groupAliases.push_back(gi);
1822
1823 location.initForDocumenting();
1824 custom = "{}";
1825 announceOnReceive = true;
1826 connectivity.initForDocumenting();
1827 power.initForDocumenting();
1828 }
1829 };
1830
1831 static void to_json(nlohmann::json& j, const PresenceDescriptor& p)
1832 {
1833 j = nlohmann::json{
1834 TOJSON_IMPL(ts),
1835 TOJSON_IMPL(nextUpdate),
1836 TOJSON_IMPL(identity),
1837 TOJSON_IMPL(comment),
1838 TOJSON_IMPL(disposition),
1839 TOJSON_IMPL(groupAliases),
1840 TOJSON_IMPL(location),
1841 TOJSON_IMPL(custom),
1842 TOJSON_IMPL(announceOnReceive),
1843 TOJSON_IMPL(connectivity),
1844 TOJSON_IMPL(power)
1845 };
1846
1847 if(!p.comment.empty()) j["comment"] = p.comment;
1848 if(!p.custom.empty()) j["custom"] = p.custom;
1849
1850 if(p.self)
1851 {
1852 j["self"] = true;
1853 }
1854 }
1855 static void from_json(const nlohmann::json& j, PresenceDescriptor& p)
1856 {
1857 p.clear();
1858 getOptional<bool>("self", p.self, j);
1859 getOptional<uint32_t>("ts", p.ts, j);
1860 getOptional<uint32_t>("nextUpdate", p.nextUpdate, j);
1861 getOptional<Identity>("identity", p.identity, j);
1862 getOptional<std::string>("comment", p.comment, j);
1863 getOptional<uint32_t>("disposition", p.disposition, j);
1864 getOptional<std::vector<PresenceDescriptorGroupItem>>("groupAliases", p.groupAliases, j);
1865 getOptional<Location>("location", p.location, j);
1866 getOptional<std::string>("custom", p.custom, j);
1867 getOptional<bool>("announceOnReceive", p.announceOnReceive, j);
1868 getOptional<Connectivity>("connectivity", p.connectivity, j);
1869 getOptional<Power>("power", p.power, j);
1870 }
1871
1877 typedef enum
1878 {
1881
1884
1887
1889 priVoice = 3
1890 } TxPriority_t;
1891
1897 typedef enum
1898 {
1901
1904
1907
1909 arpIpv6ThenIpv4 = 64
1910 } AddressResolutionPolicy_t;
1911
1912 //-----------------------------------------------------------
1913 JSON_SERIALIZED_CLASS(NetworkTxOptions)
1926 {
1927 IMPLEMENT_JSON_SERIALIZATION()
1928 IMPLEMENT_JSON_DOCUMENTATION(NetworkTxOptions)
1929
1930 public:
1933
1939 int ttl;
1940
1942 {
1943 clear();
1944 }
1945
1946 void clear()
1947 {
1948 priority = priVoice;
1949 ttl = 1;
1950 }
1951
1952 virtual void initForDocumenting()
1953 {
1954 }
1955 };
1956
1957 static void to_json(nlohmann::json& j, const NetworkTxOptions& p)
1958 {
1959 j = nlohmann::json{
1960 TOJSON_IMPL(priority),
1961 TOJSON_IMPL(ttl)
1962 };
1963 }
1964 static void from_json(const nlohmann::json& j, NetworkTxOptions& p)
1965 {
1966 p.clear();
1967 getOptional<TxPriority_t>("priority", p.priority, j, TxPriority_t::priVoice);
1968 getOptional<int>("ttl", p.ttl, j, 1);
1969 }
1970
1971
1972 //-----------------------------------------------------------
1973 JSON_SERIALIZED_CLASS(TcpNetworkTxOptions)
1982 {
1983 IMPLEMENT_JSON_SERIALIZATION()
1984 IMPLEMENT_JSON_DOCUMENTATION(TcpNetworkTxOptions)
1985
1986 public:
1988 {
1989 clear();
1990 }
1991
1992 void clear()
1993 {
1994 priority = priVoice;
1995 ttl = -1;
1996 }
1997
1998 virtual void initForDocumenting()
1999 {
2000 }
2001 };
2002
2003 static void to_json(nlohmann::json& j, const TcpNetworkTxOptions& p)
2004 {
2005 j = nlohmann::json{
2006 TOJSON_IMPL(priority),
2007 TOJSON_IMPL(ttl)
2008 };
2009 }
2010 static void from_json(const nlohmann::json& j, TcpNetworkTxOptions& p)
2011 {
2012 p.clear();
2013 getOptional<TxPriority_t>("priority", p.priority, j, TxPriority_t::priVoice);
2014 getOptional<int>("ttl", p.ttl, j, -1);
2015 }
2016
2017 typedef enum
2018 {
2021
2024
2026 ifIp6 = 6
2027 } IpFamilyType_t;
2028
2029 //-----------------------------------------------------------
2030 JSON_SERIALIZED_CLASS(NetworkAddress)
2042 {
2043 IMPLEMENT_JSON_SERIALIZATION()
2044 IMPLEMENT_JSON_DOCUMENTATION(NetworkAddress)
2045
2046 public:
2048 std::string address;
2049
2051 int port;
2052
2054 {
2055 clear();
2056 }
2057
2058 void clear()
2059 {
2060 address.clear();
2061 port = 0;
2062 }
2063
2064 bool matches(const NetworkAddress& other)
2065 {
2066 if(address.compare(other.address) != 0)
2067 {
2068 return false;
2069 }
2070
2071 if(port != other.port)
2072 {
2073 return false;
2074 }
2075
2076 return true;
2077 }
2078 };
2079
2080 static void to_json(nlohmann::json& j, const NetworkAddress& p)
2081 {
2082 j = nlohmann::json{
2083 TOJSON_IMPL(address),
2084 TOJSON_IMPL(port)
2085 };
2086 }
2087 static void from_json(const nlohmann::json& j, NetworkAddress& p)
2088 {
2089 p.clear();
2090 getOptional<std::string>("address", p.address, j);
2091 getOptional<int>("port", p.port, j);
2092 }
2093
2094
2095 //-----------------------------------------------------------
2096 JSON_SERIALIZED_CLASS(NetworkAddressRxTx)
2108 {
2109 IMPLEMENT_JSON_SERIALIZATION()
2110 IMPLEMENT_JSON_DOCUMENTATION(NetworkAddressRxTx)
2111
2112 public:
2115
2118
2120 {
2121 clear();
2122 }
2123
2124 void clear()
2125 {
2126 rx.clear();
2127 tx.clear();
2128 }
2129 };
2130
2131 static void to_json(nlohmann::json& j, const NetworkAddressRxTx& p)
2132 {
2133 j = nlohmann::json{
2134 TOJSON_IMPL(rx),
2135 TOJSON_IMPL(tx)
2136 };
2137 }
2138 static void from_json(const nlohmann::json& j, NetworkAddressRxTx& p)
2139 {
2140 p.clear();
2141 getOptional<NetworkAddress>("rx", p.rx, j);
2142 getOptional<NetworkAddress>("tx", p.tx, j);
2143 }
2144
2146 typedef enum
2147 {
2150
2152 graptStrict = 1
2153 } GroupRestrictionAccessPolicyType_t;
2154
2155 static bool isValidGroupRestrictionAccessPolicyType(GroupRestrictionAccessPolicyType_t t)
2156 {
2157 return (t == GroupRestrictionAccessPolicyType_t::graptPermissive ||
2158 t == GroupRestrictionAccessPolicyType_t::graptStrict );
2159 }
2160
2162 typedef enum
2163 {
2166
2169
2171 rtBlacklist = 2
2172 } RestrictionType_t;
2173
2174 static bool isValidRestrictionType(RestrictionType_t t)
2175 {
2176 return (t == RestrictionType_t::rtUndefined ||
2177 t == RestrictionType_t::rtWhitelist ||
2178 t == RestrictionType_t::rtBlacklist );
2179 }
2180
2205
2206 static bool isValidRestrictionElementType(RestrictionElementType_t t)
2207 {
2208 return (t == RestrictionElementType_t::retGroupId ||
2209 t == RestrictionElementType_t::retGroupIdPattern ||
2210 t == RestrictionElementType_t::retGenericAccessTagPattern ||
2211 t == RestrictionElementType_t::retCertificateSerialNumberPattern ||
2212 t == RestrictionElementType_t::retCertificateFingerprintPattern ||
2213 t == RestrictionElementType_t::retCertificateSubjectPattern ||
2214 t == RestrictionElementType_t::retCertificateIssuerPattern);
2215 }
2216
2217
2218 //-----------------------------------------------------------
2219 JSON_SERIALIZED_CLASS(NetworkAddressRestrictionList)
2231 {
2232 IMPLEMENT_JSON_SERIALIZATION()
2233 IMPLEMENT_JSON_DOCUMENTATION(NetworkAddressRestrictionList)
2234
2235 public:
2238
2240 std::vector<NetworkAddressRxTx> elements;
2241
2243 {
2244 clear();
2245 }
2246
2247 void clear()
2248 {
2249 type = RestrictionType_t::rtUndefined;
2250 elements.clear();
2251 }
2252 };
2253
2254 static void to_json(nlohmann::json& j, const NetworkAddressRestrictionList& p)
2255 {
2256 j = nlohmann::json{
2257 TOJSON_IMPL(type),
2258 TOJSON_IMPL(elements)
2259 };
2260 }
2261 static void from_json(const nlohmann::json& j, NetworkAddressRestrictionList& p)
2262 {
2263 p.clear();
2264 getOptional<RestrictionType_t>("type", p.type, j, RestrictionType_t::rtUndefined);
2265 getOptional<std::vector<NetworkAddressRxTx>>("elements", p.elements, j);
2266 }
2267
2268 //-----------------------------------------------------------
2269 JSON_SERIALIZED_CLASS(StringRestrictionList)
2281 {
2282 IMPLEMENT_JSON_SERIALIZATION()
2283 IMPLEMENT_JSON_DOCUMENTATION(StringRestrictionList)
2284
2285 public:
2288
2291
2293 std::vector<std::string> elements;
2294
2296 {
2297 type = RestrictionType_t::rtUndefined;
2298 elementsType = RestrictionElementType_t::retGroupId;
2299 clear();
2300 }
2301
2302 void clear()
2303 {
2304 elements.clear();
2305 }
2306 };
2307
2308 static void to_json(nlohmann::json& j, const StringRestrictionList& p)
2309 {
2310 j = nlohmann::json{
2311 TOJSON_IMPL(type),
2312 TOJSON_IMPL(elementsType),
2313 TOJSON_IMPL(elements)
2314 };
2315 }
2316 static void from_json(const nlohmann::json& j, StringRestrictionList& p)
2317 {
2318 p.clear();
2319 getOptional<RestrictionType_t>("type", p.type, j, RestrictionType_t::rtUndefined);
2320 getOptional<RestrictionElementType_t>("elementsType", p.elementsType, j, RestrictionElementType_t::retGroupId);
2321 getOptional<std::vector<std::string>>("elements", p.elements, j);
2322 }
2323
2324
2325 //-----------------------------------------------------------
2326 JSON_SERIALIZED_CLASS(PacketCapturer)
2336 {
2337 IMPLEMENT_JSON_SERIALIZATION()
2338 IMPLEMENT_JSON_DOCUMENTATION(PacketCapturer)
2339
2340 public:
2341 bool enabled;
2342 uint32_t maxMb;
2343 std::string filePrefix;
2344
2346 {
2347 clear();
2348 }
2349
2350 void clear()
2351 {
2352 enabled = false;
2353 maxMb = 10;
2354 filePrefix.clear();
2355 }
2356 };
2357
2358 static void to_json(nlohmann::json& j, const PacketCapturer& p)
2359 {
2360 j = nlohmann::json{
2361 TOJSON_IMPL(enabled),
2362 TOJSON_IMPL(maxMb),
2363 TOJSON_IMPL(filePrefix)
2364 };
2365 }
2366 static void from_json(const nlohmann::json& j, PacketCapturer& p)
2367 {
2368 p.clear();
2369 getOptional<bool>("enabled", p.enabled, j, false);
2370 getOptional<uint32_t>("maxMb", p.maxMb, j, 10);
2371 getOptional<std::string>("filePrefix", p.filePrefix, j, EMPTY_STRING);
2372 }
2373
2374
2375 //-----------------------------------------------------------
2376 JSON_SERIALIZED_CLASS(TransportImpairment)
2386 {
2387 IMPLEMENT_JSON_SERIALIZATION()
2388 IMPLEMENT_JSON_DOCUMENTATION(TransportImpairment)
2389
2390 public:
2391 int applicationPercentage;
2392 int jitterMs;
2393 int lossPercentage;
2394
2396 {
2397 clear();
2398 }
2399
2400 void clear()
2401 {
2402 applicationPercentage = 0;
2403 jitterMs = 0;
2404 lossPercentage = 0;
2405 }
2406 };
2407
2408 static void to_json(nlohmann::json& j, const TransportImpairment& p)
2409 {
2410 j = nlohmann::json{
2411 TOJSON_IMPL(applicationPercentage),
2412 TOJSON_IMPL(jitterMs),
2413 TOJSON_IMPL(lossPercentage)
2414 };
2415 }
2416 static void from_json(const nlohmann::json& j, TransportImpairment& p)
2417 {
2418 p.clear();
2419 getOptional<int>("applicationPercentage", p.applicationPercentage, j, 0);
2420 getOptional<int>("jitterMs", p.jitterMs, j, 0);
2421 getOptional<int>("lossPercentage", p.lossPercentage, j, 0);
2422 }
2423
2424 //-----------------------------------------------------------
2425 JSON_SERIALIZED_CLASS(NsmNetworking)
2435 {
2436 IMPLEMENT_JSON_SERIALIZATION()
2437 IMPLEMENT_JSON_DOCUMENTATION(NsmNetworking)
2438
2439 public:
2440 std::string interfaceName;
2441 NetworkAddress address;
2442 int ttl;
2443 int tos;
2444 int txOversend;
2445 TransportImpairment rxImpairment;
2446 TransportImpairment txImpairment;
2447 std::string cryptoPassword;
2448
2450 {
2451 clear();
2452 }
2453
2454 void clear()
2455 {
2456 interfaceName.clear();
2457 address.clear();
2458 ttl = 1;
2459 tos = 56;
2460 txOversend = 0;
2461 rxImpairment.clear();
2462 txImpairment.clear();
2463 cryptoPassword.clear();
2464 }
2465 };
2466
2467 static void to_json(nlohmann::json& j, const NsmNetworking& p)
2468 {
2469 j = nlohmann::json{
2470 TOJSON_IMPL(interfaceName),
2471 TOJSON_IMPL(address),
2472 TOJSON_IMPL(ttl),
2473 TOJSON_IMPL(tos),
2474 TOJSON_IMPL(txOversend),
2475 TOJSON_IMPL(rxImpairment),
2476 TOJSON_IMPL(txImpairment),
2477 TOJSON_IMPL(cryptoPassword)
2478 };
2479 }
2480 static void from_json(const nlohmann::json& j, NsmNetworking& p)
2481 {
2482 p.clear();
2483 getOptional("interfaceName", p.interfaceName, j, EMPTY_STRING);
2484 getOptional<NetworkAddress>("address", p.address, j);
2485 getOptional<int>("ttl", p.ttl, j, 1);
2486 getOptional<int>("tos", p.tos, j, 56);
2487 getOptional<int>("txOversend", p.txOversend, j, 0);
2488 getOptional<TransportImpairment>("rxImpairment", p.rxImpairment, j);
2489 getOptional<TransportImpairment>("txImpairment", p.txImpairment, j);
2490 getOptional("cryptoPassword", p.cryptoPassword, j, EMPTY_STRING);
2491 }
2492
2493
2494 //-----------------------------------------------------------
2495 JSON_SERIALIZED_CLASS(NsmConfiguration)
2505 {
2506 IMPLEMENT_JSON_SERIALIZATION()
2507 IMPLEMENT_JSON_DOCUMENTATION(NsmConfiguration)
2508
2509 public:
2510
2511 std::string id;
2512 bool favorUptime;
2513 NsmNetworking networking;
2514 std::vector<std::string> resources;
2515 int tokenStart;
2516 int tokenEnd;
2517 int intervalSecs;
2518 int transitionSecsFactor;
2519
2521 {
2522 clear();
2523 }
2524
2525 void clear()
2526 {
2527 id.clear();
2528 favorUptime = false;
2529 networking.clear();
2530 resources.clear();
2531 tokenStart = 1000000;
2532 tokenEnd = 2000000;
2533 intervalSecs = 1;
2534 transitionSecsFactor = 3;
2535 }
2536 };
2537
2538 static void to_json(nlohmann::json& j, const NsmConfiguration& p)
2539 {
2540 j = nlohmann::json{
2541 TOJSON_IMPL(id),
2542 TOJSON_IMPL(favorUptime),
2543 TOJSON_IMPL(networking),
2544 TOJSON_IMPL(resources),
2545 TOJSON_IMPL(tokenStart),
2546 TOJSON_IMPL(tokenEnd),
2547 TOJSON_IMPL(intervalSecs),
2548 TOJSON_IMPL(transitionSecsFactor)
2549 };
2550 }
2551 static void from_json(const nlohmann::json& j, NsmConfiguration& p)
2552 {
2553 p.clear();
2554 getOptional("id", p.id, j);
2555 getOptional<bool>("favorUptime", p.favorUptime, j, false);
2556 getOptional<NsmNetworking>("networking", p.networking, j);
2557 getOptional<std::vector<std::string>>("resources", p.resources, j);
2558 getOptional<int>("tokenStart", p.tokenStart, j, 1000000);
2559 getOptional<int>("tokenEnd", p.tokenEnd, j, 2000000);
2560 getOptional<int>("intervalSecs", p.intervalSecs, j, 1);
2561 getOptional<int>("transitionSecsFactor", p.transitionSecsFactor, j, 3);
2562 }
2563
2564
2565 //-----------------------------------------------------------
2566 JSON_SERIALIZED_CLASS(Rallypoint)
2575 {
2576 IMPLEMENT_JSON_SERIALIZATION()
2577 IMPLEMENT_JSON_DOCUMENTATION(Rallypoint)
2578
2579 public:
2580
2586
2598 std::string certificate;
2599
2611 std::string certificateKey;
2612
2617
2622
2626 std::vector<std::string> caCertificates;
2627
2632
2637
2640
2643
2644 Rallypoint()
2645 {
2646 clear();
2647 }
2648
2649 void clear()
2650 {
2651 host.clear();
2652 certificate.clear();
2653 certificateKey.clear();
2654 caCertificates.clear();
2655 verifyPeer = false;
2656 transactionTimeoutMs = 5000;
2657 disableMessageSigning = false;
2658 connectionTimeoutSecs = 5;
2659 tcpTxOptions.clear();
2660 }
2661
2662 bool matches(const Rallypoint& other)
2663 {
2664 if(!host.matches(other.host))
2665 {
2666 return false;
2667 }
2668
2669 if(certificate.compare(other.certificate) != 0)
2670 {
2671 return false;
2672 }
2673
2674 if(certificateKey.compare(other.certificateKey) != 0)
2675 {
2676 return false;
2677 }
2678
2679 if(verifyPeer != other.verifyPeer)
2680 {
2681 return false;
2682 }
2683
2684 if(allowSelfSignedCertificate != other.allowSelfSignedCertificate)
2685 {
2686 return false;
2687 }
2688
2689 if(caCertificates.size() != other.caCertificates.size())
2690 {
2691 return false;
2692 }
2693
2694 for(size_t x = 0; x < caCertificates.size(); x++)
2695 {
2696 bool found = false;
2697
2698 for(size_t y = 0; y < other.caCertificates.size(); y++)
2699 {
2700 if(caCertificates[x].compare(other.caCertificates[y]) == 0)
2701 {
2702 found = true;
2703 break;
2704 }
2705 }
2706
2707 if(!found)
2708 {
2709 return false;
2710 }
2711 }
2712
2713 if(transactionTimeoutMs != other.transactionTimeoutMs)
2714 {
2715 return false;
2716 }
2717
2718 if(disableMessageSigning != other.disableMessageSigning)
2719 {
2720 return false;
2721 }
2722
2723 return true;
2724 }
2725 };
2726
2727 static void to_json(nlohmann::json& j, const Rallypoint& p)
2728 {
2729 j = nlohmann::json{
2730 TOJSON_IMPL(host),
2731 TOJSON_IMPL(certificate),
2732 TOJSON_IMPL(certificateKey),
2733 TOJSON_IMPL(verifyPeer),
2734 TOJSON_IMPL(allowSelfSignedCertificate),
2735 TOJSON_IMPL(caCertificates),
2736 TOJSON_IMPL(transactionTimeoutMs),
2737 TOJSON_IMPL(disableMessageSigning),
2738 TOJSON_IMPL(connectionTimeoutSecs),
2739 TOJSON_IMPL(tcpTxOptions)
2740 };
2741 }
2742
2743 static void from_json(const nlohmann::json& j, Rallypoint& p)
2744 {
2745 p.clear();
2746 j.at("host").get_to(p.host);
2747 getOptional("certificate", p.certificate, j);
2748 getOptional("certificateKey", p.certificateKey, j);
2749 getOptional<bool>("verifyPeer", p.verifyPeer, j, true);
2750 getOptional<bool>("allowSelfSignedCertificate", p.allowSelfSignedCertificate, j, false);
2751 getOptional<std::vector<std::string>>("caCertificates", p.caCertificates, j);
2752 getOptional<int>("transactionTimeoutMs", p.transactionTimeoutMs, j, 5000);
2753 getOptional<bool>("disableMessageSigning", p.disableMessageSigning, j, false);
2754 getOptional<int>("connectionTimeoutSecs", p.connectionTimeoutSecs, j, 5);
2755 getOptional<TcpNetworkTxOptions>("tcpTxOptions", p.tcpTxOptions, j);
2756 }
2757
2758 //-----------------------------------------------------------
2759 JSON_SERIALIZED_CLASS(RallypointCluster)
2771 {
2772 IMPLEMENT_JSON_SERIALIZATION()
2773 IMPLEMENT_JSON_DOCUMENTATION(RallypointCluster)
2774
2775 public:
2781 typedef enum
2782 {
2784 csRoundRobin = 0,
2785
2787 csFailback = 1
2788 } ConnectionStrategy_t;
2789
2792
2794 std::vector<Rallypoint> rallypoints;
2795
2798
2801
2803 {
2804 clear();
2805 }
2806
2807 void clear()
2808 {
2809 connectionStrategy = csRoundRobin;
2810 rallypoints.clear();
2811 rolloverSecs = 10;
2812 connectionTimeoutSecs = 5;
2813 }
2814 };
2815
2816 static void to_json(nlohmann::json& j, const RallypointCluster& p)
2817 {
2818 j = nlohmann::json{
2819 TOJSON_IMPL(connectionStrategy),
2820 TOJSON_IMPL(rallypoints),
2821 TOJSON_IMPL(rolloverSecs),
2822 TOJSON_IMPL(connectionTimeoutSecs)
2823 };
2824 }
2825 static void from_json(const nlohmann::json& j, RallypointCluster& p)
2826 {
2827 p.clear();
2828 getOptional<RallypointCluster::ConnectionStrategy_t>("connectionStrategy", p.connectionStrategy, RallypointCluster::ConnectionStrategy_t::csRoundRobin);
2829 getOptional<std::vector<Rallypoint>>("rallypoints", p.rallypoints, j);
2830 getOptional<int>("rolloverSecs", p.rolloverSecs, j, 10);
2831 getOptional<int>("connectionTimeoutSecs", p.connectionTimeoutSecs, j, 5);
2832 }
2833
2834
2835 //-----------------------------------------------------------
2836 JSON_SERIALIZED_CLASS(NetworkDeviceDescriptor)
2847 {
2848 IMPLEMENT_JSON_SERIALIZATION()
2849 IMPLEMENT_JSON_DOCUMENTATION(NetworkDeviceDescriptor)
2850
2851 public:
2857
2859 std::string name;
2860
2862 std::string manufacturer;
2863
2865 std::string model;
2866
2868 std::string hardwareId;
2869
2871 std::string serialNumber;
2872
2874 std::string type;
2875
2877 std::string extra;
2878
2880 {
2881 clear();
2882 }
2883
2884 void clear()
2885 {
2886 deviceId = 0;
2887
2888 name.clear();
2889 manufacturer.clear();
2890 model.clear();
2891 hardwareId.clear();
2892 serialNumber.clear();
2893 type.clear();
2894 extra.clear();
2895 }
2896
2897 virtual std::string toString()
2898 {
2899 char buff[2048];
2900
2901 snprintf(buff, sizeof(buff), "deviceId=%d, name=%s, manufacturer=%s, model=%s, hardwareId=%s, serialNumber=%s, type=%s, extra=%s",
2902 deviceId,
2903 name.c_str(),
2904 manufacturer.c_str(),
2905 model.c_str(),
2906 hardwareId.c_str(),
2907 serialNumber.c_str(),
2908 type.c_str(),
2909 extra.c_str());
2910
2911 return std::string(buff);
2912 }
2913 };
2914
2915 static void to_json(nlohmann::json& j, const NetworkDeviceDescriptor& p)
2916 {
2917 j = nlohmann::json{
2918 TOJSON_IMPL(deviceId),
2919 TOJSON_IMPL(name),
2920 TOJSON_IMPL(manufacturer),
2921 TOJSON_IMPL(model),
2922 TOJSON_IMPL(hardwareId),
2923 TOJSON_IMPL(serialNumber),
2924 TOJSON_IMPL(type),
2925 TOJSON_IMPL(extra)
2926 };
2927 }
2928 static void from_json(const nlohmann::json& j, NetworkDeviceDescriptor& p)
2929 {
2930 p.clear();
2931 getOptional<int>("deviceId", p.deviceId, j, 0);
2932 getOptional("name", p.name, j);
2933 getOptional("manufacturer", p.manufacturer, j);
2934 getOptional("model", p.model, j);
2935 getOptional("hardwareId", p.hardwareId, j);
2936 getOptional("serialNumber", p.serialNumber, j);
2937 getOptional("type", p.type, j);
2938 getOptional("extra", p.extra, j);
2939 }
2940
2941 //-----------------------------------------------------------
2942 JSON_SERIALIZED_CLASS(AudioGate)
2952 {
2953 IMPLEMENT_JSON_SERIALIZATION()
2954 IMPLEMENT_JSON_DOCUMENTATION(AudioGate)
2955
2956 public:
2959
2962
2964 uint32_t hangMs;
2965
2967 uint32_t windowMin;
2968
2970 uint32_t windowMax;
2971
2974
2975
2976 AudioGate()
2977 {
2978 clear();
2979 }
2980
2981 void clear()
2982 {
2983 enabled = false;
2984 useVad = false;
2985 hangMs = 1500;
2986 windowMin = 25;
2987 windowMax = 125;
2988 coefficient = 1.75;
2989 }
2990 };
2991
2992 static void to_json(nlohmann::json& j, const AudioGate& p)
2993 {
2994 j = nlohmann::json{
2995 TOJSON_IMPL(enabled),
2996 TOJSON_IMPL(useVad),
2997 TOJSON_IMPL(hangMs),
2998 TOJSON_IMPL(windowMin),
2999 TOJSON_IMPL(windowMax),
3000 TOJSON_IMPL(coefficient)
3001 };
3002 }
3003 static void from_json(const nlohmann::json& j, AudioGate& p)
3004 {
3005 p.clear();
3006 getOptional<bool>("enabled", p.enabled, j, false);
3007 getOptional<bool>("useVad", p.useVad, j, false);
3008 getOptional<uint32_t>("hangMs", p.hangMs, j, 1500);
3009 getOptional<uint32_t>("windowMin", p.windowMin, j, 25);
3010 getOptional<uint32_t>("windowMax", p.windowMax, j, 125);
3011 getOptional<double>("coefficient", p.coefficient, j, 1.75);
3012 }
3013
3014 //-----------------------------------------------------------
3015 JSON_SERIALIZED_CLASS(TxAudio)
3029 {
3030 IMPLEMENT_JSON_SERIALIZATION()
3031 IMPLEMENT_JSON_DOCUMENTATION(TxAudio)
3032
3033 public:
3039 typedef enum
3040 {
3042 ctExternal = -1,
3043
3045 ctUnknown = 0,
3046
3047 /* G.711 */
3049 ctG711ulaw = 1,
3050
3052 ctG711alaw = 2,
3053
3054
3055 /* GSM */
3057 ctGsm610 = 3,
3058
3059
3060 /* G.729 */
3062 ctG729a = 4,
3063
3064
3065 /* PCM */
3067 ctPcm = 5,
3068
3069 // AMR Narrowband */
3071 ctAmrNb4750 = 10,
3072
3074 ctAmrNb5150 = 11,
3075
3077 ctAmrNb5900 = 12,
3078
3080 ctAmrNb6700 = 13,
3081
3083 ctAmrNb7400 = 14,
3084
3086 ctAmrNb7950 = 15,
3087
3089 ctAmrNb10200 = 16,
3090
3092 ctAmrNb12200 = 17,
3093
3094
3095 /* Opus */
3097 ctOpus6000 = 20,
3098
3100 ctOpus8000 = 21,
3101
3103 ctOpus10000 = 22,
3104
3106 ctOpus12000 = 23,
3107
3109 ctOpus14000 = 24,
3110
3112 ctOpus16000 = 25,
3113
3115 ctOpus18000 = 26,
3116
3118 ctOpus20000 = 27,
3119
3121 ctOpus22000 = 28,
3122
3124 ctOpus24000 = 29,
3125
3126
3127 /* Speex */
3129 ctSpxNb2150 = 30,
3130
3132 ctSpxNb3950 = 31,
3133
3135 ctSpxNb5950 = 32,
3136
3138 ctSpxNb8000 = 33,
3139
3141 ctSpxNb11000 = 34,
3142
3144 ctSpxNb15000 = 35,
3145
3147 ctSpxNb18200 = 36,
3148
3150 ctSpxNb24600 = 37,
3151
3152
3153 /* Codec2 */
3155 ctC2450 = 40,
3156
3158 ctC2700 = 41,
3159
3161 ctC21200 = 42,
3162
3164 ctC21300 = 43,
3165
3167 ctC21400 = 44,
3168
3170 ctC21600 = 45,
3171
3173 ctC22400 = 46,
3174
3176 ctC23200 = 47,
3177
3178
3179 /* MELPe */
3181 ctMelpe600 = 50,
3182
3184 ctMelpe1200 = 51,
3185
3187 ctMelpe2400 = 52
3188 } TxCodec_t;
3189
3192
3195
3197 std::string encoderName;
3198
3201
3204
3206 bool fdx;
3207
3215
3222
3229
3232
3235
3238
3243
3245 uint32_t internalKey;
3246
3249
3252
3254 bool dtx;
3255
3258
3259 TxAudio()
3260 {
3261 clear();
3262 }
3263
3264 void clear()
3265 {
3266 enabled = true;
3267 encoder = TxAudio::TxCodec_t::ctUnknown;
3268 encoderName.clear();
3269 framingMs = 60;
3270 blockCount = 0;
3271 fdx = false;
3272 noHdrExt = false;
3273 maxTxSecs = 0;
3274 extensionSendInterval = 10;
3275 initialHeaderBurst = 5;
3276 trailingHeaderBurst = 5;
3277 startTxNotifications = 5;
3278 customRtpPayloadType = -1;
3279 internalKey = 0;
3280 resetRtpOnTx = true;
3281 enableSmoothing = true;
3282 dtx = false;
3283 smoothedHangTimeMs = 0;
3284 }
3285 };
3286
3287 static void to_json(nlohmann::json& j, const TxAudio& p)
3288 {
3289 j = nlohmann::json{
3290 TOJSON_IMPL(enabled),
3291 TOJSON_IMPL(encoder),
3292 TOJSON_IMPL(encoderName),
3293 TOJSON_IMPL(framingMs),
3294 TOJSON_IMPL(blockCount),
3295 TOJSON_IMPL(fdx),
3296 TOJSON_IMPL(noHdrExt),
3297 TOJSON_IMPL(maxTxSecs),
3298 TOJSON_IMPL(extensionSendInterval),
3299 TOJSON_IMPL(initialHeaderBurst),
3300 TOJSON_IMPL(trailingHeaderBurst),
3301 TOJSON_IMPL(startTxNotifications),
3302 TOJSON_IMPL(customRtpPayloadType),
3303 TOJSON_IMPL(resetRtpOnTx),
3304 TOJSON_IMPL(enableSmoothing),
3305 TOJSON_IMPL(dtx),
3306 TOJSON_IMPL(smoothedHangTimeMs)
3307 };
3308
3309 // internalKey is not serialized
3310 }
3311 static void from_json(const nlohmann::json& j, TxAudio& p)
3312 {
3313 p.clear();
3314 getOptional<bool>("enabled", p.enabled, j, true);
3315 getOptional<TxAudio::TxCodec_t>("encoder", p.encoder, j, TxAudio::TxCodec_t::ctOpus8000);
3316 getOptional<std::string>("encoderName", p.encoderName, j, EMPTY_STRING);
3317 getOptional("framingMs", p.framingMs, j, 60);
3318 getOptional("blockCount", p.blockCount, j, 0);
3319 getOptional("fdx", p.fdx, j, false);
3320 getOptional("noHdrExt", p.noHdrExt, j, false);
3321 getOptional("maxTxSecs", p.maxTxSecs, j, 0);
3322 getOptional("extensionSendInterval", p.extensionSendInterval, j, 10);
3323 getOptional("initialHeaderBurst", p.initialHeaderBurst, j, 5);
3324 getOptional("trailingHeaderBurst", p.trailingHeaderBurst, j, 5);
3325 getOptional("startTxNotifications", p.startTxNotifications, j, 5);
3326 getOptional("customRtpPayloadType", p.customRtpPayloadType, j, -1);
3327 getOptional("resetRtpOnTx", p.resetRtpOnTx, j, true);
3328 getOptional("enableSmoothing", p.enableSmoothing, j, true);
3329 getOptional("dtx", p.dtx, j, false);
3330 getOptional("smoothedHangTimeMs", p.smoothedHangTimeMs, j, 0);
3331
3332 // internalKey is not serialized
3333 }
3334
3335 //-----------------------------------------------------------
3336 JSON_SERIALIZED_CLASS(AudioDeviceDescriptor)
3347 {
3348 IMPLEMENT_JSON_SERIALIZATION()
3349 IMPLEMENT_JSON_DOCUMENTATION(AudioDeviceDescriptor)
3350
3351 public:
3352
3354 typedef enum
3355 {
3357 dirUnknown = 0,
3358
3361
3364
3366 dirBoth
3367 } Direction_t;
3368
3374
3382
3390
3393
3401
3404
3406 std::string name;
3407
3409 std::string manufacturer;
3410
3412 std::string model;
3413
3415 std::string hardwareId;
3416
3418 std::string serialNumber;
3419
3422
3424 std::string type;
3425
3427 std::string extra;
3428
3431
3433 {
3434 clear();
3435 }
3436
3437 void clear()
3438 {
3439 deviceId = 0;
3440 samplingRate = 0;
3441 channels = 0;
3442 direction = dirUnknown;
3443 boostPercentage = 0;
3444 isAdad = false;
3445 isDefault = false;
3446
3447 name.clear();
3448 manufacturer.clear();
3449 model.clear();
3450 hardwareId.clear();
3451 serialNumber.clear();
3452 type.clear();
3453 extra.clear();
3454 isPresent = false;
3455 }
3456
3457 virtual std::string toString()
3458 {
3459 char buff[2048];
3460
3461 snprintf(buff, sizeof(buff), "deviceId=%d, samplingRate=%d, channels=%d, direction=%d, boostPercentage=%d, isAdad=%d, name=%s, manufacturer=%s, model=%s, hardwareId=%s, serialNumber=%s, isDefault=%d, type=%s, present=%d, extra=%s",
3462 deviceId,
3463 samplingRate,
3464 channels,
3465 (int)direction,
3466 boostPercentage,
3467 (int)isAdad,
3468 name.c_str(),
3469 manufacturer.c_str(),
3470 model.c_str(),
3471 hardwareId.c_str(),
3472 serialNumber.c_str(),
3473 (int)isDefault,
3474 type.c_str(),
3475 (int)isPresent,
3476 extra.c_str());
3477
3478 return std::string(buff);
3479 }
3480 };
3481
3482 static void to_json(nlohmann::json& j, const AudioDeviceDescriptor& p)
3483 {
3484 j = nlohmann::json{
3485 TOJSON_IMPL(deviceId),
3486 TOJSON_IMPL(samplingRate),
3487 TOJSON_IMPL(channels),
3488 TOJSON_IMPL(direction),
3489 TOJSON_IMPL(boostPercentage),
3490 TOJSON_IMPL(isAdad),
3491 TOJSON_IMPL(name),
3492 TOJSON_IMPL(manufacturer),
3493 TOJSON_IMPL(model),
3494 TOJSON_IMPL(hardwareId),
3495 TOJSON_IMPL(serialNumber),
3496 TOJSON_IMPL(isDefault),
3497 TOJSON_IMPL(type),
3498 TOJSON_IMPL(extra),
3499 TOJSON_IMPL(isPresent)
3500 };
3501 }
3502 static void from_json(const nlohmann::json& j, AudioDeviceDescriptor& p)
3503 {
3504 p.clear();
3505 getOptional<int>("deviceId", p.deviceId, j, 0);
3506 getOptional<int>("samplingRate", p.samplingRate, j, 0);
3507 getOptional<int>("channels", p.channels, j, 0);
3508 getOptional<AudioDeviceDescriptor::Direction_t>("direction", p.direction, j,
3509 AudioDeviceDescriptor::Direction_t::dirUnknown);
3510 getOptional<int>("boostPercentage", p.boostPercentage, j, 0);
3511
3512 getOptional<bool>("isAdad", p.isAdad, j, false);
3513 getOptional("name", p.name, j);
3514 getOptional("manufacturer", p.manufacturer, j);
3515 getOptional("model", p.model, j);
3516 getOptional("hardwareId", p.hardwareId, j);
3517 getOptional("serialNumber", p.serialNumber, j);
3518 getOptional("isDefault", p.isDefault, j);
3519 getOptional("type", p.type, j);
3520 getOptional("extra", p.extra, j);
3521 getOptional<bool>("isPresent", p.isPresent, j, false);
3522 }
3523
3524 //-----------------------------------------------------------
3525 JSON_SERIALIZED_CLASS(ListOfAudioDeviceDescriptor)
3527 {
3528 IMPLEMENT_JSON_SERIALIZATION()
3529 IMPLEMENT_JSON_DOCUMENTATION(ListOfAudioDeviceDescriptor)
3530
3531 public:
3532 std::vector<AudioDeviceDescriptor> list;
3533
3535 {
3536 clear();
3537 }
3538
3539 void clear()
3540 {
3541 list.clear();
3542 }
3543 };
3544
3545 static void to_json(nlohmann::json& j, const ListOfAudioDeviceDescriptor& p)
3546 {
3547 j = nlohmann::json{
3548 TOJSON_IMPL(list)
3549 };
3550 }
3551 static void from_json(const nlohmann::json& j, ListOfAudioDeviceDescriptor& p)
3552 {
3553 p.clear();
3554 getOptional<std::vector<AudioDeviceDescriptor>>("list", p.list, j);
3555 }
3556
3557 //-----------------------------------------------------------
3558 JSON_SERIALIZED_CLASS(Audio)
3567 {
3568 IMPLEMENT_JSON_SERIALIZATION()
3569 IMPLEMENT_JSON_DOCUMENTATION(Audio)
3570
3571 public:
3574
3577
3580
3583
3586
3589
3592
3595
3596 Audio()
3597 {
3598 clear();
3599 }
3600
3601 void clear()
3602 {
3603 enabled = true;
3604 inputId = 0;
3605 inputGain = 0;
3606 outputId = 0;
3607 outputGain = 0;
3608 outputLevelLeft = 100;
3609 outputLevelRight = 100;
3610 outputMuted = false;
3611 }
3612 };
3613
3614 static void to_json(nlohmann::json& j, const Audio& p)
3615 {
3616 j = nlohmann::json{
3617 TOJSON_IMPL(enabled),
3618 TOJSON_IMPL(inputId),
3619 TOJSON_IMPL(inputGain),
3620 TOJSON_IMPL(outputId),
3621 TOJSON_IMPL(outputLevelLeft),
3622 TOJSON_IMPL(outputLevelRight),
3623 TOJSON_IMPL(outputMuted)
3624 };
3625 }
3626 static void from_json(const nlohmann::json& j, Audio& p)
3627 {
3628 p.clear();
3629 getOptional<bool>("enabled", p.enabled, j, true);
3630 getOptional<int>("inputId", p.inputId, j, 0);
3631 getOptional<int>("inputGain", p.inputGain, j, 0);
3632 getOptional<int>("outputId", p.outputId, j, 0);
3633 getOptional<int>("outputGain", p.outputGain, j, 0);
3634 getOptional<int>("outputLevelLeft", p.outputLevelLeft, j, 100);
3635 getOptional<int>("outputLevelRight", p.outputLevelRight, j, 100);
3636 getOptional<bool>("outputMuted", p.outputMuted, j, false);
3637 }
3638
3639 //-----------------------------------------------------------
3640 JSON_SERIALIZED_CLASS(TalkerInformation)
3651 {
3652 IMPLEMENT_JSON_SERIALIZATION()
3653 IMPLEMENT_JSON_DOCUMENTATION(TalkerInformation)
3654
3655 public:
3656
3658 std::string alias;
3659
3661 std::string nodeId;
3662
3664 uint16_t rxFlags;
3665
3668
3670 uint32_t txId;
3671
3674
3677
3680
3682 {
3683 clear();
3684 }
3685
3686 void clear()
3687 {
3688 alias.clear();
3689 nodeId.clear();
3690 rxFlags = 0;
3691 txPriority = 0;
3692 txId = 0;
3693 duplicateCount = 0;
3694 aliasSpecializer = 0;
3695 rxMuted = false;
3696 }
3697 };
3698
3699 static void to_json(nlohmann::json& j, const TalkerInformation& p)
3700 {
3701 j = nlohmann::json{
3702 TOJSON_IMPL(alias),
3703 TOJSON_IMPL(nodeId),
3704 TOJSON_IMPL(rxFlags),
3705 TOJSON_IMPL(txPriority),
3706 TOJSON_IMPL(txId),
3707 TOJSON_IMPL(duplicateCount),
3708 TOJSON_IMPL(aliasSpecializer),
3709 TOJSON_IMPL(rxMuted)
3710 };
3711 }
3712 static void from_json(const nlohmann::json& j, TalkerInformation& p)
3713 {
3714 p.clear();
3715 getOptional<std::string>("alias", p.alias, j, EMPTY_STRING);
3716 getOptional<std::string>("nodeId", p.nodeId, j, EMPTY_STRING);
3717 getOptional<uint16_t>("rxFlags", p.rxFlags, j, 0);
3718 getOptional<int>("txPriority", p.txPriority, j, 0);
3719 getOptional<uint32_t>("txId", p.txId, j, 0);
3720 getOptional<int>("duplicateCount", p.duplicateCount, j, 0);
3721 getOptional<uint16_t>("aliasSpecializer", p.aliasSpecializer, j, 0);
3722 getOptional<bool>("rxMuted", p.rxMuted, j, false);
3723 }
3724
3725 //-----------------------------------------------------------
3726 JSON_SERIALIZED_CLASS(GroupTalkers)
3739 {
3740 IMPLEMENT_JSON_SERIALIZATION()
3741 IMPLEMENT_JSON_DOCUMENTATION(GroupTalkers)
3742
3743 public:
3745 std::vector<TalkerInformation> list;
3746
3747 GroupTalkers()
3748 {
3749 clear();
3750 }
3751
3752 void clear()
3753 {
3754 list.clear();
3755 }
3756 };
3757
3758 static void to_json(nlohmann::json& j, const GroupTalkers& p)
3759 {
3760 j = nlohmann::json{
3761 TOJSON_IMPL(list)
3762 };
3763 }
3764 static void from_json(const nlohmann::json& j, GroupTalkers& p)
3765 {
3766 p.clear();
3767 getOptional<std::vector<TalkerInformation>>("list", p.list, j);
3768 }
3769
3770 //-----------------------------------------------------------
3771 JSON_SERIALIZED_CLASS(Presence)
3782 {
3783 IMPLEMENT_JSON_SERIALIZATION()
3784 IMPLEMENT_JSON_DOCUMENTATION(Presence)
3785
3786 public:
3790 typedef enum
3791 {
3793 pfUnknown = 0,
3794
3796 pfEngage = 1,
3797
3804 pfCot = 2
3805 } Format_t;
3806
3809
3812
3815
3818
3819 Presence()
3820 {
3821 clear();
3822 }
3823
3824 void clear()
3825 {
3826 format = pfUnknown;
3827 intervalSecs = 30;
3828 listenOnly = false;
3829 minIntervalSecs = 5;
3830 }
3831 };
3832
3833 static void to_json(nlohmann::json& j, const Presence& p)
3834 {
3835 j = nlohmann::json{
3836 TOJSON_IMPL(format),
3837 TOJSON_IMPL(intervalSecs),
3838 TOJSON_IMPL(listenOnly),
3839 TOJSON_IMPL(minIntervalSecs)
3840 };
3841 }
3842 static void from_json(const nlohmann::json& j, Presence& p)
3843 {
3844 p.clear();
3845 getOptional<Presence::Format_t>("format", p.format, j, Presence::Format_t::pfEngage);
3846 getOptional<int>("intervalSecs", p.intervalSecs, j, 30);
3847 getOptional<bool>("listenOnly", p.listenOnly, j, false);
3848 getOptional<int>("minIntervalSecs", p.minIntervalSecs, j, 5);
3849 }
3850
3851
3852 //-----------------------------------------------------------
3853 JSON_SERIALIZED_CLASS(Advertising)
3864 {
3865 IMPLEMENT_JSON_SERIALIZATION()
3866 IMPLEMENT_JSON_DOCUMENTATION(Advertising)
3867
3868 public:
3871
3874
3877
3878 Advertising()
3879 {
3880 clear();
3881 }
3882
3883 void clear()
3884 {
3885 enabled = false;
3886 intervalMs = 20000;
3887 alwaysAdvertise = false;
3888 }
3889 };
3890
3891 static void to_json(nlohmann::json& j, const Advertising& p)
3892 {
3893 j = nlohmann::json{
3894 TOJSON_IMPL(enabled),
3895 TOJSON_IMPL(intervalMs),
3896 TOJSON_IMPL(alwaysAdvertise)
3897 };
3898 }
3899 static void from_json(const nlohmann::json& j, Advertising& p)
3900 {
3901 p.clear();
3902 getOptional("enabled", p.enabled, j, false);
3903 getOptional<int>("intervalMs", p.intervalMs, j, 20000);
3904 getOptional<bool>("alwaysAdvertise", p.alwaysAdvertise, j, false);
3905 }
3906
3907 //-----------------------------------------------------------
3908 JSON_SERIALIZED_CLASS(GroupPriorityTranslation)
3919 {
3920 IMPLEMENT_JSON_SERIALIZATION()
3921 IMPLEMENT_JSON_DOCUMENTATION(GroupPriorityTranslation)
3922
3923 public:
3926
3929
3932
3934 {
3935 clear();
3936 }
3937
3938 void clear()
3939 {
3940 rx.clear();
3941 tx.clear();
3942 priority = 0;
3943 }
3944 };
3945
3946 static void to_json(nlohmann::json& j, const GroupPriorityTranslation& p)
3947 {
3948 j = nlohmann::json{
3949 TOJSON_IMPL(rx),
3950 TOJSON_IMPL(tx),
3951 TOJSON_IMPL(priority)
3952 };
3953 }
3954 static void from_json(const nlohmann::json& j, GroupPriorityTranslation& p)
3955 {
3956 p.clear();
3957 j.at("rx").get_to(p.rx);
3958 j.at("tx").get_to(p.tx);
3959 FROMJSON_IMPL(priority, int, 0);
3960 }
3961
3962 //-----------------------------------------------------------
3963 JSON_SERIALIZED_CLASS(GroupTimeline)
3976 {
3977 IMPLEMENT_JSON_SERIALIZATION()
3978 IMPLEMENT_JSON_DOCUMENTATION(GroupTimeline)
3979
3980 public:
3983
3986 bool recordAudio;
3987
3989 {
3990 clear();
3991 }
3992
3993 void clear()
3994 {
3995 enabled = true;
3996 maxAudioTimeMs = 30000;
3997 recordAudio = true;
3998 }
3999 };
4000
4001 static void to_json(nlohmann::json& j, const GroupTimeline& p)
4002 {
4003 j = nlohmann::json{
4004 TOJSON_IMPL(enabled),
4005 TOJSON_IMPL(maxAudioTimeMs),
4006 TOJSON_IMPL(recordAudio)
4007 };
4008 }
4009 static void from_json(const nlohmann::json& j, GroupTimeline& p)
4010 {
4011 p.clear();
4012 getOptional("enabled", p.enabled, j, true);
4013 getOptional<int>("maxAudioTimeMs", p.maxAudioTimeMs, j, 30000);
4014 getOptional("recordAudio", p.recordAudio, j, true);
4015 }
4016
4024 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_INTERNAL = "com.rallytac.engage.internal";
4026 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_CORE = "com.rallytac.magellan.core";
4028 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_CISTECH = "com.rallytac.engage.magellan.cistech";
4030 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_TRELLISWARE = "com.rallytac.engage.magellan.trellisware";
4032 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_SILVUS = "com.rallytac.engage.magellan.silvus";
4034 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_PERSISTENT = "com.rallytac.engage.magellan.persistent";
4036 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_DOMO = "com.rallytac.engage.magellan.domo";
4038 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_KENWOOD = "com.rallytac.engage.magellan.kenwood";
4040 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_TAIT = "com.rallytac.engage.magellan.tait";
4042 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_VOCALITY = "com.rallytac.engage.magellan.vocality";
4063
4088
4104 //-----------------------------------------------------------
4105 JSON_SERIALIZED_CLASS(GroupAppTransport)
4116 {
4117 IMPLEMENT_JSON_SERIALIZATION()
4118 IMPLEMENT_JSON_DOCUMENTATION(GroupAppTransport)
4119
4120 public:
4123
4125 std::string id;
4126
4128 {
4129 clear();
4130 }
4131
4132 void clear()
4133 {
4134 enabled = false;
4135 id.clear();
4136 }
4137 };
4138
4139 static void to_json(nlohmann::json& j, const GroupAppTransport& p)
4140 {
4141 j = nlohmann::json{
4142 TOJSON_IMPL(enabled),
4143 TOJSON_IMPL(id)
4144 };
4145 }
4146 static void from_json(const nlohmann::json& j, GroupAppTransport& p)
4147 {
4148 p.clear();
4149 getOptional<bool>("enabled", p.enabled, j, false);
4150 getOptional<std::string>("id", p.id, j);
4151 }
4152
4153 //-----------------------------------------------------------
4154 JSON_SERIALIZED_CLASS(RtpProfile)
4165 {
4166 IMPLEMENT_JSON_SERIALIZATION()
4167 IMPLEMENT_JSON_DOCUMENTATION(RtpProfile)
4168
4169 public:
4175 typedef enum
4176 {
4178 jmStandard = 0,
4179
4181 jmLowLatency = 1,
4182
4184 jmReleaseOnTxEnd = 2
4185 } JitterMode_t;
4186
4189
4192
4195
4198
4201
4204
4207
4210
4213
4216
4219
4222
4225
4228
4231
4234
4238
4239 RtpProfile()
4240 {
4241 clear();
4242 }
4243
4244 void clear()
4245 {
4246 mode = jmStandard;
4247 jitterMaxMs = 10000;
4248 jitterMinMs = 100;
4249 jitterMaxFactor = 8;
4250 jitterTrimPercentage = 10;
4251 jitterUnderrunReductionThresholdMs = 1500;
4252 jitterUnderrunReductionAger = 100;
4253 latePacketSequenceRange = 5;
4254 latePacketTimestampRangeMs = 2000;
4255 inboundProcessorInactivityMs = 500;
4256 jitterForceTrimAtMs = 0;
4257 rtcpPresenceTimeoutMs = 45000;
4258 jitterMaxExceededClipPerc = 10;
4259 jitterMaxExceededClipHangMs = 1500;
4260 zombieLifetimeMs = 15000;
4261 jitterMaxTrimMs = 250;
4262 signalledInboundProcessorInactivityMs = (inboundProcessorInactivityMs * 4);
4263 }
4264 };
4265
4266 static void to_json(nlohmann::json& j, const RtpProfile& p)
4267 {
4268 j = nlohmann::json{
4269 TOJSON_IMPL(mode),
4270 TOJSON_IMPL(jitterMaxMs),
4271 TOJSON_IMPL(inboundProcessorInactivityMs),
4272 TOJSON_IMPL(jitterMinMs),
4273 TOJSON_IMPL(jitterMaxFactor),
4274 TOJSON_IMPL(jitterTrimPercentage),
4275 TOJSON_IMPL(jitterUnderrunReductionThresholdMs),
4276 TOJSON_IMPL(jitterUnderrunReductionAger),
4277 TOJSON_IMPL(latePacketSequenceRange),
4278 TOJSON_IMPL(latePacketTimestampRangeMs),
4279 TOJSON_IMPL(inboundProcessorInactivityMs),
4280 TOJSON_IMPL(jitterForceTrimAtMs),
4281 TOJSON_IMPL(jitterMaxExceededClipPerc),
4282 TOJSON_IMPL(jitterMaxExceededClipHangMs),
4283 TOJSON_IMPL(zombieLifetimeMs),
4284 TOJSON_IMPL(jitterMaxTrimMs),
4285 TOJSON_IMPL(signalledInboundProcessorInactivityMs)
4286 };
4287 }
4288 static void from_json(const nlohmann::json& j, RtpProfile& p)
4289 {
4290 p.clear();
4291 FROMJSON_IMPL(mode, RtpProfile::JitterMode_t, RtpProfile::JitterMode_t::jmStandard);
4292 FROMJSON_IMPL(jitterMaxMs, int, 10000);
4293 FROMJSON_IMPL(jitterMinMs, int, 20);
4294 FROMJSON_IMPL(jitterMaxFactor, int, 8);
4295 FROMJSON_IMPL(jitterTrimPercentage, int, 10);
4296 FROMJSON_IMPL(jitterUnderrunReductionThresholdMs, int, 1500);
4297 FROMJSON_IMPL(jitterUnderrunReductionAger, int, 100);
4298 FROMJSON_IMPL(latePacketSequenceRange, int, 5);
4299 FROMJSON_IMPL(latePacketTimestampRangeMs, int, 2000);
4300 FROMJSON_IMPL(inboundProcessorInactivityMs, int, 500);
4301 FROMJSON_IMPL(jitterForceTrimAtMs, int, 0);
4302 FROMJSON_IMPL(rtcpPresenceTimeoutMs, int, 45000);
4303 FROMJSON_IMPL(jitterMaxExceededClipPerc, int, 10);
4304 FROMJSON_IMPL(jitterMaxExceededClipHangMs, int, 1500);
4305 FROMJSON_IMPL(zombieLifetimeMs, int, 15000);
4306 FROMJSON_IMPL(jitterMaxTrimMs, int, 250);
4307 FROMJSON_IMPL(signalledInboundProcessorInactivityMs, int, (p.inboundProcessorInactivityMs * 4));
4308 }
4309
4310 //-----------------------------------------------------------
4311 JSON_SERIALIZED_CLASS(Tls)
4322 {
4323 IMPLEMENT_JSON_SERIALIZATION()
4324 IMPLEMENT_JSON_DOCUMENTATION(Tls)
4325
4326 public:
4327
4330
4333
4335 std::vector<std::string> caCertificates;
4336
4339
4342
4344 std::vector<std::string> crlSerials;
4345
4346 Tls()
4347 {
4348 clear();
4349 }
4350
4351 void clear()
4352 {
4353 verifyPeers = true;
4354 allowSelfSignedCertificates = false;
4355 caCertificates.clear();
4356 subjectRestrictions.clear();
4357 issuerRestrictions.clear();
4358 crlSerials.clear();
4359 }
4360 };
4361
4362 static void to_json(nlohmann::json& j, const Tls& p)
4363 {
4364 j = nlohmann::json{
4365 TOJSON_IMPL(verifyPeers),
4366 TOJSON_IMPL(allowSelfSignedCertificates),
4367 TOJSON_IMPL(caCertificates),
4368 TOJSON_IMPL(subjectRestrictions),
4369 TOJSON_IMPL(issuerRestrictions),
4370 TOJSON_IMPL(crlSerials)
4371 };
4372 }
4373 static void from_json(const nlohmann::json& j, Tls& p)
4374 {
4375 p.clear();
4376 getOptional<bool>("verifyPeers", p.verifyPeers, j, true);
4377 getOptional<bool>("allowSelfSignedCertificates", p.allowSelfSignedCertificates, j, false);
4378 getOptional<std::vector<std::string>>("caCertificates", p.caCertificates, j);
4379 getOptional<StringRestrictionList>("subjectRestrictions", p.subjectRestrictions, j);
4380 getOptional<StringRestrictionList>("issuerRestrictions", p.issuerRestrictions, j);
4381 getOptional<std::vector<std::string>>("crlSerials", p.crlSerials, j);
4382 }
4383
4384 //-----------------------------------------------------------
4385 JSON_SERIALIZED_CLASS(RangerPackets)
4398 {
4399 IMPLEMENT_JSON_SERIALIZATION()
4400 IMPLEMENT_JSON_DOCUMENTATION(RangerPackets)
4401
4402 public:
4405
4408
4410 {
4411 clear();
4412 }
4413
4414 void clear()
4415 {
4416 hangTimerSecs = -1;
4417 count = 5;
4418 }
4419
4420 virtual void initForDocumenting()
4421 {
4422 }
4423 };
4424
4425 static void to_json(nlohmann::json& j, const RangerPackets& p)
4426 {
4427 j = nlohmann::json{
4428 TOJSON_IMPL(hangTimerSecs),
4429 TOJSON_IMPL(count)
4430 };
4431 }
4432 static void from_json(const nlohmann::json& j, RangerPackets& p)
4433 {
4434 p.clear();
4435 getOptional<int>("hangTimerSecs", p.hangTimerSecs, j, 11);
4436 getOptional<int>("count", p.count, j, 5);
4437 }
4438
4439 //-----------------------------------------------------------
4440 JSON_SERIALIZED_CLASS(Source)
4453 {
4454 IMPLEMENT_JSON_SERIALIZATION()
4455 IMPLEMENT_JSON_DOCUMENTATION(Source)
4456
4457 public:
4459 std::string nodeId;
4460
4461 /* NOTE: Not serialized ! */
4462 uint8_t _internal_binary_nodeId[ENGAGE_MAX_NODE_ID_SIZE];
4463
4465 std::string alias;
4466
4467 /* NOTE: Not serialized ! */
4468 uint8_t _internal_binary_alias[ENGAGE_MAX_ALIAS_SIZE];
4469
4470 Source()
4471 {
4472 clear();
4473 }
4474
4475 void clear()
4476 {
4477 nodeId.clear();
4478 memset(_internal_binary_nodeId, 0, sizeof(_internal_binary_nodeId));
4479
4480 alias.clear();
4481 memset(_internal_binary_alias, 0, sizeof(_internal_binary_alias));
4482 }
4483
4484 virtual void initForDocumenting()
4485 {
4486 }
4487 };
4488
4489 static void to_json(nlohmann::json& j, const Source& p)
4490 {
4491 j = nlohmann::json{
4492 TOJSON_IMPL(nodeId),
4493 TOJSON_IMPL(alias)
4494 };
4495 }
4496 static void from_json(const nlohmann::json& j, Source& p)
4497 {
4498 p.clear();
4499 FROMJSON_IMPL_SIMPLE(nodeId);
4500 FROMJSON_IMPL_SIMPLE(alias);
4501 }
4502
4503 //-----------------------------------------------------------
4504 JSON_SERIALIZED_CLASS(Group)
4516 {
4517 IMPLEMENT_JSON_SERIALIZATION()
4518 IMPLEMENT_JSON_DOCUMENTATION(Group)
4519
4520 public:
4522 typedef enum
4523 {
4525 gtUnknown = 0,
4526
4528 gtAudio = 1,
4529
4531 gtPresence = 2,
4532
4534 gtRaw = 3
4535 } Type_t;
4536
4537
4539 typedef enum
4540 {
4542 bomRaw = 0,
4543
4545 bomPayloadTransformation = 1,
4546
4548 bomAnonymousMixing = 2,
4549
4551 bomLanguageTranslation = 3
4552 } BridgingOpMode_t;
4553
4555 typedef enum
4556 {
4558 iagpAnonymousAlias = 0,
4559
4561 iagpSsrcInHex = 1
4562 } InboundAliasGenerationPolicy_t;
4563
4566
4569
4576 std::string id;
4577
4579 std::string name;
4580
4582 std::string spokenName;
4583
4585 std::string interfaceName;
4586
4589
4592
4595
4598
4601
4603 std::string cryptoPassword;
4604
4607
4609 std::vector<Rallypoint> rallypoints;
4610
4613
4616
4625
4627 std::string alias;
4628
4631
4633 std::string source;
4634
4641
4644
4647
4650
4652 std::vector<std::string> presenceGroupAffinities;
4653
4656
4659
4661 std::vector<RtpPayloadTypeTranslation> inboundRtpPayloadTypeTranslations;
4662
4665
4668
4670 std::string anonymousAlias;
4671
4674
4677
4680
4683
4686
4689
4692
4694 std::vector<uint16_t> specializerAffinities;
4695
4698
4700 std::vector<Source> ignoreSources;
4701
4703 std::string languageCode;
4704
4706 std::string synVoice;
4707
4710
4713
4716
4719
4722
4725
4726 Group()
4727 {
4728 clear();
4729 }
4730
4731 void clear()
4732 {
4733 type = gtUnknown;
4734 bom = bomRaw;
4735 id.clear();
4736 name.clear();
4737 spokenName.clear();
4738 interfaceName.clear();
4739 rx.clear();
4740 tx.clear();
4741 txOptions.clear();
4742 txAudio.clear();
4743 presence.clear();
4744 cryptoPassword.clear();
4745
4746 alias.clear();
4747
4748 rallypoints.clear();
4749 rallypointCluster.clear();
4750
4751 audio.clear();
4752 timeline.clear();
4753
4754 blockAdvertising = false;
4755
4756 source.clear();
4757
4758 maxRxSecs = 0;
4759
4760 enableMulticastFailover = false;
4761 multicastFailoverSecs = 10;
4762
4763 rtcpPresenceRx.clear();
4764
4765 presenceGroupAffinities.clear();
4766 disablePacketEvents = false;
4767
4768 rfc4733RtpPayloadId = 0;
4769 inboundRtpPayloadTypeTranslations.clear();
4770 priorityTranslation.clear();
4771
4772 stickyTidHangSecs = 10;
4773 anonymousAlias.clear();
4774 lbCrypto = false;
4775
4776 appTransport.clear();
4777 allowLoopback = false;
4778
4779 rtpProfile.clear();
4780 rangerPackets.clear();
4781
4782 _wasDeserialized_rtpProfile = false;
4783
4784 txImpairment.clear();
4785 rxImpairment.clear();
4786
4787 specializerAffinities.clear();
4788
4789 securityLevel = 0;
4790
4791 ignoreSources.clear();
4792
4793 languageCode.clear();
4794 synVoice.clear();
4795
4796 rxCapture.clear();
4797 txCapture.clear();
4798
4799 blobRtpPayloadType = ENGAGE_DEFAULT_BLOB_RTP_PAYLOAD_TYPE;
4800 inboundAliasGenerationPolicy = iagpAnonymousAlias;
4801 gateIn.clear();
4802
4803 ignoreAudioTraffic = false;
4804 }
4805 };
4806
4807 static void to_json(nlohmann::json& j, const Group& p)
4808 {
4809 j = nlohmann::json{
4810 TOJSON_IMPL(type),
4811 TOJSON_IMPL(bom),
4812 TOJSON_IMPL(id),
4813 TOJSON_IMPL(name),
4814 TOJSON_IMPL(spokenName),
4815 TOJSON_IMPL(interfaceName),
4816 TOJSON_IMPL(rx),
4817 TOJSON_IMPL(tx),
4818 TOJSON_IMPL(txOptions),
4819 TOJSON_IMPL(txAudio),
4820 TOJSON_IMPL(presence),
4821 TOJSON_IMPL(cryptoPassword),
4822 TOJSON_IMPL(alias),
4823
4824 // See below
4825 //TOJSON_IMPL(rallypoints),
4826 //TOJSON_IMPL(rallypointCluster),
4827
4828 TOJSON_IMPL(alias),
4829 TOJSON_IMPL(audio),
4830 TOJSON_IMPL(timeline),
4831 TOJSON_IMPL(blockAdvertising),
4832 TOJSON_IMPL(source),
4833 TOJSON_IMPL(maxRxSecs),
4834 TOJSON_IMPL(enableMulticastFailover),
4835 TOJSON_IMPL(multicastFailoverSecs),
4836 TOJSON_IMPL(rtcpPresenceRx),
4837 TOJSON_IMPL(presenceGroupAffinities),
4838 TOJSON_IMPL(disablePacketEvents),
4839 TOJSON_IMPL(rfc4733RtpPayloadId),
4840 TOJSON_IMPL(inboundRtpPayloadTypeTranslations),
4841 TOJSON_IMPL(priorityTranslation),
4842 TOJSON_IMPL(stickyTidHangSecs),
4843 TOJSON_IMPL(anonymousAlias),
4844 TOJSON_IMPL(lbCrypto),
4845 TOJSON_IMPL(appTransport),
4846 TOJSON_IMPL(allowLoopback),
4847 TOJSON_IMPL(rangerPackets),
4848
4849 TOJSON_IMPL(txImpairment),
4850 TOJSON_IMPL(rxImpairment),
4851
4852 TOJSON_IMPL(specializerAffinities),
4853
4854 TOJSON_IMPL(securityLevel),
4855
4856 TOJSON_IMPL(ignoreSources),
4857
4858 TOJSON_IMPL(languageCode),
4859 TOJSON_IMPL(synVoice),
4860
4861 TOJSON_IMPL(rxCapture),
4862 TOJSON_IMPL(txCapture),
4863
4864 TOJSON_IMPL(blobRtpPayloadType),
4865
4866 TOJSON_IMPL(inboundAliasGenerationPolicy),
4867
4868 TOJSON_IMPL(gateIn),
4869
4870 TOJSON_IMPL(ignoreAudioTraffic)
4871 };
4872
4873 TOJSON_BASE_IMPL();
4874
4875 // TODO: need a better way to indicate whether rtpProfile is present
4876 if(p._wasDeserialized_rtpProfile || p.isDocumenting())
4877 {
4878 j["rtpProfile"] = p.rtpProfile;
4879 }
4880
4881 if(p.isDocumenting())
4882 {
4883 j["rallypointCluster"] = p.rallypointCluster;
4884 j["rallypoints"] = p.rallypoints;
4885 }
4886 else
4887 {
4888 // rallypointCluster takes precedence if it has elements
4889 if(!p.rallypointCluster.rallypoints.empty())
4890 {
4891 j["rallypointCluster"] = p.rallypointCluster;
4892 }
4893 else if(!p.rallypoints.empty())
4894 {
4895 j["rallypoints"] = p.rallypoints;
4896 }
4897 }
4898 }
4899 static void from_json(const nlohmann::json& j, Group& p)
4900 {
4901 p.clear();
4902 j.at("type").get_to(p.type);
4903 getOptional<Group::BridgingOpMode_t>("bom", p.bom, j, Group::BridgingOpMode_t::bomRaw);
4904 j.at("id").get_to(p.id);
4905 getOptional<std::string>("name", p.name, j);
4906 getOptional<std::string>("spokenName", p.spokenName, j);
4907 getOptional<std::string>("interfaceName", p.interfaceName, j);
4908 getOptional<NetworkAddress>("rx", p.rx, j);
4909 getOptional<NetworkAddress>("tx", p.tx, j);
4910 getOptional<NetworkTxOptions>("txOptions", p.txOptions, j);
4911 getOptional<std::string>("cryptoPassword", p.cryptoPassword, j);
4912 getOptional<std::string>("alias", p.alias, j);
4913 getOptional<TxAudio>("txAudio", p.txAudio, j);
4914 getOptional<Presence>("presence", p.presence, j);
4915 getOptional<std::vector<Rallypoint>>("rallypoints", p.rallypoints, j);
4916 getOptional<RallypointCluster>("rallypointCluster", p.rallypointCluster, j);
4917 getOptional<Audio>("audio", p.audio, j);
4918 getOptional<GroupTimeline>("timeline", p.timeline, j);
4919 getOptional<bool>("blockAdvertising", p.blockAdvertising, j, false);
4920 getOptional<std::string>("source", p.source, j);
4921 getOptional<int>("maxRxSecs", p.maxRxSecs, j, 0);
4922 getOptional<bool>("enableMulticastFailover", p.enableMulticastFailover, j, false);
4923 getOptional<int>("multicastFailoverSecs", p.multicastFailoverSecs, j, 10);
4924 getOptional<NetworkAddress>("rtcpPresenceRx", p.rtcpPresenceRx, j);
4925 getOptional<std::vector<std::string>>("presenceGroupAffinities", p.presenceGroupAffinities, j);
4926 getOptional<bool>("disablePacketEvents", p.disablePacketEvents, j, false);
4927 getOptional<int>("rfc4733RtpPayloadId", p.rfc4733RtpPayloadId, j, 0);
4928 getOptional<std::vector<RtpPayloadTypeTranslation>>("inboundRtpPayloadTypeTranslations", p.inboundRtpPayloadTypeTranslations, j);
4929 getOptional<GroupPriorityTranslation>("priorityTranslation", p.priorityTranslation, j);
4930 getOptional<int>("stickyTidHangSecs", p.stickyTidHangSecs, j, 10);
4931 getOptional<std::string>("anonymousAlias", p.anonymousAlias, j);
4932 getOptional<bool>("lbCrypto", p.lbCrypto, j, false);
4933 getOptional<GroupAppTransport>("appTransport", p.appTransport, j);
4934 getOptional<bool>("allowLoopback", p.allowLoopback, j, false);
4935 getOptionalWithIndicator<RtpProfile>("rtpProfile", p.rtpProfile, j, &p._wasDeserialized_rtpProfile);
4936 getOptional<RangerPackets>("rangerPackets", p.rangerPackets, j);
4937 getOptional<TransportImpairment>("txImpairment", p.txImpairment, j);
4938 getOptional<TransportImpairment>("rxImpairment", p.rxImpairment, j);
4939 getOptional<std::vector<uint16_t>>("specializerAffinities", p.specializerAffinities, j);
4940 getOptional<uint32_t>("securityLevel", p.securityLevel, j, 0);
4941 getOptional<std::vector<Source>>("ignoreSources", p.ignoreSources, j);
4942 getOptional<std::string>("languageCode", p.languageCode, j);
4943 getOptional<std::string>("synVoice", p.synVoice, j);
4944
4945 getOptional<PacketCapturer>("rxCapture", p.rxCapture, j);
4946 getOptional<PacketCapturer>("txCapture", p.txCapture, j);
4947
4948 getOptional<uint16_t>("blobRtpPayloadType", p.blobRtpPayloadType, j, ENGAGE_DEFAULT_BLOB_RTP_PAYLOAD_TYPE);
4949
4950 getOptional<Group::InboundAliasGenerationPolicy_t>("inboundAliasGenerationPolicy", p.inboundAliasGenerationPolicy, j, Group::InboundAliasGenerationPolicy_t::iagpAnonymousAlias);
4951
4952 getOptional<AudioGate>("gateIn", p.gateIn, j);
4953
4954 getOptional<bool>("ignoreAudioTraffic", p.ignoreAudioTraffic, j, false);
4955
4956 FROMJSON_BASE_IMPL();
4957 }
4958
4959
4960 //-----------------------------------------------------------
4961 JSON_SERIALIZED_CLASS(Mission)
4963 {
4964 IMPLEMENT_JSON_SERIALIZATION()
4965 IMPLEMENT_JSON_DOCUMENTATION(Mission)
4966
4967 public:
4968 std::string id;
4969 std::string name;
4970 std::vector<Group> groups;
4971 std::chrono::system_clock::time_point begins;
4972 std::chrono::system_clock::time_point ends;
4973 std::string certStoreId;
4974 int multicastFailoverPolicy;
4975 Rallypoint rallypoint;
4976
4977 void clear()
4978 {
4979 id.clear();
4980 name.clear();
4981 groups.clear();
4982 certStoreId.clear();
4983 multicastFailoverPolicy = 0;
4984 rallypoint.clear();
4985 }
4986 };
4987
4988 static void to_json(nlohmann::json& j, const Mission& p)
4989 {
4990 j = nlohmann::json{
4991 TOJSON_IMPL(id),
4992 TOJSON_IMPL(name),
4993 TOJSON_IMPL(groups),
4994 TOJSON_IMPL(certStoreId),
4995 TOJSON_IMPL(multicastFailoverPolicy),
4996 TOJSON_IMPL(rallypoint)
4997 };
4998 }
4999
5000 static void from_json(const nlohmann::json& j, Mission& p)
5001 {
5002 p.clear();
5003 j.at("id").get_to(p.id);
5004 j.at("name").get_to(p.name);
5005
5006 // Groups are optional
5007 try
5008 {
5009 j.at("groups").get_to(p.groups);
5010 }
5011 catch(...)
5012 {
5013 p.groups.clear();
5014 }
5015
5016 FROMJSON_IMPL(certStoreId, std::string, EMPTY_STRING);
5017 FROMJSON_IMPL(multicastFailoverPolicy, int, 0);
5018 getOptional<Rallypoint>("rallypoint", p.rallypoint, j);
5019 }
5020
5021 //-----------------------------------------------------------
5022 JSON_SERIALIZED_CLASS(LicenseDescriptor)
5033 {
5034 IMPLEMENT_JSON_SERIALIZATION()
5035 IMPLEMENT_JSON_DOCUMENTATION(LicenseDescriptor)
5036
5037 public:
5043 static const int STATUS_OK = 0;
5044 static const int ERR_NULL_ENTITLEMENT_KEY = -1;
5045 static const int ERR_NULL_LICENSE_KEY = -2;
5046 static const int ERR_INVALID_LICENSE_KEY_LEN = -3;
5047 static const int ERR_LICENSE_KEY_VERIFICATION_FAILURE = -4;
5048 static const int ERR_ACTIVATION_CODE_VERIFICATION_FAILURE = -5;
5049 static const int ERR_INVALID_EXPIRATION_DATE = -6;
5050 static const int ERR_GENERAL_FAILURE = -7;
5051 static const int ERR_NOT_INITIALIZED = -8;
5052 static const int ERR_REQUIRES_ACTIVATION = -9;
5053 static const int ERR_LICENSE_NOT_SUITED_FOR_ACTIVATION = -10;
5061 static const uint8_t LIC_CARGO_FLAG_LIMIT_TO_FEATURES = 0x01;
5072 std::string entitlement;
5073
5080 std::string key;
5081
5083 std::string activationCode;
5084
5086 std::string deviceId;
5087
5089 int type;
5090
5092 time_t expires;
5093
5095 std::string expiresFormatted;
5096
5101 uint32_t flags;
5102
5104 std::string cargo;
5105
5107 uint8_t cargoFlags;
5108
5114
5116 std::string manufacturerId;
5117
5119 {
5120 clear();
5121 }
5122
5123 void clear()
5124 {
5125 entitlement.clear();
5126 key.clear();
5127 activationCode.clear();
5128 type = 0;
5129 expires = 0;
5130 expiresFormatted.clear();
5131 flags = 0;
5132 cargo.clear();
5133 cargoFlags = 0;
5134 deviceId.clear();
5135 status = ERR_NOT_INITIALIZED;
5136 manufacturerId.clear();
5137 }
5138 };
5139
5140 static void to_json(nlohmann::json& j, const LicenseDescriptor& p)
5141 {
5142 j = nlohmann::json{
5143 //TOJSON_IMPL(entitlement),
5144 {"entitlement", "*entitlement*"},
5145 TOJSON_IMPL(key),
5146 TOJSON_IMPL(activationCode),
5147 TOJSON_IMPL(type),
5148 TOJSON_IMPL(expires),
5149 TOJSON_IMPL(expiresFormatted),
5150 TOJSON_IMPL(flags),
5151 TOJSON_IMPL(deviceId),
5152 TOJSON_IMPL(status),
5153 //TOJSON_IMPL(manufacturerId),
5154 {"manufacturerId", "*manufacturerId*"},
5155 TOJSON_IMPL(cargo),
5156 TOJSON_IMPL(cargoFlags)
5157 };
5158 }
5159
5160 static void from_json(const nlohmann::json& j, LicenseDescriptor& p)
5161 {
5162 p.clear();
5163 FROMJSON_IMPL(entitlement, std::string, EMPTY_STRING);
5164 FROMJSON_IMPL(key, std::string, EMPTY_STRING);
5165 FROMJSON_IMPL(activationCode, std::string, EMPTY_STRING);
5166 FROMJSON_IMPL(type, int, 0);
5167 FROMJSON_IMPL(expires, time_t, 0);
5168 FROMJSON_IMPL(expiresFormatted, std::string, EMPTY_STRING);
5169 FROMJSON_IMPL(flags, uint32_t, 0);
5170 FROMJSON_IMPL(deviceId, std::string, EMPTY_STRING);
5171 FROMJSON_IMPL(status, int, LicenseDescriptor::ERR_NOT_INITIALIZED);
5172 FROMJSON_IMPL(manufacturerId, std::string, EMPTY_STRING);
5173 FROMJSON_IMPL(cargo, std::string, EMPTY_STRING);
5174 FROMJSON_IMPL(cargoFlags, uint8_t, 0);
5175 }
5176
5177
5178 //-----------------------------------------------------------
5179 JSON_SERIALIZED_CLASS(EngineNetworkingRpUdpStreaming)
5192 {
5193 IMPLEMENT_JSON_SERIALIZATION()
5194 IMPLEMENT_JSON_DOCUMENTATION(EngineNetworkingRpUdpStreaming)
5195
5196 public:
5199
5201 int port;
5202
5205
5208
5210 int ttl;
5211
5213 {
5214 clear();
5215 }
5216
5217 void clear()
5218 {
5219 enabled = false;
5220 port = 0;
5221 keepaliveIntervalSecs = 15;
5222 priority = TxPriority_t::priVoice;
5223 ttl = 64;
5224 }
5225
5226 virtual void initForDocumenting()
5227 {
5228 }
5229 };
5230
5231 static void to_json(nlohmann::json& j, const EngineNetworkingRpUdpStreaming& p)
5232 {
5233 j = nlohmann::json{
5234 TOJSON_IMPL(enabled),
5235 TOJSON_IMPL(port),
5236 TOJSON_IMPL(keepaliveIntervalSecs),
5237 TOJSON_IMPL(priority),
5238 TOJSON_IMPL(ttl)
5239 };
5240 }
5241 static void from_json(const nlohmann::json& j, EngineNetworkingRpUdpStreaming& p)
5242 {
5243 p.clear();
5244 getOptional<bool>("enabled", p.enabled, j, false);
5245 getOptional<int>("port", p.port, j, 0);
5246 getOptional<int>("keepaliveIntervalSecs", p.keepaliveIntervalSecs, j, 15);
5247 getOptional<TxPriority_t>("priority", p.priority, j, TxPriority_t::priVoice);
5248 getOptional<int>("ttl", p.ttl, j, 64);
5249 }
5250
5251 //-----------------------------------------------------------
5252 JSON_SERIALIZED_CLASS(EnginePolicyNetworking)
5262 {
5263 IMPLEMENT_JSON_SERIALIZATION()
5264 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyNetworking)
5265
5266 public:
5268 std::string defaultNic;
5269
5272
5275
5278
5281
5284
5287
5290
5292 {
5293 clear();
5294 }
5295
5296 void clear()
5297 {
5298 defaultNic.clear();
5299 multicastRejoinSecs = 8;
5300 rallypointRtTestIntervalMs = 60000;
5301 logRtpJitterBufferStats = false;
5302 preventMulticastFailover = false;
5303 addressResolutionPolicy = AddressResolutionPolicy_t::arpIpv6ThenIpv4;
5304
5305 rpUdpStreaming.clear();
5306 rtpProfile.clear();
5307 }
5308 };
5309
5310 static void to_json(nlohmann::json& j, const EnginePolicyNetworking& p)
5311 {
5312 j = nlohmann::json{
5313 TOJSON_IMPL(defaultNic),
5314 TOJSON_IMPL(multicastRejoinSecs),
5315
5316 TOJSON_IMPL(rallypointRtTestIntervalMs),
5317 TOJSON_IMPL(logRtpJitterBufferStats),
5318 TOJSON_IMPL(preventMulticastFailover),
5319
5320 TOJSON_IMPL(rpUdpStreaming),
5321 TOJSON_IMPL(rtpProfile),
5322 TOJSON_IMPL(addressResolutionPolicy)
5323 };
5324 }
5325 static void from_json(const nlohmann::json& j, EnginePolicyNetworking& p)
5326 {
5327 p.clear();
5328 FROMJSON_IMPL(defaultNic, std::string, EMPTY_STRING);
5329 FROMJSON_IMPL(multicastRejoinSecs, int, 8);
5330 FROMJSON_IMPL(rallypointRtTestIntervalMs, int, 60000);
5331 FROMJSON_IMPL(logRtpJitterBufferStats, bool, false);
5332 FROMJSON_IMPL(preventMulticastFailover, bool, false);
5333
5334 getOptional<EngineNetworkingRpUdpStreaming>("rpUdpStreaming", p.rpUdpStreaming, j);
5335 getOptional<RtpProfile>("rtpProfile", p.rtpProfile, j);
5336 getOptional<AddressResolutionPolicy_t>("addressResolutionPolicy", p.addressResolutionPolicy, j, AddressResolutionPolicy_t::arpIpv6ThenIpv4);
5337 }
5338
5339 //-----------------------------------------------------------
5340 JSON_SERIALIZED_CLASS(Aec)
5351 {
5352 IMPLEMENT_JSON_SERIALIZATION()
5353 IMPLEMENT_JSON_DOCUMENTATION(Aec)
5354
5355 public:
5361 typedef enum
5362 {
5364 aecmDefault = 0,
5365
5367 aecmLow = 1,
5368
5370 aecmMedium = 2,
5371
5373 aecmHigh = 3,
5374
5376 aecmVeryHigh = 4,
5377
5379 aecmHighest = 5
5380 } Mode_t;
5381
5384
5387
5390
5392 bool cng;
5393
5394 Aec()
5395 {
5396 clear();
5397 }
5398
5399 void clear()
5400 {
5401 enabled = false;
5402 mode = aecmDefault;
5403 speakerTailMs = 60;
5404 cng = true;
5405 }
5406 };
5407
5408 static void to_json(nlohmann::json& j, const Aec& p)
5409 {
5410 j = nlohmann::json{
5411 TOJSON_IMPL(enabled),
5412 TOJSON_IMPL(mode),
5413 TOJSON_IMPL(speakerTailMs),
5414 TOJSON_IMPL(cng)
5415 };
5416 }
5417 static void from_json(const nlohmann::json& j, Aec& p)
5418 {
5419 p.clear();
5420 FROMJSON_IMPL(enabled, bool, false);
5421 FROMJSON_IMPL(mode, Aec::Mode_t, Aec::Mode_t::aecmDefault);
5422 FROMJSON_IMPL(speakerTailMs, int, 60);
5423 FROMJSON_IMPL(cng, bool, true);
5424 }
5425
5426 //-----------------------------------------------------------
5427 JSON_SERIALIZED_CLASS(Vad)
5438 {
5439 IMPLEMENT_JSON_SERIALIZATION()
5440 IMPLEMENT_JSON_DOCUMENTATION(Vad)
5441
5442 public:
5448 typedef enum
5449 {
5451 vamDefault = 0,
5452
5454 vamLowBitRate = 1,
5455
5457 vamAggressive = 2,
5458
5460 vamVeryAggressive = 3
5461 } Mode_t;
5462
5465
5468
5469 Vad()
5470 {
5471 clear();
5472 }
5473
5474 void clear()
5475 {
5476 enabled = false;
5477 mode = vamDefault;
5478 }
5479 };
5480
5481 static void to_json(nlohmann::json& j, const Vad& p)
5482 {
5483 j = nlohmann::json{
5484 TOJSON_IMPL(enabled),
5485 TOJSON_IMPL(mode)
5486 };
5487 }
5488 static void from_json(const nlohmann::json& j, Vad& p)
5489 {
5490 p.clear();
5491 FROMJSON_IMPL(enabled, bool, false);
5492 FROMJSON_IMPL(mode, Vad::Mode_t, Vad::Mode_t::vamDefault);
5493 }
5494
5495 //-----------------------------------------------------------
5496 JSON_SERIALIZED_CLASS(Bridge)
5507 {
5508 IMPLEMENT_JSON_SERIALIZATION()
5509 IMPLEMENT_JSON_DOCUMENTATION(Bridge)
5510
5511 public:
5513 std::string id;
5514
5516 std::string name;
5517
5519 std::vector<std::string> groups;
5520
5523
5524 Bridge()
5525 {
5526 clear();
5527 }
5528
5529 void clear()
5530 {
5531 id.clear();
5532 name.clear();
5533 groups.clear();
5534 enabled = true;
5535 }
5536 };
5537
5538 static void to_json(nlohmann::json& j, const Bridge& p)
5539 {
5540 j = nlohmann::json{
5541 TOJSON_IMPL(id),
5542 TOJSON_IMPL(name),
5543 TOJSON_IMPL(groups),
5544 TOJSON_IMPL(enabled)
5545 };
5546 }
5547 static void from_json(const nlohmann::json& j, Bridge& p)
5548 {
5549 p.clear();
5550 FROMJSON_IMPL(id, std::string, EMPTY_STRING);
5551 FROMJSON_IMPL(name, std::string, EMPTY_STRING);
5552 getOptional<std::vector<std::string>>("groups", p.groups, j);
5553 FROMJSON_IMPL(enabled, bool, true);
5554 }
5555
5556 //-----------------------------------------------------------
5557 JSON_SERIALIZED_CLASS(AndroidAudio)
5568 {
5569 IMPLEMENT_JSON_SERIALIZATION()
5570 IMPLEMENT_JSON_DOCUMENTATION(AndroidAudio)
5571
5572 public:
5573 constexpr static int INVALID_SESSION_ID = -9999;
5574
5576 int api;
5577
5580
5583
5599
5607
5617
5620
5623
5624
5625 AndroidAudio()
5626 {
5627 clear();
5628 }
5629
5630 void clear()
5631 {
5632 api = 0;
5633 sharingMode = 0;
5634 performanceMode = 12;
5635 usage = 2;
5636 contentType = 1;
5637 inputPreset = 7;
5638 sessionId = AndroidAudio::INVALID_SESSION_ID;
5639 engineMode = 0;
5640 }
5641 };
5642
5643 static void to_json(nlohmann::json& j, const AndroidAudio& p)
5644 {
5645 j = nlohmann::json{
5646 TOJSON_IMPL(api),
5647 TOJSON_IMPL(sharingMode),
5648 TOJSON_IMPL(performanceMode),
5649 TOJSON_IMPL(usage),
5650 TOJSON_IMPL(contentType),
5651 TOJSON_IMPL(inputPreset),
5652 TOJSON_IMPL(sessionId),
5653 TOJSON_IMPL(engineMode)
5654 };
5655 }
5656 static void from_json(const nlohmann::json& j, AndroidAudio& p)
5657 {
5658 p.clear();
5659 FROMJSON_IMPL(api, int, 0);
5660 FROMJSON_IMPL(sharingMode, int, 0);
5661 FROMJSON_IMPL(performanceMode, int, 12);
5662 FROMJSON_IMPL(usage, int, 2);
5663 FROMJSON_IMPL(contentType, int, 1);
5664 FROMJSON_IMPL(inputPreset, int, 7);
5665 FROMJSON_IMPL(sessionId, int, AndroidAudio::INVALID_SESSION_ID);
5666 FROMJSON_IMPL(engineMode, int, 0);
5667 }
5668
5669 //-----------------------------------------------------------
5670 JSON_SERIALIZED_CLASS(EnginePolicyAudio)
5681 {
5682 IMPLEMENT_JSON_SERIALIZATION()
5683 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyAudio)
5684
5685 public:
5688
5691
5694
5697
5700
5703
5706
5709
5712
5715
5718
5721
5723 {
5724 clear();
5725 }
5726
5727 void clear()
5728 {
5729 enabled = true;
5730 hardwareEnabled = true;
5731 internalRate = 16000;
5732 internalChannels = 2;
5733 muteTxOnTx = false;
5734 aec.clear();
5735 vad.clear();
5736 android.clear();
5737 inputAgc.clear();
5738 outputAgc.clear();
5739 denoiseInput = false;
5740 denoiseOutput = false;
5741 }
5742 };
5743
5744 static void to_json(nlohmann::json& j, const EnginePolicyAudio& p)
5745 {
5746 j = nlohmann::json{
5747 TOJSON_IMPL(enabled),
5748 TOJSON_IMPL(hardwareEnabled),
5749 TOJSON_IMPL(internalRate),
5750 TOJSON_IMPL(internalChannels),
5751 TOJSON_IMPL(muteTxOnTx),
5752 TOJSON_IMPL(aec),
5753 TOJSON_IMPL(vad),
5754 TOJSON_IMPL(android),
5755 TOJSON_IMPL(inputAgc),
5756 TOJSON_IMPL(outputAgc),
5757 TOJSON_IMPL(denoiseInput),
5758 TOJSON_IMPL(denoiseOutput)
5759 };
5760 }
5761 static void from_json(const nlohmann::json& j, EnginePolicyAudio& p)
5762 {
5763 p.clear();
5764 getOptional<bool>("enabled", p.enabled, j, true);
5765 getOptional<bool>("hardwareEnabled", p.hardwareEnabled, j, true);
5766 FROMJSON_IMPL(internalRate, int, 16000);
5767 FROMJSON_IMPL(internalChannels, int, 2);
5768
5769 FROMJSON_IMPL(muteTxOnTx, bool, false);
5770 getOptional<Aec>("aec", p.aec, j);
5771 getOptional<Vad>("vad", p.vad, j);
5772 getOptional<AndroidAudio>("android", p.android, j);
5773 getOptional<Agc>("inputAgc", p.inputAgc, j);
5774 getOptional<Agc>("outputAgc", p.outputAgc, j);
5775 FROMJSON_IMPL(denoiseInput, bool, false);
5776 FROMJSON_IMPL(denoiseOutput, bool, false);
5777 }
5778
5779 //-----------------------------------------------------------
5780 JSON_SERIALIZED_CLASS(SecurityCertificate)
5791 {
5792 IMPLEMENT_JSON_SERIALIZATION()
5793 IMPLEMENT_JSON_DOCUMENTATION(SecurityCertificate)
5794
5795 public:
5796
5802 std::string certificate;
5803
5805 std::string key;
5806
5808 {
5809 clear();
5810 }
5811
5812 void clear()
5813 {
5814 certificate.clear();
5815 key.clear();
5816 }
5817 };
5818
5819 static void to_json(nlohmann::json& j, const SecurityCertificate& p)
5820 {
5821 j = nlohmann::json{
5822 TOJSON_IMPL(certificate),
5823 TOJSON_IMPL(key)
5824 };
5825 }
5826 static void from_json(const nlohmann::json& j, SecurityCertificate& p)
5827 {
5828 p.clear();
5829 FROMJSON_IMPL(certificate, std::string, EMPTY_STRING);
5830 FROMJSON_IMPL(key, std::string, EMPTY_STRING);
5831 }
5832
5833 // This is where spell checking stops
5834 //-----------------------------------------------------------
5835 JSON_SERIALIZED_CLASS(EnginePolicySecurity)
5836
5837
5847 {
5848 IMPLEMENT_JSON_SERIALIZATION()
5849 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicySecurity)
5850
5851 public:
5852
5864
5872 std::vector<std::string> caCertificates;
5873
5875 {
5876 clear();
5877 }
5878
5879 void clear()
5880 {
5881 certificate.clear();
5882 caCertificates.clear();
5883 }
5884 };
5885
5886 static void to_json(nlohmann::json& j, const EnginePolicySecurity& p)
5887 {
5888 j = nlohmann::json{
5889 TOJSON_IMPL(certificate),
5890 TOJSON_IMPL(caCertificates)
5891 };
5892 }
5893 static void from_json(const nlohmann::json& j, EnginePolicySecurity& p)
5894 {
5895 p.clear();
5896 getOptional("certificate", p.certificate, j);
5897 getOptional<std::vector<std::string>>("caCertificates", p.caCertificates, j);
5898 }
5899
5900 //-----------------------------------------------------------
5901 JSON_SERIALIZED_CLASS(EnginePolicyLogging)
5912 {
5913 IMPLEMENT_JSON_SERIALIZATION()
5914 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyLogging)
5915
5916 public:
5917
5934
5937
5939 {
5940 clear();
5941 }
5942
5943 void clear()
5944 {
5945 maxLevel = 4; // ILogger::Level::debug
5946 enableSyslog = false;
5947 }
5948 };
5949
5950 static void to_json(nlohmann::json& j, const EnginePolicyLogging& p)
5951 {
5952 j = nlohmann::json{
5953 TOJSON_IMPL(maxLevel),
5954 TOJSON_IMPL(enableSyslog)
5955 };
5956 }
5957 static void from_json(const nlohmann::json& j, EnginePolicyLogging& p)
5958 {
5959 p.clear();
5960 getOptional("maxLevel", p.maxLevel, j, 4); // ILogger::Level::debug
5961 getOptional("enableSyslog", p.enableSyslog, j);
5962 }
5963
5964
5965 //-----------------------------------------------------------
5966 JSON_SERIALIZED_CLASS(EnginePolicyDatabase)
5968 {
5969 IMPLEMENT_JSON_SERIALIZATION()
5970 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyDatabase)
5971
5972 public:
5973 typedef enum
5974 {
5975 dbtFixedMemory = 0,
5976 dbtPagedMemory = 1,
5977 dbtFixedFile = 2
5978 } DatabaseType_t;
5979
5980 DatabaseType_t type;
5981 std::string fixedFileName;
5982 bool forceMaintenance;
5983 bool reclaimSpace;
5984
5986 {
5987 clear();
5988 }
5989
5990 void clear()
5991 {
5992 type = DatabaseType_t::dbtFixedMemory;
5993 fixedFileName.clear();
5994 forceMaintenance = false;
5995 reclaimSpace = false;
5996 }
5997 };
5998
5999 static void to_json(nlohmann::json& j, const EnginePolicyDatabase& p)
6000 {
6001 j = nlohmann::json{
6002 TOJSON_IMPL(type),
6003 TOJSON_IMPL(fixedFileName),
6004 TOJSON_IMPL(forceMaintenance),
6005 TOJSON_IMPL(reclaimSpace)
6006 };
6007 }
6008 static void from_json(const nlohmann::json& j, EnginePolicyDatabase& p)
6009 {
6010 p.clear();
6011 FROMJSON_IMPL(type, EnginePolicyDatabase::DatabaseType_t, EnginePolicyDatabase::DatabaseType_t::dbtFixedMemory);
6012 FROMJSON_IMPL(fixedFileName, std::string, EMPTY_STRING);
6013 FROMJSON_IMPL(forceMaintenance, bool, false);
6014 FROMJSON_IMPL(reclaimSpace, bool, false);
6015 }
6016
6017
6018 //-----------------------------------------------------------
6019 JSON_SERIALIZED_CLASS(SecureSignature)
6028 {
6029 IMPLEMENT_JSON_SERIALIZATION()
6030 IMPLEMENT_JSON_DOCUMENTATION(SecureSignature)
6031
6032 public:
6033
6035 std::string certificate;
6036
6037 // /** @brief Contains the PEM-formatted text of the certificate's public key */
6038 //std::string publicKey;
6039
6041 std::string signature;
6042
6044 {
6045 clear();
6046 }
6047
6048 void clear()
6049 {
6050 certificate.clear();
6051 //publicKey.clear();
6052 signature.clear();
6053 }
6054 };
6055
6056 static void to_json(nlohmann::json& j, const SecureSignature& p)
6057 {
6058 j = nlohmann::json{
6059 TOJSON_IMPL(certificate),
6060 //TOJSON_IMPL(publicKey),
6061 TOJSON_IMPL(signature)
6062 };
6063 }
6064 static void from_json(const nlohmann::json& j, SecureSignature& p)
6065 {
6066 p.clear();
6067 FROMJSON_IMPL(certificate, std::string, EMPTY_STRING);
6068 //FROMJSON_IMPL(publicKey, std::string, EMPTY_STRING);
6069 FROMJSON_IMPL(signature, std::string, EMPTY_STRING);
6070 }
6071
6072 //-----------------------------------------------------------
6073 JSON_SERIALIZED_CLASS(NamedAudioDevice)
6075 {
6076 IMPLEMENT_JSON_SERIALIZATION()
6077 IMPLEMENT_JSON_DOCUMENTATION(NamedAudioDevice)
6078
6079 public:
6080 std::string name;
6081 std::string manufacturer;
6082 std::string model;
6083 std::string id;
6084 std::string serialNumber;
6085 std::string type;
6086 std::string extra;
6087 bool isDefault;
6088
6090 {
6091 clear();
6092 }
6093
6094 void clear()
6095 {
6096 name.clear();
6097 manufacturer.clear();
6098 model.clear();
6099 id.clear();
6100 serialNumber.clear();
6101 type.clear();
6102 extra.clear();
6103 isDefault = false;
6104 }
6105 };
6106
6107 static void to_json(nlohmann::json& j, const NamedAudioDevice& p)
6108 {
6109 j = nlohmann::json{
6110 TOJSON_IMPL(name),
6111 TOJSON_IMPL(manufacturer),
6112 TOJSON_IMPL(model),
6113 TOJSON_IMPL(id),
6114 TOJSON_IMPL(serialNumber),
6115 TOJSON_IMPL(type),
6116 TOJSON_IMPL(extra),
6117 TOJSON_IMPL(isDefault),
6118 };
6119 }
6120 static void from_json(const nlohmann::json& j, NamedAudioDevice& p)
6121 {
6122 p.clear();
6123 getOptional<std::string>("name", p.name, j, EMPTY_STRING);
6124 getOptional<std::string>("manufacturer", p.manufacturer, j, EMPTY_STRING);
6125 getOptional<std::string>("model", p.model, j, EMPTY_STRING);
6126 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
6127 getOptional<std::string>("serialNumber", p.serialNumber, j, EMPTY_STRING);
6128 getOptional<std::string>("type", p.type, j, EMPTY_STRING);
6129 getOptional<std::string>("extra", p.extra, j, EMPTY_STRING);
6130 getOptional<bool>("isDefault", p.isDefault, j, false);
6131 }
6132
6133
6134 //-----------------------------------------------------------
6135 JSON_SERIALIZED_CLASS(EnginePolicyNamedAudioDevices)
6137 {
6138 IMPLEMENT_JSON_SERIALIZATION()
6139 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyNamedAudioDevices)
6140
6141 public:
6142 std::vector<NamedAudioDevice> inputs;
6143 std::vector<NamedAudioDevice> outputs;
6144
6146 {
6147 clear();
6148 }
6149
6150 void clear()
6151 {
6152 inputs.clear();
6153 outputs.clear();
6154 }
6155 };
6156
6157 static void to_json(nlohmann::json& j, const EnginePolicyNamedAudioDevices& p)
6158 {
6159 j = nlohmann::json{
6160 TOJSON_IMPL(inputs),
6161 TOJSON_IMPL(outputs)
6162 };
6163 }
6164 static void from_json(const nlohmann::json& j, EnginePolicyNamedAudioDevices& p)
6165 {
6166 p.clear();
6167 getOptional<std::vector<NamedAudioDevice>>("inputs", p.inputs, j);
6168 getOptional<std::vector<NamedAudioDevice>>("outputs", p.outputs, j);
6169 }
6170
6171 //-----------------------------------------------------------
6172 JSON_SERIALIZED_CLASS(Licensing)
6185 {
6186 IMPLEMENT_JSON_SERIALIZATION()
6187 IMPLEMENT_JSON_DOCUMENTATION(Licensing)
6188
6189 public:
6190
6192 std::string entitlement;
6193
6195 std::string key;
6196
6198 std::string activationCode;
6199
6201 std::string deviceId;
6202
6204 std::string manufacturerId;
6205
6206 Licensing()
6207 {
6208 clear();
6209 }
6210
6211 void clear()
6212 {
6213 entitlement.clear();
6214 key.clear();
6215 activationCode.clear();
6216 deviceId.clear();
6217 manufacturerId.clear();
6218 }
6219 };
6220
6221 static void to_json(nlohmann::json& j, const Licensing& p)
6222 {
6223 j = nlohmann::json{
6224 TOJSON_IMPL(entitlement),
6225 TOJSON_IMPL(key),
6226 TOJSON_IMPL(activationCode),
6227 TOJSON_IMPL(deviceId),
6228 TOJSON_IMPL(manufacturerId)
6229 };
6230 }
6231 static void from_json(const nlohmann::json& j, Licensing& p)
6232 {
6233 p.clear();
6234 FROMJSON_IMPL(entitlement, std::string, EMPTY_STRING);
6235 FROMJSON_IMPL(key, std::string, EMPTY_STRING);
6236 FROMJSON_IMPL(activationCode, std::string, EMPTY_STRING);
6237 FROMJSON_IMPL(deviceId, std::string, EMPTY_STRING);
6238 FROMJSON_IMPL(manufacturerId, std::string, EMPTY_STRING);
6239 }
6240
6241 //-----------------------------------------------------------
6242 JSON_SERIALIZED_CLASS(DiscoveryMagellan)
6253 {
6254 IMPLEMENT_JSON_SERIALIZATION()
6255 IMPLEMENT_JSON_DOCUMENTATION(DiscoveryMagellan)
6256
6257 public:
6258
6261
6263 std::string interfaceName;
6264
6267
6270
6272 {
6273 clear();
6274 }
6275
6276 void clear()
6277 {
6278 enabled = false;
6279 interfaceName.clear();
6280 security.clear();
6281 tls.clear();
6282 }
6283 };
6284
6285 static void to_json(nlohmann::json& j, const DiscoveryMagellan& p)
6286 {
6287 j = nlohmann::json{
6288 TOJSON_IMPL(enabled),
6289 TOJSON_IMPL(interfaceName),
6290 TOJSON_IMPL(security),
6291 TOJSON_IMPL(tls)
6292 };
6293 }
6294 static void from_json(const nlohmann::json& j, DiscoveryMagellan& p)
6295 {
6296 p.clear();
6297 getOptional("enabled", p.enabled, j, false);
6298 getOptional<Tls>("tls", p.tls, j);
6299 getOptional<SecurityCertificate>("security", p.security, j);
6300 FROMJSON_IMPL(interfaceName, std::string, EMPTY_STRING);
6301 }
6302
6303 //-----------------------------------------------------------
6304 JSON_SERIALIZED_CLASS(DiscoverySsdp)
6315 {
6316 IMPLEMENT_JSON_SERIALIZATION()
6317 IMPLEMENT_JSON_DOCUMENTATION(DiscoverySsdp)
6318
6319 public:
6320
6323
6325 std::string interfaceName;
6326
6329
6331 std::vector<std::string> searchTerms;
6332
6335
6338
6340 {
6341 clear();
6342 }
6343
6344 void clear()
6345 {
6346 enabled = false;
6347 interfaceName.clear();
6348 address.clear();
6349 searchTerms.clear();
6350 ageTimeoutMs = 30000;
6351 advertising.clear();
6352 }
6353 };
6354
6355 static void to_json(nlohmann::json& j, const DiscoverySsdp& p)
6356 {
6357 j = nlohmann::json{
6358 TOJSON_IMPL(enabled),
6359 TOJSON_IMPL(interfaceName),
6360 TOJSON_IMPL(address),
6361 TOJSON_IMPL(searchTerms),
6362 TOJSON_IMPL(ageTimeoutMs),
6363 TOJSON_IMPL(advertising)
6364 };
6365 }
6366 static void from_json(const nlohmann::json& j, DiscoverySsdp& p)
6367 {
6368 p.clear();
6369 getOptional("enabled", p.enabled, j, false);
6370 getOptional<std::string>("interfaceName", p.interfaceName, j);
6371
6372 getOptional<NetworkAddress>("address", p.address, j);
6373 if(p.address.address.empty())
6374 {
6375 p.address.address = "255.255.255.255";
6376 }
6377 if(p.address.port <= 0)
6378 {
6379 p.address.port = 1900;
6380 }
6381
6382 getOptional<std::vector<std::string>>("searchTerms", p.searchTerms, j);
6383 getOptional<int>("ageTimeoutMs", p.ageTimeoutMs, j, 30000);
6384 getOptional<Advertising>("advertising", p.advertising, j);
6385 }
6386
6387 //-----------------------------------------------------------
6388 JSON_SERIALIZED_CLASS(DiscoverySap)
6399 {
6400 IMPLEMENT_JSON_SERIALIZATION()
6401 IMPLEMENT_JSON_DOCUMENTATION(DiscoverySap)
6402
6403 public:
6406
6408 std::string interfaceName;
6409
6412
6415
6418
6419 DiscoverySap()
6420 {
6421 clear();
6422 }
6423
6424 void clear()
6425 {
6426 enabled = false;
6427 interfaceName.clear();
6428 address.clear();
6429 ageTimeoutMs = 30000;
6430 advertising.clear();
6431 }
6432 };
6433
6434 static void to_json(nlohmann::json& j, const DiscoverySap& p)
6435 {
6436 j = nlohmann::json{
6437 TOJSON_IMPL(enabled),
6438 TOJSON_IMPL(interfaceName),
6439 TOJSON_IMPL(address),
6440 TOJSON_IMPL(ageTimeoutMs),
6441 TOJSON_IMPL(advertising)
6442 };
6443 }
6444 static void from_json(const nlohmann::json& j, DiscoverySap& p)
6445 {
6446 p.clear();
6447 getOptional("enabled", p.enabled, j, false);
6448 getOptional<std::string>("interfaceName", p.interfaceName, j);
6449 getOptional<NetworkAddress>("address", p.address, j);
6450 if(p.address.address.empty())
6451 {
6452 p.address.address = "224.2.127.254";
6453 }
6454 if(p.address.port <= 0)
6455 {
6456 p.address.port = 9875;
6457 }
6458
6459 getOptional<int>("ageTimeoutMs", p.ageTimeoutMs, j, 30000);
6460 getOptional<Advertising>("advertising", p.advertising, j);
6461 }
6462
6463 //-----------------------------------------------------------
6464 JSON_SERIALIZED_CLASS(DiscoveryCistech)
6477 {
6478 IMPLEMENT_JSON_SERIALIZATION()
6479 IMPLEMENT_JSON_DOCUMENTATION(DiscoveryCistech)
6480
6481 public:
6482 bool enabled;
6483 std::string interfaceName;
6484 NetworkAddress address;
6485 int ageTimeoutMs;
6486
6488 {
6489 clear();
6490 }
6491
6492 void clear()
6493 {
6494 enabled = false;
6495 interfaceName.clear();
6496 address.clear();
6497 ageTimeoutMs = 30000;
6498 }
6499 };
6500
6501 static void to_json(nlohmann::json& j, const DiscoveryCistech& p)
6502 {
6503 j = nlohmann::json{
6504 TOJSON_IMPL(enabled),
6505 TOJSON_IMPL(interfaceName),
6506 TOJSON_IMPL(address),
6507 TOJSON_IMPL(ageTimeoutMs)
6508 };
6509 }
6510 static void from_json(const nlohmann::json& j, DiscoveryCistech& p)
6511 {
6512 p.clear();
6513 getOptional("enabled", p.enabled, j, false);
6514 getOptional<std::string>("interfaceName", p.interfaceName, j);
6515 getOptional<NetworkAddress>("address", p.address, j);
6516 getOptional<int>("ageTimeoutMs", p.ageTimeoutMs, j, 30000);
6517 }
6518
6519
6520 //-----------------------------------------------------------
6521 JSON_SERIALIZED_CLASS(DiscoveryTrellisware)
6532 {
6533 IMPLEMENT_JSON_SERIALIZATION()
6534 IMPLEMENT_JSON_DOCUMENTATION(DiscoveryTrellisware)
6535
6536 public:
6537
6540
6543
6545 {
6546 clear();
6547 }
6548
6549 void clear()
6550 {
6551 enabled = false;
6552 security.clear();
6553 }
6554 };
6555
6556 static void to_json(nlohmann::json& j, const DiscoveryTrellisware& p)
6557 {
6558 j = nlohmann::json{
6559 TOJSON_IMPL(enabled),
6560 TOJSON_IMPL(security)
6561 };
6562 }
6563 static void from_json(const nlohmann::json& j, DiscoveryTrellisware& p)
6564 {
6565 p.clear();
6566 getOptional("enabled", p.enabled, j, false);
6567 getOptional<SecurityCertificate>("security", p.security, j);
6568 }
6569
6570 //-----------------------------------------------------------
6571 JSON_SERIALIZED_CLASS(DiscoveryConfiguration)
6582 {
6583 IMPLEMENT_JSON_SERIALIZATION()
6584 IMPLEMENT_JSON_DOCUMENTATION(DiscoveryConfiguration)
6585
6586 public:
6589
6592
6595
6598
6601
6603 {
6604 clear();
6605 }
6606
6607 void clear()
6608 {
6609 magellan.clear();
6610 ssdp.clear();
6611 sap.clear();
6612 cistech.clear();
6613 }
6614 };
6615
6616 static void to_json(nlohmann::json& j, const DiscoveryConfiguration& p)
6617 {
6618 j = nlohmann::json{
6619 TOJSON_IMPL(magellan),
6620 TOJSON_IMPL(ssdp),
6621 TOJSON_IMPL(sap),
6622 TOJSON_IMPL(cistech),
6623 TOJSON_IMPL(trellisware)
6624 };
6625 }
6626 static void from_json(const nlohmann::json& j, DiscoveryConfiguration& p)
6627 {
6628 p.clear();
6629 getOptional<DiscoveryMagellan>("magellan", p.magellan, j);
6630 getOptional<DiscoverySsdp>("ssdp", p.ssdp, j);
6631 getOptional<DiscoverySap>("sap", p.sap, j);
6632 getOptional<DiscoveryCistech>("cistech", p.cistech, j);
6633 getOptional<DiscoveryTrellisware>("trellisware", p.trellisware, j);
6634 }
6635
6636
6637 //-----------------------------------------------------------
6638 JSON_SERIALIZED_CLASS(EnginePolicyInternals)
6651 {
6652 IMPLEMENT_JSON_SERIALIZATION()
6653 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyInternals)
6654
6655 public:
6658
6661
6664
6665 int maxRxSecs;
6666
6667 int logTaskQueueStatsIntervalMs;
6668
6669 bool enableLazySpeakerClosure;
6670
6673
6676
6679
6682
6685
6688
6691
6693 {
6694 clear();
6695 }
6696
6697 void clear()
6698 {
6699 watchdog.clear();
6700 housekeeperIntervalMs = 1000;
6701 logTaskQueueStatsIntervalMs = 0;
6702 maxTxSecs = 30;
6703 maxRxSecs = 0;
6704 enableLazySpeakerClosure = false;
6705 rpClusterStrategy = RallypointCluster::ConnectionStrategy_t::csRoundRobin;
6706 rpClusterRolloverSecs = 10;
6707 rtpExpirationCheckIntervalMs = 250;
6708 rpConnectionTimeoutSecs = 5;
6709 stickyTidHangSecs = 10;
6710 uriStreamingIntervalMs = 60;
6711 delayedMicrophoneClosureSecs = 15;
6712 }
6713 };
6714
6715 static void to_json(nlohmann::json& j, const EnginePolicyInternals& p)
6716 {
6717 j = nlohmann::json{
6718 TOJSON_IMPL(watchdog),
6719 TOJSON_IMPL(housekeeperIntervalMs),
6720 TOJSON_IMPL(logTaskQueueStatsIntervalMs),
6721 TOJSON_IMPL(maxTxSecs),
6722 TOJSON_IMPL(maxRxSecs),
6723 TOJSON_IMPL(enableLazySpeakerClosure),
6724 TOJSON_IMPL(rpClusterStrategy),
6725 TOJSON_IMPL(rpClusterRolloverSecs),
6726 TOJSON_IMPL(rtpExpirationCheckIntervalMs),
6727 TOJSON_IMPL(rpConnectionTimeoutSecs),
6728 TOJSON_IMPL(stickyTidHangSecs),
6729 TOJSON_IMPL(uriStreamingIntervalMs),
6730 TOJSON_IMPL(delayedMicrophoneClosureSecs)
6731 };
6732 }
6733 static void from_json(const nlohmann::json& j, EnginePolicyInternals& p)
6734 {
6735 p.clear();
6736 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
6737 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
6738 getOptional<int>("logTaskQueueStatsIntervalMs", p.logTaskQueueStatsIntervalMs, j, 0);
6739 getOptional<int>("maxTxSecs", p.maxTxSecs, j, 30);
6740 getOptional<int>("maxRxSecs", p.maxRxSecs, j, 0);
6741 getOptional<bool>("enableLazySpeakerClosure", p.enableLazySpeakerClosure, j, false);
6742 getOptional<RallypointCluster::ConnectionStrategy_t>("rpClusterStrategy", p.rpClusterStrategy, j, RallypointCluster::ConnectionStrategy_t::csRoundRobin);
6743 getOptional<int>("rpClusterRolloverSecs", p.rpClusterRolloverSecs, j, 10);
6744 getOptional<int>("rtpExpirationCheckIntervalMs", p.rtpExpirationCheckIntervalMs, j, 250);
6745 getOptional<int>("rpConnectionTimeoutSecs", p.rpConnectionTimeoutSecs, j, 5);
6746 getOptional<int>("stickyTidHangSecs", p.stickyTidHangSecs, j, 10);
6747 getOptional<int>("uriStreamingIntervalMs", p.uriStreamingIntervalMs, j, 60);
6748 getOptional<int>("delayedMicrophoneClosureSecs", p.delayedMicrophoneClosureSecs, j, 15);
6749 }
6750
6751 //-----------------------------------------------------------
6752 JSON_SERIALIZED_CLASS(EnginePolicyTimelines)
6765 {
6766 IMPLEMENT_JSON_SERIALIZATION()
6767 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyTimelines)
6768
6769 public:
6770
6777
6779 std::string storageRoot;
6780
6783
6786
6789
6792
6801
6804
6807
6810
6812 {
6813 clear();
6814 }
6815
6816 void clear()
6817 {
6818 enabled = true;
6819 storageRoot.clear();
6820 maxStorageMb = 1024; // 1 Gigabyte
6821 maxEventAgeSecs = (86400 * 30); // 30 days
6822 groomingIntervalSecs = (60 * 30); // 30 minutes
6823 maxEvents = 1000;
6824 autosaveIntervalSecs = 5;
6825 security.clear();
6826 disableSigningAndVerification = false;
6827 ephemeral = false;
6828 }
6829 };
6830
6831 static void to_json(nlohmann::json& j, const EnginePolicyTimelines& p)
6832 {
6833 j = nlohmann::json{
6834 TOJSON_IMPL(enabled),
6835 TOJSON_IMPL(storageRoot),
6836 TOJSON_IMPL(maxStorageMb),
6837 TOJSON_IMPL(maxEventAgeSecs),
6838 TOJSON_IMPL(maxEvents),
6839 TOJSON_IMPL(groomingIntervalSecs),
6840 TOJSON_IMPL(autosaveIntervalSecs),
6841 TOJSON_IMPL(security),
6842 TOJSON_IMPL(disableSigningAndVerification),
6843 TOJSON_IMPL(ephemeral)
6844 };
6845 }
6846 static void from_json(const nlohmann::json& j, EnginePolicyTimelines& p)
6847 {
6848 p.clear();
6849 getOptional<bool>("enabled", p.enabled, j, true);
6850 getOptional<std::string>("storageRoot", p.storageRoot, j, EMPTY_STRING);
6851
6852 getOptional<int>("maxStorageMb", p.maxStorageMb, j, 1024);
6853 getOptional<long>("maxEventAgeSecs", p.maxEventAgeSecs, j, (86400 * 30));
6854 getOptional<long>("groomingIntervalSecs", p.groomingIntervalSecs, j, (60 * 30));
6855 getOptional<long>("autosaveIntervalSecs", p.autosaveIntervalSecs, j, 5);
6856 getOptional<int>("maxEvents", p.maxEvents, j, 1000);
6857 getOptional<SecurityCertificate>("security", p.security, j);
6858 getOptional<bool>("disableSigningAndVerification", p.disableSigningAndVerification, j, false);
6859 getOptional<bool>("ephemeral", p.ephemeral, j, false);
6860 }
6861
6862
6863 //-----------------------------------------------------------
6864 JSON_SERIALIZED_CLASS(RtpMapEntry)
6875 {
6876 IMPLEMENT_JSON_SERIALIZATION()
6877 IMPLEMENT_JSON_DOCUMENTATION(RtpMapEntry)
6878
6879 public:
6881 std::string name;
6882
6885
6888
6889 RtpMapEntry()
6890 {
6891 clear();
6892 }
6893
6894 void clear()
6895 {
6896 name.clear();
6897 engageType = -1;
6898 rtpPayloadType = -1;
6899 }
6900 };
6901
6902 static void to_json(nlohmann::json& j, const RtpMapEntry& p)
6903 {
6904 j = nlohmann::json{
6905 TOJSON_IMPL(name),
6906 TOJSON_IMPL(engageType),
6907 TOJSON_IMPL(rtpPayloadType)
6908 };
6909 }
6910 static void from_json(const nlohmann::json& j, RtpMapEntry& p)
6911 {
6912 p.clear();
6913 getOptional<std::string>("name", p.name, j, EMPTY_STRING);
6914 getOptional<int>("engageType", p.engageType, j, -1);
6915 getOptional<int>("rtpPayloadType", p.rtpPayloadType, j, -1);
6916 }
6917
6918 //-----------------------------------------------------------
6919 JSON_SERIALIZED_CLASS(ExternalModule)
6930 {
6931 IMPLEMENT_JSON_SERIALIZATION()
6932 IMPLEMENT_JSON_DOCUMENTATION(ExternalModule)
6933
6934 public:
6936 std::string name;
6937
6939 std::string file;
6940
6942 nlohmann::json configuration;
6943
6945 {
6946 clear();
6947 }
6948
6949 void clear()
6950 {
6951 name.clear();
6952 file.clear();
6953 configuration.clear();
6954 }
6955 };
6956
6957 static void to_json(nlohmann::json& j, const ExternalModule& p)
6958 {
6959 j = nlohmann::json{
6960 TOJSON_IMPL(name),
6961 TOJSON_IMPL(file)
6962 };
6963
6964 if(!p.configuration.empty())
6965 {
6966 j["configuration"] = p.configuration;
6967 }
6968 }
6969 static void from_json(const nlohmann::json& j, ExternalModule& p)
6970 {
6971 p.clear();
6972 getOptional<std::string>("name", p.name, j, EMPTY_STRING);
6973 getOptional<std::string>("file", p.file, j, EMPTY_STRING);
6974
6975 try
6976 {
6977 p.configuration = j.at("configuration");
6978 }
6979 catch(...)
6980 {
6981 p.configuration.clear();
6982 }
6983 }
6984
6985
6986 //-----------------------------------------------------------
6987 JSON_SERIALIZED_CLASS(ExternalCodecDescriptor)
6998 {
6999 IMPLEMENT_JSON_SERIALIZATION()
7000 IMPLEMENT_JSON_DOCUMENTATION(ExternalCodecDescriptor)
7001
7002 public:
7005
7008
7011
7014
7016 {
7017 clear();
7018 }
7019
7020 void clear()
7021 {
7022 rtpPayloadType = -1;
7023 samplingRate = -1;
7024 channels = -1;
7025 rtpTsMultiplier = 0;
7026 }
7027 };
7028
7029 static void to_json(nlohmann::json& j, const ExternalCodecDescriptor& p)
7030 {
7031 j = nlohmann::json{
7032 TOJSON_IMPL(rtpPayloadType),
7033 TOJSON_IMPL(samplingRate),
7034 TOJSON_IMPL(channels),
7035 TOJSON_IMPL(rtpTsMultiplier)
7036 };
7037 }
7038 static void from_json(const nlohmann::json& j, ExternalCodecDescriptor& p)
7039 {
7040 p.clear();
7041
7042 getOptional<int>("rtpPayloadType", p.rtpPayloadType, j, -1);
7043 getOptional<int>("samplingRate", p.samplingRate, j, -1);
7044 getOptional<int>("channels", p.channels, j, -1);
7045 getOptional<int>("rtpTsMultiplier", p.rtpTsMultiplier, j, -1);
7046 }
7047
7048 //-----------------------------------------------------------
7049 JSON_SERIALIZED_CLASS(EnginePolicy)
7062 {
7063 IMPLEMENT_JSON_SERIALIZATION()
7064 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicy)
7065
7066 public:
7067
7069 std::string dataDirectory;
7070
7073
7076
7079
7082
7085
7088
7091
7094
7097
7100
7103
7105 std::vector<ExternalModule> externalCodecs;
7106
7108 std::vector<RtpMapEntry> rtpMap;
7109
7110 EnginePolicy()
7111 {
7112 clear();
7113 }
7114
7115 void clear()
7116 {
7117 dataDirectory.clear();
7118 licensing.clear();
7119 security.clear();
7120 networking.clear();
7121 audio.clear();
7122 discovery.clear();
7123 logging.clear();
7124 internals.clear();
7125 timelines.clear();
7126 database.clear();
7127 featureset.clear();
7128 namedAudioDevices.clear();
7129 externalCodecs.clear();
7130 rtpMap.clear();
7131 }
7132 };
7133
7134 static void to_json(nlohmann::json& j, const EnginePolicy& p)
7135 {
7136 j = nlohmann::json{
7137 TOJSON_IMPL(dataDirectory),
7138 TOJSON_IMPL(licensing),
7139 TOJSON_IMPL(security),
7140 TOJSON_IMPL(networking),
7141 TOJSON_IMPL(audio),
7142 TOJSON_IMPL(discovery),
7143 TOJSON_IMPL(logging),
7144 TOJSON_IMPL(internals),
7145 TOJSON_IMPL(timelines),
7146 TOJSON_IMPL(database),
7147 TOJSON_IMPL(featureset),
7148 TOJSON_IMPL(namedAudioDevices),
7149 TOJSON_IMPL(externalCodecs),
7150 TOJSON_IMPL(rtpMap)
7151 };
7152 }
7153 static void from_json(const nlohmann::json& j, EnginePolicy& p)
7154 {
7155 p.clear();
7156 FROMJSON_IMPL_SIMPLE(dataDirectory);
7157 FROMJSON_IMPL_SIMPLE(licensing);
7158 FROMJSON_IMPL_SIMPLE(security);
7159 FROMJSON_IMPL_SIMPLE(networking);
7160 FROMJSON_IMPL_SIMPLE(audio);
7161 FROMJSON_IMPL_SIMPLE(discovery);
7162 FROMJSON_IMPL_SIMPLE(logging);
7163 FROMJSON_IMPL_SIMPLE(internals);
7164 FROMJSON_IMPL_SIMPLE(timelines);
7165 FROMJSON_IMPL_SIMPLE(database);
7166 FROMJSON_IMPL_SIMPLE(featureset);
7167 FROMJSON_IMPL_SIMPLE(namedAudioDevices);
7168 FROMJSON_IMPL_SIMPLE(externalCodecs);
7169 FROMJSON_IMPL_SIMPLE(rtpMap);
7170 }
7171
7172
7173 //-----------------------------------------------------------
7174 JSON_SERIALIZED_CLASS(TalkgroupAsset)
7185 {
7186 IMPLEMENT_JSON_SERIALIZATION()
7187 IMPLEMENT_JSON_DOCUMENTATION(TalkgroupAsset)
7188
7189 public:
7190
7192 std::string nodeId;
7193
7196
7198 {
7199 clear();
7200 }
7201
7202 void clear()
7203 {
7204 nodeId.clear();
7205 group.clear();
7206 }
7207 };
7208
7209 static void to_json(nlohmann::json& j, const TalkgroupAsset& p)
7210 {
7211 j = nlohmann::json{
7212 TOJSON_IMPL(nodeId),
7213 TOJSON_IMPL(group)
7214 };
7215 }
7216 static void from_json(const nlohmann::json& j, TalkgroupAsset& p)
7217 {
7218 p.clear();
7219 getOptional<std::string>("nodeId", p.nodeId, j);
7220 getOptional<Group>("group", p.group, j);
7221 }
7222
7223 //-----------------------------------------------------------
7224 JSON_SERIALIZED_CLASS(EngageDiscoveredGroup)
7233 {
7234 IMPLEMENT_JSON_SERIALIZATION()
7235 IMPLEMENT_JSON_DOCUMENTATION(EngageDiscoveredGroup)
7236
7237 public:
7239 std::string id;
7240
7242 int type;
7243
7246
7249
7251 {
7252 clear();
7253 }
7254
7255 void clear()
7256 {
7257 id.clear();
7258 type = 0;
7259 rx.clear();
7260 tx.clear();
7261 }
7262 };
7263
7264 static void to_json(nlohmann::json& j, const EngageDiscoveredGroup& p)
7265 {
7266 j = nlohmann::json{
7267 TOJSON_IMPL(id),
7268 TOJSON_IMPL(type),
7269 TOJSON_IMPL(rx),
7270 TOJSON_IMPL(tx)
7271 };
7272 }
7273 static void from_json(const nlohmann::json& j, EngageDiscoveredGroup& p)
7274 {
7275 p.clear();
7276 getOptional<std::string>("id", p.id, j);
7277 getOptional<int>("type", p.type, j, 0);
7278 getOptional<NetworkAddress>("rx", p.rx, j);
7279 getOptional<NetworkAddress>("tx", p.tx, j);
7280 }
7281
7282 //-----------------------------------------------------------
7283 JSON_SERIALIZED_CLASS(RallypointPeer)
7294 {
7295 IMPLEMENT_JSON_SERIALIZATION()
7296 IMPLEMENT_JSON_DOCUMENTATION(RallypointPeer)
7297
7298 public:
7300 std::string id;
7301
7304
7307
7310
7313
7316
7318 {
7319 clear();
7320 }
7321
7322 void clear()
7323 {
7324 id.clear();
7325 enabled = true;
7326 host.clear();
7327 certificate.clear();
7328 connectionTimeoutSecs = 0;
7329 forceIsMeshLeaf = false;
7330 }
7331 };
7332
7333 static void to_json(nlohmann::json& j, const RallypointPeer& p)
7334 {
7335 j = nlohmann::json{
7336 TOJSON_IMPL(id),
7337 TOJSON_IMPL(enabled),
7338 TOJSON_IMPL(host),
7339 TOJSON_IMPL(certificate),
7340 TOJSON_IMPL(connectionTimeoutSecs),
7341 TOJSON_IMPL(forceIsMeshLeaf)
7342 };
7343 }
7344 static void from_json(const nlohmann::json& j, RallypointPeer& p)
7345 {
7346 p.clear();
7347 j.at("id").get_to(p.id);
7348 getOptional<bool>("enabled", p.enabled, j, true);
7349 getOptional<NetworkAddress>("host", p.host, j);
7350 getOptional<SecurityCertificate>("certificate", p.certificate, j);
7351 getOptional<int>("connectionTimeoutSecs", p.connectionTimeoutSecs, j, 0);
7352 getOptional<bool>("forceIsMeshLeaf", p.forceIsMeshLeaf, j, false);
7353 }
7354
7355 //-----------------------------------------------------------
7356 JSON_SERIALIZED_CLASS(RallypointServerLimits)
7367 {
7368 IMPLEMENT_JSON_SERIALIZATION()
7369 IMPLEMENT_JSON_DOCUMENTATION(RallypointServerLimits)
7370
7371 public:
7373 uint32_t maxClients;
7374
7376 uint32_t maxPeers;
7377
7380
7383
7386
7389
7392
7395
7398
7401
7404
7407
7410
7413
7416
7418 {
7419 clear();
7420 }
7421
7422 void clear()
7423 {
7424 maxClients = 0;
7425 maxPeers = 0;
7426 maxMulticastReflectors = 0;
7427 maxRegisteredStreams = 0;
7428 maxStreamPaths = 0;
7429 maxRxPacketsPerSec = 0;
7430 maxTxPacketsPerSec = 0;
7431 maxRxBytesPerSec = 0;
7432 maxTxBytesPerSec = 0;
7433 maxQOpsPerSec = 0;
7434 maxInboundBacklog = 64;
7435 lowPriorityQueueThreshold = 64;
7436 normalPriorityQueueThreshold = 256;
7437 denyNewConnectionCpuThreshold = 75;
7438 warnAtCpuThreshold = 65;
7439 }
7440 };
7441
7442 static void to_json(nlohmann::json& j, const RallypointServerLimits& p)
7443 {
7444 j = nlohmann::json{
7445 TOJSON_IMPL(maxClients),
7446 TOJSON_IMPL(maxPeers),
7447 TOJSON_IMPL(maxMulticastReflectors),
7448 TOJSON_IMPL(maxRegisteredStreams),
7449 TOJSON_IMPL(maxStreamPaths),
7450 TOJSON_IMPL(maxRxPacketsPerSec),
7451 TOJSON_IMPL(maxTxPacketsPerSec),
7452 TOJSON_IMPL(maxRxBytesPerSec),
7453 TOJSON_IMPL(maxTxBytesPerSec),
7454 TOJSON_IMPL(maxQOpsPerSec),
7455 TOJSON_IMPL(maxInboundBacklog),
7456 TOJSON_IMPL(lowPriorityQueueThreshold),
7457 TOJSON_IMPL(normalPriorityQueueThreshold),
7458 TOJSON_IMPL(denyNewConnectionCpuThreshold),
7459 TOJSON_IMPL(warnAtCpuThreshold)
7460 };
7461 }
7462 static void from_json(const nlohmann::json& j, RallypointServerLimits& p)
7463 {
7464 p.clear();
7465 getOptional<uint32_t>("maxClients", p.maxClients, j, 0);
7466 getOptional<uint32_t>("maxPeers", p.maxPeers, j, 0);
7467 getOptional<uint32_t>("maxMulticastReflectors", p.maxMulticastReflectors, j, 0);
7468 getOptional<uint32_t>("maxRegisteredStreams", p.maxRegisteredStreams, j, 0);
7469 getOptional<uint32_t>("maxStreamPaths", p.maxStreamPaths, j, 0);
7470 getOptional<uint32_t>("maxRxPacketsPerSec", p.maxRxPacketsPerSec, j, 0);
7471 getOptional<uint32_t>("maxTxPacketsPerSec", p.maxTxPacketsPerSec, j, 0);
7472 getOptional<uint32_t>("maxRxBytesPerSec", p.maxRxBytesPerSec, j, 0);
7473 getOptional<uint32_t>("maxTxBytesPerSec", p.maxTxBytesPerSec, j, 0);
7474 getOptional<uint32_t>("maxQOpsPerSec", p.maxQOpsPerSec, j, 0);
7475 getOptional<uint32_t>("maxInboundBacklog", p.maxInboundBacklog, j, 64);
7476 getOptional<uint32_t>("lowPriorityQueueThreshold", p.lowPriorityQueueThreshold, j, 64);
7477 getOptional<uint32_t>("normalPriorityQueueThreshold", p.normalPriorityQueueThreshold, j, 256);
7478 getOptional<uint32_t>("denyNewConnectionCpuThreshold", p.denyNewConnectionCpuThreshold, j, 75);
7479 getOptional<uint32_t>("warnAtCpuThreshold", p.warnAtCpuThreshold, j, 65);
7480 }
7481
7482 //-----------------------------------------------------------
7483 JSON_SERIALIZED_CLASS(RallypointServerStatusReportConfiguration)
7494 {
7495 IMPLEMENT_JSON_SERIALIZATION()
7496 IMPLEMENT_JSON_DOCUMENTATION(RallypointServerStatusReportConfiguration)
7497
7498 public:
7500 std::string fileName;
7501
7504
7507
7510
7513
7516
7518 std::string runCmd;
7519
7521 {
7522 clear();
7523 }
7524
7525 void clear()
7526 {
7527 fileName.clear();
7528 intervalSecs = 60;
7529 enabled = false;
7530 includeLinks = false;
7531 includePeerLinkDetails = false;
7532 includeClientLinkDetails = false;
7533 runCmd.clear();
7534 }
7535 };
7536
7537 static void to_json(nlohmann::json& j, const RallypointServerStatusReportConfiguration& p)
7538 {
7539 j = nlohmann::json{
7540 TOJSON_IMPL(fileName),
7541 TOJSON_IMPL(intervalSecs),
7542 TOJSON_IMPL(enabled),
7543 TOJSON_IMPL(includeLinks),
7544 TOJSON_IMPL(includePeerLinkDetails),
7545 TOJSON_IMPL(includeClientLinkDetails),
7546 TOJSON_IMPL(runCmd)
7547 };
7548 }
7549 static void from_json(const nlohmann::json& j, RallypointServerStatusReportConfiguration& p)
7550 {
7551 p.clear();
7552 getOptional<std::string>("fileName", p.fileName, j);
7553 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
7554 getOptional<bool>("enabled", p.enabled, j, false);
7555 getOptional<bool>("includeLinks", p.includeLinks, j, false);
7556 getOptional<bool>("includePeerLinkDetails", p.includePeerLinkDetails, j, false);
7557 getOptional<bool>("includeClientLinkDetails", p.includeClientLinkDetails, j, false);
7558 getOptional<std::string>("runCmd", p.runCmd, j);
7559 }
7560
7561 //-----------------------------------------------------------
7562 JSON_SERIALIZED_CLASS(RallypointServerLinkGraph)
7564 {
7565 IMPLEMENT_JSON_SERIALIZATION()
7566 IMPLEMENT_JSON_DOCUMENTATION(RallypointServerLinkGraph)
7567
7568 public:
7570 std::string fileName;
7571
7574
7577
7580
7585
7587 std::string coreRpStyling;
7588
7590 std::string leafRpStyling;
7591
7593 std::string clientStyling;
7594
7596 std::string runCmd;
7597
7599 {
7600 clear();
7601 }
7602
7603 void clear()
7604 {
7605 fileName.clear();
7606 minRefreshSecs = 5;
7607 enabled = false;
7608 includeDigraphEnclosure = true;
7609 includeClients = false;
7610 coreRpStyling = "[shape=hexagon color=firebrick style=filled]";
7611 leafRpStyling = "[shape=box color=gray style=filled]";
7612 clientStyling.clear();
7613 runCmd.clear();
7614 }
7615 };
7616
7617 static void to_json(nlohmann::json& j, const RallypointServerLinkGraph& p)
7618 {
7619 j = nlohmann::json{
7620 TOJSON_IMPL(fileName),
7621 TOJSON_IMPL(minRefreshSecs),
7622 TOJSON_IMPL(enabled),
7623 TOJSON_IMPL(includeDigraphEnclosure),
7624 TOJSON_IMPL(includeClients),
7625 TOJSON_IMPL(coreRpStyling),
7626 TOJSON_IMPL(leafRpStyling),
7627 TOJSON_IMPL(clientStyling),
7628 TOJSON_IMPL(runCmd)
7629 };
7630 }
7631 static void from_json(const nlohmann::json& j, RallypointServerLinkGraph& p)
7632 {
7633 p.clear();
7634 getOptional<std::string>("fileName", p.fileName, j);
7635 getOptional<int>("minRefreshSecs", p.minRefreshSecs, j, 5);
7636 getOptional<bool>("enabled", p.enabled, j, false);
7637 getOptional<bool>("includeDigraphEnclosure", p.includeDigraphEnclosure, j, true);
7638 getOptional<bool>("includeClients", p.includeClients, j, false);
7639 getOptional<std::string>("coreRpStyling", p.coreRpStyling, j, "[shape=hexagon color=firebrick style=filled]");
7640 getOptional<std::string>("leafRpStyling", p.leafRpStyling, j, "[shape=box color=gray style=filled]");
7641 getOptional<std::string>("clientStyling", p.clientStyling, j);
7642 getOptional<std::string>("runCmd", p.runCmd, j);
7643 }
7644
7645
7646 //-----------------------------------------------------------
7647 JSON_SERIALIZED_CLASS(RallypointServerRouteMap)
7649 {
7650 IMPLEMENT_JSON_SERIALIZATION()
7651 IMPLEMENT_JSON_DOCUMENTATION(RallypointServerRouteMap)
7652
7653 public:
7655 std::string fileName;
7656
7659
7662
7664 std::string runCmd;
7665
7667 {
7668 clear();
7669 }
7670
7671 void clear()
7672 {
7673 fileName.clear();
7674 minRefreshSecs = 5;
7675 enabled = false;
7676 }
7677 };
7678
7679 static void to_json(nlohmann::json& j, const RallypointServerRouteMap& p)
7680 {
7681 j = nlohmann::json{
7682 TOJSON_IMPL(fileName),
7683 TOJSON_IMPL(minRefreshSecs),
7684 TOJSON_IMPL(enabled),
7685 TOJSON_IMPL(runCmd)
7686 };
7687 }
7688 static void from_json(const nlohmann::json& j, RallypointServerRouteMap& p)
7689 {
7690 p.clear();
7691 getOptional<std::string>("fileName", p.fileName, j);
7692 getOptional<int>("minRefreshSecs", p.minRefreshSecs, j, 5);
7693 getOptional<bool>("enabled", p.enabled, j, false);
7694 getOptional<std::string>("runCmd", p.runCmd, j);
7695 }
7696
7697
7698 //-----------------------------------------------------------
7699 JSON_SERIALIZED_CLASS(ExternalHealthCheckResponder)
7710 {
7711 IMPLEMENT_JSON_SERIALIZATION()
7712 IMPLEMENT_JSON_DOCUMENTATION(ExternalHealthCheckResponder)
7713
7714 public:
7715
7718
7721
7723 {
7724 clear();
7725 }
7726
7727 void clear()
7728 {
7729 listenPort = 0;
7730 immediateClose = true;
7731 }
7732 };
7733
7734 static void to_json(nlohmann::json& j, const ExternalHealthCheckResponder& p)
7735 {
7736 j = nlohmann::json{
7737 TOJSON_IMPL(listenPort),
7738 TOJSON_IMPL(immediateClose)
7739 };
7740 }
7741 static void from_json(const nlohmann::json& j, ExternalHealthCheckResponder& p)
7742 {
7743 p.clear();
7744 getOptional<int>("listenPort", p.listenPort, j, 0);
7745 getOptional<bool>("immediateClose", p.immediateClose, j, true);
7746 }
7747
7748
7749 //-----------------------------------------------------------
7750 JSON_SERIALIZED_CLASS(PeeringConfiguration)
7759 {
7760 IMPLEMENT_JSON_SERIALIZATION()
7761 IMPLEMENT_JSON_DOCUMENTATION(PeeringConfiguration)
7762
7763 public:
7764
7766 std::string id;
7767
7770
7772 std::string comments;
7773
7775 std::vector<RallypointPeer> peers;
7776
7778 {
7779 clear();
7780 }
7781
7782 void clear()
7783 {
7784 id.clear();
7785 version = 0;
7786 comments.clear();
7787 }
7788 };
7789
7790 static void to_json(nlohmann::json& j, const PeeringConfiguration& p)
7791 {
7792 j = nlohmann::json{
7793 TOJSON_IMPL(id),
7794 TOJSON_IMPL(version),
7795 TOJSON_IMPL(comments),
7796 TOJSON_IMPL(peers)
7797 };
7798 }
7799 static void from_json(const nlohmann::json& j, PeeringConfiguration& p)
7800 {
7801 p.clear();
7802 getOptional<std::string>("id", p.id, j);
7803 getOptional<int>("version", p.version, j, 0);
7804 getOptional<std::string>("comments", p.comments, j);
7805 getOptional<std::vector<RallypointPeer>>("peers", p.peers, j);
7806 }
7807
7808 //-----------------------------------------------------------
7809 JSON_SERIALIZED_CLASS(IgmpSnooping)
7818 {
7819 IMPLEMENT_JSON_SERIALIZATION()
7820 IMPLEMENT_JSON_DOCUMENTATION(IgmpSnooping)
7821
7822 public:
7823
7826
7829
7832
7835
7836 IgmpSnooping()
7837 {
7838 clear();
7839 }
7840
7841 void clear()
7842 {
7843 enabled = false;
7844 queryIntervalMs = 60000;
7845 lastMemberQueryIntervalMs = 1000;
7846 lastMemberQueryCount = 1;
7847 }
7848 };
7849
7850 static void to_json(nlohmann::json& j, const IgmpSnooping& p)
7851 {
7852 j = nlohmann::json{
7853 TOJSON_IMPL(enabled),
7854 TOJSON_IMPL(queryIntervalMs),
7855 TOJSON_IMPL(lastMemberQueryIntervalMs),
7856 TOJSON_IMPL(lastMemberQueryCount)
7857 };
7858 }
7859 static void from_json(const nlohmann::json& j, IgmpSnooping& p)
7860 {
7861 p.clear();
7862 getOptional<bool>("enabled", p.enabled, j);
7863 getOptional<int>("queryIntervalMs", p.queryIntervalMs, j, 60000);
7864 getOptional<int>("lastMemberQueryIntervalMs", p.lastMemberQueryIntervalMs, j, 1000);
7865 getOptional<int>("lastMemberQueryCount", p.lastMemberQueryCount, j, 1);
7866 }
7867
7868
7869 //-----------------------------------------------------------
7870 JSON_SERIALIZED_CLASS(RallypointReflector)
7878 {
7879 IMPLEMENT_JSON_SERIALIZATION()
7880 IMPLEMENT_JSON_DOCUMENTATION(RallypointReflector)
7881
7882 public:
7886 std::string id;
7887
7890
7893
7896
7898 std::vector<NetworkAddress> additionalTx;
7899
7901 {
7902 clear();
7903 }
7904
7905 void clear()
7906 {
7907 id.clear();
7908 rx.clear();
7909 tx.clear();
7910 multicastInterfaceName.clear();
7911 additionalTx.clear();
7912 }
7913 };
7914
7915 static void to_json(nlohmann::json& j, const RallypointReflector& p)
7916 {
7917 j = nlohmann::json{
7918 TOJSON_IMPL(id),
7919 TOJSON_IMPL(rx),
7920 TOJSON_IMPL(tx),
7921 TOJSON_IMPL(multicastInterfaceName),
7922 TOJSON_IMPL(additionalTx)
7923 };
7924 }
7925 static void from_json(const nlohmann::json& j, RallypointReflector& p)
7926 {
7927 p.clear();
7928 j.at("id").get_to(p.id);
7929 j.at("rx").get_to(p.rx);
7930 j.at("tx").get_to(p.tx);
7931 getOptional<std::string>("multicastInterfaceName", p.multicastInterfaceName, j);
7932 getOptional<std::vector<NetworkAddress>>("additionalTx", p.additionalTx, j);
7933 }
7934
7935
7936 //-----------------------------------------------------------
7937 JSON_SERIALIZED_CLASS(RallypointUdpStreamingIpvX)
7945 {
7946 IMPLEMENT_JSON_SERIALIZATION()
7947 IMPLEMENT_JSON_DOCUMENTATION(RallypointUdpStreamingIpvX)
7948
7949 public:
7952
7955
7957 {
7958 clear();
7959 }
7960
7961 void clear()
7962 {
7963 enabled = true;
7964 external.clear();
7965 }
7966 };
7967
7968 static void to_json(nlohmann::json& j, const RallypointUdpStreamingIpvX& p)
7969 {
7970 j = nlohmann::json{
7971 TOJSON_IMPL(enabled),
7972 TOJSON_IMPL(external)
7973 };
7974 }
7975 static void from_json(const nlohmann::json& j, RallypointUdpStreamingIpvX& p)
7976 {
7977 p.clear();
7978 getOptional<bool>("enabled", p.enabled, j, true);
7979 getOptional<NetworkAddress>("external", p.external, j);
7980 }
7981
7982 //-----------------------------------------------------------
7983 JSON_SERIALIZED_CLASS(RallypointUdpStreaming)
7991 {
7992 IMPLEMENT_JSON_SERIALIZATION()
7993 IMPLEMENT_JSON_DOCUMENTATION(RallypointUdpStreaming)
7994
7995 public:
7997 typedef enum
7998 {
8000 ctUnknown = 0,
8001
8003 ctSharedKeyAes256FullIv = 1,
8004
8006 ctSharedKeyAes256IdxIv = 2,
8007
8009 ctSharedKeyChaCha20FullIv = 3,
8010
8012 ctSharedKeyChaCha20IdxIv = 4
8013 } CryptoType_t;
8014
8017
8020
8023
8026
8029
8032
8035
8037 int ttl;
8038
8039
8041 {
8042 clear();
8043 }
8044
8045 void clear()
8046 {
8047 enabled = true;
8048 cryptoType = CryptoType_t::ctSharedKeyAes256FullIv;
8049 listenPort = 7444;
8050 ipv4.clear();
8051 ipv6.clear();
8052 keepaliveIntervalSecs = 15;
8053 priority = TxPriority_t::priVoice;
8054 ttl = 64;
8055 }
8056 };
8057
8058 static void to_json(nlohmann::json& j, const RallypointUdpStreaming& p)
8059 {
8060 j = nlohmann::json{
8061 TOJSON_IMPL(enabled),
8062 TOJSON_IMPL(cryptoType),
8063 TOJSON_IMPL(listenPort),
8064 TOJSON_IMPL(keepaliveIntervalSecs),
8065 TOJSON_IMPL(ipv4),
8066 TOJSON_IMPL(ipv6),
8067 TOJSON_IMPL(priority),
8068 TOJSON_IMPL(ttl)
8069 };
8070 }
8071 static void from_json(const nlohmann::json& j, RallypointUdpStreaming& p)
8072 {
8073 p.clear();
8074 getOptional<bool>("enabled", p.enabled, j, true);
8075 getOptional<RallypointUdpStreaming::CryptoType_t>("cryptoType", p.cryptoType, j, RallypointUdpStreaming::CryptoType_t::ctSharedKeyAes256FullIv);
8076 getOptional<int>("listenPort", p.listenPort, j, 7444);
8077 getOptional<int>("keepaliveIntervalSecs", p.keepaliveIntervalSecs, j, 15);
8078 getOptional<RallypointUdpStreamingIpvX>("ipv4", p.ipv4, j);
8079 getOptional<RallypointUdpStreamingIpvX>("ipv6", p.ipv6, j);
8080 getOptional<TxPriority_t>("priority", p.priority, j, TxPriority_t::priVoice);
8081 getOptional<int>("ttl", p.ttl, j, 64);
8082 }
8083
8084 //-----------------------------------------------------------
8085 JSON_SERIALIZED_CLASS(RallypointRpRtTimingBehavior)
8093 {
8094 IMPLEMENT_JSON_SERIALIZATION()
8095 IMPLEMENT_JSON_DOCUMENTATION(RallypointRpRtTimingBehavior)
8096
8097 public:
8099 typedef enum
8100 {
8103
8106
8109
8112
8114 btDrop = 99
8115 } BehaviorType_t;
8116
8119
8121 uint32_t atOrAboveMs;
8122
8124 std::string runCmd;
8125
8127 {
8128 clear();
8129 }
8130
8131 void clear()
8132 {
8133 behavior = btNone;
8134 atOrAboveMs = 0;
8135 runCmd.clear();
8136 }
8137 };
8138
8139 static void to_json(nlohmann::json& j, const RallypointRpRtTimingBehavior& p)
8140 {
8141 j = nlohmann::json{
8142 TOJSON_IMPL(behavior),
8143 TOJSON_IMPL(atOrAboveMs),
8144 TOJSON_IMPL(runCmd)
8145 };
8146 }
8147 static void from_json(const nlohmann::json& j, RallypointRpRtTimingBehavior& p)
8148 {
8149 p.clear();
8150 getOptional<RallypointRpRtTimingBehavior::BehaviorType_t>("behavior", p.behavior, j, RallypointRpRtTimingBehavior::BehaviorType_t::btNone);
8151 getOptional<uint32_t>("atOrAboveMs", p.atOrAboveMs, j, 0);
8152 getOptional<std::string>("runCmd", p.runCmd, j);
8153 }
8154
8155
8156 //-----------------------------------------------------------
8157 JSON_SERIALIZED_CLASS(RallypointWebsocketSettings)
8165 {
8166 IMPLEMENT_JSON_SERIALIZATION()
8167 IMPLEMENT_JSON_DOCUMENTATION(RallypointWebsocketSettings)
8168
8169 public:
8172
8175
8178
8180 {
8181 clear();
8182 }
8183
8184 void clear()
8185 {
8186 enabled = false;
8187 listenPort = 8443;
8188 certificate.clear();
8189 }
8190 };
8191
8192 static void to_json(nlohmann::json& j, const RallypointWebsocketSettings& p)
8193 {
8194 j = nlohmann::json{
8195 TOJSON_IMPL(enabled),
8196 TOJSON_IMPL(listenPort),
8197 TOJSON_IMPL(certificate)
8198 };
8199 }
8200 static void from_json(const nlohmann::json& j, RallypointWebsocketSettings& p)
8201 {
8202 p.clear();
8203 getOptional<bool>("enabled", p.enabled, j, false);
8204 getOptional<int>("listenPort", p.listenPort, j, 8443);
8205 getOptional<SecurityCertificate>("certificate", p.certificate, j);
8206 }
8207
8208
8209
8210 //-----------------------------------------------------------
8211 JSON_SERIALIZED_CLASS(RallypointAdvertisingSettings)
8219 {
8220 IMPLEMENT_JSON_SERIALIZATION()
8221 IMPLEMENT_JSON_DOCUMENTATION(RallypointAdvertisingSettings)
8222
8223 public:
8226
8228 std::string meshName;
8229
8231 std::string hostName;
8232
8234 std::string serviceName;
8235
8237 std::string interfaceName;
8238
8240 int port;
8241
8243 int ttl;
8244
8246 std::vector<std::string> extraMeshes;
8247
8248
8250 {
8251 clear();
8252 }
8253
8254 void clear()
8255 {
8256 enabled = false;
8257 meshName.clear();
8258 hostName.clear();
8259 serviceName = "_rallypoint._tcp.local.";
8260 interfaceName.clear();
8261 port = 0;
8262 ttl = 60;
8263 extraMeshes.clear();
8264 }
8265 };
8266
8267 static void to_json(nlohmann::json& j, const RallypointAdvertisingSettings& p)
8268 {
8269 j = nlohmann::json{
8270 TOJSON_IMPL(enabled),
8271 TOJSON_IMPL(meshName),
8272 TOJSON_IMPL(hostName),
8273 TOJSON_IMPL(serviceName),
8274 TOJSON_IMPL(interfaceName),
8275 TOJSON_IMPL(port),
8276 TOJSON_IMPL(ttl),
8277 TOJSON_IMPL(extraMeshes)
8278 };
8279 }
8280 static void from_json(const nlohmann::json& j, RallypointAdvertisingSettings& p)
8281 {
8282 p.clear();
8283 getOptional<bool>("enabled", p.enabled, j, false);
8284 getOptional<std::string>("meshName", p.meshName, j);
8285 getOptional<std::string>("hostName", p.hostName, j);
8286 getOptional<std::string>("serviceName", p.serviceName, j, "_rallypoint._tcp.local.");
8287 getOptional<std::string>("interfaceName", p.interfaceName, j);
8288
8289 getOptional<int>("port", p.port, j, 0);
8290 getOptional<int>("ttl", p.ttl, j, 60);
8291 getOptional<std::vector<std::string>>("extraMeshes", p.extraMeshes, j);
8292 }
8293
8294
8295 //-----------------------------------------------------------
8296 JSON_SERIALIZED_CLASS(RallypointExtendedGroupRestriction)
8304 {
8305 IMPLEMENT_JSON_SERIALIZATION()
8306 IMPLEMENT_JSON_DOCUMENTATION(RallypointExtendedGroupRestriction)
8307
8308 public:
8310 std::string id;
8311
8313 std::vector<StringRestrictionList> restrictions;
8314
8316 {
8317 clear();
8318 }
8319
8320 void clear()
8321 {
8322 id.clear();
8323 restrictions.clear();
8324 }
8325 };
8326
8327 static void to_json(nlohmann::json& j, const RallypointExtendedGroupRestriction& p)
8328 {
8329 j = nlohmann::json{
8330 TOJSON_IMPL(id),
8331 TOJSON_IMPL(restrictions)
8332 };
8333 }
8334 static void from_json(const nlohmann::json& j, RallypointExtendedGroupRestriction& p)
8335 {
8336 p.clear();
8337 getOptional<std::string>("id", p.id, j);
8338 getOptional<std::vector<StringRestrictionList>>("restrictions", p.restrictions, j);
8339 }
8340
8341
8342 //-----------------------------------------------------------
8343 JSON_SERIALIZED_CLASS(RallypointServer)
8353 {
8354 IMPLEMENT_JSON_SERIALIZATION()
8355 IMPLEMENT_JSON_DOCUMENTATION(RallypointServer)
8356
8357 public:
8360
8363
8365 std::string id;
8366
8369
8372
8374 std::string interfaceName;
8375
8378
8381
8384
8387
8390
8393
8396
8399
8402
8405
8408
8411
8414
8417
8420
8423
8425 PeeringConfiguration peeringConfiguration; // NOTE: This is NOT serialized
8426
8429
8432
8435
8438
8440 std::vector<RallypointReflector> staticReflectors;
8441
8444
8447
8450
8453
8456
8459
8461 std::vector<RallypointExtendedGroupRestriction> extendedGroupRestrictions;
8462
8465
8468
8471
8474
8476 uint32_t sysFlags;
8477
8480
8483
8486
8489
8492
8495
8498
8500 std::vector<RallypointRpRtTimingBehavior> peerRtBehaviors;
8501
8504
8507
8510
8513
8516
8518 {
8519 clear();
8520 }
8521
8522 void clear()
8523 {
8524 fipsCrypto.clear();
8525 watchdog.clear();
8526 id.clear();
8527 listenPort = 7443;
8528 interfaceName.clear();
8529 certificate.clear();
8530 allowMulticastForwarding = false;
8531 peeringConfiguration.clear();
8532 peeringConfigurationFileName.clear();
8533 peeringConfigurationFileCommand.clear();
8534 peeringConfigurationFileCheckSecs = 60;
8535 ioPools = -1;
8536 statusReport.clear();
8537 limits.clear();
8538 linkGraph.clear();
8539 externalHealthCheckResponder.clear();
8540 allowPeerForwarding = false;
8541 multicastInterfaceName.clear();
8542 tls.clear();
8543 discovery.clear();
8544 forwardDiscoveredGroups = false;
8545 forwardMulticastAddressing = false;
8546 isMeshLeaf = false;
8547 disableMessageSigning = false;
8548 multicastRestrictions.clear();
8549 igmpSnooping.clear();
8550 staticReflectors.clear();
8551 tcpTxOptions.clear();
8552 multicastTxOptions.clear();
8553 certStoreFileName.clear();
8554 certStorePasswordHex.clear();
8555 groupRestrictions.clear();
8556 configurationCheckSignalName = "rts.7b392d1.${id}";
8557 licensing.clear();
8558 featureset.clear();
8559 udpStreaming.clear();
8560 sysFlags = 0;
8561 normalTaskQueueBias = 0;
8562 enableLeafReflectionReverseSubscription = false;
8563 disableLoopDetection = false;
8564 maxSecurityLevel = 0;
8565 routeMap.clear();
8566 maxOutboundPeerConnectionIntervalDeltaSecs = 15;
8567 peerRtTestIntervalMs = 60000;
8568 peerRtBehaviors.clear();
8569 websocket.clear();
8570 nsm.clear();
8571 advertising.clear();
8572 extendedGroupRestrictions.clear();
8573 groupRestrictionAccessPolicyType = GroupRestrictionAccessPolicyType_t::graptPermissive;
8574 ipFamily = IpFamilyType_t::ifIpUnspec;
8575 rxCapture.clear();
8576 txCapture.clear();
8577 }
8578 };
8579
8580 static void to_json(nlohmann::json& j, const RallypointServer& p)
8581 {
8582 j = nlohmann::json{
8583 TOJSON_IMPL(fipsCrypto),
8584 TOJSON_IMPL(watchdog),
8585 TOJSON_IMPL(id),
8586 TOJSON_IMPL(listenPort),
8587 TOJSON_IMPL(interfaceName),
8588 TOJSON_IMPL(certificate),
8589 TOJSON_IMPL(allowMulticastForwarding),
8590 // TOJSON_IMPL(peeringConfiguration), // NOTE: Not serialized!
8591 TOJSON_IMPL(peeringConfigurationFileName),
8592 TOJSON_IMPL(peeringConfigurationFileCommand),
8593 TOJSON_IMPL(peeringConfigurationFileCheckSecs),
8594 TOJSON_IMPL(ioPools),
8595 TOJSON_IMPL(statusReport),
8596 TOJSON_IMPL(limits),
8597 TOJSON_IMPL(linkGraph),
8598 TOJSON_IMPL(externalHealthCheckResponder),
8599 TOJSON_IMPL(allowPeerForwarding),
8600 TOJSON_IMPL(multicastInterfaceName),
8601 TOJSON_IMPL(tls),
8602 TOJSON_IMPL(discovery),
8603 TOJSON_IMPL(forwardDiscoveredGroups),
8604 TOJSON_IMPL(forwardMulticastAddressing),
8605 TOJSON_IMPL(isMeshLeaf),
8606 TOJSON_IMPL(disableMessageSigning),
8607 TOJSON_IMPL(multicastRestrictions),
8608 TOJSON_IMPL(igmpSnooping),
8609 TOJSON_IMPL(staticReflectors),
8610 TOJSON_IMPL(tcpTxOptions),
8611 TOJSON_IMPL(multicastTxOptions),
8612 TOJSON_IMPL(certStoreFileName),
8613 TOJSON_IMPL(certStorePasswordHex),
8614 TOJSON_IMPL(groupRestrictions),
8615 TOJSON_IMPL(configurationCheckSignalName),
8616 TOJSON_IMPL(featureset),
8617 TOJSON_IMPL(licensing),
8618 TOJSON_IMPL(udpStreaming),
8619 TOJSON_IMPL(sysFlags),
8620 TOJSON_IMPL(normalTaskQueueBias),
8621 TOJSON_IMPL(enableLeafReflectionReverseSubscription),
8622 TOJSON_IMPL(disableLoopDetection),
8623 TOJSON_IMPL(maxSecurityLevel),
8624 TOJSON_IMPL(routeMap),
8625 TOJSON_IMPL(maxOutboundPeerConnectionIntervalDeltaSecs),
8626 TOJSON_IMPL(peerRtTestIntervalMs),
8627 TOJSON_IMPL(peerRtBehaviors),
8628 TOJSON_IMPL(websocket),
8629 TOJSON_IMPL(nsm),
8630 TOJSON_IMPL(advertising),
8631 TOJSON_IMPL(extendedGroupRestrictions),
8632 TOJSON_IMPL(groupRestrictionAccessPolicyType),
8633 TOJSON_IMPL(ipFamily),
8634 TOJSON_IMPL(rxCapture),
8635 TOJSON_IMPL(txCapture)
8636 };
8637 }
8638 static void from_json(const nlohmann::json& j, RallypointServer& p)
8639 {
8640 p.clear();
8641 getOptional<FipsCryptoSettings>("fipsCrypto", p.fipsCrypto, j);
8642 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
8643 getOptional<std::string>("id", p.id, j);
8644 getOptional<SecurityCertificate>("certificate", p.certificate, j);
8645 getOptional<std::string>("interfaceName", p.interfaceName, j);
8646 getOptional<int>("listenPort", p.listenPort, j, 7443);
8647 getOptional<bool>("allowMulticastForwarding", p.allowMulticastForwarding, j, false);
8648 //getOptional<PeeringConfiguration>("peeringConfiguration", p.peeringConfiguration, j); // NOTE: Not serialized!
8649 getOptional<std::string>("peeringConfigurationFileName", p.peeringConfigurationFileName, j);
8650 getOptional<std::string>("peeringConfigurationFileCommand", p.peeringConfigurationFileCommand, j);
8651 getOptional<int>("peeringConfigurationFileCheckSecs", p.peeringConfigurationFileCheckSecs, j, 60);
8652 getOptional<int>("ioPools", p.ioPools, j, -1);
8653 getOptional<RallypointServerStatusReportConfiguration>("statusReport", p.statusReport, j);
8654 getOptional<RallypointServerLimits>("limits", p.limits, j);
8655 getOptional<RallypointServerLinkGraph>("linkGraph", p.linkGraph, j);
8656 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
8657 getOptional<bool>("allowPeerForwarding", p.allowPeerForwarding, j, false);
8658 getOptional<std::string>("multicastInterfaceName", p.multicastInterfaceName, j);
8659 getOptional<Tls>("tls", p.tls, j);
8660 getOptional<DiscoveryConfiguration>("discovery", p.discovery, j);
8661 getOptional<bool>("forwardDiscoveredGroups", p.forwardDiscoveredGroups, j, false);
8662 getOptional<bool>("forwardMulticastAddressing", p.forwardMulticastAddressing, j, false);
8663 getOptional<bool>("isMeshLeaf", p.isMeshLeaf, j, false);
8664 getOptional<bool>("disableMessageSigning", p.disableMessageSigning, j, false);
8665 getOptional<NetworkAddressRestrictionList>("multicastRestrictions", p.multicastRestrictions, j);
8666 getOptional<IgmpSnooping>("igmpSnooping", p.igmpSnooping, j);
8667 getOptional<std::vector<RallypointReflector>>("staticReflectors", p.staticReflectors, j);
8668 getOptional<TcpNetworkTxOptions>("tcpTxOptions", p.tcpTxOptions, j);
8669 getOptional<NetworkTxOptions>("multicastTxOptions", p.multicastTxOptions, j);
8670 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
8671 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
8672 getOptional<StringRestrictionList>("groupRestrictions", p.groupRestrictions, j);
8673 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.7b392d1.${id}");
8674 getOptional<Licensing>("licensing", p.licensing, j);
8675 getOptional<Featureset>("featureset", p.featureset, j);
8676 getOptional<RallypointUdpStreaming>("udpStreaming", p.udpStreaming, j);
8677 getOptional<uint32_t>("sysFlags", p.sysFlags, j, 0);
8678 getOptional<uint32_t>("normalTaskQueueBias", p.normalTaskQueueBias, j, 0);
8679 getOptional<bool>("enableLeafReflectionReverseSubscription", p.enableLeafReflectionReverseSubscription, j, false);
8680 getOptional<bool>("disableLoopDetection", p.disableLoopDetection, j, false);
8681 getOptional<uint32_t>("maxSecurityLevel", p.maxSecurityLevel, j, 0);
8682 getOptional<RallypointServerRouteMap>("routeMap", p.routeMap, j);
8683 getOptional<uint32_t>("maxOutboundPeerConnectionIntervalDeltaSecs", p.maxOutboundPeerConnectionIntervalDeltaSecs, j, 15);
8684 getOptional<int>("peerRtTestIntervalMs", p.peerRtTestIntervalMs, j, 60000);
8685 getOptional<std::vector<RallypointRpRtTimingBehavior>>("peerRtBehaviors", p.peerRtBehaviors, j);
8686 getOptional<RallypointWebsocketSettings>("websocket", p.websocket, j);
8687 getOptional<NsmConfiguration>("nsm", p.nsm, j);
8688 getOptional<RallypointAdvertisingSettings>("advertising", p.advertising, j);
8689 getOptional<std::vector<RallypointExtendedGroupRestriction>>("extendedGroupRestrictions", p.extendedGroupRestrictions, j);
8690 getOptional<GroupRestrictionAccessPolicyType_t>("groupRestrictionAccessPolicyType", p.groupRestrictionAccessPolicyType, j, GroupRestrictionAccessPolicyType_t::graptPermissive);
8691 getOptional<IpFamilyType_t>("ipFamily", p.ipFamily, j, IpFamilyType_t::ifIpUnspec);
8692 getOptional<PacketCapturer>("rxCapture", p.rxCapture, j);
8693 getOptional<PacketCapturer>("txCapture", p.txCapture, j);
8694 }
8695
8696 //-----------------------------------------------------------
8697 JSON_SERIALIZED_CLASS(PlatformDiscoveredService)
8708 {
8709 IMPLEMENT_JSON_SERIALIZATION()
8710 IMPLEMENT_JSON_DOCUMENTATION(PlatformDiscoveredService)
8711
8712 public:
8713
8715 std::string id;
8716
8718 std::string type;
8719
8721 std::string name;
8722
8725
8727 std::string uri;
8728
8731
8733 {
8734 clear();
8735 }
8736
8737 void clear()
8738 {
8739 id.clear();
8740 type.clear();
8741 name.clear();
8742 address.clear();
8743 uri.clear();
8744 configurationVersion = 0;
8745 }
8746 };
8747
8748 static void to_json(nlohmann::json& j, const PlatformDiscoveredService& p)
8749 {
8750 j = nlohmann::json{
8751 TOJSON_IMPL(id),
8752 TOJSON_IMPL(type),
8753 TOJSON_IMPL(name),
8754 TOJSON_IMPL(address),
8755 TOJSON_IMPL(uri),
8756 TOJSON_IMPL(configurationVersion)
8757 };
8758 }
8759 static void from_json(const nlohmann::json& j, PlatformDiscoveredService& p)
8760 {
8761 p.clear();
8762 getOptional<std::string>("id", p.id, j);
8763 getOptional<std::string>("type", p.type, j);
8764 getOptional<std::string>("name", p.name, j);
8765 getOptional<NetworkAddress>("address", p.address, j);
8766 getOptional<std::string>("uri", p.uri, j);
8767 getOptional<uint32_t>("configurationVersion", p.configurationVersion, j, 0);
8768 }
8769
8770
8771 //-----------------------------------------------------------
8773 {
8774 public:
8775 typedef enum
8776 {
8777 etUndefined = 0,
8778 etAudio = 1,
8779 etLocation = 2,
8780 etUser = 3
8781 } EventType_t;
8782
8783 typedef enum
8784 {
8785 dNone = 0,
8786 dInbound = 1,
8787 dOutbound = 2,
8788 dBoth = 3,
8789 dUndefined = 4,
8790 } Direction_t;
8791 };
8792
8793
8794 //-----------------------------------------------------------
8795 JSON_SERIALIZED_CLASS(TimelineQueryParameters)
8806 {
8807 IMPLEMENT_JSON_SERIALIZATION()
8808 IMPLEMENT_JSON_DOCUMENTATION(TimelineQueryParameters)
8809
8810 public:
8811
8814
8817
8820
8823
8826
8829
8832
8834 std::string onlyAlias;
8835
8837 std::string onlyNodeId;
8838
8841
8843 std::string sql;
8844
8846 {
8847 clear();
8848 }
8849
8850 void clear()
8851 {
8852 maxCount = 50;
8853 mostRecentFirst = true;
8854 startedOnOrAfter = 0;
8855 endedOnOrBefore = 0;
8856 onlyDirection = 0;
8857 onlyType = 0;
8858 onlyCommitted = true;
8859 onlyAlias.clear();
8860 onlyNodeId.clear();
8861 sql.clear();
8862 onlyTxId = 0;
8863 }
8864 };
8865
8866 static void to_json(nlohmann::json& j, const TimelineQueryParameters& p)
8867 {
8868 j = nlohmann::json{
8869 TOJSON_IMPL(maxCount),
8870 TOJSON_IMPL(mostRecentFirst),
8871 TOJSON_IMPL(startedOnOrAfter),
8872 TOJSON_IMPL(endedOnOrBefore),
8873 TOJSON_IMPL(onlyDirection),
8874 TOJSON_IMPL(onlyType),
8875 TOJSON_IMPL(onlyCommitted),
8876 TOJSON_IMPL(onlyAlias),
8877 TOJSON_IMPL(onlyNodeId),
8878 TOJSON_IMPL(onlyTxId),
8879 TOJSON_IMPL(sql)
8880 };
8881 }
8882 static void from_json(const nlohmann::json& j, TimelineQueryParameters& p)
8883 {
8884 p.clear();
8885 getOptional<long>("maxCount", p.maxCount, j, 50);
8886 getOptional<bool>("mostRecentFirst", p.mostRecentFirst, j, false);
8887 getOptional<uint64_t>("startedOnOrAfter", p.startedOnOrAfter, j, 0);
8888 getOptional<uint64_t>("endedOnOrBefore", p.endedOnOrBefore, j, 0);
8889 getOptional<int>("onlyDirection", p.onlyDirection, j, 0);
8890 getOptional<int>("onlyType", p.onlyType, j, 0);
8891 getOptional<bool>("onlyCommitted", p.onlyCommitted, j, true);
8892 getOptional<std::string>("onlyAlias", p.onlyAlias, j, EMPTY_STRING);
8893 getOptional<std::string>("onlyNodeId", p.onlyNodeId, j, EMPTY_STRING);
8894 getOptional<int>("onlyTxId", p.onlyTxId, j, 0);
8895 getOptional<std::string>("sql", p.sql, j, EMPTY_STRING);
8896 }
8897
8898 //-----------------------------------------------------------
8899 JSON_SERIALIZED_CLASS(CertStoreCertificate)
8907 {
8908 IMPLEMENT_JSON_SERIALIZATION()
8909 IMPLEMENT_JSON_DOCUMENTATION(CertStoreCertificate)
8910
8911 public:
8913 std::string id;
8914
8916 std::string certificatePem;
8917
8919 std::string privateKeyPem;
8920
8923
8925 std::string tags;
8926
8928 {
8929 clear();
8930 }
8931
8932 void clear()
8933 {
8934 id.clear();
8935 certificatePem.clear();
8936 privateKeyPem.clear();
8937 internalData = nullptr;
8938 tags.clear();
8939 }
8940 };
8941
8942 static void to_json(nlohmann::json& j, const CertStoreCertificate& p)
8943 {
8944 j = nlohmann::json{
8945 TOJSON_IMPL(id),
8946 TOJSON_IMPL(certificatePem),
8947 TOJSON_IMPL(privateKeyPem),
8948 TOJSON_IMPL(tags)
8949 };
8950 }
8951 static void from_json(const nlohmann::json& j, CertStoreCertificate& p)
8952 {
8953 p.clear();
8954 j.at("id").get_to(p.id);
8955 j.at("certificatePem").get_to(p.certificatePem);
8956 getOptional<std::string>("privateKeyPem", p.privateKeyPem, j, EMPTY_STRING);
8957 getOptional<std::string>("tags", p.tags, j, EMPTY_STRING);
8958 }
8959
8960 //-----------------------------------------------------------
8961 JSON_SERIALIZED_CLASS(CertStore)
8969 {
8970 IMPLEMENT_JSON_SERIALIZATION()
8971 IMPLEMENT_JSON_DOCUMENTATION(CertStore)
8972
8973 public:
8975 std::string id;
8976
8978 std::vector<CertStoreCertificate> certificates;
8979
8980 CertStore()
8981 {
8982 clear();
8983 }
8984
8985 void clear()
8986 {
8987 id.clear();
8988 certificates.clear();
8989 }
8990 };
8991
8992 static void to_json(nlohmann::json& j, const CertStore& p)
8993 {
8994 j = nlohmann::json{
8995 TOJSON_IMPL(id),
8996 TOJSON_IMPL(certificates)
8997 };
8998 }
8999 static void from_json(const nlohmann::json& j, CertStore& p)
9000 {
9001 p.clear();
9002 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9003 getOptional<std::vector<CertStoreCertificate>>("certificates", p.certificates, j);
9004 }
9005
9006 //-----------------------------------------------------------
9007 JSON_SERIALIZED_CLASS(CertStoreCertificateElement)
9015 {
9016 IMPLEMENT_JSON_SERIALIZATION()
9017 IMPLEMENT_JSON_DOCUMENTATION(CertStoreCertificateElement)
9018
9019 public:
9021 std::string id;
9022
9025
9027 std::string certificatePem;
9028
9030 std::string tags;
9031
9033 {
9034 clear();
9035 }
9036
9037 void clear()
9038 {
9039 id.clear();
9040 hasPrivateKey = false;
9041 tags.clear();
9042 }
9043 };
9044
9045 static void to_json(nlohmann::json& j, const CertStoreCertificateElement& p)
9046 {
9047 j = nlohmann::json{
9048 TOJSON_IMPL(id),
9049 TOJSON_IMPL(hasPrivateKey),
9050 TOJSON_IMPL(tags)
9051 };
9052
9053 if(!p.certificatePem.empty())
9054 {
9055 j["certificatePem"] = p.certificatePem;
9056 }
9057 }
9058 static void from_json(const nlohmann::json& j, CertStoreCertificateElement& p)
9059 {
9060 p.clear();
9061 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9062 getOptional<bool>("hasPrivateKey", p.hasPrivateKey, j, false);
9063 getOptional<std::string>("certificatePem", p.certificatePem, j, EMPTY_STRING);
9064 getOptional<std::string>("tags", p.tags, j, EMPTY_STRING);
9065 }
9066
9067 //-----------------------------------------------------------
9068 JSON_SERIALIZED_CLASS(CertStoreDescriptor)
9076 {
9077 IMPLEMENT_JSON_SERIALIZATION()
9078 IMPLEMENT_JSON_DOCUMENTATION(CertStoreDescriptor)
9079
9080 public:
9082 std::string id;
9083
9085 std::string fileName;
9086
9089
9092
9094 std::vector<CertStoreCertificateElement> certificates;
9095
9097 {
9098 clear();
9099 }
9100
9101 void clear()
9102 {
9103 id.clear();
9104 fileName.clear();
9105 version = 0;
9106 flags = 0;
9107 certificates.clear();
9108 }
9109 };
9110
9111 static void to_json(nlohmann::json& j, const CertStoreDescriptor& p)
9112 {
9113 j = nlohmann::json{
9114 TOJSON_IMPL(id),
9115 TOJSON_IMPL(fileName),
9116 TOJSON_IMPL(version),
9117 TOJSON_IMPL(flags),
9118 TOJSON_IMPL(certificates)
9119 };
9120 }
9121 static void from_json(const nlohmann::json& j, CertStoreDescriptor& p)
9122 {
9123 p.clear();
9124 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9125 getOptional<std::string>("fileName", p.fileName, j, EMPTY_STRING);
9126 getOptional<int>("version", p.version, j, 0);
9127 getOptional<int>("flags", p.flags, j, 0);
9128 getOptional<std::vector<CertStoreCertificateElement>>("certificates", p.certificates, j);
9129 }
9130
9131 //-----------------------------------------------------------
9132 JSON_SERIALIZED_CLASS(CertificateSubjectElement)
9140 {
9141 IMPLEMENT_JSON_SERIALIZATION()
9142 IMPLEMENT_JSON_DOCUMENTATION(CertificateSubjectElement)
9143
9144 public:
9146 std::string name;
9147
9149 std::string value;
9150
9152 {
9153 clear();
9154 }
9155
9156 void clear()
9157 {
9158 name.clear();
9159 value.clear();
9160 }
9161 };
9162
9163 static void to_json(nlohmann::json& j, const CertificateSubjectElement& p)
9164 {
9165 j = nlohmann::json{
9166 TOJSON_IMPL(name),
9167 TOJSON_IMPL(value)
9168 };
9169 }
9170 static void from_json(const nlohmann::json& j, CertificateSubjectElement& p)
9171 {
9172 p.clear();
9173 getOptional<std::string>("name", p.name, j, EMPTY_STRING);
9174 getOptional<std::string>("value", p.value, j, EMPTY_STRING);
9175 }
9176
9177
9178 //-----------------------------------------------------------
9179 JSON_SERIALIZED_CLASS(CertificateDescriptor)
9187 {
9188 IMPLEMENT_JSON_SERIALIZATION()
9189 IMPLEMENT_JSON_DOCUMENTATION(CertificateDescriptor)
9190
9191 public:
9193 std::string subject;
9194
9196 std::string issuer;
9197
9200
9203
9205 std::string notBefore;
9206
9208 std::string notAfter;
9209
9211 std::string serial;
9212
9214 std::string fingerprint;
9215
9217 std::vector<CertificateSubjectElement> subjectElements;
9218
9220 std::string certificatePem;
9221
9223 std::string publicKeyPem;
9224
9226 {
9227 clear();
9228 }
9229
9230 void clear()
9231 {
9232 subject.clear();
9233 issuer.clear();
9234 selfSigned = false;
9235 version = 0;
9236 notBefore.clear();
9237 notAfter.clear();
9238 serial.clear();
9239 fingerprint.clear();
9240 subjectElements.clear();
9241 certificatePem.clear();
9242 publicKeyPem.clear();
9243 }
9244 };
9245
9246 static void to_json(nlohmann::json& j, const CertificateDescriptor& p)
9247 {
9248 j = nlohmann::json{
9249 TOJSON_IMPL(subject),
9250 TOJSON_IMPL(issuer),
9251 TOJSON_IMPL(selfSigned),
9252 TOJSON_IMPL(version),
9253 TOJSON_IMPL(notBefore),
9254 TOJSON_IMPL(notAfter),
9255 TOJSON_IMPL(serial),
9256 TOJSON_IMPL(fingerprint),
9257 TOJSON_IMPL(subjectElements),
9258 TOJSON_IMPL(certificatePem),
9259 TOJSON_IMPL(publicKeyPem)
9260 };
9261 }
9262 static void from_json(const nlohmann::json& j, CertificateDescriptor& p)
9263 {
9264 p.clear();
9265 getOptional<std::string>("subject", p.subject, j, EMPTY_STRING);
9266 getOptional<std::string>("issuer", p.issuer, j, EMPTY_STRING);
9267 getOptional<bool>("selfSigned", p.selfSigned, j, false);
9268 getOptional<int>("version", p.version, j, 0);
9269 getOptional<std::string>("notBefore", p.notBefore, j, EMPTY_STRING);
9270 getOptional<std::string>("notAfter", p.notAfter, j, EMPTY_STRING);
9271 getOptional<std::string>("serial", p.serial, j, EMPTY_STRING);
9272 getOptional<std::string>("fingerprint", p.fingerprint, j, EMPTY_STRING);
9273 getOptional<std::string>("certificatePem", p.certificatePem, j, EMPTY_STRING);
9274 getOptional<std::string>("publicKeyPem", p.publicKeyPem, j, EMPTY_STRING);
9275 getOptional<std::vector<CertificateSubjectElement>>("subjectElements", p.subjectElements, j);
9276 }
9277
9278
9279 //-----------------------------------------------------------
9280 JSON_SERIALIZED_CLASS(RiffDescriptor)
9291 {
9292 IMPLEMENT_JSON_SERIALIZATION()
9293 IMPLEMENT_JSON_DOCUMENTATION(RiffDescriptor)
9294
9295 public:
9297 std::string file;
9298
9301
9304
9307
9309 std::string meta;
9310
9312 std::string certPem;
9313
9316
9318 std::string signature;
9319
9321 {
9322 clear();
9323 }
9324
9325 void clear()
9326 {
9327 file.clear();
9328 verified = false;
9329 channels = 0;
9330 sampleCount = 0;
9331 meta.clear();
9332 certPem.clear();
9333 certDescriptor.clear();
9334 signature.clear();
9335 }
9336 };
9337
9338 static void to_json(nlohmann::json& j, const RiffDescriptor& p)
9339 {
9340 j = nlohmann::json{
9341 TOJSON_IMPL(file),
9342 TOJSON_IMPL(verified),
9343 TOJSON_IMPL(channels),
9344 TOJSON_IMPL(sampleCount),
9345 TOJSON_IMPL(meta),
9346 TOJSON_IMPL(certPem),
9347 TOJSON_IMPL(certDescriptor),
9348 TOJSON_IMPL(signature)
9349 };
9350 }
9351
9352 static void from_json(const nlohmann::json& j, RiffDescriptor& p)
9353 {
9354 p.clear();
9355 FROMJSON_IMPL(file, std::string, EMPTY_STRING);
9356 FROMJSON_IMPL(verified, bool, false);
9357 FROMJSON_IMPL(channels, int, 0);
9358 FROMJSON_IMPL(sampleCount, int, 0);
9359 FROMJSON_IMPL(meta, std::string, EMPTY_STRING);
9360 FROMJSON_IMPL(certPem, std::string, EMPTY_STRING);
9361 getOptional<CertificateDescriptor>("certDescriptor", p.certDescriptor, j);
9362 FROMJSON_IMPL(signature, std::string, EMPTY_STRING);
9363 }
9364
9365
9366 //-----------------------------------------------------------
9367 JSON_SERIALIZED_CLASS(BridgeCreationDetail)
9375 {
9376 IMPLEMENT_JSON_SERIALIZATION()
9377 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(BridgeCreationDetail)
9378 IMPLEMENT_JSON_DOCUMENTATION(BridgeCreationDetail)
9379
9380 public:
9382 typedef enum
9383 {
9385 csUndefined = 0,
9386
9388 csOk = 1,
9389
9391 csNoJson = -1,
9392
9394 csAlreadyExists = -3,
9395
9397 csInvalidConfiguration = -4,
9398
9400 csInvalidJson = -5,
9401
9403 csInsufficientGroups = -6,
9404
9406 csTooManyGroups = -7,
9407
9409 csDuplicateGroup = -8,
9410
9412 csLocalLoopDetected = -9,
9413 } CreationStatus_t;
9414
9416 std::string id;
9417
9420
9422 {
9423 clear();
9424 }
9425
9426 void clear()
9427 {
9428 id.clear();
9429 status = csUndefined;
9430 }
9431 };
9432
9433 static void to_json(nlohmann::json& j, const BridgeCreationDetail& p)
9434 {
9435 j = nlohmann::json{
9436 TOJSON_IMPL(id),
9437 TOJSON_IMPL(status)
9438 };
9439 }
9440 static void from_json(const nlohmann::json& j, BridgeCreationDetail& p)
9441 {
9442 p.clear();
9443 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9444 getOptional<BridgeCreationDetail::CreationStatus_t>("status", p.status, j, BridgeCreationDetail::CreationStatus_t::csUndefined);
9445 }
9446 //-----------------------------------------------------------
9447 JSON_SERIALIZED_CLASS(GroupConnectionDetail)
9455 {
9456 IMPLEMENT_JSON_SERIALIZATION()
9457 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupConnectionDetail)
9458 IMPLEMENT_JSON_DOCUMENTATION(GroupConnectionDetail)
9459
9460 public:
9462 typedef enum
9463 {
9465 ctUndefined = 0,
9466
9468 ctDirectDatagram = 1,
9469
9471 ctRallypoint = 2
9472 } ConnectionType_t;
9473
9475 std::string id;
9476
9479
9481 std::string peer;
9482
9485
9487 std::string reason;
9488
9490 {
9491 clear();
9492 }
9493
9494 void clear()
9495 {
9496 id.clear();
9497 connectionType = ctUndefined;
9498 peer.clear();
9499 asFailover = false;
9500 reason.clear();
9501 }
9502 };
9503
9504 static void to_json(nlohmann::json& j, const GroupConnectionDetail& p)
9505 {
9506 j = nlohmann::json{
9507 TOJSON_IMPL(id),
9508 TOJSON_IMPL(connectionType),
9509 TOJSON_IMPL(peer),
9510 TOJSON_IMPL(asFailover),
9511 TOJSON_IMPL(reason)
9512 };
9513
9514 if(p.asFailover)
9515 {
9516 j["asFailover"] = p.asFailover;
9517 }
9518 }
9519 static void from_json(const nlohmann::json& j, GroupConnectionDetail& p)
9520 {
9521 p.clear();
9522 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9523 getOptional<GroupConnectionDetail::ConnectionType_t>("connectionType", p.connectionType, j, GroupConnectionDetail::ConnectionType_t::ctUndefined);
9524 getOptional<std::string>("peer", p.peer, j, EMPTY_STRING);
9525 getOptional<bool>("asFailover", p.asFailover, j, false);
9526 getOptional<std::string>("reason", p.reason, j, EMPTY_STRING);
9527 }
9528
9529 //-----------------------------------------------------------
9530 JSON_SERIALIZED_CLASS(GroupTxDetail)
9538 {
9539 IMPLEMENT_JSON_SERIALIZATION()
9540 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupTxDetail)
9541 IMPLEMENT_JSON_DOCUMENTATION(GroupTxDetail)
9542
9543 public:
9545 typedef enum
9546 {
9548 txsUndefined = 0,
9549
9551 txsTxStarted = 1,
9552
9554 txsTxEnded = 2,
9555
9557 txsNotAnAudioGroup = -1,
9558
9560 txsNotJoined = -2,
9561
9563 txsNotConnected = -3,
9564
9566 txsAlreadyTransmitting = -4,
9567
9569 txsInvalidParams = -5,
9570
9572 txsPriorityTooLow = -6,
9573
9575 txsRxActiveOnNonFdx = -7,
9576
9578 txsCannotSubscribeToInput = -8,
9579
9581 txsInvalidId = -9,
9582
9584 txsTxEndedWithFailure = -10,
9585
9587 txsOthersActive = -11
9588 } TxStatus_t;
9589
9591 std::string id;
9592
9595
9598
9601
9604
9606 uint32_t txId;
9607
9609 {
9610 clear();
9611 }
9612
9613 void clear()
9614 {
9615 id.clear();
9616 status = txsUndefined;
9617 localPriority = 0;
9618 remotePriority = 0;
9619 nonFdxMsHangRemaining = 0;
9620 txId = 0;
9621 }
9622 };
9623
9624 static void to_json(nlohmann::json& j, const GroupTxDetail& p)
9625 {
9626 j = nlohmann::json{
9627 TOJSON_IMPL(id),
9628 TOJSON_IMPL(status),
9629 TOJSON_IMPL(localPriority),
9630 TOJSON_IMPL(txId)
9631 };
9632
9633 // Include remote priority if status is related to that
9634 if(p.status == GroupTxDetail::TxStatus_t::txsPriorityTooLow)
9635 {
9636 j["remotePriority"] = p.remotePriority;
9637 }
9638 else if(p.status == GroupTxDetail::TxStatus_t::txsRxActiveOnNonFdx)
9639 {
9640 j["nonFdxMsHangRemaining"] = p.nonFdxMsHangRemaining;
9641 }
9642 }
9643 static void from_json(const nlohmann::json& j, GroupTxDetail& p)
9644 {
9645 p.clear();
9646 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9647 getOptional<GroupTxDetail::TxStatus_t>("status", p.status, j, GroupTxDetail::TxStatus_t::txsUndefined);
9648 getOptional<int>("localPriority", p.localPriority, j, 0);
9649 getOptional<int>("remotePriority", p.remotePriority, j, 0);
9650 getOptional<long>("nonFdxMsHangRemaining", p.nonFdxMsHangRemaining, j, 0);
9651 getOptional<uint32_t>("txId", p.txId, j, 0);
9652 }
9653
9654 //-----------------------------------------------------------
9655 JSON_SERIALIZED_CLASS(GroupCreationDetail)
9663 {
9664 IMPLEMENT_JSON_SERIALIZATION()
9665 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupCreationDetail)
9666 IMPLEMENT_JSON_DOCUMENTATION(GroupCreationDetail)
9667
9668 public:
9670 typedef enum
9671 {
9673 csUndefined = 0,
9674
9676 csOk = 1,
9677
9679 csNoJson = -1,
9680
9682 csConflictingRpListAndCluster = -2,
9683
9685 csAlreadyExists = -3,
9686
9688 csInvalidConfiguration = -4,
9689
9691 csInvalidJson = -5,
9692
9694 csCryptoFailure = -6,
9695
9697 csAudioInputFailure = -7,
9698
9700 csAudioOutputFailure = -8,
9701
9703 csUnsupportedAudioEncoder = -9,
9704
9706 csNoLicense = -10,
9707
9709 csInvalidTransport = -11,
9710 } CreationStatus_t;
9711
9713 std::string id;
9714
9717
9719 {
9720 clear();
9721 }
9722
9723 void clear()
9724 {
9725 id.clear();
9726 status = csUndefined;
9727 }
9728 };
9729
9730 static void to_json(nlohmann::json& j, const GroupCreationDetail& p)
9731 {
9732 j = nlohmann::json{
9733 TOJSON_IMPL(id),
9734 TOJSON_IMPL(status)
9735 };
9736 }
9737 static void from_json(const nlohmann::json& j, GroupCreationDetail& p)
9738 {
9739 p.clear();
9740 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9741 getOptional<GroupCreationDetail::CreationStatus_t>("status", p.status, j, GroupCreationDetail::CreationStatus_t::csUndefined);
9742 }
9743
9744
9745 //-----------------------------------------------------------
9746 JSON_SERIALIZED_CLASS(GroupReconfigurationDetail)
9754 {
9755 IMPLEMENT_JSON_SERIALIZATION()
9756 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupReconfigurationDetail)
9757 IMPLEMENT_JSON_DOCUMENTATION(GroupReconfigurationDetail)
9758
9759 public:
9761 typedef enum
9762 {
9764 rsUndefined = 0,
9765
9767 rsOk = 1,
9768
9770 rsNoJson = -1,
9771
9773 rsInvalidConfiguration = -2,
9774
9776 rsInvalidJson = -3,
9777
9779 rsAudioInputFailure = -4,
9780
9782 rsAudioOutputFailure = -5,
9783
9785 rsDoesNotExist = -6,
9786
9788 rsAudioInputInUse = -7,
9789
9791 rsAudioDisabledForGroup = -8,
9792
9794 rsGroupIsNotAudio = -9
9795 } ReconfigurationStatus_t;
9796
9798 std::string id;
9799
9802
9804 {
9805 clear();
9806 }
9807
9808 void clear()
9809 {
9810 id.clear();
9811 status = rsUndefined;
9812 }
9813 };
9814
9815 static void to_json(nlohmann::json& j, const GroupReconfigurationDetail& p)
9816 {
9817 j = nlohmann::json{
9818 TOJSON_IMPL(id),
9819 TOJSON_IMPL(status)
9820 };
9821 }
9822 static void from_json(const nlohmann::json& j, GroupReconfigurationDetail& p)
9823 {
9824 p.clear();
9825 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9826 getOptional<GroupReconfigurationDetail::ReconfigurationStatus_t>("status", p.status, j, GroupReconfigurationDetail::ReconfigurationStatus_t::rsUndefined);
9827 }
9828
9829
9830 //-----------------------------------------------------------
9831 JSON_SERIALIZED_CLASS(GroupHealthReport)
9839 {
9840 IMPLEMENT_JSON_SERIALIZATION()
9841 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupHealthReport)
9842 IMPLEMENT_JSON_DOCUMENTATION(GroupHealthReport)
9843
9844 public:
9845 std::string id;
9846 uint64_t lastErrorTs;
9847 uint64_t decryptionErrors;
9848 uint64_t encryptionErrors;
9849 uint64_t unsupportDecoderErrors;
9850 uint64_t decoderFailures;
9851 uint64_t decoderStartFailures;
9852 uint64_t inboundRtpPacketAllocationFailures;
9853 uint64_t inboundRtpPacketLoadFailures;
9854 uint64_t latePacketsDiscarded;
9855 uint64_t jitterBufferInsertionFailures;
9856 uint64_t presenceDeserializationFailures;
9857 uint64_t notRtpErrors;
9858 uint64_t generalErrors;
9859
9861 {
9862 clear();
9863 }
9864
9865 void clear()
9866 {
9867 id.clear();
9868 lastErrorTs = 0;
9869 decryptionErrors = 0;
9870 encryptionErrors = 0;
9871 unsupportDecoderErrors = 0;
9872 decoderFailures = 0;
9873 decoderStartFailures = 0;
9874 inboundRtpPacketAllocationFailures = 0;
9875 inboundRtpPacketLoadFailures = 0;
9876 latePacketsDiscarded = 0;
9877 jitterBufferInsertionFailures = 0;
9878 presenceDeserializationFailures = 0;
9879 notRtpErrors = 0;
9880 generalErrors = 0;
9881 }
9882 };
9883
9884 static void to_json(nlohmann::json& j, const GroupHealthReport& p)
9885 {
9886 j = nlohmann::json{
9887 TOJSON_IMPL(id),
9888 TOJSON_IMPL(lastErrorTs),
9889 TOJSON_IMPL(decryptionErrors),
9890 TOJSON_IMPL(encryptionErrors),
9891 TOJSON_IMPL(unsupportDecoderErrors),
9892 TOJSON_IMPL(decoderFailures),
9893 TOJSON_IMPL(decoderStartFailures),
9894 TOJSON_IMPL(inboundRtpPacketAllocationFailures),
9895 TOJSON_IMPL(inboundRtpPacketLoadFailures),
9896 TOJSON_IMPL(latePacketsDiscarded),
9897 TOJSON_IMPL(jitterBufferInsertionFailures),
9898 TOJSON_IMPL(presenceDeserializationFailures),
9899 TOJSON_IMPL(notRtpErrors),
9900 TOJSON_IMPL(generalErrors)
9901 };
9902 }
9903 static void from_json(const nlohmann::json& j, GroupHealthReport& p)
9904 {
9905 p.clear();
9906 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9907 getOptional<uint64_t>("lastErrorTs", p.lastErrorTs, j, 0);
9908 getOptional<uint64_t>("decryptionErrors", p.decryptionErrors, j, 0);
9909 getOptional<uint64_t>("encryptionErrors", p.encryptionErrors, j, 0);
9910 getOptional<uint64_t>("unsupportDecoderErrors", p.unsupportDecoderErrors, j, 0);
9911 getOptional<uint64_t>("decoderFailures", p.decoderFailures, j, 0);
9912 getOptional<uint64_t>("decoderStartFailures", p.decoderStartFailures, j, 0);
9913 getOptional<uint64_t>("inboundRtpPacketAllocationFailures", p.inboundRtpPacketAllocationFailures, j, 0);
9914 getOptional<uint64_t>("inboundRtpPacketLoadFailures", p.inboundRtpPacketLoadFailures, j, 0);
9915 getOptional<uint64_t>("latePacketsDiscarded", p.latePacketsDiscarded, j, 0);
9916 getOptional<uint64_t>("jitterBufferInsertionFailures", p.jitterBufferInsertionFailures, j, 0);
9917 getOptional<uint64_t>("presenceDeserializationFailures", p.presenceDeserializationFailures, j, 0);
9918 getOptional<uint64_t>("notRtpErrors", p.notRtpErrors, j, 0);
9919 getOptional<uint64_t>("generalErrors", p.generalErrors, j, 0);
9920 }
9921
9922 //-----------------------------------------------------------
9923 JSON_SERIALIZED_CLASS(InboundProcessorStats)
9931 {
9932 IMPLEMENT_JSON_SERIALIZATION()
9933 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(InboundProcessorStats)
9934 IMPLEMENT_JSON_DOCUMENTATION(InboundProcessorStats)
9935
9936 public:
9937 uint32_t ssrc;
9938 double jitter;
9939 uint64_t minRtpSamplesInQueue;
9940 uint64_t maxRtpSamplesInQueue;
9941 uint64_t totalSamplesTrimmed;
9942 uint64_t underruns;
9943 uint64_t overruns;
9944 uint64_t samplesInQueue;
9945 uint64_t totalPacketsReceived;
9946 uint64_t totalPacketsLost;
9947 uint64_t totalPacketsDiscarded;
9948
9950 {
9951 clear();
9952 }
9953
9954 void clear()
9955 {
9956 ssrc = 0;
9957 jitter = 0.0;
9958 minRtpSamplesInQueue = 0;
9959 maxRtpSamplesInQueue = 0;
9960 totalSamplesTrimmed = 0;
9961 underruns = 0;
9962 overruns = 0;
9963 samplesInQueue = 0;
9964 totalPacketsReceived = 0;
9965 totalPacketsLost = 0;
9966 totalPacketsDiscarded = 0;
9967 }
9968 };
9969
9970 static void to_json(nlohmann::json& j, const InboundProcessorStats& p)
9971 {
9972 j = nlohmann::json{
9973 TOJSON_IMPL(ssrc),
9974 TOJSON_IMPL(jitter),
9975 TOJSON_IMPL(minRtpSamplesInQueue),
9976 TOJSON_IMPL(maxRtpSamplesInQueue),
9977 TOJSON_IMPL(totalSamplesTrimmed),
9978 TOJSON_IMPL(underruns),
9979 TOJSON_IMPL(overruns),
9980 TOJSON_IMPL(samplesInQueue),
9981 TOJSON_IMPL(totalPacketsReceived),
9982 TOJSON_IMPL(totalPacketsLost),
9983 TOJSON_IMPL(totalPacketsDiscarded)
9984 };
9985 }
9986 static void from_json(const nlohmann::json& j, InboundProcessorStats& p)
9987 {
9988 p.clear();
9989 getOptional<uint32_t>("ssrc", p.ssrc, j, 0);
9990 getOptional<double>("jitter", p.jitter, j, 0.0);
9991 getOptional<uint64_t>("minRtpSamplesInQueue", p.minRtpSamplesInQueue, j, 0);
9992 getOptional<uint64_t>("maxRtpSamplesInQueue", p.maxRtpSamplesInQueue, j, 0);
9993 getOptional<uint64_t>("totalSamplesTrimmed", p.totalSamplesTrimmed, j, 0);
9994 getOptional<uint64_t>("underruns", p.underruns, j, 0);
9995 getOptional<uint64_t>("overruns", p.overruns, j, 0);
9996 getOptional<uint64_t>("samplesInQueue", p.samplesInQueue, j, 0);
9997 getOptional<uint64_t>("totalPacketsReceived", p.totalPacketsReceived, j, 0);
9998 getOptional<uint64_t>("totalPacketsLost", p.totalPacketsLost, j, 0);
9999 getOptional<uint64_t>("totalPacketsDiscarded", p.totalPacketsDiscarded, j, 0);
10000 }
10001
10002 //-----------------------------------------------------------
10003 JSON_SERIALIZED_CLASS(TrafficCounter)
10011 {
10012 IMPLEMENT_JSON_SERIALIZATION()
10013 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(TrafficCounter)
10014 IMPLEMENT_JSON_DOCUMENTATION(TrafficCounter)
10015
10016 public:
10017 uint64_t packets;
10018 uint64_t bytes;
10019 uint64_t errors;
10020
10022 {
10023 clear();
10024 }
10025
10026 void clear()
10027 {
10028 packets = 0;
10029 bytes = 0;
10030 errors = 0;
10031 }
10032 };
10033
10034 static void to_json(nlohmann::json& j, const TrafficCounter& p)
10035 {
10036 j = nlohmann::json{
10037 TOJSON_IMPL(packets),
10038 TOJSON_IMPL(bytes),
10039 TOJSON_IMPL(errors)
10040 };
10041 }
10042 static void from_json(const nlohmann::json& j, TrafficCounter& p)
10043 {
10044 p.clear();
10045 getOptional<uint64_t>("packets", p.packets, j, 0);
10046 getOptional<uint64_t>("bytes", p.bytes, j, 0);
10047 getOptional<uint64_t>("errors", p.errors, j, 0);
10048 }
10049
10050 //-----------------------------------------------------------
10051 JSON_SERIALIZED_CLASS(GroupStats)
10059 {
10060 IMPLEMENT_JSON_SERIALIZATION()
10061 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupStats)
10062 IMPLEMENT_JSON_DOCUMENTATION(GroupStats)
10063
10064 public:
10065 std::string id;
10066 //std::vector<InboundProcessorStats> rtpInbounds;
10067 TrafficCounter rxTraffic;
10068 TrafficCounter txTraffic;
10069
10070 GroupStats()
10071 {
10072 clear();
10073 }
10074
10075 void clear()
10076 {
10077 id.clear();
10078 //rtpInbounds.clear();
10079 rxTraffic.clear();
10080 txTraffic.clear();
10081 }
10082 };
10083
10084 static void to_json(nlohmann::json& j, const GroupStats& p)
10085 {
10086 j = nlohmann::json{
10087 TOJSON_IMPL(id),
10088 //TOJSON_IMPL(rtpInbounds),
10089 TOJSON_IMPL(rxTraffic),
10090 TOJSON_IMPL(txTraffic)
10091 };
10092 }
10093 static void from_json(const nlohmann::json& j, GroupStats& p)
10094 {
10095 p.clear();
10096 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
10097 //getOptional<std::vector<InboundProcessorStats>>("rtpInbounds", p.rtpInbounds, j);
10098 getOptional<TrafficCounter>("rxTraffic", p.rxTraffic, j);
10099 getOptional<TrafficCounter>("txTraffic", p.txTraffic, j);
10100 }
10101
10102 //-----------------------------------------------------------
10103 JSON_SERIALIZED_CLASS(RallypointConnectionDetail)
10111 {
10112 IMPLEMENT_JSON_SERIALIZATION()
10113 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(RallypointConnectionDetail)
10114 IMPLEMENT_JSON_DOCUMENTATION(RallypointConnectionDetail)
10115
10116 public:
10118 std::string internalId;
10119
10121 std::string host;
10122
10124 int port;
10125
10128
10130 {
10131 clear();
10132 }
10133
10134 void clear()
10135 {
10136 internalId.clear();
10137 host.clear();
10138 port = 0;
10139 msToNextConnectionAttempt = 0;
10140 }
10141 };
10142
10143 static void to_json(nlohmann::json& j, const RallypointConnectionDetail& p)
10144 {
10145 j = nlohmann::json{
10146 TOJSON_IMPL(internalId),
10147 TOJSON_IMPL(host),
10148 TOJSON_IMPL(port)
10149 };
10150
10151 if(p.msToNextConnectionAttempt > 0)
10152 {
10153 j["msToNextConnectionAttempt"] = p.msToNextConnectionAttempt;
10154 }
10155 }
10156 static void from_json(const nlohmann::json& j, RallypointConnectionDetail& p)
10157 {
10158 p.clear();
10159 getOptional<std::string>("internalId", p.internalId, j, EMPTY_STRING);
10160 getOptional<std::string>("host", p.host, j, EMPTY_STRING);
10161 getOptional<int>("port", p.port, j, 0);
10162 getOptional<uint64_t>("msToNextConnectionAttempt", p.msToNextConnectionAttempt, j, 0);
10163 }
10164
10165 //-----------------------------------------------------------
10166 JSON_SERIALIZED_CLASS(TranslationSession)
10177 {
10178 IMPLEMENT_JSON_SERIALIZATION()
10179 IMPLEMENT_JSON_DOCUMENTATION(TranslationSession)
10180
10181 public:
10183 std::string id;
10184
10186 std::string name;
10187
10189 std::vector<std::string> groups;
10190
10193
10195 {
10196 clear();
10197 }
10198
10199 void clear()
10200 {
10201 id.clear();
10202 name.clear();
10203 groups.clear();
10204 enabled = true;
10205 }
10206 };
10207
10208 static void to_json(nlohmann::json& j, const TranslationSession& p)
10209 {
10210 j = nlohmann::json{
10211 TOJSON_IMPL(id),
10212 TOJSON_IMPL(name),
10213 TOJSON_IMPL(groups),
10214 TOJSON_IMPL(enabled)
10215 };
10216 }
10217 static void from_json(const nlohmann::json& j, TranslationSession& p)
10218 {
10219 p.clear();
10220 FROMJSON_IMPL(id, std::string, EMPTY_STRING);
10221 FROMJSON_IMPL(name, std::string, EMPTY_STRING);
10222 getOptional<std::vector<std::string>>("groups", p.groups, j);
10223 FROMJSON_IMPL(enabled, bool, true);
10224 }
10225
10226 //-----------------------------------------------------------
10227 JSON_SERIALIZED_CLASS(TranslationConfiguration)
10238 {
10239 IMPLEMENT_JSON_SERIALIZATION()
10240 IMPLEMENT_JSON_DOCUMENTATION(TranslationConfiguration)
10241
10242 public:
10244 std::vector<TranslationSession> sessions;
10245
10247 std::vector<Group> groups;
10248
10250 {
10251 clear();
10252 }
10253
10254 void clear()
10255 {
10256 sessions.clear();
10257 groups.clear();
10258 }
10259 };
10260
10261 static void to_json(nlohmann::json& j, const TranslationConfiguration& p)
10262 {
10263 j = nlohmann::json{
10264 TOJSON_IMPL(sessions),
10265 TOJSON_IMPL(groups)
10266 };
10267 }
10268 static void from_json(const nlohmann::json& j, TranslationConfiguration& p)
10269 {
10270 p.clear();
10271 getOptional<std::vector<TranslationSession>>("sessions", p.sessions, j);
10272 getOptional<std::vector<Group>>("groups", p.groups, j);
10273 }
10274
10275 //-----------------------------------------------------------
10276 JSON_SERIALIZED_CLASS(LingoServerStatusReportConfiguration)
10287 {
10288 IMPLEMENT_JSON_SERIALIZATION()
10289 IMPLEMENT_JSON_DOCUMENTATION(LingoServerStatusReportConfiguration)
10290
10291 public:
10293 std::string fileName;
10294
10297
10300
10302 std::string runCmd;
10303
10306
10309
10312
10314 {
10315 clear();
10316 }
10317
10318 void clear()
10319 {
10320 fileName.clear();
10321 intervalSecs = 60;
10322 enabled = false;
10323 includeGroupDetail = false;
10324 includeSessionDetail = false;
10325 includeSessionGroupDetail = false;
10326 runCmd.clear();
10327 }
10328 };
10329
10330 static void to_json(nlohmann::json& j, const LingoServerStatusReportConfiguration& p)
10331 {
10332 j = nlohmann::json{
10333 TOJSON_IMPL(fileName),
10334 TOJSON_IMPL(intervalSecs),
10335 TOJSON_IMPL(enabled),
10336 TOJSON_IMPL(includeGroupDetail),
10337 TOJSON_IMPL(includeSessionDetail),
10338 TOJSON_IMPL(includeSessionGroupDetail),
10339 TOJSON_IMPL(runCmd)
10340 };
10341 }
10342 static void from_json(const nlohmann::json& j, LingoServerStatusReportConfiguration& p)
10343 {
10344 p.clear();
10345 getOptional<std::string>("fileName", p.fileName, j);
10346 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
10347 getOptional<bool>("enabled", p.enabled, j, false);
10348 getOptional<std::string>("runCmd", p.runCmd, j);
10349 getOptional<bool>("includeGroupDetail", p.includeGroupDetail, j, false);
10350 getOptional<bool>("includeSessionDetail", p.includeSessionDetail, j, false);
10351 getOptional<bool>("includeSessionGroupDetail", p.includeSessionGroupDetail, j, false);
10352 }
10353
10354 //-----------------------------------------------------------
10355 JSON_SERIALIZED_CLASS(LingoServerInternals)
10368 {
10369 IMPLEMENT_JSON_SERIALIZATION()
10370 IMPLEMENT_JSON_DOCUMENTATION(LingoServerInternals)
10371
10372 public:
10375
10378
10380 {
10381 clear();
10382 }
10383
10384 void clear()
10385 {
10386 watchdog.clear();
10387 housekeeperIntervalMs = 1000;
10388 }
10389 };
10390
10391 static void to_json(nlohmann::json& j, const LingoServerInternals& p)
10392 {
10393 j = nlohmann::json{
10394 TOJSON_IMPL(watchdog),
10395 TOJSON_IMPL(housekeeperIntervalMs)
10396 };
10397 }
10398 static void from_json(const nlohmann::json& j, LingoServerInternals& p)
10399 {
10400 p.clear();
10401 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
10402 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
10403 }
10404
10405 //-----------------------------------------------------------
10406 JSON_SERIALIZED_CLASS(LingoServerConfiguration)
10416 {
10417 IMPLEMENT_JSON_SERIALIZATION()
10418 IMPLEMENT_JSON_DOCUMENTATION(LingoServerConfiguration)
10419
10420 public:
10422 std::string id;
10423
10426
10429
10432
10435
10438
10441
10444
10447
10450
10453
10456
10459
10462
10465
10467 {
10468 clear();
10469 }
10470
10471 void clear()
10472 {
10473 id.clear();
10474 serviceConfigurationFileCheckSecs = 60;
10475 lingoConfigurationFileName.clear();
10476 lingoConfigurationFileCommand.clear();
10477 lingoConfigurationFileCheckSecs = 60;
10478 statusReport.clear();
10479 externalHealthCheckResponder.clear();
10480 internals.clear();
10481 certStoreFileName.clear();
10482 certStorePasswordHex.clear();
10483 enginePolicy.clear();
10484 configurationCheckSignalName = "rts.22f4ec3.${id}";
10485 fipsCrypto.clear();
10486 proxy.clear();
10487 nsm.clear();
10488 }
10489 };
10490
10491 static void to_json(nlohmann::json& j, const LingoServerConfiguration& p)
10492 {
10493 j = nlohmann::json{
10494 TOJSON_IMPL(id),
10495 TOJSON_IMPL(serviceConfigurationFileCheckSecs),
10496 TOJSON_IMPL(lingoConfigurationFileName),
10497 TOJSON_IMPL(lingoConfigurationFileCommand),
10498 TOJSON_IMPL(lingoConfigurationFileCheckSecs),
10499 TOJSON_IMPL(statusReport),
10500 TOJSON_IMPL(externalHealthCheckResponder),
10501 TOJSON_IMPL(internals),
10502 TOJSON_IMPL(certStoreFileName),
10503 TOJSON_IMPL(certStorePasswordHex),
10504 TOJSON_IMPL(enginePolicy),
10505 TOJSON_IMPL(configurationCheckSignalName),
10506 TOJSON_IMPL(fipsCrypto),
10507 TOJSON_IMPL(proxy),
10508 TOJSON_IMPL(nsm)
10509 };
10510 }
10511 static void from_json(const nlohmann::json& j, LingoServerConfiguration& p)
10512 {
10513 p.clear();
10514 getOptional<std::string>("id", p.id, j);
10515 getOptional<int>("serviceConfigurationFileCheckSecs", p.serviceConfigurationFileCheckSecs, j, 60);
10516 getOptional<std::string>("lingoConfigurationFileName", p.lingoConfigurationFileName, j);
10517 getOptional<std::string>("lingoConfigurationFileCommand", p.lingoConfigurationFileCommand, j);
10518 getOptional<int>("lingoConfigurationFileCheckSecs", p.lingoConfigurationFileCheckSecs, j, 60);
10519 getOptional<LingoServerStatusReportConfiguration>("statusReport", p.statusReport, j);
10520 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
10521 getOptional<LingoServerInternals>("internals", p.internals, j);
10522 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
10523 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
10524 j.at("enginePolicy").get_to(p.enginePolicy);
10525 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.22f4ec3.${id}");
10526 getOptional<FipsCryptoSettings>("fipsCrypo", p.fipsCrypto, j);
10527 getOptional<NetworkAddress>("proxy", p.proxy, j);
10528 getOptional<NsmConfiguration>("nsm", p.nsm, j);
10529 }
10530
10531
10532 //-----------------------------------------------------------
10533 JSON_SERIALIZED_CLASS(VoiceToVoiceSession)
10544 {
10545 IMPLEMENT_JSON_SERIALIZATION()
10546 IMPLEMENT_JSON_DOCUMENTATION(VoiceToVoiceSession)
10547
10548 public:
10550 std::string id;
10551
10553 std::string name;
10554
10556 std::vector<std::string> groups;
10557
10560
10562 {
10563 clear();
10564 }
10565
10566 void clear()
10567 {
10568 id.clear();
10569 name.clear();
10570 groups.clear();
10571 enabled = true;
10572 }
10573 };
10574
10575 static void to_json(nlohmann::json& j, const VoiceToVoiceSession& p)
10576 {
10577 j = nlohmann::json{
10578 TOJSON_IMPL(id),
10579 TOJSON_IMPL(name),
10580 TOJSON_IMPL(groups),
10581 TOJSON_IMPL(enabled)
10582 };
10583 }
10584 static void from_json(const nlohmann::json& j, VoiceToVoiceSession& p)
10585 {
10586 p.clear();
10587 FROMJSON_IMPL(id, std::string, EMPTY_STRING);
10588 FROMJSON_IMPL(name, std::string, EMPTY_STRING);
10589 getOptional<std::vector<std::string>>("groups", p.groups, j);
10590 FROMJSON_IMPL(enabled, bool, true);
10591 }
10592
10593 //-----------------------------------------------------------
10594 JSON_SERIALIZED_CLASS(LingoConfiguration)
10605 {
10606 IMPLEMENT_JSON_SERIALIZATION()
10607 IMPLEMENT_JSON_DOCUMENTATION(LingoConfiguration)
10608
10609 public:
10611 std::vector<VoiceToVoiceSession> voiceToVoiceSessions;
10612
10614 std::vector<Group> groups;
10615
10617 {
10618 clear();
10619 }
10620
10621 void clear()
10622 {
10623 voiceToVoiceSessions.clear();
10624 groups.clear();
10625 }
10626 };
10627
10628 static void to_json(nlohmann::json& j, const LingoConfiguration& p)
10629 {
10630 j = nlohmann::json{
10631 TOJSON_IMPL(voiceToVoiceSessions),
10632 TOJSON_IMPL(groups)
10633 };
10634 }
10635 static void from_json(const nlohmann::json& j, LingoConfiguration& p)
10636 {
10637 p.clear();
10638 getOptional<std::vector<VoiceToVoiceSession>>("voiceToVoiceSessions", p.voiceToVoiceSessions, j);
10639 getOptional<std::vector<Group>>("groups", p.groups, j);
10640 }
10641
10642 //-----------------------------------------------------------
10643 JSON_SERIALIZED_CLASS(BridgingConfiguration)
10654 {
10655 IMPLEMENT_JSON_SERIALIZATION()
10656 IMPLEMENT_JSON_DOCUMENTATION(BridgingConfiguration)
10657
10658 public:
10660 std::vector<Bridge> bridges;
10661
10663 std::vector<Group> groups;
10664
10666 {
10667 clear();
10668 }
10669
10670 void clear()
10671 {
10672 bridges.clear();
10673 groups.clear();
10674 }
10675 };
10676
10677 static void to_json(nlohmann::json& j, const BridgingConfiguration& p)
10678 {
10679 j = nlohmann::json{
10680 TOJSON_IMPL(bridges),
10681 TOJSON_IMPL(groups)
10682 };
10683 }
10684 static void from_json(const nlohmann::json& j, BridgingConfiguration& p)
10685 {
10686 p.clear();
10687 getOptional<std::vector<Bridge>>("bridges", p.bridges, j);
10688 getOptional<std::vector<Group>>("groups", p.groups, j);
10689 }
10690
10691 //-----------------------------------------------------------
10692 JSON_SERIALIZED_CLASS(BridgingServerStatusReportConfiguration)
10703 {
10704 IMPLEMENT_JSON_SERIALIZATION()
10705 IMPLEMENT_JSON_DOCUMENTATION(BridgingServerStatusReportConfiguration)
10706
10707 public:
10709 std::string fileName;
10710
10713
10716
10718 std::string runCmd;
10719
10722
10725
10728
10730 {
10731 clear();
10732 }
10733
10734 void clear()
10735 {
10736 fileName.clear();
10737 intervalSecs = 60;
10738 enabled = false;
10739 includeGroupDetail = false;
10740 includeBridgeDetail = false;
10741 includeBridgeGroupDetail = false;
10742 runCmd.clear();
10743 }
10744 };
10745
10746 static void to_json(nlohmann::json& j, const BridgingServerStatusReportConfiguration& p)
10747 {
10748 j = nlohmann::json{
10749 TOJSON_IMPL(fileName),
10750 TOJSON_IMPL(intervalSecs),
10751 TOJSON_IMPL(enabled),
10752 TOJSON_IMPL(includeGroupDetail),
10753 TOJSON_IMPL(includeBridgeDetail),
10754 TOJSON_IMPL(includeBridgeGroupDetail),
10755 TOJSON_IMPL(runCmd)
10756 };
10757 }
10758 static void from_json(const nlohmann::json& j, BridgingServerStatusReportConfiguration& p)
10759 {
10760 p.clear();
10761 getOptional<std::string>("fileName", p.fileName, j);
10762 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
10763 getOptional<bool>("enabled", p.enabled, j, false);
10764 getOptional<std::string>("runCmd", p.runCmd, j);
10765 getOptional<bool>("includeGroupDetail", p.includeGroupDetail, j, false);
10766 getOptional<bool>("includeBridgeDetail", p.includeBridgeDetail, j, false);
10767 getOptional<bool>("includeBridgeGroupDetail", p.includeBridgeGroupDetail, j, false);
10768 }
10769
10770 //-----------------------------------------------------------
10771 JSON_SERIALIZED_CLASS(BridgingServerInternals)
10784 {
10785 IMPLEMENT_JSON_SERIALIZATION()
10786 IMPLEMENT_JSON_DOCUMENTATION(BridgingServerInternals)
10787
10788 public:
10791
10794
10796 {
10797 clear();
10798 }
10799
10800 void clear()
10801 {
10802 watchdog.clear();
10803 housekeeperIntervalMs = 1000;
10804 }
10805 };
10806
10807 static void to_json(nlohmann::json& j, const BridgingServerInternals& p)
10808 {
10809 j = nlohmann::json{
10810 TOJSON_IMPL(watchdog),
10811 TOJSON_IMPL(housekeeperIntervalMs)
10812 };
10813 }
10814 static void from_json(const nlohmann::json& j, BridgingServerInternals& p)
10815 {
10816 p.clear();
10817 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
10818 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
10819 }
10820
10821 //-----------------------------------------------------------
10822 JSON_SERIALIZED_CLASS(BridgingServerConfiguration)
10832 {
10833 IMPLEMENT_JSON_SERIALIZATION()
10834 IMPLEMENT_JSON_DOCUMENTATION(BridgingServerConfiguration)
10835
10836 public:
10838 typedef enum
10839 {
10841 omRaw = 0,
10842
10844 omPayloadTransformation = 1,
10845
10847 omAnonymousMixing = 2,
10848
10850 omLanguageTranslation = 3
10851 } OpMode_t;
10852
10854 std::string id;
10855
10858
10861
10864
10867
10870
10873
10876
10879
10882
10885
10888
10891
10894
10897
10899 {
10900 clear();
10901 }
10902
10903 void clear()
10904 {
10905 id.clear();
10906 mode = omRaw;
10907 serviceConfigurationFileCheckSecs = 60;
10908 bridgingConfigurationFileName.clear();
10909 bridgingConfigurationFileCommand.clear();
10910 bridgingConfigurationFileCheckSecs = 60;
10911 statusReport.clear();
10912 externalHealthCheckResponder.clear();
10913 internals.clear();
10914 certStoreFileName.clear();
10915 certStorePasswordHex.clear();
10916 enginePolicy.clear();
10917 configurationCheckSignalName = "rts.6cc0651.${id}";
10918 fipsCrypto.clear();
10919 nsm.clear();
10920 }
10921 };
10922
10923 static void to_json(nlohmann::json& j, const BridgingServerConfiguration& p)
10924 {
10925 j = nlohmann::json{
10926 TOJSON_IMPL(id),
10927 TOJSON_IMPL(mode),
10928 TOJSON_IMPL(serviceConfigurationFileCheckSecs),
10929 TOJSON_IMPL(bridgingConfigurationFileName),
10930 TOJSON_IMPL(bridgingConfigurationFileCommand),
10931 TOJSON_IMPL(bridgingConfigurationFileCheckSecs),
10932 TOJSON_IMPL(statusReport),
10933 TOJSON_IMPL(externalHealthCheckResponder),
10934 TOJSON_IMPL(internals),
10935 TOJSON_IMPL(certStoreFileName),
10936 TOJSON_IMPL(certStorePasswordHex),
10937 TOJSON_IMPL(enginePolicy),
10938 TOJSON_IMPL(configurationCheckSignalName),
10939 TOJSON_IMPL(fipsCrypto),
10940 TOJSON_IMPL(nsm)
10941 };
10942 }
10943 static void from_json(const nlohmann::json& j, BridgingServerConfiguration& p)
10944 {
10945 p.clear();
10946 getOptional<std::string>("id", p.id, j);
10947 getOptional<BridgingServerConfiguration::OpMode_t>("mode", p.mode, j, BridgingServerConfiguration::OpMode_t::omRaw);
10948 getOptional<int>("serviceConfigurationFileCheckSecs", p.serviceConfigurationFileCheckSecs, j, 60);
10949 getOptional<std::string>("bridgingConfigurationFileName", p.bridgingConfigurationFileName, j);
10950 getOptional<std::string>("bridgingConfigurationFileCommand", p.bridgingConfigurationFileCommand, j);
10951 getOptional<int>("bridgingConfigurationFileCheckSecs", p.bridgingConfigurationFileCheckSecs, j, 60);
10952 getOptional<BridgingServerStatusReportConfiguration>("statusReport", p.statusReport, j);
10953 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
10954 getOptional<BridgingServerInternals>("internals", p.internals, j);
10955 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
10956 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
10957 j.at("enginePolicy").get_to(p.enginePolicy);
10958 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.6cc0651.${id}");
10959 getOptional<FipsCryptoSettings>("fipsCrypto", p.fipsCrypto, j);
10960 getOptional<NsmConfiguration>("nsm", p.nsm, j);
10961 }
10962
10963
10964 //-----------------------------------------------------------
10965 JSON_SERIALIZED_CLASS(EarGroupsConfiguration)
10976 {
10977 IMPLEMENT_JSON_SERIALIZATION()
10978 IMPLEMENT_JSON_DOCUMENTATION(EarGroupsConfiguration)
10979
10980 public:
10982 std::vector<Group> groups;
10983
10985 {
10986 clear();
10987 }
10988
10989 void clear()
10990 {
10991 groups.clear();
10992 }
10993 };
10994
10995 static void to_json(nlohmann::json& j, const EarGroupsConfiguration& p)
10996 {
10997 j = nlohmann::json{
10998 TOJSON_IMPL(groups)
10999 };
11000 }
11001 static void from_json(const nlohmann::json& j, EarGroupsConfiguration& p)
11002 {
11003 p.clear();
11004 getOptional<std::vector<Group>>("groups", p.groups, j);
11005 }
11006
11007 //-----------------------------------------------------------
11008 JSON_SERIALIZED_CLASS(EarServerStatusReportConfiguration)
11019 {
11020 IMPLEMENT_JSON_SERIALIZATION()
11021 IMPLEMENT_JSON_DOCUMENTATION(EarServerStatusReportConfiguration)
11022
11023 public:
11025 std::string fileName;
11026
11029
11032
11034 std::string runCmd;
11035
11038
11040 {
11041 clear();
11042 }
11043
11044 void clear()
11045 {
11046 fileName.clear();
11047 intervalSecs = 60;
11048 enabled = false;
11049 includeGroupDetail = false;
11050 runCmd.clear();
11051 }
11052 };
11053
11054 static void to_json(nlohmann::json& j, const EarServerStatusReportConfiguration& p)
11055 {
11056 j = nlohmann::json{
11057 TOJSON_IMPL(fileName),
11058 TOJSON_IMPL(intervalSecs),
11059 TOJSON_IMPL(enabled),
11060 TOJSON_IMPL(includeGroupDetail),
11061 TOJSON_IMPL(runCmd)
11062 };
11063 }
11064 static void from_json(const nlohmann::json& j, EarServerStatusReportConfiguration& p)
11065 {
11066 p.clear();
11067 getOptional<std::string>("fileName", p.fileName, j);
11068 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
11069 getOptional<bool>("enabled", p.enabled, j, false);
11070 getOptional<std::string>("runCmd", p.runCmd, j);
11071 getOptional<bool>("includeGroupDetail", p.includeGroupDetail, j, false);
11072 }
11073
11074 //-----------------------------------------------------------
11075 JSON_SERIALIZED_CLASS(EarServerInternals)
11088 {
11089 IMPLEMENT_JSON_SERIALIZATION()
11090 IMPLEMENT_JSON_DOCUMENTATION(EarServerInternals)
11091
11092 public:
11095
11098
11100 {
11101 clear();
11102 }
11103
11104 void clear()
11105 {
11106 watchdog.clear();
11107 housekeeperIntervalMs = 1000;
11108 }
11109 };
11110
11111 static void to_json(nlohmann::json& j, const EarServerInternals& p)
11112 {
11113 j = nlohmann::json{
11114 TOJSON_IMPL(watchdog),
11115 TOJSON_IMPL(housekeeperIntervalMs)
11116 };
11117 }
11118 static void from_json(const nlohmann::json& j, EarServerInternals& p)
11119 {
11120 p.clear();
11121 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
11122 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
11123 }
11124
11125 //-----------------------------------------------------------
11126 JSON_SERIALIZED_CLASS(EarServerConfiguration)
11136 {
11137 IMPLEMENT_JSON_SERIALIZATION()
11138 IMPLEMENT_JSON_DOCUMENTATION(EarServerConfiguration)
11139
11140 public:
11141
11143 std::string id;
11144
11147
11150
11153
11156
11159
11162
11165
11168
11171
11174
11177
11180
11183
11185 {
11186 clear();
11187 }
11188
11189 void clear()
11190 {
11191 id.clear();
11192 serviceConfigurationFileCheckSecs = 60;
11193 groupsConfigurationFileName.clear();
11194 groupsConfigurationFileCommand.clear();
11195 groupsConfigurationFileCheckSecs = 60;
11196 statusReport.clear();
11197 externalHealthCheckResponder.clear();
11198 internals.clear();
11199 certStoreFileName.clear();
11200 certStorePasswordHex.clear();
11201 enginePolicy.clear();
11202 configurationCheckSignalName = "rts.9a164fa.${id}";
11203 fipsCrypto.clear();
11204 nsm.clear();
11205 }
11206 };
11207
11208 static void to_json(nlohmann::json& j, const EarServerConfiguration& p)
11209 {
11210 j = nlohmann::json{
11211 TOJSON_IMPL(id),
11212 TOJSON_IMPL(serviceConfigurationFileCheckSecs),
11213 TOJSON_IMPL(groupsConfigurationFileName),
11214 TOJSON_IMPL(groupsConfigurationFileCommand),
11215 TOJSON_IMPL(groupsConfigurationFileCheckSecs),
11216 TOJSON_IMPL(statusReport),
11217 TOJSON_IMPL(externalHealthCheckResponder),
11218 TOJSON_IMPL(internals),
11219 TOJSON_IMPL(certStoreFileName),
11220 TOJSON_IMPL(certStorePasswordHex),
11221 TOJSON_IMPL(enginePolicy),
11222 TOJSON_IMPL(configurationCheckSignalName),
11223 TOJSON_IMPL(fipsCrypto),
11224 TOJSON_IMPL(nsm)
11225 };
11226 }
11227 static void from_json(const nlohmann::json& j, EarServerConfiguration& p)
11228 {
11229 p.clear();
11230 getOptional<std::string>("id", p.id, j);
11231 getOptional<int>("serviceConfigurationFileCheckSecs", p.serviceConfigurationFileCheckSecs, j, 60);
11232 getOptional<std::string>("groupsConfigurationFileName", p.groupsConfigurationFileName, j);
11233 getOptional<std::string>("groupsConfigurationFileCommand", p.groupsConfigurationFileCommand, j);
11234 getOptional<int>("groupsConfigurationFileCheckSecs", p.groupsConfigurationFileCheckSecs, j, 60);
11235 getOptional<EarServerStatusReportConfiguration>("statusReport", p.statusReport, j);
11236 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
11237 getOptional<EarServerInternals>("internals", p.internals, j);
11238 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
11239 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
11240 j.at("enginePolicy").get_to(p.enginePolicy);
11241 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.9a164fa.${id}");
11242 getOptional<FipsCryptoSettings>("fipsCrypto", p.fipsCrypto, j);
11243 getOptional<NsmConfiguration>("nsm", p.nsm, j);
11244 }
11245
11246//-----------------------------------------------------------
11247 JSON_SERIALIZED_CLASS(EngageSemGroupsConfiguration)
11258 {
11259 IMPLEMENT_JSON_SERIALIZATION()
11260 IMPLEMENT_JSON_DOCUMENTATION(EngageSemGroupsConfiguration)
11261
11262 public:
11264 std::vector<Group> groups;
11265
11267 {
11268 clear();
11269 }
11270
11271 void clear()
11272 {
11273 groups.clear();
11274 }
11275 };
11276
11277 static void to_json(nlohmann::json& j, const EngageSemGroupsConfiguration& p)
11278 {
11279 j = nlohmann::json{
11280 TOJSON_IMPL(groups)
11281 };
11282 }
11283 static void from_json(const nlohmann::json& j, EngageSemGroupsConfiguration& p)
11284 {
11285 p.clear();
11286 getOptional<std::vector<Group>>("groups", p.groups, j);
11287 }
11288
11289 //-----------------------------------------------------------
11290 JSON_SERIALIZED_CLASS(EngageSemServerStatusReportConfiguration)
11301 {
11302 IMPLEMENT_JSON_SERIALIZATION()
11303 IMPLEMENT_JSON_DOCUMENTATION(EngageSemServerStatusReportConfiguration)
11304
11305 public:
11307 std::string fileName;
11308
11311
11314
11316 std::string runCmd;
11317
11320
11322 {
11323 clear();
11324 }
11325
11326 void clear()
11327 {
11328 fileName.clear();
11329 intervalSecs = 60;
11330 enabled = false;
11331 includeGroupDetail = false;
11332 runCmd.clear();
11333 }
11334 };
11335
11336 static void to_json(nlohmann::json& j, const EngageSemServerStatusReportConfiguration& p)
11337 {
11338 j = nlohmann::json{
11339 TOJSON_IMPL(fileName),
11340 TOJSON_IMPL(intervalSecs),
11341 TOJSON_IMPL(enabled),
11342 TOJSON_IMPL(includeGroupDetail),
11343 TOJSON_IMPL(runCmd)
11344 };
11345 }
11346 static void from_json(const nlohmann::json& j, EngageSemServerStatusReportConfiguration& p)
11347 {
11348 p.clear();
11349 getOptional<std::string>("fileName", p.fileName, j);
11350 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
11351 getOptional<bool>("enabled", p.enabled, j, false);
11352 getOptional<std::string>("runCmd", p.runCmd, j);
11353 getOptional<bool>("includeGroupDetail", p.includeGroupDetail, j, false);
11354 }
11355
11356 //-----------------------------------------------------------
11357 JSON_SERIALIZED_CLASS(EngageSemServerInternals)
11370 {
11371 IMPLEMENT_JSON_SERIALIZATION()
11372 IMPLEMENT_JSON_DOCUMENTATION(EngageSemServerInternals)
11373
11374 public:
11377
11380
11382 {
11383 clear();
11384 }
11385
11386 void clear()
11387 {
11388 watchdog.clear();
11389 housekeeperIntervalMs = 1000;
11390 }
11391 };
11392
11393 static void to_json(nlohmann::json& j, const EngageSemServerInternals& p)
11394 {
11395 j = nlohmann::json{
11396 TOJSON_IMPL(watchdog),
11397 TOJSON_IMPL(housekeeperIntervalMs)
11398 };
11399 }
11400 static void from_json(const nlohmann::json& j, EngageSemServerInternals& p)
11401 {
11402 p.clear();
11403 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
11404 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
11405 }
11406
11407 //-----------------------------------------------------------
11408 JSON_SERIALIZED_CLASS(EngageSemServerConfiguration)
11418 {
11419 IMPLEMENT_JSON_SERIALIZATION()
11420 IMPLEMENT_JSON_DOCUMENTATION(EngageSemServerConfiguration)
11421
11422 public:
11423
11425 std::string id;
11426
11429
11432
11435
11438
11441
11444
11447
11450
11453
11456
11459
11462
11465
11466 int maxQueueLen;
11467 int minQueuingMs;
11468 int maxQueuingMs;
11469 int minPriority;
11470 int maxPriority;
11471
11473 {
11474 clear();
11475 }
11476
11477 void clear()
11478 {
11479 id.clear();
11480 serviceConfigurationFileCheckSecs = 60;
11481 groupsConfigurationFileName.clear();
11482 groupsConfigurationFileCommand.clear();
11483 groupsConfigurationFileCheckSecs = 60;
11484 statusReport.clear();
11485 externalHealthCheckResponder.clear();
11486 internals.clear();
11487 certStoreFileName.clear();
11488 certStorePasswordHex.clear();
11489 enginePolicy.clear();
11490 configurationCheckSignalName = "rts.9a164fa.${id}";
11491 fipsCrypto.clear();
11492 nsm.clear();
11493
11494 maxQueueLen = 64;
11495 minQueuingMs = 0;
11496 maxQueuingMs = 15000;
11497 minPriority = 0;
11498 maxPriority = 255;
11499 }
11500 };
11501
11502 static void to_json(nlohmann::json& j, const EngageSemServerConfiguration& p)
11503 {
11504 j = nlohmann::json{
11505 TOJSON_IMPL(id),
11506 TOJSON_IMPL(serviceConfigurationFileCheckSecs),
11507 TOJSON_IMPL(groupsConfigurationFileName),
11508 TOJSON_IMPL(groupsConfigurationFileCommand),
11509 TOJSON_IMPL(groupsConfigurationFileCheckSecs),
11510 TOJSON_IMPL(statusReport),
11511 TOJSON_IMPL(externalHealthCheckResponder),
11512 TOJSON_IMPL(internals),
11513 TOJSON_IMPL(certStoreFileName),
11514 TOJSON_IMPL(certStorePasswordHex),
11515 TOJSON_IMPL(enginePolicy),
11516 TOJSON_IMPL(configurationCheckSignalName),
11517 TOJSON_IMPL(fipsCrypto),
11518 TOJSON_IMPL(nsm),
11519 TOJSON_IMPL(maxQueueLen),
11520 TOJSON_IMPL(minQueuingMs),
11521 TOJSON_IMPL(maxQueuingMs),
11522 TOJSON_IMPL(minPriority),
11523 TOJSON_IMPL(maxPriority)
11524 };
11525 }
11526 static void from_json(const nlohmann::json& j, EngageSemServerConfiguration& p)
11527 {
11528 p.clear();
11529 getOptional<std::string>("id", p.id, j);
11530 getOptional<int>("serviceConfigurationFileCheckSecs", p.serviceConfigurationFileCheckSecs, j, 60);
11531 getOptional<std::string>("groupsConfigurationFileName", p.groupsConfigurationFileName, j);
11532 getOptional<std::string>("groupsConfigurationFileCommand", p.groupsConfigurationFileCommand, j);
11533 getOptional<int>("groupsConfigurationFileCheckSecs", p.groupsConfigurationFileCheckSecs, j, 60);
11534 getOptional<EngageSemServerStatusReportConfiguration>("statusReport", p.statusReport, j);
11535 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
11536 getOptional<EngageSemServerInternals>("internals", p.internals, j);
11537 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
11538 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
11539 j.at("enginePolicy").get_to(p.enginePolicy);
11540 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.9a164fa.${id}");
11541 getOptional<FipsCryptoSettings>("fipsCrypto", p.fipsCrypto, j);
11542 getOptional<NsmConfiguration>("nsm", p.nsm, j);
11543 getOptional<int>("maxQueueLen", p.maxQueueLen, j, 64);
11544 getOptional<int>("minQueuingMs", p.minQueuingMs, j, 0);
11545 getOptional<int>("maxQueuingMs", p.maxQueuingMs, j, 15000);
11546 getOptional<int>("minPriority", p.minPriority, j, 0);
11547 getOptional<int>("maxPriority", p.maxPriority, j, 255);
11548 }
11549
11550 //-----------------------------------------------------------
11551 static inline void dumpExampleConfigurations(const char *path)
11552 {
11553 WatchdogSettings::document();
11554 FileRecordingRequest::document();
11555 Feature::document();
11556 Featureset::document();
11557 Agc::document();
11558 RtpPayloadTypeTranslation::document();
11559 NetworkInterfaceDevice::document();
11560 ListOfNetworkInterfaceDevice::document();
11561 RtpHeader::document();
11562 BlobInfo::document();
11563 TxAudioUri::document();
11564 AdvancedTxParams::document();
11565 Identity::document();
11566 Location::document();
11567 Power::document();
11568 Connectivity::document();
11569 PresenceDescriptorGroupItem::document();
11570 PresenceDescriptor::document();
11571 NetworkTxOptions::document();
11572 TcpNetworkTxOptions::document();
11573 NetworkAddress::document();
11574 NetworkAddressRxTx::document();
11575 NetworkAddressRestrictionList::document();
11576 StringRestrictionList::document();
11577 Rallypoint::document();
11578 RallypointCluster::document();
11579 NetworkDeviceDescriptor::document();
11580 TxAudio::document();
11581 AudioDeviceDescriptor::document();
11582 ListOfAudioDeviceDescriptor::document();
11583 Audio::document();
11584 TalkerInformation::document();
11585 GroupTalkers::document();
11586 Presence::document();
11587 Advertising::document();
11588 GroupPriorityTranslation::document();
11589 GroupTimeline::document();
11590 GroupAppTransport::document();
11591 RtpProfile::document();
11592 Group::document();
11593 Mission::document();
11594 LicenseDescriptor::document();
11595 EngineNetworkingRpUdpStreaming::document();
11596 EnginePolicyNetworking::document();
11597 Aec::document();
11598 Vad::document();
11599 Bridge::document();
11600 AndroidAudio::document();
11601 EnginePolicyAudio::document();
11602 SecurityCertificate::document();
11603 EnginePolicySecurity::document();
11604 EnginePolicyLogging::document();
11605 EnginePolicyDatabase::document();
11606 NamedAudioDevice::document();
11607 EnginePolicyNamedAudioDevices::document();
11608 Licensing::document();
11609 DiscoveryMagellan::document();
11610 DiscoverySsdp::document();
11611 DiscoverySap::document();
11612 DiscoveryCistech::document();
11613 DiscoveryTrellisware::document();
11614 DiscoveryConfiguration::document();
11615 EnginePolicyInternals::document();
11616 EnginePolicyTimelines::document();
11617 RtpMapEntry::document();
11618 ExternalModule::document();
11619 ExternalCodecDescriptor::document();
11620 EnginePolicy::document();
11621 TalkgroupAsset::document();
11622 EngageDiscoveredGroup::document();
11623 RallypointPeer::document();
11624 RallypointServerLimits::document();
11625 RallypointServerStatusReportConfiguration::document();
11626 RallypointServerLinkGraph::document();
11627 ExternalHealthCheckResponder::document();
11628 Tls::document();
11629 PeeringConfiguration::document();
11630 IgmpSnooping::document();
11631 RallypointReflector::document();
11632 RallypointUdpStreaming::document();
11633 RallypointServer::document();
11634 PlatformDiscoveredService::document();
11635 TimelineQueryParameters::document();
11636 CertStoreCertificate::document();
11637 CertStore::document();
11638 CertStoreCertificateElement::document();
11639 CertStoreDescriptor::document();
11640 CertificateDescriptor::document();
11641 BridgeCreationDetail::document();
11642 GroupConnectionDetail::document();
11643 GroupTxDetail::document();
11644 GroupCreationDetail::document();
11645 GroupReconfigurationDetail::document();
11646 GroupHealthReport::document();
11647 InboundProcessorStats::document();
11648 TrafficCounter::document();
11649 GroupStats::document();
11650 RallypointConnectionDetail::document();
11651 BridgingConfiguration::document();
11652 BridgingServerStatusReportConfiguration::document();
11653 BridgingServerInternals::document();
11654 BridgingServerConfiguration::document();
11655 EarGroupsConfiguration::document();
11656 EarServerStatusReportConfiguration::document();
11657 EarServerInternals::document();
11658 EarServerConfiguration::document();
11659 RangerPackets::document();
11660 TransportImpairment::document();
11661
11662 EngageSemGroupsConfiguration::document();
11663 EngageSemServerStatusReportConfiguration::document();
11664 EngageSemServerInternals::document();
11665 EngageSemServerConfiguration::document();
11666 }
11667}
11668
11669#ifndef WIN32
11670 #pragma GCC diagnostic pop
11671#endif
11672
11673#endif /* ConfigurationObjects_h */
TxPriority_t
Network Transmission Priority.
AddressResolutionPolicy_t
Address family resolution policy.
#define ENGAGE_IGNORE_COMPILER_UNUSED_WARNING
RestrictionElementType_t
Enum describing restriction element types.
@ retGenericAccessTagPattern
Elements are generic access tags regex patterns.
@ retGroupIdPattern
Elements are group ID regex patterns.
@ retGroupId
A literal group ID.
@ retCertificateIssuerPattern
Elements are X.509 certificate issuer regex patterns.
@ retCertificateSubjectPattern
Elements are X.509 certificate subject regex patterns.
@ retCertificateFingerprintPattern
Elements are X.509 certificate fingerprint regex patterns.
@ retCertificateSerialNumberPattern
Elements are X.509 certificate serial number regex patterns.
GroupRestrictionAccessPolicyType_t
Enum describing restriction types.
@ graptStrict
Registration for groups is NOT allowed by default - requires definitive access through something like...
@ graptPermissive
Registration for groups is allowed by default.
RestrictionType_t
Enum describing restriction types.
@ rtWhitelist
Elements are whitelisted.
@ rtBlacklist
Elements are blacklisted.
Configuration when using the engageBeginGroupTxAdvanced API.
TxAudioUri audioUri
[Optional] A URI to stream from instead of the audio input device
uint8_t priority
[Optional, Default: 0] Transmit priority between 0 (lowest) and 255 (highest).
bool receiverRxMuteForAliasSpecializer
[Optional, Default: false] Indicates that the aliasSpecializer must cause receivers to mute this tran...
uint16_t subchannelTag
[Optional, Default: 0] Defines a sub channel within a group. Audio will be opaque to all other client...
uint16_t aliasSpecializer
[Optional, Default: 0] Defines a numeric affinity value to be included in the transmission....
uint16_t flags
[Optional, Default: 0] Combination of the ENGAGE_TXFLAG_xxx flags
std::string alias
[Optional, Default: empty string] The Engage Engine should transmit the user's alias as part of the h...
bool includeNodeId
[Optional, Default: false] The Engage Engine should transmit the NodeId as part of the header extensi...
uint32_t txId
[Optional, Default: 0] Transmission ID
bool muted
[Optional, Default: false] While the microphone should be opened, captured audio should be ignored un...
Defines parameters for advertising of an entity such as a known, public, group.
int intervalMs
[Optional, Default: 20000] Interval at which the advertisement should be sent in milliseconds.
bool enabled
[Optional, Default: false] Enabled advertising
bool alwaysAdvertise
[Optional, Default: false] If true, the node will advertise the item even if it detects other nodes m...
Acoustic Echo Cancellation settings.
int speakerTailMs
[Optional, Default: 60] Milliseconds of speaker tail
bool cng
[Optional, Default: true] Enable comfort noise generation
bool enabled
[Optional, Default: false] Enable acoustic echo cancellation
Mode_t
Acoustic echo cancellation mode enum.
Mode_t mode
[Optional, Default: aecmDefault] Specifies AEC mode. See Mode_t for all modes
bool enabled
[Optional, Default: false] Enables automatic gain control.
int compressionGainDb
[Optional, Default: 25, Minimum = 0, Maximum = 125] Gain in db.
bool enableLimiter
[Optional, Default: false] Enables limiter to prevent overdrive.
int maxLevel
[Optional, Default: 255] Maximum level.
int minLevel
[Optional, Default: 0] Minimum level.
int targetLevelDb
[Optional, Default: 9] Target gain level if there is no compression gain.
Default audio settings for AndroidAudio.
int api
[Optional, Default 0] Android audio API version: 0=Unspecified, 1=AAudio, 2=OpenGLES
int sessionId
[Optional, Default INVALID_SESSION_ID] A session ID from the Android AudioManager
int contentType
[Optional, Default 1] Usage type: 1=Speech 2=Music 3=Movie 4=Sonification
int sharingMode
[Optional, Default 0] Sharing mode: 0=Exclusive, 1=Shared
int performanceMode
[Optional, Default 12] Performance mode: 10=None/Default, 11=PowerSaving, 12=LowLatency
int inputPreset
[Optional, Default 7] Input preset: 1=Generic 5=Camcorder 6=VoiceRecognition 7=VoiceCommunication 9=U...
int usage
[Optional, Default 2] Usage type: 1=Media 2=VoiceCommunication 3=VoiceCommunicationSignalling 4=Alarm...
int engineMode
[Optional, Default 0] 0=use legacy low-level APIs, 1=use high-level Android APIs
int samplingRate
This is the rate that the device will process the PCM audio data at.
std::string name
Name of the device assigned by the platform.
bool isDefault
True if this is the default device for the direction above.
std::string serialNumber
Device serial number (if any)
int channels
Indicates the number of audio channels to process.
std::string hardwareId
Device hardware ID (if any)
std::string manufacturer
Device manufacturer (if any)
Direction_t direction
Audio direction the device supports.
std::string extra
Extra data provided by the platform (if any)
bool isPresent
True if the device is currently present on the system.
int boostPercentage
A percentage at which to gain/attenuate the audio.
bool isAdad
True if the device is an Application-Defined Audio Device.
int deviceId
[Read Only] Unique device identifier assigned by Engage Engine at time of device creation.
double coefficient
[Optional. Default: 1.75] Coefficient by which to multiply the current history average to determine t...
uint32_t hangMs
[Optional. Default: 1500] Hang timer in milliseconds
bool enabled
[Optional. Default: false] Enables the audio gate if true
uint32_t windowMin
[Optional. Default: 25] Number of 10ms history samples to gather before calculating the noise floor -...
bool useVad
[Optional. Default: false] Use voice activity detection rather than audio energy
uint32_t windowMax
[Optional. Default: 125] Maximum number of 10ms history samples - ignored if useVad is true
Used to configure the Audio properties for a group.
int outputLevelRight
[Optional, Default: 100] The percentage at which to set the right audio at.
bool outputMuted
[Optional, Default: false] Mutes output audio.
bool enabled
[Optional, Default: true] Audio is enabled
int inputId
[Optional, Default: first audio device] Id for the input audio device to use for this group.
int outputGain
[Optional, Default: 0] The percentage at which to gain the output audio.
int outputId
[Optional, Default: first audio device] Id for the output audio device to use for this group.
int inputGain
[Optional, Default: 0] The percentage at which to gain the input audio.
int outputLevelLeft
[Optional, Default: 100] The percentage at which to set the left audio at.
Describes the Blob data being sent used in the engageSendGroupBlob API.
size_t size
[Optional, Default : 0] Size of the payload
RtpHeader rtpHeader
Custom RTP header.
PayloadType_t payloadType
[Optional, Default: bptUndefined] The payload type to send in the blob
std::string target
[Optional, Default: empty string] The nodeId to which this message is targeted. If this is empty,...
std::string source
[Optional, Default: empty string] The nodeId of Engage Engine that sent the message....
PayloadType_t
Payload type. BlobInfo RTP supported Payload types.
Detailed information for a bridge creation.
CreationStatus_t status
The creation status.
std::vector< std::string > groups
List of group IDs to be included in the session.
bool enabled
[Optional, Default: true] Enable the bridge
std::vector< Group > groups
Array of bridges in the configuration.
std::vector< Bridge > bridges
Array of bridges in the configuration.
std::string certStoreFileName
Path to the certificate store.
FipsCryptoSettings fipsCrypto
[Optional] Settings for the FIPS crypto.
std::string configurationCheckSignalName
Name to use for signalling a configuration check.
ExternalHealthCheckResponder externalHealthCheckResponder
Details concerning the server's interaction with an external health-checker such as a load-balancer.
OpMode_t mode
Specifies the operation mode (see OpMode_t).
EnginePolicy enginePolicy
The policy to be used for the underlying Engage Engine.
BridgingServerStatusReportConfiguration statusReport
Details for producing a status report.
std::string bridgingConfigurationFileCommand
Command-line to execute that returns a bridging configuration.
std::string bridgingConfigurationFileName
Name of a file containing the bridging configuration.
std::string certStorePasswordHex
Hex password for the certificate store (if any)
OpMode_t
Enum describing the modes the briging service runs in.
BridgingServerInternals internals
Internal settings.
int bridgingConfigurationFileCheckSecs
Number of seconds between checks to see if the bridging configuration has been updated....
int serviceConfigurationFileCheckSecs
Number of seconds between checks to see if the service configuration has been updated....
std::string id
A unqiue identifier for the bridge server.
NsmConfiguration nsm
[Optional] Settings for NSM.
int housekeeperIntervalMs
[Optional, Default: 1000] Interval at which to run the housekeeper thread.
WatchdogSettings watchdog
[Optional] Settings for the watchdog.
TODO: Configuration for the bridging server status report file.
Description of a certstore certificate element.
bool hasPrivateKey
True if the certificate has a private key associated with it.
Holds a certificate and (optionally) a private key in a certstore.
std::string certificatePem
Certificate in PEM format.
std::string privateKeyPem
Private key in PEM format.
std::vector< CertStoreCertificateElement > certificates
Array of certificate elements.
std::string fileName
Name of the file the certstore resides in.
std::vector< CertStoreCertificate > certificates
Array of certificates in this store.
std::string id
The ID of the certstore.
std::vector< CertificateSubjectElement > subjectElements
Array of subject elements.
std::string publicKeyPem
PEM version of the public key.
bool selfSigned
Indicates whether the certificqte is self-signed.
std::string notBefore
Validity date notBefore.
std::string certificatePem
PEM version of the certificate.
Description of a certificate subject element.
Connectivity Information used as part of the PresenceDescriptor.
int type
Is the type of connectivity the device has to the network.
int strength
Is the strength of the connection connection as reported by the OS - usually in dbm.
int rating
Is the quality of the network connection as reported by the OS - OS dependent.
Configuration for the Discovery features.
DiscoveryMagellan Discovery settings.
Tls tls
[Optional] Details concerning Transport Layer Security.
std::string interfaceName
[Optional, Default: default system interface] The network interface to bind to for discovery packets.
Session Announcement Discovery settings settings.
int ageTimeoutMs
[Optional, Default 30000] Number of milliseconds of no SAP announcment before the advertised entity i...
Advertising advertising
Parameters for advertising.
NetworkAddress address
[Optional, Default 224.2.127.254:9875] IP address and port.
bool enabled
[Optional, Default: false] Enables the Engage Engine to use SAP for asset discovery.
std::string interfaceName
[Optional, Default: default system interface] The network interface to bind to for discovery packets.
Simple Service Discovery Protocol settings.
bool enabled
[Optional, Default: false] Enables the Engage Engine to use SSDP for asset discovery.
std::vector< std::string > searchTerms
[Optional] An array of regex strings to be used to filter SSDP requests and responses.
int ageTimeoutMs
[Optional, Default 30000] Number of milliseconds of no SSDP announcment before the advertised entity ...
Advertising advertising
Parameters for advertising.
std::string interfaceName
[Optional, Default: default system interface] The network interface to bind to for discovery packets.
NetworkAddress address
[Optional, Default 255.255.255.255:1900] IP address and port.
std::vector< Group > groups
Array of groups in the configuration.
std::string id
A unqiue identifier for the EAR server.
std::string configurationCheckSignalName
Name to use for signalling a configuration check.
std::string certStorePasswordHex
Hex password for the certificate store (if any)
ExternalHealthCheckResponder externalHealthCheckResponder
Details concerning the server's interaction with an external health-checker such as a load-balancer.
FipsCryptoSettings fipsCrypto
[Optional] Settings for the FIPS crypto.
NsmConfiguration nsm
[Optional] Settings for NSM.
int groupsConfigurationFileCheckSecs
Number of seconds between checks to see if the configuration has been updated. Default is 60.
EarServerStatusReportConfiguration statusReport
Details for producing a status report.
std::string certStoreFileName
Path to the certificate store.
std::string groupsConfigurationFileName
Name of a file containing the ear configuration.
int serviceConfigurationFileCheckSecs
Number of seconds between checks to see if the service configuration has been updated....
std::string groupsConfigurationFileCommand
Command-line to execute that returns a configuration.
EnginePolicy enginePolicy
The policy to be used for the underlying Engage Engine.
int housekeeperIntervalMs
[Optional, Default: 1000] Interval at which to run the housekeeper thread.
WatchdogSettings watchdog
[Optional] Settings for the EAR's watchdog.
TODO: Configuration for the ear server status report file.
std::vector< Group > groups
Array of groups in the configuration.
FipsCryptoSettings fipsCrypto
[Optional] Settings for the FIPS crypto.
EnginePolicy enginePolicy
The policy to be used for the underlying Engage Engine.
std::string configurationCheckSignalName
Name to use for signalling a configuration check.
EngageSemServerStatusReportConfiguration statusReport
Details for producing a status report.
std::string id
A unqiue identifier for the EFC server.
std::string certStoreFileName
Path to the certificate store.
std::string groupsConfigurationFileName
Name of a file containing the EFC configuration.
int serviceConfigurationFileCheckSecs
Number of seconds between checks to see if the service configuration has been updated....
NsmConfiguration nsm
[Optional] Settings for NSM.
std::string groupsConfigurationFileCommand
Command-line to execute that returns a configuration.
ExternalHealthCheckResponder externalHealthCheckResponder
Details concerning the server's interaction with an external health-checker such as a load-balancer.
EngageSemServerInternals internals
Internal settings.
std::string certStorePasswordHex
Hex password for the certificate store (if any)
int groupsConfigurationFileCheckSecs
Number of seconds between checks to see if the configuration has been updated. Default is 60.
WatchdogSettings watchdog
[Optional] Settings for the EFC's watchdog.
int housekeeperIntervalMs
[Optional, Default: 1000] Interval at which to run the housekeeper thread.
TODO: Configuration for the EFC server status report file.
TxPriority_t priority
[Optional, Default: priVoice] Transmission priority. This has meaning on some operating systems based...
int keepaliveIntervalSecs
Optional, Default: 15] Seconds interval at which to send UDP keepalives to Rallypoints....
int ttl
[Optional, Default: 64] Time to live or hop limit is a mechanism that limits the lifespan or lifetime...
int port
[Optional, 0] The port to be used for Rallypoint UDP streaming. A value of 0 will result in an epheme...
bool enabled
[Optional, false] Enables UDP streaming if the RP supports it
Default audio settings for Engage Engine policy.
Vad vad
[Optional] Voice activity detection settings
Agc outputAgc
[Optional] Automatic Gain Control for audio outputs
bool enabled
[Optional, Default: true] Enables audio processing
AndroidAudio android
[Optional] Android-specific audio settings
int internalRate
[Optional, Default: 16000] Internal sampling rate - 8000 or 16000
bool muteTxOnTx
[Optional, Default: false] Automatically mute TX when TX begins
Agc inputAgc
[Optional] Automatic Gain Control for audio inputs
bool hardwareEnabled
[Optional, Default: true] Enables local machine hardware audio
Aec aec
[Optional] Acoustic echo cancellation settings
bool denoiseInput
[Optional, Default: false] Denoise input
bool denoiseOutput
[Optional, Default: false] Denoise output
int internalChannels
[Optional, Default: 2] Internal audio channel count rate - 1 or 2
Provides Engage Engine policy configuration.
std::vector< ExternalModule > externalCodecs
Optional external codecs.
EnginePolicyNamedAudioDevices namedAudioDevices
Optional named audio devices (Linux only)
Featureset featureset
Optional feature set.
EnginePolicyDatabase database
Database settings.
EnginePolicyAudio audio
Audio settings.
std::string dataDirectory
Specifies the root of the physical path to store data.
EnginePolicyLogging logging
Logging settings.
DiscoveryConfiguration discovery
Discovery settings.
std::vector< RtpMapEntry > rtpMap
Optional RTP - overrides the default.
EnginePolicyInternals internals
Internal settings.
EnginePolicySecurity security
Security settings.
EnginePolicyTimelines timelines
Timelines settings.
EnginePolicyNetworking networking
Security settings.
int stickyTidHangSecs
[Optional, Default: 10] The number of seconds after which "sticky" transmission IDs expire.
int maxTxSecs
[Optional, Default: 30] The default duration the engageBeginGroupTx and engageBeginGroupTxAdvanced fu...
int rpConnectionTimeoutSecs
[Optional, Default: 5] Connection timeout in seconds to RP
WatchdogSettings watchdog
[Optional] Settings for the Engine's watchdog.
RallypointCluster::ConnectionStrategy_t rpClusterStrategy
[Optional, Default: csRoundRobin] Specifies the default RP cluster connection strategy to be followed...
int delayedMicrophoneClosureSecs
[Optional, Default: 15] The number of seconds to cache an open microphone before actually closing it.
int rtpExpirationCheckIntervalMs
[Optional, Default: 250] Interval at which to check for RTP expiration.
int rpClusterRolloverSecs
[Optional, Default: 10] Seconds between switching to a new target in a RP cluster
int housekeeperIntervalMs
[Optional, Default: 1000] Interval at which to run the housekeeper thread.
int uriStreamingIntervalMs
[Optional, Default: 60] The packet framing interval for audio streaming from a URI.
int maxLevel
[Optional, Default: 4, Range: 0-4] This is the maximum logging level to display in other words,...
EngineNetworkingRpUdpStreaming rpUdpStreaming
[Optional] Configuration for UDP streaming
std::string defaultNic
The default network interface card the Engage Engine should bind to.
RtpProfile rtpProfile
[Optional] Configuration for RTP profile
AddressResolutionPolicy_t addressResolutionPolicy
[Optional, Default 64] Address resolution policy
int multicastRejoinSecs
[Optional, Default: 8] Number of seconds elapsed between RX of multicast packets before an IGMP rejoi...
bool logRtpJitterBufferStats
[Optional, Default: false] If true, logs RTP jitter buffer statistics periodically
int rallypointRtTestIntervalMs
[Optional, Default: 60000] Milliseconds between sending Rallypoint round-trip test requests
bool preventMulticastFailover
[Optional, Default: false] Overrides/cancels group-level multicast failover if set to true
Default certificate to use for security operation in the Engage Engine.
SecurityCertificate certificate
The default certificate and private key for the Engine instance.
std::vector< std::string > caCertificates
[Optional] An array of CA certificates to be used for validation of far-end X.509 certificates
long autosaveIntervalSecs
[Default 5] Interval at which events are to be saved from memory to disk (a slow operation)
int maxStorageMb
Specifies the maximum storage space to use.
bool enabled
[Optional, Default: true] Specifies if Time Lines are enabled by default.
SecurityCertificate security
The certificate to use for signing the recording.
long maxEventAgeSecs
Maximum age of an event after which it is to be erased.
std::string storageRoot
Specifies where the timeline recordings will be stored physically.
bool ephemeral
[Default false] If true, recordings are automatically purged when the Engine is shut down and/or rein...
bool disableSigningAndVerification
[Default false] If true, prevents signing of events - i.e. no anti-tanpering features will be availab...
int maxEvents
Maximum number of events to be retained.
long groomingIntervalSecs
Interval at which events are to be checked for age-based grooming.
TODO: Configuration to enable external systems to use to check if the service is still running.
Base for a description of an external module.
nlohmann::json configuration
Optional free-form JSON configuration to be passed to the module.
bool debug
[Optional, Default false] If true, requests the crypto engine module to run in debugging mode.
bool enabled
[Optional, Default false] If true, requires FIPS140-2 crypto operation.
std::string path
Path where the crypto engine module is located
Configuration for the optional custom transport functionality for Group.
bool enabled
[Optional, Default: false] Enables custom feature.
std::string id
The id/name of the transport. This must match the id/name supplied when registering the app transport...
Detailed information for a group connection.
bool asFailover
Indicates whether the connection is for purposes of failover.
ConnectionType_t connectionType
The connection type.
std::string reason
[Optional] Additional reason information
Detailed information for a group creation.
CreationStatus_t status
The creation status.
Detailed information regarding a group's health.
GroupAppTransport appTransport
[Optional] Settings necessary if the group is transported via an application-supplied custom transpor...
std::string source
[Optional, Default: null] Indicates the source of this configuration - e.g. from the application or d...
Presence presence
Presence configuration (see Presence).
std::vector< uint16_t > specializerAffinities
List of specializer IDs that the local node has an affinity for/member of.
std::vector< Source > ignoreSources
[Optional] List of sources to ignore for this group
NetworkAddress rtcpPresenceRx
The network address for receiving RTCP presencing packets.
bool allowLoopback
[Optional, Default: false] Allows for processing of looped back packets - primarily meant for debuggi...
Type_t
Enum describing the group types.
NetworkAddress tx
The network address for transmitting network traffic to.
std::string alias
User alias to transmit as part of the realtime audio stream when using the engageBeginGroupTx API.
int stickyTidHangSecs
[Optional, Default: 10] The number of seconds after which "sticky" transmission IDs expire.
TxAudio txAudio
Audio transmit options such as codec, framing size etc (see TxAudio).
int maxRxSecs
[Optional, Default: 0] Maximum number of seconds the Engine will receive for on this group.
PacketCapturer txCapture
Details for capture of transmitted packets
NetworkTxOptions txOptions
Transmit options for the group (see NetworkTxOptions).
std::string synVoice
Name of the synthesis voice to use for the group
TransportImpairment rxImpairment
[Optional] The RX impairment to apply
std::string languageCode
ISO 639-2 language code for the group
std::string cryptoPassword
Password to be used for encryption. Note that this is not the encryption key but, rather,...
std::vector< std::string > presenceGroupAffinities
List of presence group IDs with which this group has an affinity.
GroupTimeline timeline
Audio timeline is configuration.
GroupPriorityTranslation priorityTranslation
[Optional] Describe how traffic for this group on a different addressing scheme translates to priorit...
bool disablePacketEvents
[Optional, Default: false] Disable packet events.
bool blockAdvertising
[Optional, Default: false] Set this to true if you do not want the Engine to advertise this Group on ...
bool ignoreAudioTraffic
[Optional, Default: false] Indicates that the group should ignore traffic that is audio-related
std::string interfaceName
The name of the network interface to use for multicasting for this group. If not provided,...
bool _wasDeserialized_rtpProfile
[Internal - not serialized
bool enableMulticastFailover
[Optional, Default: false] Set this to true to enable failover to multicast operation if a Rallypoint...
std::string name
The human readable name for the group.
NetworkAddress rx
The network address for receiving network traffic on.
Type_t type
Specifies the group type (see Type_t).
uint16_t blobRtpPayloadType
[Optional, Default: ENGAGE_DEFAULT_BLOB_RTP_PAYLOAD_TYPE] The RTP payload type to be used for blobs s...
std::vector< Rallypoint > rallypoints
[DEPRECATED] List of Rallypoint (s) the Group should use to connect to a Rallypoint router....
BridgingOpMode_t bom
Specifies the bridging operation mode if applicable (see BridgingOpMode_t).
BridgingOpMode_t
Enum describing bridging operation mode types where applicable.
RtpProfile rtpProfile
[Optional] RTP profile the group
std::vector< RtpPayloadTypeTranslation > inboundRtpPayloadTypeTranslations
[Optional] A vector of translations from external entity RTP payload types to those used by Engage
int multicastFailoverSecs
[Optional, Default: 10] Specifies the number fo seconds to wait after Rallypoint connection failure t...
InboundAliasGenerationPolicy_t
Enum describing the alias generation policy.
RangerPackets rangerPackets
[Optional] Ranger packet options
int rfc4733RtpPayloadId
[Optional, Default: 0] The RTP payload ID by which to identify (RX and TX) payloads encoded according...
uint32_t securityLevel
[Optional, Default: 0] The security classification level of the group.
PacketCapturer rxCapture
Details for capture of received packets
std::string id
Unique identity for the group.
AudioGate gateIn
[Optional] Inbound gating of audio - only audio allowed through by the gate will be processed
RallypointCluster rallypointCluster
Cluster of one or more Rallypoints the group may use.
TransportImpairment txImpairment
[Optional] The TX impairment to apply
Audio audio
Sets audio properties like which audio device to use, audio gain etc (see Audio).
bool lbCrypto
[Optional, Default: false] Use low-bandwidth crypto
std::string spokenName
The group name as spoken - typically by a text-to-speech system
InboundAliasGenerationPolicy_t inboundAliasGenerationPolicy
[Optional, Default: iagpAnonymousAlias]
std::string anonymousAlias
[Optional] Alias to use for inbound streams that do not have an alias component
Details for priority transmission based on unique network addressing.
Detailed information for a group reconfiguration.
ReconfigurationStatus_t status
The creation status.
List of TalkerInformation objects.
std::vector< TalkerInformation > list
List of TalkerInformation objects.
Configuration for Timeline functionality for Group.
bool enabled
[Optional, Default: true] Enables timeline feature.
int maxAudioTimeMs
[Optional, Default: 30000] Maximum audio block size to record in milliseconds.
Detailed information for a group transmit.
int remotePriority
Remote TX priority (optional)
long nonFdxMsHangRemaining
Milliseconds of hang time remaining on a non-FDX group (optional)
int localPriority
Local TX priority (optional)
uint32_t txId
Transmission ID (optional)
std::string displayName
[Optional, Default: empty string] The display name to be used for the user.
std::string userId
[Optional, Default: empty string] The user ID to be used to represent the user.
std::string nodeId
[Optional, Default: Auto Generated] This is the Node ID to use to represent instance on the network.
std::string avatar
[Optional, Default: empty string] This is a application defined field used to indicate a users avatar...
Configuration for IGMP snooping.
bool enabled
Enables IGMP. Default is false.
Detailed statistics for an inbound processor.
Helper class for serializing and deserializing the LicenseDescriptor JSON.
std::string entitlement
Entitlement key to use for the product.
std::string cargo
Reserved for internal use.
std::string manufacturerId
[Read only] Manufacturer ID.
std::string key
License Key to be used for the application.
uint8_t cargoFlags
Reserved for internal use.
int type
[Read only] 0 = unknown, 1 = perpetual, 2 = expires
std::string deviceId
[Read only] Unique device identifier generated by the Engine.
time_t expires
[Read only] The time that the license key or activation code expires in Unix timestamp - Zulu/UTC.
std::string activationCode
If the key required activation, this is the activation code generated using the entitlement,...
std::string expiresFormatted
[Read only] The time that the license key or activation code expires formatted in ISO 8601 format,...
std::string deviceId
Device Identifier. See LicenseDescriptor::deviceId for details.
std::string manufacturerId
Manufacturer ID to use for the product. See LicenseDescriptor::manufacturerId for details.
std::string activationCode
Activation Code issued for the license key. See LicenseDescriptor::activationCode for details.
std::string key
License key. See LicenseDescriptor::key for details.
std::string entitlement
Entitlement key to use for the product. See LicenseDescriptor::entitlement for details.
std::vector< Group > groups
Array of groups in the configuration.
std::vector< VoiceToVoiceSession > voiceToVoiceSessions
Array of voiceToVoice sessions in the configuration.
Configuration for the linguistics server.
LingoServerStatusReportConfiguration statusReport
Details for producing a status report.
std::string lingoConfigurationFileName
Name of a file containing the linguistics configuration.
std::string configurationCheckSignalName
Name to use for signalling a configuration check.
std::string id
A unqiue identifier for the linguistics server.
ExternalHealthCheckResponder externalHealthCheckResponder
Details concerning the server's interaction with an external health-checker such as a load-balancer.
NsmConfiguration nsm
[Optional] Settings for NSM.
std::string certStorePasswordHex
Hex password for the certificate store (if any)
std::string lingoConfigurationFileCommand
Command-line to execute that returns a linguistics configuration.
LingoServerInternals internals
Internal settings.
EnginePolicy enginePolicy
The policy to be used for the underlying Engage Engine.
int lingoConfigurationFileCheckSecs
Number of seconds between checks to see if the linguistics configuration has been updated....
std::string certStoreFileName
Path to the certificate store.
FipsCryptoSettings fipsCrypto
[Optional] Settings for the FIPS crypto.
NetworkAddress proxy
Address and port of the proxy.
int serviceConfigurationFileCheckSecs
Number of seconds between checks to see if the service configuration has been updated....
int housekeeperIntervalMs
[Optional, Default: 1000] Interval at which to run the housekeeper thread.
WatchdogSettings watchdog
[Optional] Settings for the watchdog.
TODO: Configuration for the translation server status report file.
Location information used as part of the PresenceDescriptor.
double longitude
Its the longitudinal position using the Signed degrees format (DDD.dddd) format. Valid range is -180 ...
double altitude
[Optional, Default: INVALID_LOCATION_VALUE] The altitude above sea level in meters.
uint32_t ts
[Read Only: Unix timestamp - Zulu/UTC] Indicates the timestamp that the location was recorded.
double latitude
Its the latitude position using the using the Signed degrees format (DDD.dddd). Valid range is -90 to...
double direction
[Optional, Default: INVALID_LOCATION_VALUE] Direction the endpoint is traveling in degrees....
double speed
[Optional, Default: INVALID_LOCATION_VALUE] The speed the endpoint is traveling at in meters per seco...
RestrictionType_t type
Type indicating how the elements are to be treated.
std::vector< NetworkAddressRxTx > elements
List of elements.
std::string manufacturer
Device manufacturer (if any)
int deviceId
[Read Only] Unique device identifier assigned by Engage Engine at time of device creation.
std::string extra
Extra data provided by the platform (if any)
std::string hardwareId
Device hardware ID (if any)
std::string serialNumber
Device serial number (if any)
std::string name
Name of the device assigned by the platform.
int ttl
[Optional, Default: 1] Time to live or hop limit is a mechanism that limits the lifespan or lifetime ...
TxPriority_t priority
[Optional, Default: priVoice] Transmission priority. This has meaning on some operating systems based...
Description of a packet capturer.
int version
TODO: A version number for the mesh configuration. Change this whenever you update your configuration...
std::string id
An identifier useful for organizations that track different mesh configurations by ID.
std::vector< RallypointPeer > peers
List of Rallypoint peers to connect to.
uint32_t configurationVersion
Internal configuration version.
Device Power Information used as part of the PresenceDescriptor.
int state
[Optional, Default: 0] Is the current state that the power system is in.
int source
[Optional, Default: 0] Is the source the power is being delivered from
int level
[Optional, Default: 0] Is the current level of the battery or power system as a percentage....
Group Alias used as part of the PresenceDescriptor.
uint16_t status
Status flags for the user's participation on the group.
std::string groupId
Group Id the alias is associated with.
Represents an endpoints presence properties. Used in engageUpdatePresenceDescriptor API and PFN_ENGAG...
Power power
[Optional, Default: see Power] Device power information like charging state, battery level,...
std::string custom
[Optional, Default: empty string] Custom string application can use of presence descriptor....
bool self
[Read Only] Indicates that this presence declaration was generated by the Engage Engine the applicati...
uint32_t nextUpdate
[Read Only, Unix timestamp - Zulu/UTC] Indicates the next time the presence descriptor will be sent.
std::vector< PresenceDescriptorGroupItem > groupAliases
[Read Only] List of group items associated with this presence descriptor.
Identity identity
[Optional, Default see Identity] Endpoint's identity information.
bool announceOnReceive
[Read Only] Indicates that the Engine will announce its PresenceDescriptor in response to this messag...
uint32_t ts
[Read Only, Unix timestamp - Zulu/UTC] Indicates the timestamp that the message was originally sent.
std::string comment
[Optional] No defined limit on size but the total size of the serialized JSON object must fit inside ...
Connectivity connectivity
[Optional, Default: see Connectivity] Device connectivity information like wifi/cellular,...
uint32_t disposition
[Optional] Indicates the users disposition
Location location
[Optional, Default: see Location] Location information
Describes how the Presence is configured for a group of type Group::gtPresence in Group::Type_t.
Format_t format
Format to be used to represent presence information.
bool listenOnly
Instructs the Engage Engine to not transmit presence descriptor.
int minIntervalSecs
[Optional, Default: 5] The minimum interval to send at to prevent network flooding
int intervalSecs
[Optional, Default: 30] The interval in seconds at which to send the presence descriptor on the prese...
Defines settings for Rallypoint advertising.
std::string interfaceName
The multicast network interface for mDNS.
std::string serviceName
[Optional, Default "_rallypoint._tcp.local."] The service name
std::string hostName
[Optional] This Rallypoint's DNS-SD host name
std::vector< std::string > extraMeshes
[Optional] List of additional meshes that can be reached via this RP
int port
[Default: RP port] The multicast network interface for mDNS
bool enabled
[Default: false] Advertising is enabled
std::string meshName
[Optional] This Rallypoint's mesh name
int rolloverSecs
Seconds between switching to a new target.
int connectionTimeoutSecs
[Optional, Default: 0] Default connection timeout in seconds to any RP in the cluster
std::vector< Rallypoint > rallypoints
List of Rallypoints.
ConnectionStrategy_t connectionStrategy
[Optional, Default: csRoundRobin] Specifies the connection strategy to be followed....
Detailed information for a rallypoint connection.
uint64_t msToNextConnectionAttempt
Milliseconds until next connection attempt.
Defines settings for Rallypoint extended group restrictions.
std::vector< StringRestrictionList > restrictions
Restrictions.
int transactionTimeoutMs
[Optional, Default 5000] Number of milliseconds that a transaction may take before the link is consid...
bool allowSelfSignedCertificate
[Optional, Default false] Allows the Rallypoint to accept self-signed certificates from the far-end
std::vector< std::string > caCertificates
[Optional] A vector of certificates (raw content, file names, or certificate store elements) used to ...
std::string certificate
This is the X509 certificate to use for mutual authentication.
bool verifyPeer
[Optional, Default true] Indicates whether the connection peer is to be verified by checking the vali...
bool disableMessageSigning
[Optional, Default false] Indicates whether to forego ECSDA signing of control-plane messages.
NetworkAddress host
This is the host address for the Engine to connect to the RallyPoint service.
std::string certificateKey
This is the private key used to generate the X509 certificate.
int connectionTimeoutSecs
[Optional, Default: 5] Connection timeout in seconds to the RP
TcpNetworkTxOptions tcpTxOptions
[Optional] Tx options for the TCP link
SecurityCertificate certificate
Internal certificate detail.
bool forceIsMeshLeaf
Internal enablement setting.
int connectionTimeoutSecs
[Optional, Default: 0 - OS platform default] Connection timeout in seconds to the peer
NetworkAddress host
Internal host detail.
bool enabled
Internal enablement setting.
Definition of a static group for Rallypoints.
NetworkAddress rx
The network address for receiving network traffic on.
std::string id
Unique identity for the group.
std::vector< NetworkAddress > additionalTx
Vector of additional TX addresses .
NetworkAddress tx
The network address for transmitting network traffic to.
std::string multicastInterfaceName
[Optional] The name of the NIC on which to send and receive multicast traffic.
Defines a behavior for a Rallypoint peer roundtrip time.
BehaviorType_t behavior
Specifies the streaming mode type (see BehaviorType_t).
Configuration for the Rallypoint server.
uint32_t maxSecurityLevel
[Optional, Default 0] Sets the maximum item security level that can be registered with the RP
bool forwardDiscoveredGroups
Enables automatic forwarding of discovered multicast traffic to peer Rallypoints.
std::string interfaceName
Name of the NIC to bind to for listening for incoming TCP connections.
NetworkTxOptions multicastTxOptions
Tx options for multicast.
bool disableMessageSigning
Set to true to forgo DSA signing of messages. Doing so is is a security risk but can be useful on CPU...
SecurityCertificate certificate
X.509 certificate and private key that identifies the Rallypoint.
std::string multicastInterfaceName
The name of the NIC on which to send and receive multicast traffic.
StringRestrictionList groupRestrictions
Group IDs to be restricted (inclusive or exclusive)
std::string peeringConfigurationFileName
Name of a file containing a JSON array of Rallypoint peers to connect to.
uint32_t sysFlags
[Optional, Default 0] Internal system flags
int listenPort
TCP port to listen on. Default is 7443.
FipsCryptoSettings fipsCrypto
[Optional] Settings for the FIPS crypto.
NetworkAddressRestrictionList multicastRestrictions
Multicasts to be restricted (inclusive or exclusive)
uint32_t normalTaskQueueBias
[Optional, Default 0] Sets the queue's normal task bias
PacketCapturer txCapture
Details for capture of transmitted packets
std::vector< RallypointReflector > staticReflectors
Vector of static groups.
bool enableLeafReflectionReverseSubscription
If enabled, causes a mesh leaf to reverse-subscribe to a core node upon the core subscribing and a re...
std::string configurationCheckSignalName
Name to use for signalling a configuration check.
IpFamilyType_t ipFamily
[Optional, Default IpFamilyType_t::ifIp4] Address familiy to be used for listening
int peerRtTestIntervalMs
[Optional, Default: 60000] Milliseconds between sending round-trip test requests to peers
WatchdogSettings watchdog
[Optional] Settings for the Rallypoint's watchdog.
DiscoveryConfiguration discovery
Details discovery capabilities.
bool isMeshLeaf
Indicates whether this Rallypoint is part of a core mesh or hangs off the periphery as a leaf node.
std::string certStorePasswordHex
Hex password for the certificate store (if any)
GroupRestrictionAccessPolicyType_t groupRestrictionAccessPolicyType
The policy employed to allow group registration.
PacketCapturer rxCapture
Details for capture of received packets
uint32_t maxOutboundPeerConnectionIntervalDeltaSecs
[Optional, Default 15] Sets the delta value for the maximum number of seconds to delay when attemptin...
RallypointAdvertisingSettings advertising
[Optional] Settings for advertising.
ExternalHealthCheckResponder externalHealthCheckResponder
Details concerning the Rallypoint's interaction with an external health-checker such as a load-balanc...
std::vector< RallypointExtendedGroupRestriction > extendedGroupRestrictions
Extended group restrictions.
int ioPools
Number of threading pools to create for network I/O. Default is -1 which creates 1 I/O pool per CPU c...
RallypointServerStatusReportConfiguration statusReport
Details for producing a status report.
IgmpSnooping igmpSnooping
IGMP snooping configuration.
RallypointServerLinkGraph linkGraph
Details for producing a Graphviz-compatible link graph.
RallypointServerLimits limits
Details for capacity limits and determining processing load.
PeeringConfiguration peeringConfiguration
Internal - not serialized.
bool allowMulticastForwarding
Allows traffic received on unicast links to be forwarded to the multicast network.
RallypointWebsocketSettings websocket
[Optional] Settings for websocket operation
std::string peeringConfigurationFileCommand
Command-line to execute that returns a JSON array of Rallypoint peers to connect to.
RallypointServerRouteMap routeMap
Details for producing a report containing the route map.
bool allowPeerForwarding
Set to true to allow forwarding of packets received from other Rallypoints to all other Rallypoints....
TcpNetworkTxOptions tcpTxOptions
Tx options for TCP.
RallypointUdpStreaming udpStreaming
Optional configuration for high-performance UDP streaming.
bool forwardMulticastAddressing
Enables forwarding of multicast addressing to peer Rallypoints.
std::vector< RallypointRpRtTimingBehavior > peerRtBehaviors
[Optional] Array of behaviors for roundtrip times to peers
std::string id
A unqiue identifier for the Rallypoint.
NsmConfiguration nsm
[Optional] Settings for NSM.
bool disableLoopDetection
If true, turns off loop detection.
std::string certStoreFileName
Path to the certificate store.
int peeringConfigurationFileCheckSecs
Number of seconds between checks to see if the peering configuration has been updated....
Tls tls
Details concerning Transport Layer Security.
TODO: Configuration for Rallypoint limits.
uint32_t maxQOpsPerSec
Maximum number of queue operations per second (0 = unlimited)
uint32_t maxInboundBacklog
Maximum number of inbound backlog requests the Rallypoint will accept.
uint32_t normalPriorityQueueThreshold
Number of normal priority queue operations after which new connections will not be accepted.
uint32_t maxPeers
Maximum number of peers (0 = unlimited)
uint32_t maxTxBytesPerSec
Maximum number of bytes transmitted per second (0 = unlimited)
uint32_t maxTxPacketsPerSec
Maximum number of packets transmitted per second (0 = unlimited)
uint32_t maxRegisteredStreams
Maximum number of registered streams (0 = unlimited)
uint32_t maxClients
Maximum number of clients (0 = unlimited)
uint32_t maxMulticastReflectors
Maximum number of multicastReflectors (0 = unlimited)
uint32_t maxStreamPaths
Maximum number of bidirectional stream paths (0 = unlimited)
uint32_t lowPriorityQueueThreshold
Number of low priority queue operations after which new connections will not be accepted.
uint32_t maxRxBytesPerSec
Maximum number of bytes received per second (0 = unlimited)
uint32_t denyNewConnectionCpuThreshold
The CPU utilization threshold percentage (0-100) beyond which new connections are denied.
uint32_t maxRxPacketsPerSec
Maximum number of packets received per second (0 = unlimited)
uint32_t warnAtCpuThreshold
The CPU utilization threshold percentage (0-100) beyond which warnings are logged.
TODO: Configuration for the Rallypoint status report file.
Streaming configuration for RP clients.
int listenPort
UDP port to listen on. Default is 7444.
TxPriority_t priority
[Optional, Default: priVoice] Transmission priority. This has meaning on some operating systems based...
bool enabled
[Optional, Default true] If true, enables UDP streaming unless turned off on a per-family basis.
CryptoType_t cryptoType
[Optional, Default ctSharedKeyAes256FullIv] The crypto method to be used
int ttl
[Optional, Default: 64] Time to live or hop limit.
CryptoType_t
Enum describing UDP streaming modes.
int keepaliveIntervalSecs
[Optional, Default: 15] Interval (seconds) at which to send UDP keepalives
bool enabled
[Optional, Default true] If true, enables UDP streaming for vX.
NetworkAddress external
Network address for external entities to transmit to. Defaults to the address of the local interface ...
Defines settings for Rallypoint websockets functionality.
SecurityCertificate certificate
Certificate to be used for WebSockets.
bool enabled
[Default: false] Websocket is enabled
int count
[Optional, Default: 5] Number of ranger packets to send when a new interval starts
int hangTimerSecs
[Optional, Default: -1] Number of seconds since last packet transmission before 'count' packets are s...
Helper class for serializing and deserializing the RiffDescriptor JSON.
CertificateDescriptor certDescriptor
[Optional] X.509 certificate parsed into a CertificateDescriptor object.
std::string meta
[Optional] Meta data associated with the file - typically a stringified JSON object.
bool verified
True if the ECDSA signature is verified.
std::string signature
[Optional] ECDSA signature
std::string certPem
[Optional] X.509 certificate in PEM format used to sign the RIFF file.
std::string file
Name of the RIFF file.
RTP header information as per RFC 3550.
uint32_t ssrc
Psuedo-random synchronization source.
uint16_t seq
Packet sequence number.
bool marker
Indicates whether this is the start of the media stream burst.
int pt
A valid RTP payload between 0 and 127 See IANA Real-Time Transport Protocol (RTP) Parameters
uint32_t ts
Media sample timestamp.
An RTP map entry.
std::string name
Name of the CODEC.
int engageType
An integer representing the codec type.
int rtpPayloadType
The RTP payload type identifier.
uint16_t engage
The payload type used by Engage.
uint16_t external
The payload type used by the external entity.
Configuration for the optional RtpProfile.
int signalledInboundProcessorInactivityMs
[Optional, Default: inboundProcessorInactivityMs * 4] The number of milliseconds of RTP inactivity on...
int jitterUnderrunReductionAger
[Optional, Default: 100] Number of jitter buffer operations after which to reduce any underrun
int jitterMinMs
[Optional, Default: 100] Low-water mark for jitter buffers that are in a buffering state.
int jitterMaxFactor
[Optional, Default: 8] The factor by which to multiply the jitter buffer's active low-water to determ...
int inboundProcessorInactivityMs
[Optional, Default: 500] The number of milliseconds of RTP inactivity before heuristically determinin...
JitterMode_t mode
[Optional, Default: jmStandard] Specifies the operation mode (see JitterMode_t).
int jitterForceTrimAtMs
[Optional, Default: 0] Forces trimming of the jitter buffer if the queue length is greater (and not z...
int latePacketSequenceRange
[Optional, Default: 5] The delta in RTP sequence numbers in order to heuristically determine the star...
int jitterMaxExceededClipHangMs
[Optional, Default: 1500] Number of milliseconds for which the jitter buffer may exceed max before cl...
int jitterTrimPercentage
[Optional, Default: 10] The percentage of the overall jitter buffer sample count to trim when potenti...
int jitterMaxTrimMs
[Optional, Default: 250] Maximum number of milliseconds to be trimmed from a jitter buffer at any one...
int jitterMaxMs
[Optional, Default: 10000] Maximum number of milliseconds allowed in the queue
int latePacketTimestampRangeMs
[Optional, Default: 500] The delta in milliseconds in order to heuristically determine the start of a...
int jitterMaxExceededClipPerc
[Optional, Default: 10] Percentage by which maximum number of samples in the queue exceeded computed ...
int zombieLifetimeMs
[Optional, Default: 15000] The number of milliseconds that a "zombified" RTP processor is kept around...
int rtcpPresenceTimeoutMs
[Optional, Default: 45000] Timeout for RTCP presence.
int jitterUnderrunReductionThresholdMs
[Optional, Default: 1500] Number of milliseconds of error-free operations in a jitter buffer before t...
Configuration for a secure signature.
std::string signature
Contains the signature.
std::string certificate
Contains the PEM-formatted text of the certificate.
Configuration for a Security Certificate used in various configurations.
std::string key
As for above but for certificate's private key.
std::string certificate
Contains the PEM-formatted text of the certificate, OR, a reference to a PEM file denoted by "@file:/...
std::string alias
[Optional] An alias
std::string nodeId
[Optional] A node ID
RestrictionType_t type
Type indicating how the elements are to be treated.
std::vector< std::string > elements
List of elements.
RestrictionElementType_t elementsType
Type indicating what kind of data each element contains.
Contains talker information used in providing a list in GroupTalkers.
uint32_t txId
Transmission ID associated with a talker's transmission.
int duplicateCount
Number of duplicates detected.
int txPriority
Priority associated with a talker's transmission.
std::string alias
The user alias to represent as a "talker".
std::string nodeId
The nodeId the talker is originating from.
bool rxMuted
Indicates if RX is muted for this talker.
uint16_t rxFlags
Flags associated with a talker's transmission.
uint16_t aliasSpecializer
The numeric specializer (if any) associated with the alias.
std::string nodeId
A unique identifier for the asset.
Parameters for querying the group timeline.
bool onlyCommitted
Include only committed (not in-progress) events.
uint64_t startedOnOrAfter
Include events that started on or after this UNIX millisecond timestamp.
long maxCount
Maximum number of records to return.
uint64_t endedOnOrBefore
Include events that ended on or after this UNIX millisecond timestamp.
std::string sql
Ignore all other settings for SQL construction and use this query string instead.
bool mostRecentFirst
Sorted results with most recent timestamp first.
std::string onlyNodeId
Include events for this transmitter node ID.
int onlyDirection
Include events for this direction.
int onlyTxId
Include events for this transmission ID.
std::string onlyAlias
Include events for this transmitter alias.
TODO: Transport Security Layer (TLS) settings.
bool verifyPeers
[Optional, Default: true] When true, checks the far-end certificate validity and Engage-specific TLS ...
StringRestrictionList subjectRestrictions
[NOT USED AT THIS TIME]
std::vector< std::string > caCertificates
[Optional] Array of CA certificates (PEM or "@" file/certstore references) to be used to validate far...
StringRestrictionList issuerRestrictions
[NOT USED AT THIS TIME]
bool allowSelfSignedCertificates
[Optional, Default: false] When true, accepts far-end certificates that are self-signed.
std::vector< std::string > crlSerials
[Optional] Array of serial numbers certificates that have been revoked
std::vector< TranslationSession > sessions
Array of sessions in the configuration.
std::vector< Group > groups
Array of groups in the configuration.
std::vector< std::string > groups
List of group IDs to be included in the session.
bool enabled
[Optional, Default: true] Enable the session
Description of a transport impairment.
Configuration for the audio transmit properties for a group.
int startTxNotifications
[Optional, Default: 5] Number of start TX notifications to send when TX is about to begin.
int framingMs
[Optional, Default: 60] Audio sample framing size in milliseconds.
int maxTxSecs
[Optional, Default: 0] Maximum number of seconds the Engine will transmit for.
uint32_t internalKey
[INTERNAL] The Engine-assigned key for the codec
bool enabled
[Optional, Default: true] Audio transmission is enabled
bool fdx
[Optional, Default: false] Indicates if full duplex audio is supported.
int initialHeaderBurst
[Optional, Default: 5] Number of headers to send at the beginning of a talk burst.
bool resetRtpOnTx
[Optional, Default: true] Resets RTP counters on each new transmission.
bool dtx
[Optional, Default: false] Support discontinuous transmission on those CODECs that allow it
std::string encoderName
[Optional] The name of the external codec - overrides encoder
TxCodec_t encoder
[Optional, Default: ctOpus8000] Specifies the Codec Type to use for the transmission....
int blockCount
[Optional, Default: 0] If >0, derives framingMs based on the encoder's internal operation
int smoothedHangTimeMs
[Optional, Default: 0] Hang timer for ongoing TX - only applicable if enableSmoothing is true
int customRtpPayloadType
[Optional, Default: -1] The custom RTP payload type to use for transmission. A value of -1 causes the...
bool noHdrExt
[Optional, Default: false] Set to true whether to disable header extensions.
bool enableSmoothing
[Optional, Default: true] Smooth input audio
int trailingHeaderBurst
[Optional, Default: 5] Number of headers to send at the conclusion of a talk burst.
int extensionSendInterval
[Optional, Default: 10] The number of packets when to periodically send the header extension.
Optional audio streaming from a URI for engageBeginGroupTxAdvanced.
int repeatCount
[Optional, Default: 0] Number of times to repeat
Voice Activity Detection settings.
bool enabled
[Optional, Default: false] Enable VAD
Mode_t mode
[Optional, Default: vamDefault] Specifies VAD mode. See Mode_t for all modes
std::vector< std::string > groups
List of group IDs to be included in the session.
bool enabled
[Optional, Default: true] Enable the session
int intervalMs
[Optional, Default: 5000] Interval at which checks are made.
int hangDetectionMs
[Optional, Default: 2000] Number of milliseconds that must pass before a hang is assumed.
int slowExecutionThresholdMs
[Optional, Default: 100] Maximum number of milliseconds that a task may take before being considered ...
bool abortOnHang
[Optional, Default: true] If true, aborts the process if a hang is detected.
bool enabled
[Optional, Default: true] Enables/disables a watchdog.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * OID_RTS_PEM
Rally Tactical Systems' PEN as assigned by IANA.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * OID_RTS_CERT_SUBJ_ACCESS_TAGS
The link to the Rallypoint is down.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_EXCLUDED_SERIAL
The Rallypoint denied the registration request because the far-end's certificate serial number has be...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_SECURITY_CLASSIFICATION_LEVEL_TOO_HIGH
The Rallypoint has denied the registration because the registration is for a security level not allow...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_ON_BLACKLIST
The Rallypoint denied the registration request because the far-end does appears in blackist criteria.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_EXCLUDED_FINGERPRINT
The Rallypoint denied the registration request because the far-end's certificate fingerprint has been...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_NO_ISSUER
The Rallypoint denied the registration request because the far-end's certificate does not have an an ...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_GENERAL_DENIAL
The Rallypoint has denied the registration for no specific reason.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_NO_ACCESS_TAG
The Rallypoint denied the registration request because the far-end's certificate does not have an acc...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_NO_SUBJECT
The Rallypoint denied the registration request because the far-end's certificate does not have an an ...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_NOT_ALLOWED
The Rallypoint is not accepting registration for the group at this time.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_EXCLUDED_SUBJECT
The Rallypoint denied the registration request because the far-end's certificate subject has been exc...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_NO_LINK
The link to the Rallypoint is down.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_NO_SERIAL
The Rallypoint denied the registration request because the far-end's certificate does not have an an ...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_NO_FINGERPRINT
The Rallypoint denied the registration request because the far-end's certificate does not have an an ...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_EXCLUDED_ISSUER
The Rallypoint denied the registration request because the far-end's certificate issuer has been excl...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_EXCLUDED_ACCESS_TAG
The Rallypoint denied the registration request because the far-end's certificate does not have an acc...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_UNREGISTERED
The group has been gracefully unregistered from the Rallypoint.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_NO_REAON
No particular reason was provided.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_DISCONNECTED_REASON_NOT_ON_WHITELIST
The Rallypoint denied the registration request because the far-end does not appear in any whitelist c...
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_MAGELLAN_DOMO
The source is Domo Tactical via Magellan discovery.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_MAGELLAN_CISTECH
The source is CISTECH via Magellan discovery.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_MAGELLAN_CORE
The source is a Magellan-capable entity.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_INTERNAL
Internal to Engage.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_MAGELLAN_TAIT
The source is Tait via Magellan discovery.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_MAGELLAN_TRELLISWARE
The source is Trellisware via Magellan discovery.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_MAGELLAN_SILVUS
The source is Silvus via Magellan discovery.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_MAGELLAN_VOCALITY
The source is Vocality via Magellan discovery.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_MAGELLAN_PERSISTENT
The source is Persistent Systems via Magellan discovery.
static ENGAGE_IGNORE_COMPILER_UNUSED_WARNING const char * GROUP_SOURCE_ENGAGE_MAGELLAN_KENWOOD
The source is Kenwood via Magellan discovery.
static const uint8_t ENGAGE_DEFAULT_BLOB_RTP_PAYLOAD_TYPE
The default RTP payload type Engage uses for RTP blob messaging.
uint8_t t
DataSeries Type. Currently supported types.
uint8_t it
Increment type. Valid Types:
uint32_t ts
Timestamp representing the number of seconds elapsed since January 1, 1970 - based on traditional Uni...
uint8_t im
Increment multiplier. The increment multiplier is an additional field that allows you apply a multipl...