Engage Engine API  1.250.9090
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 JSON_SERIALIZED_CLASS(KvPair)
461 {
462 IMPLEMENT_JSON_SERIALIZATION()
463 IMPLEMENT_JSON_DOCUMENTATION(KvPair)
464
465 public:
467 std::string key;
468
470 std::string value;
471
472 KvPair()
473 {
474 clear();
475 }
476
477 void clear()
478 {
479 key.clear();
480 value.clear();
481 }
482 };
483
484 static void to_json(nlohmann::json& j, const KvPair& p)
485 {
486 j = nlohmann::json{
487 TOJSON_IMPL(key),
488 TOJSON_IMPL(value)
489 };
490 }
491 static void from_json(const nlohmann::json& j, KvPair& p)
492 {
493 p.clear();
494 getOptional<std::string>("key", p.key, j, EMPTY_STRING);
495 getOptional<std::string>("tags", p.value, j, EMPTY_STRING);
496 }
497
498 //-----------------------------------------------------------
499 JSON_SERIALIZED_CLASS(TuningSettings)
501 {
502 IMPLEMENT_JSON_SERIALIZATION()
503 IMPLEMENT_JSON_DOCUMENTATION(TuningSettings)
504
505 public:
508
511
514
515
518
521
524
525
528
531
534
537
539 {
540 clear();
541 }
542
543 void clear()
544 {
545 maxPooledRtpMb = 0;
546 maxPooledRtpObjects = 0;
547 maxActiveRtpObjects = 0;
548
549 maxPooledBlobMb = 0;
550 maxPooledBlobObjects = 0;
551 maxActiveBlobObjects = 0;
552
553 maxPooledBufferMb = 0;
554 maxPooledBufferObjects = 0;
555 maxActiveBufferObjects = 0;
556
557 maxActiveRtpProcessors = 0;
558 }
559
560 virtual void initForDocumenting()
561 {
562 clear();
563 }
564 };
565
566 static void to_json(nlohmann::json& j, const TuningSettings& p)
567 {
568 j = nlohmann::json{
569 TOJSON_IMPL(maxPooledRtpMb),
570 TOJSON_IMPL(maxPooledRtpObjects),
571 TOJSON_IMPL(maxActiveRtpObjects),
572
573 TOJSON_IMPL(maxPooledBlobMb),
574 TOJSON_IMPL(maxPooledBlobObjects),
575 TOJSON_IMPL(maxActiveBlobObjects),
576
577 TOJSON_IMPL(maxPooledBufferMb),
578 TOJSON_IMPL(maxPooledBufferObjects),
579 TOJSON_IMPL(maxActiveBufferObjects),
580
581 TOJSON_IMPL(maxActiveRtpProcessors)
582 };
583 }
584 static void from_json(const nlohmann::json& j, TuningSettings& p)
585 {
586 p.clear();
587 FROMJSON_IMPL(maxPooledRtpMb, uint32_t, 0);
588 FROMJSON_IMPL(maxPooledRtpObjects, uint32_t, 0);
589 FROMJSON_IMPL(maxActiveRtpObjects, uint32_t, 0);
590
591 FROMJSON_IMPL(maxPooledBlobMb, uint32_t, 0);
592 FROMJSON_IMPL(maxPooledBlobObjects, uint32_t, 0);
593 FROMJSON_IMPL(maxActiveBlobObjects, uint32_t, 0);
594
595 FROMJSON_IMPL(maxPooledBufferMb, uint32_t, 0);
596 FROMJSON_IMPL(maxPooledBufferObjects, uint32_t, 0);
597 FROMJSON_IMPL(maxActiveBufferObjects, uint32_t, 0);
598
599 FROMJSON_IMPL(maxActiveRtpProcessors, uint32_t, 0);
600 }
601
602
603 //-----------------------------------------------------------
604 JSON_SERIALIZED_CLASS(FipsCryptoSettings)
606 {
607 IMPLEMENT_JSON_SERIALIZATION()
608 IMPLEMENT_JSON_DOCUMENTATION(FipsCryptoSettings)
609
610 public:
613
615 std::string path;
616
618 bool debug;
619
621 std::string curves;
622
624 std::string ciphers;
625
627 {
628 clear();
629 }
630
631 void clear()
632 {
633 enabled = false;
634 path.clear();
635 debug = false;
636 curves.clear();
637 ciphers.clear();
638 }
639
640 virtual void initForDocumenting()
641 {
642 clear();
643 }
644 };
645
646 static void to_json(nlohmann::json& j, const FipsCryptoSettings& p)
647 {
648 j = nlohmann::json{
649 TOJSON_IMPL(enabled),
650 TOJSON_IMPL(path),
651 TOJSON_IMPL(debug),
652 TOJSON_IMPL(curves),
653 TOJSON_IMPL(ciphers)
654 };
655 }
656 static void from_json(const nlohmann::json& j, FipsCryptoSettings& p)
657 {
658 p.clear();
659 FROMJSON_IMPL_SIMPLE(enabled);
660 FROMJSON_IMPL_SIMPLE(path);
661 FROMJSON_IMPL_SIMPLE(debug);
662 FROMJSON_IMPL_SIMPLE(curves);
663 FROMJSON_IMPL_SIMPLE(ciphers);
664 }
665
666
667 //-----------------------------------------------------------
668 JSON_SERIALIZED_CLASS(WatchdogSettings)
670 {
671 IMPLEMENT_JSON_SERIALIZATION()
672 IMPLEMENT_JSON_DOCUMENTATION(WatchdogSettings)
673
674 public:
677
680
683
686
689
691 {
692 clear();
693 }
694
695 void clear()
696 {
697 enabled = true;
698 intervalMs = 5000;
699 hangDetectionMs = 2000;
700 abortOnHang = true;
701 slowExecutionThresholdMs = 100;
702 }
703
704 virtual void initForDocumenting()
705 {
706 clear();
707 }
708 };
709
710 static void to_json(nlohmann::json& j, const WatchdogSettings& p)
711 {
712 j = nlohmann::json{
713 TOJSON_IMPL(enabled),
714 TOJSON_IMPL(intervalMs),
715 TOJSON_IMPL(hangDetectionMs),
716 TOJSON_IMPL(abortOnHang),
717 TOJSON_IMPL(slowExecutionThresholdMs)
718 };
719 }
720 static void from_json(const nlohmann::json& j, WatchdogSettings& p)
721 {
722 p.clear();
723 getOptional<bool>("enabled", p.enabled, j, true);
724 getOptional<int>("intervalMs", p.intervalMs, j, 5000);
725 getOptional<int>("hangDetectionMs", p.hangDetectionMs, j, 2000);
726 getOptional<bool>("abortOnHang", p.abortOnHang, j, true);
727 getOptional<int>("slowExecutionThresholdMs", p.slowExecutionThresholdMs, j, 100);
728 }
729
730
731 //-----------------------------------------------------------
732 JSON_SERIALIZED_CLASS(FileRecordingRequest)
734 {
735 IMPLEMENT_JSON_SERIALIZATION()
736 IMPLEMENT_JSON_DOCUMENTATION(FileRecordingRequest)
737
738 public:
739 std::string id;
740 std::string fileName;
741 uint32_t maxMs;
742
744 {
745 clear();
746 }
747
748 void clear()
749 {
750 id.clear();
751 fileName.clear();
752 maxMs = 60000;
753 }
754
755 virtual void initForDocumenting()
756 {
757 clear();
758 id = "1-2-3-4-5-6-7-8-9";
759 fileName = "/tmp/test.wav";
760 maxMs = 10000;
761 }
762 };
763
764 static void to_json(nlohmann::json& j, const FileRecordingRequest& p)
765 {
766 j = nlohmann::json{
767 TOJSON_IMPL(id),
768 TOJSON_IMPL(fileName),
769 TOJSON_IMPL(maxMs)
770 };
771 }
772 static void from_json(const nlohmann::json& j, FileRecordingRequest& p)
773 {
774 p.clear();
775 j.at("id").get_to(p.id);
776 j.at("fileName").get_to(p.fileName);
777 getOptional<uint32_t>("maxMs", p.maxMs, j, 60000);
778 }
779
780
781 //-----------------------------------------------------------
782 JSON_SERIALIZED_CLASS(Feature)
784 {
785 IMPLEMENT_JSON_SERIALIZATION()
786 IMPLEMENT_JSON_DOCUMENTATION(Feature)
787
788 public:
789 std::string id;
790 std::string name;
791 std::string description;
792 std::string comments;
793 int count;
794 int used; // NOTE: Ignored during deserialization!
795
796 Feature()
797 {
798 clear();
799 }
800
801 void clear()
802 {
803 id.clear();
804 name.clear();
805 description.clear();
806 comments.clear();
807 count = 0;
808 used = 0;
809 }
810
811 virtual void initForDocumenting()
812 {
813 clear();
814 id = "{af9540d1-3e86-4fa6-8b80-e26daecb61ab}";
815 name = "A sample feature";
816 description = "This is an example of a feature";
817 comments = "These are comments for this feature";
818 count = 42;
819 used = 16;
820 }
821 };
822
823 static void to_json(nlohmann::json& j, const Feature& p)
824 {
825 j = nlohmann::json{
826 TOJSON_IMPL(id),
827 TOJSON_IMPL(name),
828 TOJSON_IMPL(description),
829 TOJSON_IMPL(comments),
830 TOJSON_IMPL(count),
831 TOJSON_IMPL(used)
832 };
833 }
834 static void from_json(const nlohmann::json& j, Feature& p)
835 {
836 p.clear();
837 j.at("id").get_to(p.id);
838 getOptional("name", p.name, j);
839 getOptional("description", p.description, j);
840 getOptional("comments", p.comments, j);
841 getOptional("count", p.count, j, 0);
842
843 // NOTE: Not deserialized!
844 //getOptional("used", p.used, j, 0);
845 }
846
847
848 //-----------------------------------------------------------
849 JSON_SERIALIZED_CLASS(Featureset)
851 {
852 IMPLEMENT_JSON_SERIALIZATION()
853 IMPLEMENT_JSON_DOCUMENTATION(Featureset)
854
855 public:
856 std::string signature;
857 bool lockToDeviceId;
858 std::vector<Feature> features;
859
860 Featureset()
861 {
862 clear();
863 }
864
865 void clear()
866 {
867 signature.clear();
868 lockToDeviceId = false;
869 features.clear();
870 }
871
872 virtual void initForDocumenting()
873 {
874 clear();
875 signature = "c39df3f36c6444e686e47e70fc45cf91e6ed2d8de62d4a1e89f507d567ff48aaabb1a70e54b44377b46fc4a1a2e319e5b77e4abffc444db98f8eb55d709aad5f";
876 lockToDeviceId = false;
877 }
878 };
879
880 static void to_json(nlohmann::json& j, const Featureset& p)
881 {
882 j = nlohmann::json{
883 TOJSON_IMPL(signature),
884 TOJSON_IMPL(lockToDeviceId),
885 TOJSON_IMPL(features)
886 };
887 }
888 static void from_json(const nlohmann::json& j, Featureset& p)
889 {
890 p.clear();
891 getOptional("signature", p.signature, j);
892 getOptional<bool>("lockToDeviceId", p.lockToDeviceId, j, false);
893 getOptional<std::vector<Feature>>("features", p.features, j);
894 }
895
896
897 //-----------------------------------------------------------
898 JSON_SERIALIZED_CLASS(Agc)
908 {
909 IMPLEMENT_JSON_SERIALIZATION()
910 IMPLEMENT_JSON_DOCUMENTATION(Agc)
911
912 public:
915
918
921
924
927
930
931 Agc()
932 {
933 clear();
934 }
935
936 void clear()
937 {
938 enabled = false;
939 minLevel = 0;
940 maxLevel = 255;
941 compressionGainDb = 25;
942 enableLimiter = false;
943 targetLevelDb = 3;
944 }
945 };
946
947 static void to_json(nlohmann::json& j, const Agc& p)
948 {
949 j = nlohmann::json{
950 TOJSON_IMPL(enabled),
951 TOJSON_IMPL(minLevel),
952 TOJSON_IMPL(maxLevel),
953 TOJSON_IMPL(compressionGainDb),
954 TOJSON_IMPL(enableLimiter),
955 TOJSON_IMPL(targetLevelDb)
956 };
957 }
958 static void from_json(const nlohmann::json& j, Agc& p)
959 {
960 p.clear();
961 getOptional<bool>("enabled", p.enabled, j, false);
962 getOptional<int>("minLevel", p.minLevel, j, 0);
963 getOptional<int>("maxLevel", p.maxLevel, j, 255);
964 getOptional<int>("compressionGainDb", p.compressionGainDb, j, 25);
965 getOptional<bool>("enableLimiter", p.enableLimiter, j, false);
966 getOptional<int>("targetLevelDb", p.targetLevelDb, j, 3);
967 }
968
969
970 //-----------------------------------------------------------
971 JSON_SERIALIZED_CLASS(RtpPayloadTypeTranslation)
981 {
982 IMPLEMENT_JSON_SERIALIZATION()
983 IMPLEMENT_JSON_DOCUMENTATION(RtpPayloadTypeTranslation)
984
985 public:
987 uint16_t external;
988
990 uint16_t engage;
991
993 {
994 clear();
995 }
996
997 void clear()
998 {
999 external = 0;
1000 engage = 0;
1001 }
1002
1003 bool matches(const RtpPayloadTypeTranslation& other)
1004 {
1005 return ( (external == other.external) && (engage == other.engage) );
1006 }
1007 };
1008
1009 static void to_json(nlohmann::json& j, const RtpPayloadTypeTranslation& p)
1010 {
1011 j = nlohmann::json{
1012 TOJSON_IMPL(external),
1013 TOJSON_IMPL(engage)
1014 };
1015 }
1016 static void from_json(const nlohmann::json& j, RtpPayloadTypeTranslation& p)
1017 {
1018 p.clear();
1019 getOptional<uint16_t>("external", p.external, j);
1020 getOptional<uint16_t>("engage", p.engage, j);
1021 }
1022
1023 //-----------------------------------------------------------
1024 JSON_SERIALIZED_CLASS(NetworkInterfaceDevice)
1026 {
1027 IMPLEMENT_JSON_SERIALIZATION()
1028 IMPLEMENT_JSON_DOCUMENTATION(NetworkInterfaceDevice)
1029
1030 public:
1031 std::string name;
1032 std::string friendlyName;
1033 std::string description;
1034 int family;
1035 std::string address;
1036 bool available;
1037 bool isLoopback;
1038 bool supportsMulticast;
1039 std::string hardwareAddress;
1040
1042 {
1043 clear();
1044 }
1045
1046 void clear()
1047 {
1048 name.clear();
1049 friendlyName.clear();
1050 description.clear();
1051 family = -1;
1052 address.clear();
1053 available = false;
1054 isLoopback = false;
1055 supportsMulticast = false;
1056 hardwareAddress.clear();
1057 }
1058
1059 virtual void initForDocumenting()
1060 {
1061 clear();
1062 name = "en0";
1063 friendlyName = "Wi-Fi";
1064 description = "A wi-fi adapter";
1065 family = 1;
1066 address = "127.0.0.1";
1067 available = true;
1068 isLoopback = true;
1069 supportsMulticast = false;
1070 hardwareAddress = "DE:AD:BE:EF:01:02:03";
1071 }
1072 };
1073
1074 static void to_json(nlohmann::json& j, const NetworkInterfaceDevice& p)
1075 {
1076 j = nlohmann::json{
1077 TOJSON_IMPL(name),
1078 TOJSON_IMPL(friendlyName),
1079 TOJSON_IMPL(description),
1080 TOJSON_IMPL(family),
1081 TOJSON_IMPL(address),
1082 TOJSON_IMPL(available),
1083 TOJSON_IMPL(isLoopback),
1084 TOJSON_IMPL(supportsMulticast),
1085 TOJSON_IMPL(hardwareAddress)
1086 };
1087 }
1088 static void from_json(const nlohmann::json& j, NetworkInterfaceDevice& p)
1089 {
1090 p.clear();
1091 getOptional("name", p.name, j);
1092 getOptional("friendlyName", p.friendlyName, j);
1093 getOptional("description", p.description, j);
1094 getOptional("family", p.family, j, -1);
1095 getOptional("address", p.address, j);
1096 getOptional("available", p.available, j, false);
1097 getOptional("isLoopback", p.isLoopback, j, false);
1098 getOptional("supportsMulticast", p.supportsMulticast, j, false);
1099 getOptional("hardwareAddress", p.hardwareAddress, j);
1100 }
1101
1102 //-----------------------------------------------------------
1103 JSON_SERIALIZED_CLASS(ListOfNetworkInterfaceDevice)
1105 {
1106 IMPLEMENT_JSON_SERIALIZATION()
1107 IMPLEMENT_JSON_DOCUMENTATION(ListOfNetworkInterfaceDevice)
1108
1109 public:
1110 std::vector<NetworkInterfaceDevice> list;
1111
1113 {
1114 clear();
1115 }
1116
1117 void clear()
1118 {
1119 list.clear();
1120 }
1121 };
1122
1123 static void to_json(nlohmann::json& j, const ListOfNetworkInterfaceDevice& p)
1124 {
1125 j = nlohmann::json{
1126 TOJSON_IMPL(list)
1127 };
1128 }
1129 static void from_json(const nlohmann::json& j, ListOfNetworkInterfaceDevice& p)
1130 {
1131 p.clear();
1132 getOptional<std::vector<NetworkInterfaceDevice>>("list", p.list, j);
1133 }
1134
1135
1136 //-----------------------------------------------------------
1137 JSON_SERIALIZED_CLASS(RtpHeader)
1147 {
1148 IMPLEMENT_JSON_SERIALIZATION()
1149 IMPLEMENT_JSON_DOCUMENTATION(RtpHeader)
1150
1151 public:
1152
1154 int pt;
1155
1158
1160 uint16_t seq;
1161
1163 uint32_t ssrc;
1164
1166 uint32_t ts;
1167
1168 RtpHeader()
1169 {
1170 clear();
1171 }
1172
1173 void clear()
1174 {
1175 pt = -1;
1176 marker = false;
1177 seq = 0;
1178 ssrc = 0;
1179 ts = 0;
1180 }
1181
1182 virtual void initForDocumenting()
1183 {
1184 clear();
1185 pt = 0;
1186 marker = false;
1187 seq = 123;
1188 ssrc = 12345678;
1189 ts = 87654321;
1190 }
1191 };
1192
1193 static void to_json(nlohmann::json& j, const RtpHeader& p)
1194 {
1195 if(p.pt != -1)
1196 {
1197 j = nlohmann::json{
1198 TOJSON_IMPL(pt),
1199 TOJSON_IMPL(marker),
1200 TOJSON_IMPL(seq),
1201 TOJSON_IMPL(ssrc),
1202 TOJSON_IMPL(ts)
1203 };
1204 }
1205 }
1206 static void from_json(const nlohmann::json& j, RtpHeader& p)
1207 {
1208 p.clear();
1209 getOptional<int>("pt", p.pt, j, -1);
1210 getOptional<bool>("marker", p.marker, j, false);
1211 getOptional<uint16_t>("seq", p.seq, j, 0);
1212 getOptional<uint32_t>("ssrc", p.ssrc, j, 0);
1213 getOptional<uint32_t>("ts", p.ts, j, 0);
1214 }
1215
1216 //-----------------------------------------------------------
1217 JSON_SERIALIZED_CLASS(BlobInfo)
1227 {
1228 IMPLEMENT_JSON_SERIALIZATION()
1229 IMPLEMENT_JSON_DOCUMENTATION(BlobInfo)
1230
1231 public:
1235 typedef enum
1236 {
1238 bptUndefined = 0,
1239
1241 bptAppTextUtf8 = 1,
1242
1244 bptJsonTextUtf8 = 2,
1245
1247 bptAppBinary = 3,
1248
1250 bptEngageBinaryHumanBiometrics = 4,
1251
1253 bptAppMimeMessage = 5,
1254
1256 bptEngageInternal = 42
1257 } PayloadType_t;
1258
1260 size_t size;
1261
1263 std::string source;
1264
1266 std::string target;
1267
1270
1273
1275 std::string txnId;
1276
1279
1280 BlobInfo()
1281 {
1282 clear();
1283 }
1284
1285 void clear()
1286 {
1287 size = 0;
1288 source.clear();
1289 target.clear();
1290 rtpHeader.clear();
1291 payloadType = PayloadType_t::bptUndefined;
1292 txnId.clear();
1293 txnTimeoutSecs = 0;
1294 }
1295
1296 virtual void initForDocumenting()
1297 {
1298 clear();
1299 rtpHeader.initForDocumenting();
1300 }
1301 };
1302
1303 static void to_json(nlohmann::json& j, const BlobInfo& p)
1304 {
1305 j = nlohmann::json{
1306 TOJSON_IMPL(size),
1307 TOJSON_IMPL(source),
1308 TOJSON_IMPL(target),
1309 TOJSON_IMPL(rtpHeader),
1310 TOJSON_IMPL(payloadType),
1311 TOJSON_IMPL(txnId),
1312 TOJSON_IMPL(txnTimeoutSecs)
1313 };
1314 }
1315 static void from_json(const nlohmann::json& j, BlobInfo& p)
1316 {
1317 p.clear();
1318 getOptional<size_t>("size", p.size, j, 0);
1319 getOptional<std::string>("source", p.source, j, EMPTY_STRING);
1320 getOptional<std::string>("target", p.target, j, EMPTY_STRING);
1321 getOptional<RtpHeader>("rtpHeader", p.rtpHeader, j);
1322 getOptional<BlobInfo::PayloadType_t>("payloadType", p.payloadType, j, BlobInfo::PayloadType_t::bptUndefined);
1323 getOptional<std::string>("txnId", p.txnId, j, EMPTY_STRING);
1324 getOptional<int>("txnTimeoutSecs", p.txnTimeoutSecs, j, 0);
1325 }
1326
1327
1328 //-----------------------------------------------------------
1329 JSON_SERIALIZED_CLASS(TxAudioUri)
1342 {
1343 IMPLEMENT_JSON_SERIALIZATION()
1344 IMPLEMENT_JSON_DOCUMENTATION(TxAudioUri)
1345
1346 public:
1348 std::string uri;
1349
1352
1353 TxAudioUri()
1354 {
1355 clear();
1356 }
1357
1358 void clear()
1359 {
1360 uri.clear();
1361 repeatCount = 0;
1362 }
1363
1364 virtual void initForDocumenting()
1365 {
1366 }
1367 };
1368
1369 static void to_json(nlohmann::json& j, const TxAudioUri& p)
1370 {
1371 j = nlohmann::json{
1372 TOJSON_IMPL(uri),
1373 TOJSON_IMPL(repeatCount)
1374 };
1375 }
1376 static void from_json(const nlohmann::json& j, TxAudioUri& p)
1377 {
1378 p.clear();
1379 getOptional<std::string>("uri", p.uri, j, EMPTY_STRING);
1380 getOptional<int>("repeatCount", p.repeatCount, j, 0);
1381 }
1382
1383
1384 //-----------------------------------------------------------
1385 JSON_SERIALIZED_CLASS(AdvancedTxParams)
1398 {
1399 IMPLEMENT_JSON_SERIALIZATION()
1400 IMPLEMENT_JSON_DOCUMENTATION(AdvancedTxParams)
1401
1402 public:
1403
1405 uint16_t flags;
1406
1408 uint8_t priority;
1409
1412
1415
1417 std::string alias;
1418
1420 bool muted;
1421
1423 uint32_t txId;
1424
1427
1430
1433
1435 {
1436 clear();
1437 }
1438
1439 void clear()
1440 {
1441 flags = 0;
1442 priority = 0;
1443 subchannelTag = 0;
1444 includeNodeId = false;
1445 alias.clear();
1446 muted = false;
1447 txId = 0;
1448 audioUri.clear();
1449 aliasSpecializer = 0;
1450 receiverRxMuteForAliasSpecializer = false;
1451 }
1452
1453 virtual void initForDocumenting()
1454 {
1455 }
1456 };
1457
1458 static void to_json(nlohmann::json& j, const AdvancedTxParams& p)
1459 {
1460 j = nlohmann::json{
1461 TOJSON_IMPL(flags),
1462 TOJSON_IMPL(priority),
1463 TOJSON_IMPL(subchannelTag),
1464 TOJSON_IMPL(includeNodeId),
1465 TOJSON_IMPL(alias),
1466 TOJSON_IMPL(muted),
1467 TOJSON_IMPL(txId),
1468 TOJSON_IMPL(audioUri),
1469 TOJSON_IMPL(aliasSpecializer),
1470 TOJSON_IMPL(receiverRxMuteForAliasSpecializer)
1471 };
1472 }
1473 static void from_json(const nlohmann::json& j, AdvancedTxParams& p)
1474 {
1475 p.clear();
1476 getOptional<uint16_t>("flags", p.flags, j, 0);
1477 getOptional<uint8_t>("priority", p.priority, j, 0);
1478 getOptional<uint16_t>("subchannelTag", p.subchannelTag, j, 0);
1479 getOptional<bool>("includeNodeId", p.includeNodeId, j, false);
1480 getOptional<std::string>("alias", p.alias, j, EMPTY_STRING);
1481 getOptional<bool>("muted", p.muted, j, false);
1482 getOptional<uint32_t>("txId", p.txId, j, 0);
1483 getOptional<TxAudioUri>("audioUri", p.audioUri, j);
1484 getOptional<uint16_t>("aliasSpecializer", p.aliasSpecializer, j, 0);
1485 getOptional<bool>("receiverRxMuteForAliasSpecializer", p.receiverRxMuteForAliasSpecializer, j, false);
1486 }
1487
1488 //-----------------------------------------------------------
1489 JSON_SERIALIZED_CLASS(Identity)
1502 {
1503 IMPLEMENT_JSON_SERIALIZATION()
1504 IMPLEMENT_JSON_DOCUMENTATION(Identity)
1505
1506 public:
1514 std::string nodeId;
1515
1517 std::string userId;
1518
1520 std::string displayName;
1521
1523 std::string avatar;
1524
1525 Identity()
1526 {
1527 clear();
1528 }
1529
1530 void clear()
1531 {
1532 nodeId.clear();
1533 userId.clear();
1534 displayName.clear();
1535 avatar.clear();
1536 }
1537
1538 virtual void initForDocumenting()
1539 {
1540 }
1541 };
1542
1543 static void to_json(nlohmann::json& j, const Identity& p)
1544 {
1545 j = nlohmann::json{
1546 TOJSON_IMPL(nodeId),
1547 TOJSON_IMPL(userId),
1548 TOJSON_IMPL(displayName),
1549 TOJSON_IMPL(avatar)
1550 };
1551 }
1552 static void from_json(const nlohmann::json& j, Identity& p)
1553 {
1554 p.clear();
1555 getOptional<std::string>("nodeId", p.nodeId, j);
1556 getOptional<std::string>("userId", p.userId, j);
1557 getOptional<std::string>("displayName", p.displayName, j);
1558 getOptional<std::string>("avatar", p.avatar, j);
1559 }
1560
1561
1562 //-----------------------------------------------------------
1563 JSON_SERIALIZED_CLASS(Location)
1576 {
1577 IMPLEMENT_JSON_SERIALIZATION()
1578 IMPLEMENT_JSON_DOCUMENTATION(Location)
1579
1580 public:
1581 constexpr static double INVALID_LOCATION_VALUE = -999.999;
1582
1584 uint32_t ts;
1585
1587 double latitude;
1588
1591
1593 double altitude;
1594
1597
1599 double speed;
1600
1601 Location()
1602 {
1603 clear();
1604 }
1605
1606 void clear()
1607 {
1608 ts = 0;
1609 latitude = INVALID_LOCATION_VALUE;
1610 longitude = INVALID_LOCATION_VALUE;
1611 altitude = INVALID_LOCATION_VALUE;
1612 direction = INVALID_LOCATION_VALUE;
1613 speed = INVALID_LOCATION_VALUE;
1614 }
1615
1616 virtual void initForDocumenting()
1617 {
1618 clear();
1619
1620 ts = 123456;
1621 latitude = 123.456;
1622 longitude = 456.789;
1623 altitude = 123;
1624 direction = 1;
1625 speed = 1234;
1626 }
1627 };
1628
1629 static void to_json(nlohmann::json& j, const Location& p)
1630 {
1631 if(p.latitude != Location::INVALID_LOCATION_VALUE && p.longitude != Location::INVALID_LOCATION_VALUE)
1632 {
1633 j = nlohmann::json{
1634 TOJSON_IMPL(latitude),
1635 TOJSON_IMPL(longitude),
1636 };
1637
1638 if(p.ts != 0) j["ts"] = p.ts;
1639 if(p.altitude != Location::INVALID_LOCATION_VALUE) j["altitude"] = p.altitude;
1640 if(p.speed != Location::INVALID_LOCATION_VALUE) j["speed"] = p.speed;
1641 if(p.direction != Location::INVALID_LOCATION_VALUE) j["direction"] = p.direction;
1642 }
1643 }
1644 static void from_json(const nlohmann::json& j, Location& p)
1645 {
1646 p.clear();
1647 getOptional<uint32_t>("ts", p.ts, j, 0);
1648 j.at("latitude").get_to(p.latitude);
1649 j.at("longitude").get_to(p.longitude);
1650 getOptional<double>("altitude", p.altitude, j, Location::INVALID_LOCATION_VALUE);
1651 getOptional<double>("direction", p.direction, j, Location::INVALID_LOCATION_VALUE);
1652 getOptional<double>("speed", p.speed, j, Location::INVALID_LOCATION_VALUE);
1653 }
1654
1655 //-----------------------------------------------------------
1656 JSON_SERIALIZED_CLASS(Power)
1667 {
1668 IMPLEMENT_JSON_SERIALIZATION()
1669 IMPLEMENT_JSON_DOCUMENTATION(Power)
1670
1671 public:
1672
1685
1699
1702
1703 Power()
1704 {
1705 clear();
1706 }
1707
1708 void clear()
1709 {
1710 source = 0;
1711 state = 0;
1712 level = 0;
1713 }
1714
1715 virtual void initForDocumenting()
1716 {
1717 }
1718 };
1719
1720 static void to_json(nlohmann::json& j, const Power& p)
1721 {
1722 if(p.source != 0 && p.state != 0 && p.level != 0)
1723 {
1724 j = nlohmann::json{
1725 TOJSON_IMPL(source),
1726 TOJSON_IMPL(state),
1727 TOJSON_IMPL(level)
1728 };
1729 }
1730 }
1731 static void from_json(const nlohmann::json& j, Power& p)
1732 {
1733 p.clear();
1734 getOptional<int>("source", p.source, j, 0);
1735 getOptional<int>("state", p.state, j, 0);
1736 getOptional<int>("level", p.level, j, 0);
1737 }
1738
1739
1740 //-----------------------------------------------------------
1741 JSON_SERIALIZED_CLASS(Connectivity)
1752 {
1753 IMPLEMENT_JSON_SERIALIZATION()
1754 IMPLEMENT_JSON_DOCUMENTATION(Connectivity)
1755
1756 public:
1770 int type;
1771
1774
1777
1778 Connectivity()
1779 {
1780 clear();
1781 }
1782
1783 void clear()
1784 {
1785 type = 0;
1786 strength = 0;
1787 rating = 0;
1788 }
1789
1790 virtual void initForDocumenting()
1791 {
1792 clear();
1793
1794 type = 1;
1795 strength = 2;
1796 rating = 3;
1797 }
1798 };
1799
1800 static void to_json(nlohmann::json& j, const Connectivity& p)
1801 {
1802 if(p.type != 0)
1803 {
1804 j = nlohmann::json{
1805 TOJSON_IMPL(type),
1806 TOJSON_IMPL(strength),
1807 TOJSON_IMPL(rating)
1808 };
1809 }
1810 }
1811 static void from_json(const nlohmann::json& j, Connectivity& p)
1812 {
1813 p.clear();
1814 getOptional<int>("type", p.type, j, 0);
1815 getOptional<int>("strength", p.strength, j, 0);
1816 getOptional<int>("rating", p.rating, j, 0);
1817 }
1818
1819
1820 //-----------------------------------------------------------
1821 JSON_SERIALIZED_CLASS(PresenceDescriptorGroupItem)
1832 {
1833 IMPLEMENT_JSON_SERIALIZATION()
1834 IMPLEMENT_JSON_DOCUMENTATION(PresenceDescriptorGroupItem)
1835
1836 public:
1838 std::string groupId;
1839
1841 std::string alias;
1842
1844 uint16_t status;
1845
1847 {
1848 clear();
1849 }
1850
1851 void clear()
1852 {
1853 groupId.clear();
1854 alias.clear();
1855 status = 0;
1856 }
1857
1858 virtual void initForDocumenting()
1859 {
1860 groupId = "{123-456}";
1861 alias = "MYALIAS";
1862 status = 0;
1863 }
1864 };
1865
1866 static void to_json(nlohmann::json& j, const PresenceDescriptorGroupItem& p)
1867 {
1868 j = nlohmann::json{
1869 TOJSON_IMPL(groupId),
1870 TOJSON_IMPL(alias),
1871 TOJSON_IMPL(status)
1872 };
1873 }
1874 static void from_json(const nlohmann::json& j, PresenceDescriptorGroupItem& p)
1875 {
1876 p.clear();
1877 getOptional<std::string>("groupId", p.groupId, j);
1878 getOptional<std::string>("alias", p.alias, j);
1879 getOptional<uint16_t>("status", p.status, j);
1880 }
1881
1882
1883 //-----------------------------------------------------------
1884 JSON_SERIALIZED_CLASS(PresenceDescriptor)
1895 {
1896 IMPLEMENT_JSON_SERIALIZATION()
1897 IMPLEMENT_JSON_DOCUMENTATION(PresenceDescriptor)
1898
1899 public:
1900
1906 bool self;
1907
1913 uint32_t ts;
1914
1920 uint32_t nextUpdate;
1921
1924
1926 std::string comment;
1927
1941 uint32_t disposition;
1942
1944 std::vector<PresenceDescriptorGroupItem> groupAliases;
1945
1948
1950 std::string custom;
1951
1954
1957
1960
1962 {
1963 clear();
1964 }
1965
1966 void clear()
1967 {
1968 self = false;
1969 ts = 0;
1970 nextUpdate = 0;
1971 identity.clear();
1972 comment.clear();
1973 disposition = 0;
1974 groupAliases.clear();
1975 location.clear();
1976 custom.clear();
1977 announceOnReceive = false;
1978 connectivity.clear();
1979 power.clear();
1980 }
1981
1982 virtual void initForDocumenting()
1983 {
1984 clear();
1985
1986 self = true;
1987 ts = 123;
1988 nextUpdate = 0;
1989 identity.initForDocumenting();
1990 comment = "This is a comment";
1991 disposition = 123;
1992
1993 PresenceDescriptorGroupItem gi;
1994 gi.initForDocumenting();
1995 groupAliases.push_back(gi);
1996
1997 location.initForDocumenting();
1998 custom = "{}";
1999 announceOnReceive = true;
2000 connectivity.initForDocumenting();
2001 power.initForDocumenting();
2002 }
2003 };
2004
2005 static void to_json(nlohmann::json& j, const PresenceDescriptor& p)
2006 {
2007 j = nlohmann::json{
2008 TOJSON_IMPL(ts),
2009 TOJSON_IMPL(nextUpdate),
2010 TOJSON_IMPL(identity),
2011 TOJSON_IMPL(comment),
2012 TOJSON_IMPL(disposition),
2013 TOJSON_IMPL(groupAliases),
2014 TOJSON_IMPL(location),
2015 TOJSON_IMPL(custom),
2016 TOJSON_IMPL(announceOnReceive),
2017 TOJSON_IMPL(connectivity),
2018 TOJSON_IMPL(power)
2019 };
2020
2021 if(!p.comment.empty()) j["comment"] = p.comment;
2022 if(!p.custom.empty()) j["custom"] = p.custom;
2023
2024 if(p.self)
2025 {
2026 j["self"] = true;
2027 }
2028 }
2029 static void from_json(const nlohmann::json& j, PresenceDescriptor& p)
2030 {
2031 p.clear();
2032 getOptional<bool>("self", p.self, j);
2033 getOptional<uint32_t>("ts", p.ts, j);
2034 getOptional<uint32_t>("nextUpdate", p.nextUpdate, j);
2035 getOptional<Identity>("identity", p.identity, j);
2036 getOptional<std::string>("comment", p.comment, j);
2037 getOptional<uint32_t>("disposition", p.disposition, j);
2038 getOptional<std::vector<PresenceDescriptorGroupItem>>("groupAliases", p.groupAliases, j);
2039 getOptional<Location>("location", p.location, j);
2040 getOptional<std::string>("custom", p.custom, j);
2041 getOptional<bool>("announceOnReceive", p.announceOnReceive, j);
2042 getOptional<Connectivity>("connectivity", p.connectivity, j);
2043 getOptional<Power>("power", p.power, j);
2044 }
2045
2051 typedef enum
2052 {
2055
2058
2061
2063 priVoice = 3
2064 } TxPriority_t;
2065
2071 typedef enum
2072 {
2075
2078
2081
2083 arpIpv6ThenIpv4 = 64
2084 } AddressResolutionPolicy_t;
2085
2086 //-----------------------------------------------------------
2087 JSON_SERIALIZED_CLASS(NetworkTxOptions)
2100 {
2101 IMPLEMENT_JSON_SERIALIZATION()
2102 IMPLEMENT_JSON_DOCUMENTATION(NetworkTxOptions)
2103
2104 public:
2107
2113 int ttl;
2114
2116 {
2117 clear();
2118 }
2119
2120 void clear()
2121 {
2122 priority = priVoice;
2123 ttl = 1;
2124 }
2125
2126 virtual void initForDocumenting()
2127 {
2128 }
2129 };
2130
2131 static void to_json(nlohmann::json& j, const NetworkTxOptions& p)
2132 {
2133 j = nlohmann::json{
2134 TOJSON_IMPL(priority),
2135 TOJSON_IMPL(ttl)
2136 };
2137 }
2138 static void from_json(const nlohmann::json& j, NetworkTxOptions& p)
2139 {
2140 p.clear();
2141 getOptional<TxPriority_t>("priority", p.priority, j, TxPriority_t::priVoice);
2142 getOptional<int>("ttl", p.ttl, j, 1);
2143 }
2144
2145
2146 //-----------------------------------------------------------
2147 JSON_SERIALIZED_CLASS(TcpNetworkTxOptions)
2156 {
2157 IMPLEMENT_JSON_SERIALIZATION()
2158 IMPLEMENT_JSON_DOCUMENTATION(TcpNetworkTxOptions)
2159
2160 public:
2162 {
2163 clear();
2164 }
2165
2166 void clear()
2167 {
2168 priority = priVoice;
2169 ttl = -1;
2170 }
2171
2172 virtual void initForDocumenting()
2173 {
2174 }
2175 };
2176
2177 static void to_json(nlohmann::json& j, const TcpNetworkTxOptions& p)
2178 {
2179 j = nlohmann::json{
2180 TOJSON_IMPL(priority),
2181 TOJSON_IMPL(ttl)
2182 };
2183 }
2184 static void from_json(const nlohmann::json& j, TcpNetworkTxOptions& p)
2185 {
2186 p.clear();
2187 getOptional<TxPriority_t>("priority", p.priority, j, TxPriority_t::priVoice);
2188 getOptional<int>("ttl", p.ttl, j, -1);
2189 }
2190
2191 typedef enum
2192 {
2195
2198
2200 ifIp6 = 6
2201 } IpFamilyType_t;
2202
2203 //-----------------------------------------------------------
2204 JSON_SERIALIZED_CLASS(NetworkAddress)
2216 {
2217 IMPLEMENT_JSON_SERIALIZATION()
2218 IMPLEMENT_JSON_DOCUMENTATION(NetworkAddress)
2219
2220 public:
2222 std::string address;
2223
2225 int port;
2226
2228 {
2229 clear();
2230 }
2231
2232 void clear()
2233 {
2234 address.clear();
2235 port = 0;
2236 }
2237
2238 bool matches(const NetworkAddress& other)
2239 {
2240 if(address.compare(other.address) != 0)
2241 {
2242 return false;
2243 }
2244
2245 if(port != other.port)
2246 {
2247 return false;
2248 }
2249
2250 return true;
2251 }
2252 };
2253
2254 static void to_json(nlohmann::json& j, const NetworkAddress& p)
2255 {
2256 j = nlohmann::json{
2257 TOJSON_IMPL(address),
2258 TOJSON_IMPL(port)
2259 };
2260 }
2261 static void from_json(const nlohmann::json& j, NetworkAddress& p)
2262 {
2263 p.clear();
2264 getOptional<std::string>("address", p.address, j);
2265 getOptional<int>("port", p.port, j);
2266 }
2267
2268
2269 //-----------------------------------------------------------
2270 JSON_SERIALIZED_CLASS(NetworkAddressRxTx)
2282 {
2283 IMPLEMENT_JSON_SERIALIZATION()
2284 IMPLEMENT_JSON_DOCUMENTATION(NetworkAddressRxTx)
2285
2286 public:
2289
2292
2294 {
2295 clear();
2296 }
2297
2298 void clear()
2299 {
2300 rx.clear();
2301 tx.clear();
2302 }
2303 };
2304
2305 static void to_json(nlohmann::json& j, const NetworkAddressRxTx& p)
2306 {
2307 j = nlohmann::json{
2308 TOJSON_IMPL(rx),
2309 TOJSON_IMPL(tx)
2310 };
2311 }
2312 static void from_json(const nlohmann::json& j, NetworkAddressRxTx& p)
2313 {
2314 p.clear();
2315 getOptional<NetworkAddress>("rx", p.rx, j);
2316 getOptional<NetworkAddress>("tx", p.tx, j);
2317 }
2318
2320 typedef enum
2321 {
2324
2326 graptStrict = 1
2327 } GroupRestrictionAccessPolicyType_t;
2328
2329 static bool isValidGroupRestrictionAccessPolicyType(GroupRestrictionAccessPolicyType_t t)
2330 {
2331 return (t == GroupRestrictionAccessPolicyType_t::graptPermissive ||
2332 t == GroupRestrictionAccessPolicyType_t::graptStrict );
2333 }
2334
2336 typedef enum
2337 {
2340
2343
2345 rtBlacklist = 2
2346 } RestrictionType_t;
2347
2348 static bool isValidRestrictionType(RestrictionType_t t)
2349 {
2350 return (t == RestrictionType_t::rtUndefined ||
2351 t == RestrictionType_t::rtWhitelist ||
2352 t == RestrictionType_t::rtBlacklist );
2353 }
2354
2379
2380 static bool isValidRestrictionElementType(RestrictionElementType_t t)
2381 {
2382 return (t == RestrictionElementType_t::retGroupId ||
2383 t == RestrictionElementType_t::retGroupIdPattern ||
2384 t == RestrictionElementType_t::retGenericAccessTagPattern ||
2385 t == RestrictionElementType_t::retCertificateSerialNumberPattern ||
2386 t == RestrictionElementType_t::retCertificateFingerprintPattern ||
2387 t == RestrictionElementType_t::retCertificateSubjectPattern ||
2388 t == RestrictionElementType_t::retCertificateIssuerPattern);
2389 }
2390
2391
2392 //-----------------------------------------------------------
2393 JSON_SERIALIZED_CLASS(NetworkAddressRestrictionList)
2405 {
2406 IMPLEMENT_JSON_SERIALIZATION()
2407 IMPLEMENT_JSON_DOCUMENTATION(NetworkAddressRestrictionList)
2408
2409 public:
2412
2414 std::vector<NetworkAddressRxTx> elements;
2415
2417 {
2418 clear();
2419 }
2420
2421 void clear()
2422 {
2423 type = RestrictionType_t::rtUndefined;
2424 elements.clear();
2425 }
2426 };
2427
2428 static void to_json(nlohmann::json& j, const NetworkAddressRestrictionList& p)
2429 {
2430 j = nlohmann::json{
2431 TOJSON_IMPL(type),
2432 TOJSON_IMPL(elements)
2433 };
2434 }
2435 static void from_json(const nlohmann::json& j, NetworkAddressRestrictionList& p)
2436 {
2437 p.clear();
2438 getOptional<RestrictionType_t>("type", p.type, j, RestrictionType_t::rtUndefined);
2439 getOptional<std::vector<NetworkAddressRxTx>>("elements", p.elements, j);
2440 }
2441
2442 //-----------------------------------------------------------
2443 JSON_SERIALIZED_CLASS(StringRestrictionList)
2455 {
2456 IMPLEMENT_JSON_SERIALIZATION()
2457 IMPLEMENT_JSON_DOCUMENTATION(StringRestrictionList)
2458
2459 public:
2462
2465
2467 std::vector<std::string> elements;
2468
2470 {
2471 type = RestrictionType_t::rtUndefined;
2472 elementsType = RestrictionElementType_t::retGroupId;
2473 clear();
2474 }
2475
2476 void clear()
2477 {
2478 elements.clear();
2479 }
2480 };
2481
2482 static void to_json(nlohmann::json& j, const StringRestrictionList& p)
2483 {
2484 j = nlohmann::json{
2485 TOJSON_IMPL(type),
2486 TOJSON_IMPL(elementsType),
2487 TOJSON_IMPL(elements)
2488 };
2489 }
2490 static void from_json(const nlohmann::json& j, StringRestrictionList& p)
2491 {
2492 p.clear();
2493 getOptional<RestrictionType_t>("type", p.type, j, RestrictionType_t::rtUndefined);
2494 getOptional<RestrictionElementType_t>("elementsType", p.elementsType, j, RestrictionElementType_t::retGroupId);
2495 getOptional<std::vector<std::string>>("elements", p.elements, j);
2496 }
2497
2498
2499 //-----------------------------------------------------------
2500 JSON_SERIALIZED_CLASS(PacketCapturer)
2510 {
2511 IMPLEMENT_JSON_SERIALIZATION()
2512 IMPLEMENT_JSON_DOCUMENTATION(PacketCapturer)
2513
2514 public:
2515 bool enabled;
2516 uint32_t maxMb;
2517 std::string filePrefix;
2518
2520 {
2521 clear();
2522 }
2523
2524 void clear()
2525 {
2526 enabled = false;
2527 maxMb = 10;
2528 filePrefix.clear();
2529 }
2530 };
2531
2532 static void to_json(nlohmann::json& j, const PacketCapturer& p)
2533 {
2534 j = nlohmann::json{
2535 TOJSON_IMPL(enabled),
2536 TOJSON_IMPL(maxMb),
2537 TOJSON_IMPL(filePrefix)
2538 };
2539 }
2540 static void from_json(const nlohmann::json& j, PacketCapturer& p)
2541 {
2542 p.clear();
2543 getOptional<bool>("enabled", p.enabled, j, false);
2544 getOptional<uint32_t>("maxMb", p.maxMb, j, 10);
2545 getOptional<std::string>("filePrefix", p.filePrefix, j, EMPTY_STRING);
2546 }
2547
2548
2549 //-----------------------------------------------------------
2550 JSON_SERIALIZED_CLASS(TransportImpairment)
2560 {
2561 IMPLEMENT_JSON_SERIALIZATION()
2562 IMPLEMENT_JSON_DOCUMENTATION(TransportImpairment)
2563
2564 public:
2565 int applicationPercentage;
2566 int jitterMs;
2567 int lossPercentage;
2568
2570 {
2571 clear();
2572 }
2573
2574 void clear()
2575 {
2576 applicationPercentage = 0;
2577 jitterMs = 0;
2578 lossPercentage = 0;
2579 }
2580 };
2581
2582 static void to_json(nlohmann::json& j, const TransportImpairment& p)
2583 {
2584 j = nlohmann::json{
2585 TOJSON_IMPL(applicationPercentage),
2586 TOJSON_IMPL(jitterMs),
2587 TOJSON_IMPL(lossPercentage)
2588 };
2589 }
2590 static void from_json(const nlohmann::json& j, TransportImpairment& p)
2591 {
2592 p.clear();
2593 getOptional<int>("applicationPercentage", p.applicationPercentage, j, 0);
2594 getOptional<int>("jitterMs", p.jitterMs, j, 0);
2595 getOptional<int>("lossPercentage", p.lossPercentage, j, 0);
2596 }
2597
2598 //-----------------------------------------------------------
2599 JSON_SERIALIZED_CLASS(NsmNetworking)
2609 {
2610 IMPLEMENT_JSON_SERIALIZATION()
2611 IMPLEMENT_JSON_DOCUMENTATION(NsmNetworking)
2612
2613 public:
2614 std::string interfaceName;
2615 NetworkAddress address;
2616 int ttl;
2617 int tos;
2618 int txOversend;
2619 TransportImpairment rxImpairment;
2620 TransportImpairment txImpairment;
2621 std::string cryptoPassword;
2622
2624 {
2625 clear();
2626 }
2627
2628 void clear()
2629 {
2630 interfaceName.clear();
2631 address.clear();
2632 ttl = 1;
2633 tos = 56;
2634 txOversend = 0;
2635 rxImpairment.clear();
2636 txImpairment.clear();
2637 cryptoPassword.clear();
2638 }
2639 };
2640
2641 static void to_json(nlohmann::json& j, const NsmNetworking& p)
2642 {
2643 j = nlohmann::json{
2644 TOJSON_IMPL(interfaceName),
2645 TOJSON_IMPL(address),
2646 TOJSON_IMPL(ttl),
2647 TOJSON_IMPL(tos),
2648 TOJSON_IMPL(txOversend),
2649 TOJSON_IMPL(rxImpairment),
2650 TOJSON_IMPL(txImpairment),
2651 TOJSON_IMPL(cryptoPassword)
2652 };
2653 }
2654 static void from_json(const nlohmann::json& j, NsmNetworking& p)
2655 {
2656 p.clear();
2657 getOptional("interfaceName", p.interfaceName, j, EMPTY_STRING);
2658 getOptional<NetworkAddress>("address", p.address, j);
2659 getOptional<int>("ttl", p.ttl, j, 1);
2660 getOptional<int>("tos", p.tos, j, 56);
2661 getOptional<int>("txOversend", p.txOversend, j, 0);
2662 getOptional<TransportImpairment>("rxImpairment", p.rxImpairment, j);
2663 getOptional<TransportImpairment>("txImpairment", p.txImpairment, j);
2664 getOptional("cryptoPassword", p.cryptoPassword, j, EMPTY_STRING);
2665 }
2666
2667
2668 //-----------------------------------------------------------
2669 JSON_SERIALIZED_CLASS(NsmConfiguration)
2679 {
2680 IMPLEMENT_JSON_SERIALIZATION()
2681 IMPLEMENT_JSON_DOCUMENTATION(NsmConfiguration)
2682
2683 public:
2684
2685 std::string id;
2686 bool favorUptime;
2687 NsmNetworking networking;
2688 std::vector<std::string> resources;
2689 int tokenStart;
2690 int tokenEnd;
2691 int intervalSecs;
2692 int transitionSecsFactor;
2693
2695 {
2696 clear();
2697 }
2698
2699 void clear()
2700 {
2701 id.clear();
2702 favorUptime = false;
2703 networking.clear();
2704 resources.clear();
2705 tokenStart = 1000000;
2706 tokenEnd = 2000000;
2707 intervalSecs = 1;
2708 transitionSecsFactor = 3;
2709 }
2710 };
2711
2712 static void to_json(nlohmann::json& j, const NsmConfiguration& p)
2713 {
2714 j = nlohmann::json{
2715 TOJSON_IMPL(id),
2716 TOJSON_IMPL(favorUptime),
2717 TOJSON_IMPL(networking),
2718 TOJSON_IMPL(resources),
2719 TOJSON_IMPL(tokenStart),
2720 TOJSON_IMPL(tokenEnd),
2721 TOJSON_IMPL(intervalSecs),
2722 TOJSON_IMPL(transitionSecsFactor)
2723 };
2724 }
2725 static void from_json(const nlohmann::json& j, NsmConfiguration& p)
2726 {
2727 p.clear();
2728 getOptional("id", p.id, j);
2729 getOptional<bool>("favorUptime", p.favorUptime, j, false);
2730 getOptional<NsmNetworking>("networking", p.networking, j);
2731 getOptional<std::vector<std::string>>("resources", p.resources, j);
2732 getOptional<int>("tokenStart", p.tokenStart, j, 1000000);
2733 getOptional<int>("tokenEnd", p.tokenEnd, j, 2000000);
2734 getOptional<int>("intervalSecs", p.intervalSecs, j, 1);
2735 getOptional<int>("transitionSecsFactor", p.transitionSecsFactor, j, 3);
2736 }
2737
2738
2739 //-----------------------------------------------------------
2740 JSON_SERIALIZED_CLASS(Rallypoint)
2749 {
2750 IMPLEMENT_JSON_SERIALIZATION()
2751 IMPLEMENT_JSON_DOCUMENTATION(Rallypoint)
2752
2753 public:
2754
2760
2772 std::string certificate;
2773
2785 std::string certificateKey;
2786
2791
2796
2800 std::vector<std::string> caCertificates;
2801
2806
2811
2814
2817
2818 Rallypoint()
2819 {
2820 clear();
2821 }
2822
2823 void clear()
2824 {
2825 host.clear();
2826 certificate.clear();
2827 certificateKey.clear();
2828 caCertificates.clear();
2829 verifyPeer = false;
2830 transactionTimeoutMs = 5000;
2831 disableMessageSigning = false;
2832 connectionTimeoutSecs = 5;
2833 tcpTxOptions.clear();
2834 }
2835
2836 bool matches(const Rallypoint& other)
2837 {
2838 if(!host.matches(other.host))
2839 {
2840 return false;
2841 }
2842
2843 if(certificate.compare(other.certificate) != 0)
2844 {
2845 return false;
2846 }
2847
2848 if(certificateKey.compare(other.certificateKey) != 0)
2849 {
2850 return false;
2851 }
2852
2853 if(verifyPeer != other.verifyPeer)
2854 {
2855 return false;
2856 }
2857
2858 if(allowSelfSignedCertificate != other.allowSelfSignedCertificate)
2859 {
2860 return false;
2861 }
2862
2863 if(caCertificates.size() != other.caCertificates.size())
2864 {
2865 return false;
2866 }
2867
2868 for(size_t x = 0; x < caCertificates.size(); x++)
2869 {
2870 bool found = false;
2871
2872 for(size_t y = 0; y < other.caCertificates.size(); y++)
2873 {
2874 if(caCertificates[x].compare(other.caCertificates[y]) == 0)
2875 {
2876 found = true;
2877 break;
2878 }
2879 }
2880
2881 if(!found)
2882 {
2883 return false;
2884 }
2885 }
2886
2887 if(transactionTimeoutMs != other.transactionTimeoutMs)
2888 {
2889 return false;
2890 }
2891
2892 if(disableMessageSigning != other.disableMessageSigning)
2893 {
2894 return false;
2895 }
2896
2897 return true;
2898 }
2899 };
2900
2901 static void to_json(nlohmann::json& j, const Rallypoint& p)
2902 {
2903 j = nlohmann::json{
2904 TOJSON_IMPL(host),
2905 TOJSON_IMPL(certificate),
2906 TOJSON_IMPL(certificateKey),
2907 TOJSON_IMPL(verifyPeer),
2908 TOJSON_IMPL(allowSelfSignedCertificate),
2909 TOJSON_IMPL(caCertificates),
2910 TOJSON_IMPL(transactionTimeoutMs),
2911 TOJSON_IMPL(disableMessageSigning),
2912 TOJSON_IMPL(connectionTimeoutSecs),
2913 TOJSON_IMPL(tcpTxOptions)
2914 };
2915 }
2916
2917 static void from_json(const nlohmann::json& j, Rallypoint& p)
2918 {
2919 p.clear();
2920 j.at("host").get_to(p.host);
2921 getOptional("certificate", p.certificate, j);
2922 getOptional("certificateKey", p.certificateKey, j);
2923 getOptional<bool>("verifyPeer", p.verifyPeer, j, true);
2924 getOptional<bool>("allowSelfSignedCertificate", p.allowSelfSignedCertificate, j, false);
2925 getOptional<std::vector<std::string>>("caCertificates", p.caCertificates, j);
2926 getOptional<int>("transactionTimeoutMs", p.transactionTimeoutMs, j, 5000);
2927 getOptional<bool>("disableMessageSigning", p.disableMessageSigning, j, false);
2928 getOptional<int>("connectionTimeoutSecs", p.connectionTimeoutSecs, j, 5);
2929 getOptional<TcpNetworkTxOptions>("tcpTxOptions", p.tcpTxOptions, j);
2930 }
2931
2932 //-----------------------------------------------------------
2933 JSON_SERIALIZED_CLASS(RallypointCluster)
2945 {
2946 IMPLEMENT_JSON_SERIALIZATION()
2947 IMPLEMENT_JSON_DOCUMENTATION(RallypointCluster)
2948
2949 public:
2955 typedef enum
2956 {
2958 csRoundRobin = 0,
2959
2961 csFailback = 1
2962 } ConnectionStrategy_t;
2963
2966
2968 std::vector<Rallypoint> rallypoints;
2969
2972
2975
2977 {
2978 clear();
2979 }
2980
2981 void clear()
2982 {
2983 connectionStrategy = csRoundRobin;
2984 rallypoints.clear();
2985 rolloverSecs = 10;
2986 connectionTimeoutSecs = 5;
2987 }
2988 };
2989
2990 static void to_json(nlohmann::json& j, const RallypointCluster& p)
2991 {
2992 j = nlohmann::json{
2993 TOJSON_IMPL(connectionStrategy),
2994 TOJSON_IMPL(rallypoints),
2995 TOJSON_IMPL(rolloverSecs),
2996 TOJSON_IMPL(connectionTimeoutSecs)
2997 };
2998 }
2999 static void from_json(const nlohmann::json& j, RallypointCluster& p)
3000 {
3001 p.clear();
3002 getOptional<RallypointCluster::ConnectionStrategy_t>("connectionStrategy", p.connectionStrategy, RallypointCluster::ConnectionStrategy_t::csRoundRobin);
3003 getOptional<std::vector<Rallypoint>>("rallypoints", p.rallypoints, j);
3004 getOptional<int>("rolloverSecs", p.rolloverSecs, j, 10);
3005 getOptional<int>("connectionTimeoutSecs", p.connectionTimeoutSecs, j, 5);
3006 }
3007
3008
3009 //-----------------------------------------------------------
3010 JSON_SERIALIZED_CLASS(NetworkDeviceDescriptor)
3021 {
3022 IMPLEMENT_JSON_SERIALIZATION()
3023 IMPLEMENT_JSON_DOCUMENTATION(NetworkDeviceDescriptor)
3024
3025 public:
3031
3033 std::string name;
3034
3036 std::string manufacturer;
3037
3039 std::string model;
3040
3042 std::string hardwareId;
3043
3045 std::string serialNumber;
3046
3048 std::string type;
3049
3051 std::string extra;
3052
3054 {
3055 clear();
3056 }
3057
3058 void clear()
3059 {
3060 deviceId = 0;
3061
3062 name.clear();
3063 manufacturer.clear();
3064 model.clear();
3065 hardwareId.clear();
3066 serialNumber.clear();
3067 type.clear();
3068 extra.clear();
3069 }
3070
3071 virtual std::string toString()
3072 {
3073 char buff[2048];
3074
3075 snprintf(buff, sizeof(buff), "deviceId=%d, name=%s, manufacturer=%s, model=%s, hardwareId=%s, serialNumber=%s, type=%s, extra=%s",
3076 deviceId,
3077 name.c_str(),
3078 manufacturer.c_str(),
3079 model.c_str(),
3080 hardwareId.c_str(),
3081 serialNumber.c_str(),
3082 type.c_str(),
3083 extra.c_str());
3084
3085 return std::string(buff);
3086 }
3087 };
3088
3089 static void to_json(nlohmann::json& j, const NetworkDeviceDescriptor& p)
3090 {
3091 j = nlohmann::json{
3092 TOJSON_IMPL(deviceId),
3093 TOJSON_IMPL(name),
3094 TOJSON_IMPL(manufacturer),
3095 TOJSON_IMPL(model),
3096 TOJSON_IMPL(hardwareId),
3097 TOJSON_IMPL(serialNumber),
3098 TOJSON_IMPL(type),
3099 TOJSON_IMPL(extra)
3100 };
3101 }
3102 static void from_json(const nlohmann::json& j, NetworkDeviceDescriptor& p)
3103 {
3104 p.clear();
3105 getOptional<int>("deviceId", p.deviceId, j, 0);
3106 getOptional("name", p.name, j);
3107 getOptional("manufacturer", p.manufacturer, j);
3108 getOptional("model", p.model, j);
3109 getOptional("hardwareId", p.hardwareId, j);
3110 getOptional("serialNumber", p.serialNumber, j);
3111 getOptional("type", p.type, j);
3112 getOptional("extra", p.extra, j);
3113 }
3114
3115 //-----------------------------------------------------------
3116 JSON_SERIALIZED_CLASS(AudioGate)
3126 {
3127 IMPLEMENT_JSON_SERIALIZATION()
3128 IMPLEMENT_JSON_DOCUMENTATION(AudioGate)
3129
3130 public:
3133
3136
3138 uint32_t hangMs;
3139
3141 uint32_t windowMin;
3142
3144 uint32_t windowMax;
3145
3148
3149
3150 AudioGate()
3151 {
3152 clear();
3153 }
3154
3155 void clear()
3156 {
3157 enabled = false;
3158 useVad = false;
3159 hangMs = 1500;
3160 windowMin = 25;
3161 windowMax = 125;
3162 coefficient = 1.75;
3163 }
3164 };
3165
3166 static void to_json(nlohmann::json& j, const AudioGate& p)
3167 {
3168 j = nlohmann::json{
3169 TOJSON_IMPL(enabled),
3170 TOJSON_IMPL(useVad),
3171 TOJSON_IMPL(hangMs),
3172 TOJSON_IMPL(windowMin),
3173 TOJSON_IMPL(windowMax),
3174 TOJSON_IMPL(coefficient)
3175 };
3176 }
3177 static void from_json(const nlohmann::json& j, AudioGate& p)
3178 {
3179 p.clear();
3180 getOptional<bool>("enabled", p.enabled, j, false);
3181 getOptional<bool>("useVad", p.useVad, j, false);
3182 getOptional<uint32_t>("hangMs", p.hangMs, j, 1500);
3183 getOptional<uint32_t>("windowMin", p.windowMin, j, 25);
3184 getOptional<uint32_t>("windowMax", p.windowMax, j, 125);
3185 getOptional<double>("coefficient", p.coefficient, j, 1.75);
3186 }
3187
3188 //-----------------------------------------------------------
3189 JSON_SERIALIZED_CLASS(TxAudio)
3203 {
3204 IMPLEMENT_JSON_SERIALIZATION()
3205 IMPLEMENT_JSON_DOCUMENTATION(TxAudio)
3206
3207 public:
3213 typedef enum
3214 {
3216 ctExternal = -1,
3217
3219 ctUnknown = 0,
3220
3221 /* G.711 */
3223 ctG711ulaw = 1,
3224
3226 ctG711alaw = 2,
3227
3228
3229 /* GSM */
3231 ctGsm610 = 3,
3232
3233
3234 /* G.729 */
3236 ctG729a = 4,
3237
3238
3239 /* PCM */
3241 ctPcm = 5,
3242
3243 // AMR Narrowband */
3245 ctAmrNb4750 = 10,
3246
3248 ctAmrNb5150 = 11,
3249
3251 ctAmrNb5900 = 12,
3252
3254 ctAmrNb6700 = 13,
3255
3257 ctAmrNb7400 = 14,
3258
3260 ctAmrNb7950 = 15,
3261
3263 ctAmrNb10200 = 16,
3264
3266 ctAmrNb12200 = 17,
3267
3268
3269 /* Opus */
3271 ctOpus6000 = 20,
3272
3274 ctOpus8000 = 21,
3275
3277 ctOpus10000 = 22,
3278
3280 ctOpus12000 = 23,
3281
3283 ctOpus14000 = 24,
3284
3286 ctOpus16000 = 25,
3287
3289 ctOpus18000 = 26,
3290
3292 ctOpus20000 = 27,
3293
3295 ctOpus22000 = 28,
3296
3298 ctOpus24000 = 29,
3299
3300
3301 /* Speex */
3303 ctSpxNb2150 = 30,
3304
3306 ctSpxNb3950 = 31,
3307
3309 ctSpxNb5950 = 32,
3310
3312 ctSpxNb8000 = 33,
3313
3315 ctSpxNb11000 = 34,
3316
3318 ctSpxNb15000 = 35,
3319
3321 ctSpxNb18200 = 36,
3322
3324 ctSpxNb24600 = 37,
3325
3326
3327 /* Codec2 */
3329 ctC2450 = 40,
3330
3332 ctC2700 = 41,
3333
3335 ctC21200 = 42,
3336
3338 ctC21300 = 43,
3339
3341 ctC21400 = 44,
3342
3344 ctC21600 = 45,
3345
3347 ctC22400 = 46,
3348
3350 ctC23200 = 47,
3351
3352
3353 /* MELPe */
3355 ctMelpe600 = 50,
3356
3358 ctMelpe1200 = 51,
3359
3361 ctMelpe2400 = 52
3362 } TxCodec_t;
3363
3366
3369
3371 std::string encoderName;
3372
3375
3378
3380 bool fdx;
3381
3389
3396
3403
3406
3409
3412
3417
3419 uint32_t internalKey;
3420
3423
3426
3428 bool dtx;
3429
3432
3433 TxAudio()
3434 {
3435 clear();
3436 }
3437
3438 void clear()
3439 {
3440 enabled = true;
3441 encoder = TxAudio::TxCodec_t::ctUnknown;
3442 encoderName.clear();
3443 framingMs = 60;
3444 blockCount = 0;
3445 fdx = false;
3446 noHdrExt = false;
3447 maxTxSecs = 0;
3448 extensionSendInterval = 10;
3449 initialHeaderBurst = 5;
3450 trailingHeaderBurst = 5;
3451 startTxNotifications = 5;
3452 customRtpPayloadType = -1;
3453 internalKey = 0;
3454 resetRtpOnTx = true;
3455 enableSmoothing = true;
3456 dtx = false;
3457 smoothedHangTimeMs = 0;
3458 }
3459 };
3460
3461 static void to_json(nlohmann::json& j, const TxAudio& p)
3462 {
3463 j = nlohmann::json{
3464 TOJSON_IMPL(enabled),
3465 TOJSON_IMPL(encoder),
3466 TOJSON_IMPL(encoderName),
3467 TOJSON_IMPL(framingMs),
3468 TOJSON_IMPL(blockCount),
3469 TOJSON_IMPL(fdx),
3470 TOJSON_IMPL(noHdrExt),
3471 TOJSON_IMPL(maxTxSecs),
3472 TOJSON_IMPL(extensionSendInterval),
3473 TOJSON_IMPL(initialHeaderBurst),
3474 TOJSON_IMPL(trailingHeaderBurst),
3475 TOJSON_IMPL(startTxNotifications),
3476 TOJSON_IMPL(customRtpPayloadType),
3477 TOJSON_IMPL(resetRtpOnTx),
3478 TOJSON_IMPL(enableSmoothing),
3479 TOJSON_IMPL(dtx),
3480 TOJSON_IMPL(smoothedHangTimeMs)
3481 };
3482
3483 // internalKey is not serialized
3484 }
3485 static void from_json(const nlohmann::json& j, TxAudio& p)
3486 {
3487 p.clear();
3488 getOptional<bool>("enabled", p.enabled, j, true);
3489 getOptional<TxAudio::TxCodec_t>("encoder", p.encoder, j, TxAudio::TxCodec_t::ctOpus8000);
3490 getOptional<std::string>("encoderName", p.encoderName, j, EMPTY_STRING);
3491 getOptional("framingMs", p.framingMs, j, 60);
3492 getOptional("blockCount", p.blockCount, j, 0);
3493 getOptional("fdx", p.fdx, j, false);
3494 getOptional("noHdrExt", p.noHdrExt, j, false);
3495 getOptional("maxTxSecs", p.maxTxSecs, j, 0);
3496 getOptional("extensionSendInterval", p.extensionSendInterval, j, 10);
3497 getOptional("initialHeaderBurst", p.initialHeaderBurst, j, 5);
3498 getOptional("trailingHeaderBurst", p.trailingHeaderBurst, j, 5);
3499 getOptional("startTxNotifications", p.startTxNotifications, j, 5);
3500 getOptional("customRtpPayloadType", p.customRtpPayloadType, j, -1);
3501 getOptional("resetRtpOnTx", p.resetRtpOnTx, j, true);
3502 getOptional("enableSmoothing", p.enableSmoothing, j, true);
3503 getOptional("dtx", p.dtx, j, false);
3504 getOptional("smoothedHangTimeMs", p.smoothedHangTimeMs, j, 0);
3505
3506 // internalKey is not serialized
3507 }
3508
3509 //-----------------------------------------------------------
3510 JSON_SERIALIZED_CLASS(AudioDeviceDescriptor)
3521 {
3522 IMPLEMENT_JSON_SERIALIZATION()
3523 IMPLEMENT_JSON_DOCUMENTATION(AudioDeviceDescriptor)
3524
3525 public:
3526
3528 typedef enum
3529 {
3531 dirUnknown = 0,
3532
3535
3538
3540 dirBoth
3541 } Direction_t;
3542
3548
3556
3564
3567
3575
3578
3580 std::string name;
3581
3583 std::string manufacturer;
3584
3586 std::string model;
3587
3589 std::string hardwareId;
3590
3592 std::string serialNumber;
3593
3596
3598 std::string type;
3599
3601 std::string extra;
3602
3605
3607 {
3608 clear();
3609 }
3610
3611 void clear()
3612 {
3613 deviceId = 0;
3614 samplingRate = 0;
3615 channels = 0;
3616 direction = dirUnknown;
3617 boostPercentage = 0;
3618 isAdad = false;
3619 isDefault = false;
3620
3621 name.clear();
3622 manufacturer.clear();
3623 model.clear();
3624 hardwareId.clear();
3625 serialNumber.clear();
3626 type.clear();
3627 extra.clear();
3628 isPresent = false;
3629 }
3630
3631 virtual std::string toString()
3632 {
3633 char buff[2048];
3634
3635 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",
3636 deviceId,
3637 samplingRate,
3638 channels,
3639 (int)direction,
3640 boostPercentage,
3641 (int)isAdad,
3642 name.c_str(),
3643 manufacturer.c_str(),
3644 model.c_str(),
3645 hardwareId.c_str(),
3646 serialNumber.c_str(),
3647 (int)isDefault,
3648 type.c_str(),
3649 (int)isPresent,
3650 extra.c_str());
3651
3652 return std::string(buff);
3653 }
3654 };
3655
3656 static void to_json(nlohmann::json& j, const AudioDeviceDescriptor& p)
3657 {
3658 j = nlohmann::json{
3659 TOJSON_IMPL(deviceId),
3660 TOJSON_IMPL(samplingRate),
3661 TOJSON_IMPL(channels),
3662 TOJSON_IMPL(direction),
3663 TOJSON_IMPL(boostPercentage),
3664 TOJSON_IMPL(isAdad),
3665 TOJSON_IMPL(name),
3666 TOJSON_IMPL(manufacturer),
3667 TOJSON_IMPL(model),
3668 TOJSON_IMPL(hardwareId),
3669 TOJSON_IMPL(serialNumber),
3670 TOJSON_IMPL(isDefault),
3671 TOJSON_IMPL(type),
3672 TOJSON_IMPL(extra),
3673 TOJSON_IMPL(isPresent)
3674 };
3675 }
3676 static void from_json(const nlohmann::json& j, AudioDeviceDescriptor& p)
3677 {
3678 p.clear();
3679 getOptional<int>("deviceId", p.deviceId, j, 0);
3680 getOptional<int>("samplingRate", p.samplingRate, j, 0);
3681 getOptional<int>("channels", p.channels, j, 0);
3682 getOptional<AudioDeviceDescriptor::Direction_t>("direction", p.direction, j,
3683 AudioDeviceDescriptor::Direction_t::dirUnknown);
3684 getOptional<int>("boostPercentage", p.boostPercentage, j, 0);
3685
3686 getOptional<bool>("isAdad", p.isAdad, j, false);
3687 getOptional("name", p.name, j);
3688 getOptional("manufacturer", p.manufacturer, j);
3689 getOptional("model", p.model, j);
3690 getOptional("hardwareId", p.hardwareId, j);
3691 getOptional("serialNumber", p.serialNumber, j);
3692 getOptional("isDefault", p.isDefault, j);
3693 getOptional("type", p.type, j);
3694 getOptional("extra", p.extra, j);
3695 getOptional<bool>("isPresent", p.isPresent, j, false);
3696 }
3697
3698 //-----------------------------------------------------------
3699 JSON_SERIALIZED_CLASS(ListOfAudioDeviceDescriptor)
3701 {
3702 IMPLEMENT_JSON_SERIALIZATION()
3703 IMPLEMENT_JSON_DOCUMENTATION(ListOfAudioDeviceDescriptor)
3704
3705 public:
3706 std::vector<AudioDeviceDescriptor> list;
3707
3709 {
3710 clear();
3711 }
3712
3713 void clear()
3714 {
3715 list.clear();
3716 }
3717 };
3718
3719 static void to_json(nlohmann::json& j, const ListOfAudioDeviceDescriptor& p)
3720 {
3721 j = nlohmann::json{
3722 TOJSON_IMPL(list)
3723 };
3724 }
3725 static void from_json(const nlohmann::json& j, ListOfAudioDeviceDescriptor& p)
3726 {
3727 p.clear();
3728 getOptional<std::vector<AudioDeviceDescriptor>>("list", p.list, j);
3729 }
3730
3731 //-----------------------------------------------------------
3732 JSON_SERIALIZED_CLASS(Audio)
3741 {
3742 IMPLEMENT_JSON_SERIALIZATION()
3743 IMPLEMENT_JSON_DOCUMENTATION(Audio)
3744
3745 public:
3748
3751
3754
3757
3760
3763
3766
3769
3770 Audio()
3771 {
3772 clear();
3773 }
3774
3775 void clear()
3776 {
3777 enabled = true;
3778 inputId = 0;
3779 inputGain = 0;
3780 outputId = 0;
3781 outputGain = 0;
3782 outputLevelLeft = 100;
3783 outputLevelRight = 100;
3784 outputMuted = false;
3785 }
3786 };
3787
3788 static void to_json(nlohmann::json& j, const Audio& p)
3789 {
3790 j = nlohmann::json{
3791 TOJSON_IMPL(enabled),
3792 TOJSON_IMPL(inputId),
3793 TOJSON_IMPL(inputGain),
3794 TOJSON_IMPL(outputId),
3795 TOJSON_IMPL(outputLevelLeft),
3796 TOJSON_IMPL(outputLevelRight),
3797 TOJSON_IMPL(outputMuted)
3798 };
3799 }
3800 static void from_json(const nlohmann::json& j, Audio& p)
3801 {
3802 p.clear();
3803 getOptional<bool>("enabled", p.enabled, j, true);
3804 getOptional<int>("inputId", p.inputId, j, 0);
3805 getOptional<int>("inputGain", p.inputGain, j, 0);
3806 getOptional<int>("outputId", p.outputId, j, 0);
3807 getOptional<int>("outputGain", p.outputGain, j, 0);
3808 getOptional<int>("outputLevelLeft", p.outputLevelLeft, j, 100);
3809 getOptional<int>("outputLevelRight", p.outputLevelRight, j, 100);
3810 getOptional<bool>("outputMuted", p.outputMuted, j, false);
3811 }
3812
3813 //-----------------------------------------------------------
3814 JSON_SERIALIZED_CLASS(TalkerInformation)
3825 {
3826 IMPLEMENT_JSON_SERIALIZATION()
3827 IMPLEMENT_JSON_DOCUMENTATION(TalkerInformation)
3828
3829 public:
3833 typedef enum
3834 {
3836 matNone = 0,
3837
3839 matAnonymous = 1,
3840
3842 matSsrcGenerated = 2
3843 } ManufacturedAliasType_t;
3844
3846 std::string alias;
3847
3849 std::string nodeId;
3850
3852 uint16_t rxFlags;
3853
3856
3858 uint32_t txId;
3859
3862
3865
3868
3870 uint32_t ssrc;
3871
3874
3876 {
3877 clear();
3878 }
3879
3880 void clear()
3881 {
3882 alias.clear();
3883 nodeId.clear();
3884 rxFlags = 0;
3885 txPriority = 0;
3886 txId = 0;
3887 duplicateCount = 0;
3888 aliasSpecializer = 0;
3889 rxMuted = false;
3890 manufacturedAliasType = ManufacturedAliasType_t::matNone;
3891 ssrc = 0;
3892 }
3893 };
3894
3895 static void to_json(nlohmann::json& j, const TalkerInformation& p)
3896 {
3897 j = nlohmann::json{
3898 TOJSON_IMPL(alias),
3899 TOJSON_IMPL(nodeId),
3900 TOJSON_IMPL(rxFlags),
3901 TOJSON_IMPL(txPriority),
3902 TOJSON_IMPL(txId),
3903 TOJSON_IMPL(duplicateCount),
3904 TOJSON_IMPL(aliasSpecializer),
3905 TOJSON_IMPL(rxMuted),
3906 TOJSON_IMPL(manufacturedAliasType),
3907 TOJSON_IMPL(ssrc)
3908 };
3909 }
3910 static void from_json(const nlohmann::json& j, TalkerInformation& p)
3911 {
3912 p.clear();
3913 getOptional<std::string>("alias", p.alias, j, EMPTY_STRING);
3914 getOptional<std::string>("nodeId", p.nodeId, j, EMPTY_STRING);
3915 getOptional<uint16_t>("rxFlags", p.rxFlags, j, 0);
3916 getOptional<int>("txPriority", p.txPriority, j, 0);
3917 getOptional<uint32_t>("txId", p.txId, j, 0);
3918 getOptional<int>("duplicateCount", p.duplicateCount, j, 0);
3919 getOptional<uint16_t>("aliasSpecializer", p.aliasSpecializer, j, 0);
3920 getOptional<bool>("rxMuted", p.rxMuted, j, false);
3921 getOptional<TalkerInformation::ManufacturedAliasType_t>("manufacturedAliasType", p.manufacturedAliasType, j, TalkerInformation::ManufacturedAliasType_t::matNone);
3922 getOptional<uint32_t>("ssrc", p.ssrc, j, 0);
3923 }
3924
3925 //-----------------------------------------------------------
3926 JSON_SERIALIZED_CLASS(GroupTalkers)
3939 {
3940 IMPLEMENT_JSON_SERIALIZATION()
3941 IMPLEMENT_JSON_DOCUMENTATION(GroupTalkers)
3942
3943 public:
3945 std::vector<TalkerInformation> list;
3946
3947 GroupTalkers()
3948 {
3949 clear();
3950 }
3951
3952 void clear()
3953 {
3954 list.clear();
3955 }
3956 };
3957
3958 static void to_json(nlohmann::json& j, const GroupTalkers& p)
3959 {
3960 j = nlohmann::json{
3961 TOJSON_IMPL(list)
3962 };
3963 }
3964 static void from_json(const nlohmann::json& j, GroupTalkers& p)
3965 {
3966 p.clear();
3967 getOptional<std::vector<TalkerInformation>>("list", p.list, j);
3968 }
3969
3970 //-----------------------------------------------------------
3971 JSON_SERIALIZED_CLASS(Presence)
3982 {
3983 IMPLEMENT_JSON_SERIALIZATION()
3984 IMPLEMENT_JSON_DOCUMENTATION(Presence)
3985
3986 public:
3990 typedef enum
3991 {
3993 pfUnknown = 0,
3994
3996 pfEngage = 1,
3997
4004 pfCot = 2
4005 } Format_t;
4006
4009
4012
4015
4018
4019 Presence()
4020 {
4021 clear();
4022 }
4023
4024 void clear()
4025 {
4026 format = pfUnknown;
4027 intervalSecs = 30;
4028 listenOnly = false;
4029 minIntervalSecs = 5;
4030 }
4031 };
4032
4033 static void to_json(nlohmann::json& j, const Presence& p)
4034 {
4035 j = nlohmann::json{
4036 TOJSON_IMPL(format),
4037 TOJSON_IMPL(intervalSecs),
4038 TOJSON_IMPL(listenOnly),
4039 TOJSON_IMPL(minIntervalSecs)
4040 };
4041 }
4042 static void from_json(const nlohmann::json& j, Presence& p)
4043 {
4044 p.clear();
4045 getOptional<Presence::Format_t>("format", p.format, j, Presence::Format_t::pfEngage);
4046 getOptional<int>("intervalSecs", p.intervalSecs, j, 30);
4047 getOptional<bool>("listenOnly", p.listenOnly, j, false);
4048 getOptional<int>("minIntervalSecs", p.minIntervalSecs, j, 5);
4049 }
4050
4051
4052 //-----------------------------------------------------------
4053 JSON_SERIALIZED_CLASS(Advertising)
4064 {
4065 IMPLEMENT_JSON_SERIALIZATION()
4066 IMPLEMENT_JSON_DOCUMENTATION(Advertising)
4067
4068 public:
4071
4074
4077
4078 Advertising()
4079 {
4080 clear();
4081 }
4082
4083 void clear()
4084 {
4085 enabled = false;
4086 intervalMs = 20000;
4087 alwaysAdvertise = false;
4088 }
4089 };
4090
4091 static void to_json(nlohmann::json& j, const Advertising& p)
4092 {
4093 j = nlohmann::json{
4094 TOJSON_IMPL(enabled),
4095 TOJSON_IMPL(intervalMs),
4096 TOJSON_IMPL(alwaysAdvertise)
4097 };
4098 }
4099 static void from_json(const nlohmann::json& j, Advertising& p)
4100 {
4101 p.clear();
4102 getOptional("enabled", p.enabled, j, false);
4103 getOptional<int>("intervalMs", p.intervalMs, j, 20000);
4104 getOptional<bool>("alwaysAdvertise", p.alwaysAdvertise, j, false);
4105 }
4106
4107 //-----------------------------------------------------------
4108 JSON_SERIALIZED_CLASS(GroupPriorityTranslation)
4119 {
4120 IMPLEMENT_JSON_SERIALIZATION()
4121 IMPLEMENT_JSON_DOCUMENTATION(GroupPriorityTranslation)
4122
4123 public:
4126
4129
4132
4134 {
4135 clear();
4136 }
4137
4138 void clear()
4139 {
4140 rx.clear();
4141 tx.clear();
4142 priority = 0;
4143 }
4144 };
4145
4146 static void to_json(nlohmann::json& j, const GroupPriorityTranslation& p)
4147 {
4148 j = nlohmann::json{
4149 TOJSON_IMPL(rx),
4150 TOJSON_IMPL(tx),
4151 TOJSON_IMPL(priority)
4152 };
4153 }
4154 static void from_json(const nlohmann::json& j, GroupPriorityTranslation& p)
4155 {
4156 p.clear();
4157 j.at("rx").get_to(p.rx);
4158 j.at("tx").get_to(p.tx);
4159 FROMJSON_IMPL(priority, int, 0);
4160 }
4161
4162 //-----------------------------------------------------------
4163 JSON_SERIALIZED_CLASS(GroupTimeline)
4176 {
4177 IMPLEMENT_JSON_SERIALIZATION()
4178 IMPLEMENT_JSON_DOCUMENTATION(GroupTimeline)
4179
4180 public:
4183
4186 bool recordAudio;
4187
4189 {
4190 clear();
4191 }
4192
4193 void clear()
4194 {
4195 enabled = true;
4196 maxAudioTimeMs = 30000;
4197 recordAudio = true;
4198 }
4199 };
4200
4201 static void to_json(nlohmann::json& j, const GroupTimeline& p)
4202 {
4203 j = nlohmann::json{
4204 TOJSON_IMPL(enabled),
4205 TOJSON_IMPL(maxAudioTimeMs),
4206 TOJSON_IMPL(recordAudio)
4207 };
4208 }
4209 static void from_json(const nlohmann::json& j, GroupTimeline& p)
4210 {
4211 p.clear();
4212 getOptional("enabled", p.enabled, j, true);
4213 getOptional<int>("maxAudioTimeMs", p.maxAudioTimeMs, j, 30000);
4214 getOptional("recordAudio", p.recordAudio, j, true);
4215 }
4216
4224 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_INTERNAL = "com.rallytac.engage.internal";
4226 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_CORE = "com.rallytac.magellan.core";
4228 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_CISTECH = "com.rallytac.engage.magellan.cistech";
4230 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_TRELLISWARE = "com.rallytac.engage.magellan.trellisware";
4232 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_SILVUS = "com.rallytac.engage.magellan.silvus";
4234 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_PERSISTENT = "com.rallytac.engage.magellan.persistent";
4236 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_DOMO = "com.rallytac.engage.magellan.domo";
4238 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_KENWOOD = "com.rallytac.engage.magellan.kenwood";
4240 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_TAIT = "com.rallytac.engage.magellan.tait";
4242 ENGAGE_IGNORE_COMPILER_UNUSED_WARNING static const char *GROUP_SOURCE_ENGAGE_MAGELLAN_VOCALITY = "com.rallytac.engage.magellan.vocality";
4263
4288
4304 //-----------------------------------------------------------
4305 JSON_SERIALIZED_CLASS(GroupAppTransport)
4316 {
4317 IMPLEMENT_JSON_SERIALIZATION()
4318 IMPLEMENT_JSON_DOCUMENTATION(GroupAppTransport)
4319
4320 public:
4323
4325 std::string id;
4326
4328 {
4329 clear();
4330 }
4331
4332 void clear()
4333 {
4334 enabled = false;
4335 id.clear();
4336 }
4337 };
4338
4339 static void to_json(nlohmann::json& j, const GroupAppTransport& p)
4340 {
4341 j = nlohmann::json{
4342 TOJSON_IMPL(enabled),
4343 TOJSON_IMPL(id)
4344 };
4345 }
4346 static void from_json(const nlohmann::json& j, GroupAppTransport& p)
4347 {
4348 p.clear();
4349 getOptional<bool>("enabled", p.enabled, j, false);
4350 getOptional<std::string>("id", p.id, j);
4351 }
4352
4353 //-----------------------------------------------------------
4354 JSON_SERIALIZED_CLASS(RtpProfile)
4365 {
4366 IMPLEMENT_JSON_SERIALIZATION()
4367 IMPLEMENT_JSON_DOCUMENTATION(RtpProfile)
4368
4369 public:
4375 typedef enum
4376 {
4378 jmStandard = 0,
4379
4381 jmLowLatency = 1,
4382
4384 jmReleaseOnTxEnd = 2
4385 } JitterMode_t;
4386
4389
4392
4395
4398
4401
4404
4407
4410
4413
4416
4419
4422
4425
4428
4431
4434
4438
4439 RtpProfile()
4440 {
4441 clear();
4442 }
4443
4444 void clear()
4445 {
4446 mode = jmStandard;
4447 jitterMaxMs = 10000;
4448 jitterMinMs = 100;
4449 jitterMaxFactor = 8;
4450 jitterTrimPercentage = 10;
4451 jitterUnderrunReductionThresholdMs = 1500;
4452 jitterUnderrunReductionAger = 100;
4453 latePacketSequenceRange = 5;
4454 latePacketTimestampRangeMs = 2000;
4455 inboundProcessorInactivityMs = 500;
4456 jitterForceTrimAtMs = 0;
4457 rtcpPresenceTimeoutMs = 45000;
4458 jitterMaxExceededClipPerc = 10;
4459 jitterMaxExceededClipHangMs = 1500;
4460 zombieLifetimeMs = 15000;
4461 jitterMaxTrimMs = 250;
4462 signalledInboundProcessorInactivityMs = (inboundProcessorInactivityMs * 4);
4463 }
4464 };
4465
4466 static void to_json(nlohmann::json& j, const RtpProfile& p)
4467 {
4468 j = nlohmann::json{
4469 TOJSON_IMPL(mode),
4470 TOJSON_IMPL(jitterMaxMs),
4471 TOJSON_IMPL(inboundProcessorInactivityMs),
4472 TOJSON_IMPL(jitterMinMs),
4473 TOJSON_IMPL(jitterMaxFactor),
4474 TOJSON_IMPL(jitterTrimPercentage),
4475 TOJSON_IMPL(jitterUnderrunReductionThresholdMs),
4476 TOJSON_IMPL(jitterUnderrunReductionAger),
4477 TOJSON_IMPL(latePacketSequenceRange),
4478 TOJSON_IMPL(latePacketTimestampRangeMs),
4479 TOJSON_IMPL(inboundProcessorInactivityMs),
4480 TOJSON_IMPL(jitterForceTrimAtMs),
4481 TOJSON_IMPL(jitterMaxExceededClipPerc),
4482 TOJSON_IMPL(jitterMaxExceededClipHangMs),
4483 TOJSON_IMPL(zombieLifetimeMs),
4484 TOJSON_IMPL(jitterMaxTrimMs),
4485 TOJSON_IMPL(signalledInboundProcessorInactivityMs)
4486 };
4487 }
4488 static void from_json(const nlohmann::json& j, RtpProfile& p)
4489 {
4490 p.clear();
4491 FROMJSON_IMPL(mode, RtpProfile::JitterMode_t, RtpProfile::JitterMode_t::jmStandard);
4492 FROMJSON_IMPL(jitterMaxMs, int, 10000);
4493 FROMJSON_IMPL(jitterMinMs, int, 20);
4494 FROMJSON_IMPL(jitterMaxFactor, int, 8);
4495 FROMJSON_IMPL(jitterTrimPercentage, int, 10);
4496 FROMJSON_IMPL(jitterUnderrunReductionThresholdMs, int, 1500);
4497 FROMJSON_IMPL(jitterUnderrunReductionAger, int, 100);
4498 FROMJSON_IMPL(latePacketSequenceRange, int, 5);
4499 FROMJSON_IMPL(latePacketTimestampRangeMs, int, 2000);
4500 FROMJSON_IMPL(inboundProcessorInactivityMs, int, 500);
4501 FROMJSON_IMPL(jitterForceTrimAtMs, int, 0);
4502 FROMJSON_IMPL(rtcpPresenceTimeoutMs, int, 45000);
4503 FROMJSON_IMPL(jitterMaxExceededClipPerc, int, 10);
4504 FROMJSON_IMPL(jitterMaxExceededClipHangMs, int, 1500);
4505 FROMJSON_IMPL(zombieLifetimeMs, int, 15000);
4506 FROMJSON_IMPL(jitterMaxTrimMs, int, 250);
4507 FROMJSON_IMPL(signalledInboundProcessorInactivityMs, int, (p.inboundProcessorInactivityMs * 4));
4508 }
4509
4510 //-----------------------------------------------------------
4511 JSON_SERIALIZED_CLASS(Tls)
4522 {
4523 IMPLEMENT_JSON_SERIALIZATION()
4524 IMPLEMENT_JSON_DOCUMENTATION(Tls)
4525
4526 public:
4527
4530
4533
4535 std::vector<std::string> caCertificates;
4536
4539
4542
4544 std::vector<std::string> crlSerials;
4545
4546 Tls()
4547 {
4548 clear();
4549 }
4550
4551 void clear()
4552 {
4553 verifyPeers = true;
4554 allowSelfSignedCertificates = false;
4555 caCertificates.clear();
4556 subjectRestrictions.clear();
4557 issuerRestrictions.clear();
4558 crlSerials.clear();
4559 }
4560 };
4561
4562 static void to_json(nlohmann::json& j, const Tls& p)
4563 {
4564 j = nlohmann::json{
4565 TOJSON_IMPL(verifyPeers),
4566 TOJSON_IMPL(allowSelfSignedCertificates),
4567 TOJSON_IMPL(caCertificates),
4568 TOJSON_IMPL(subjectRestrictions),
4569 TOJSON_IMPL(issuerRestrictions),
4570 TOJSON_IMPL(crlSerials)
4571 };
4572 }
4573 static void from_json(const nlohmann::json& j, Tls& p)
4574 {
4575 p.clear();
4576 getOptional<bool>("verifyPeers", p.verifyPeers, j, true);
4577 getOptional<bool>("allowSelfSignedCertificates", p.allowSelfSignedCertificates, j, false);
4578 getOptional<std::vector<std::string>>("caCertificates", p.caCertificates, j);
4579 getOptional<StringRestrictionList>("subjectRestrictions", p.subjectRestrictions, j);
4580 getOptional<StringRestrictionList>("issuerRestrictions", p.issuerRestrictions, j);
4581 getOptional<std::vector<std::string>>("crlSerials", p.crlSerials, j);
4582 }
4583
4584 //-----------------------------------------------------------
4585 JSON_SERIALIZED_CLASS(RangerPackets)
4598 {
4599 IMPLEMENT_JSON_SERIALIZATION()
4600 IMPLEMENT_JSON_DOCUMENTATION(RangerPackets)
4601
4602 public:
4605
4608
4610 {
4611 clear();
4612 }
4613
4614 void clear()
4615 {
4616 hangTimerSecs = -1;
4617 count = 5;
4618 }
4619
4620 virtual void initForDocumenting()
4621 {
4622 }
4623 };
4624
4625 static void to_json(nlohmann::json& j, const RangerPackets& p)
4626 {
4627 j = nlohmann::json{
4628 TOJSON_IMPL(hangTimerSecs),
4629 TOJSON_IMPL(count)
4630 };
4631 }
4632 static void from_json(const nlohmann::json& j, RangerPackets& p)
4633 {
4634 p.clear();
4635 getOptional<int>("hangTimerSecs", p.hangTimerSecs, j, 11);
4636 getOptional<int>("count", p.count, j, 5);
4637 }
4638
4639 //-----------------------------------------------------------
4640 JSON_SERIALIZED_CLASS(Source)
4653 {
4654 IMPLEMENT_JSON_SERIALIZATION()
4655 IMPLEMENT_JSON_DOCUMENTATION(Source)
4656
4657 public:
4659 std::string nodeId;
4660
4661 /* NOTE: Not serialized ! */
4662 uint8_t _internal_binary_nodeId[ENGAGE_MAX_NODE_ID_SIZE];
4663
4665 std::string alias;
4666
4667 /* NOTE: Not serialized ! */
4668 uint8_t _internal_binary_alias[ENGAGE_MAX_ALIAS_SIZE];
4669
4670 Source()
4671 {
4672 clear();
4673 }
4674
4675 void clear()
4676 {
4677 nodeId.clear();
4678 memset(_internal_binary_nodeId, 0, sizeof(_internal_binary_nodeId));
4679
4680 alias.clear();
4681 memset(_internal_binary_alias, 0, sizeof(_internal_binary_alias));
4682 }
4683
4684 virtual void initForDocumenting()
4685 {
4686 }
4687 };
4688
4689 static void to_json(nlohmann::json& j, const Source& p)
4690 {
4691 j = nlohmann::json{
4692 TOJSON_IMPL(nodeId),
4693 TOJSON_IMPL(alias)
4694 };
4695 }
4696 static void from_json(const nlohmann::json& j, Source& p)
4697 {
4698 p.clear();
4699 FROMJSON_IMPL_SIMPLE(nodeId);
4700 FROMJSON_IMPL_SIMPLE(alias);
4701 }
4702
4703 //-----------------------------------------------------------
4704 JSON_SERIALIZED_CLASS(Group)
4716 {
4717 IMPLEMENT_JSON_SERIALIZATION()
4718 IMPLEMENT_JSON_DOCUMENTATION(Group)
4719
4720 public:
4722 typedef enum
4723 {
4725 gtUnknown = 0,
4726
4728 gtAudio = 1,
4729
4731 gtPresence = 2,
4732
4734 gtRaw = 3
4735 } Type_t;
4736
4737
4739 typedef enum
4740 {
4742 bomRaw = 0,
4743
4745 bomPayloadTransformation = 1,
4746
4748 bomAnonymousMixing = 2,
4749
4751 bomLanguageTranslation = 3
4752 } BridgingOpMode_t;
4753
4755 typedef enum
4756 {
4758 iagpAnonymousAlias = 0,
4759
4761 iagpSsrcInHex = 1
4762 } InboundAliasGenerationPolicy_t;
4763
4766
4769
4776 std::string id;
4777
4779 std::string name;
4780
4782 std::string spokenName;
4783
4785 std::string interfaceName;
4786
4789
4792
4795
4798
4801
4803 std::string cryptoPassword;
4804
4807
4809 std::vector<Rallypoint> rallypoints;
4810
4813
4816
4825
4827 std::string alias;
4828
4831
4833 std::string source;
4834
4841
4844
4847
4850
4852 std::vector<std::string> presenceGroupAffinities;
4853
4856
4859
4861 std::vector<RtpPayloadTypeTranslation> inboundRtpPayloadTypeTranslations;
4862
4865
4868
4870 std::string anonymousAlias;
4871
4874
4877
4880
4883
4886
4889
4892
4894 std::vector<uint16_t> specializerAffinities;
4895
4898
4900 std::vector<Source> ignoreSources;
4901
4903 std::string languageCode;
4904
4906 std::string synVoice;
4907
4910
4913
4916
4919
4922
4925
4926 Group()
4927 {
4928 clear();
4929 }
4930
4931 void clear()
4932 {
4933 type = gtUnknown;
4934 bom = bomRaw;
4935 id.clear();
4936 name.clear();
4937 spokenName.clear();
4938 interfaceName.clear();
4939 rx.clear();
4940 tx.clear();
4941 txOptions.clear();
4942 txAudio.clear();
4943 presence.clear();
4944 cryptoPassword.clear();
4945
4946 alias.clear();
4947
4948 rallypoints.clear();
4949 rallypointCluster.clear();
4950
4951 audio.clear();
4952 timeline.clear();
4953
4954 blockAdvertising = false;
4955
4956 source.clear();
4957
4958 maxRxSecs = 0;
4959
4960 enableMulticastFailover = false;
4961 multicastFailoverSecs = 10;
4962
4963 rtcpPresenceRx.clear();
4964
4965 presenceGroupAffinities.clear();
4966 disablePacketEvents = false;
4967
4968 rfc4733RtpPayloadId = 0;
4969 inboundRtpPayloadTypeTranslations.clear();
4970 priorityTranslation.clear();
4971
4972 stickyTidHangSecs = 10;
4973 anonymousAlias.clear();
4974 lbCrypto = false;
4975
4976 appTransport.clear();
4977 allowLoopback = false;
4978
4979 rtpProfile.clear();
4980 rangerPackets.clear();
4981
4982 _wasDeserialized_rtpProfile = false;
4983
4984 txImpairment.clear();
4985 rxImpairment.clear();
4986
4987 specializerAffinities.clear();
4988
4989 securityLevel = 0;
4990
4991 ignoreSources.clear();
4992
4993 languageCode.clear();
4994 synVoice.clear();
4995
4996 rxCapture.clear();
4997 txCapture.clear();
4998
4999 blobRtpPayloadType = ENGAGE_DEFAULT_BLOB_RTP_PAYLOAD_TYPE;
5000 inboundAliasGenerationPolicy = iagpAnonymousAlias;
5001 gateIn.clear();
5002
5003 ignoreAudioTraffic = false;
5004 }
5005 };
5006
5007 static void to_json(nlohmann::json& j, const Group& p)
5008 {
5009 j = nlohmann::json{
5010 TOJSON_IMPL(type),
5011 TOJSON_IMPL(bom),
5012 TOJSON_IMPL(id),
5013 TOJSON_IMPL(name),
5014 TOJSON_IMPL(spokenName),
5015 TOJSON_IMPL(interfaceName),
5016 TOJSON_IMPL(rx),
5017 TOJSON_IMPL(tx),
5018 TOJSON_IMPL(txOptions),
5019 TOJSON_IMPL(txAudio),
5020 TOJSON_IMPL(presence),
5021 TOJSON_IMPL(cryptoPassword),
5022 TOJSON_IMPL(alias),
5023
5024 // See below
5025 //TOJSON_IMPL(rallypoints),
5026 //TOJSON_IMPL(rallypointCluster),
5027
5028 TOJSON_IMPL(alias),
5029 TOJSON_IMPL(audio),
5030 TOJSON_IMPL(timeline),
5031 TOJSON_IMPL(blockAdvertising),
5032 TOJSON_IMPL(source),
5033 TOJSON_IMPL(maxRxSecs),
5034 TOJSON_IMPL(enableMulticastFailover),
5035 TOJSON_IMPL(multicastFailoverSecs),
5036 TOJSON_IMPL(rtcpPresenceRx),
5037 TOJSON_IMPL(presenceGroupAffinities),
5038 TOJSON_IMPL(disablePacketEvents),
5039 TOJSON_IMPL(rfc4733RtpPayloadId),
5040 TOJSON_IMPL(inboundRtpPayloadTypeTranslations),
5041 TOJSON_IMPL(priorityTranslation),
5042 TOJSON_IMPL(stickyTidHangSecs),
5043 TOJSON_IMPL(anonymousAlias),
5044 TOJSON_IMPL(lbCrypto),
5045 TOJSON_IMPL(appTransport),
5046 TOJSON_IMPL(allowLoopback),
5047 TOJSON_IMPL(rangerPackets),
5048
5049 TOJSON_IMPL(txImpairment),
5050 TOJSON_IMPL(rxImpairment),
5051
5052 TOJSON_IMPL(specializerAffinities),
5053
5054 TOJSON_IMPL(securityLevel),
5055
5056 TOJSON_IMPL(ignoreSources),
5057
5058 TOJSON_IMPL(languageCode),
5059 TOJSON_IMPL(synVoice),
5060
5061 TOJSON_IMPL(rxCapture),
5062 TOJSON_IMPL(txCapture),
5063
5064 TOJSON_IMPL(blobRtpPayloadType),
5065
5066 TOJSON_IMPL(inboundAliasGenerationPolicy),
5067
5068 TOJSON_IMPL(gateIn),
5069
5070 TOJSON_IMPL(ignoreAudioTraffic)
5071 };
5072
5073 TOJSON_BASE_IMPL();
5074
5075 // TODO: need a better way to indicate whether rtpProfile is present
5076 if(p._wasDeserialized_rtpProfile || p.isDocumenting())
5077 {
5078 j["rtpProfile"] = p.rtpProfile;
5079 }
5080
5081 if(p.isDocumenting())
5082 {
5083 j["rallypointCluster"] = p.rallypointCluster;
5084 j["rallypoints"] = p.rallypoints;
5085 }
5086 else
5087 {
5088 // rallypointCluster takes precedence if it has elements
5089 if(!p.rallypointCluster.rallypoints.empty())
5090 {
5091 j["rallypointCluster"] = p.rallypointCluster;
5092 }
5093 else if(!p.rallypoints.empty())
5094 {
5095 j["rallypoints"] = p.rallypoints;
5096 }
5097 }
5098 }
5099 static void from_json(const nlohmann::json& j, Group& p)
5100 {
5101 p.clear();
5102 j.at("type").get_to(p.type);
5103 getOptional<Group::BridgingOpMode_t>("bom", p.bom, j, Group::BridgingOpMode_t::bomRaw);
5104 j.at("id").get_to(p.id);
5105 getOptional<std::string>("name", p.name, j);
5106 getOptional<std::string>("spokenName", p.spokenName, j);
5107 getOptional<std::string>("interfaceName", p.interfaceName, j);
5108 getOptional<NetworkAddress>("rx", p.rx, j);
5109 getOptional<NetworkAddress>("tx", p.tx, j);
5110 getOptional<NetworkTxOptions>("txOptions", p.txOptions, j);
5111 getOptional<std::string>("cryptoPassword", p.cryptoPassword, j);
5112 getOptional<std::string>("alias", p.alias, j);
5113 getOptional<TxAudio>("txAudio", p.txAudio, j);
5114 getOptional<Presence>("presence", p.presence, j);
5115 getOptional<std::vector<Rallypoint>>("rallypoints", p.rallypoints, j);
5116 getOptional<RallypointCluster>("rallypointCluster", p.rallypointCluster, j);
5117 getOptional<Audio>("audio", p.audio, j);
5118 getOptional<GroupTimeline>("timeline", p.timeline, j);
5119 getOptional<bool>("blockAdvertising", p.blockAdvertising, j, false);
5120 getOptional<std::string>("source", p.source, j);
5121 getOptional<int>("maxRxSecs", p.maxRxSecs, j, 0);
5122 getOptional<bool>("enableMulticastFailover", p.enableMulticastFailover, j, false);
5123 getOptional<int>("multicastFailoverSecs", p.multicastFailoverSecs, j, 10);
5124 getOptional<NetworkAddress>("rtcpPresenceRx", p.rtcpPresenceRx, j);
5125 getOptional<std::vector<std::string>>("presenceGroupAffinities", p.presenceGroupAffinities, j);
5126 getOptional<bool>("disablePacketEvents", p.disablePacketEvents, j, false);
5127 getOptional<int>("rfc4733RtpPayloadId", p.rfc4733RtpPayloadId, j, 0);
5128 getOptional<std::vector<RtpPayloadTypeTranslation>>("inboundRtpPayloadTypeTranslations", p.inboundRtpPayloadTypeTranslations, j);
5129 getOptional<GroupPriorityTranslation>("priorityTranslation", p.priorityTranslation, j);
5130 getOptional<int>("stickyTidHangSecs", p.stickyTidHangSecs, j, 10);
5131 getOptional<std::string>("anonymousAlias", p.anonymousAlias, j);
5132 getOptional<bool>("lbCrypto", p.lbCrypto, j, false);
5133 getOptional<GroupAppTransport>("appTransport", p.appTransport, j);
5134 getOptional<bool>("allowLoopback", p.allowLoopback, j, false);
5135 getOptionalWithIndicator<RtpProfile>("rtpProfile", p.rtpProfile, j, &p._wasDeserialized_rtpProfile);
5136 getOptional<RangerPackets>("rangerPackets", p.rangerPackets, j);
5137 getOptional<TransportImpairment>("txImpairment", p.txImpairment, j);
5138 getOptional<TransportImpairment>("rxImpairment", p.rxImpairment, j);
5139 getOptional<std::vector<uint16_t>>("specializerAffinities", p.specializerAffinities, j);
5140 getOptional<uint32_t>("securityLevel", p.securityLevel, j, 0);
5141 getOptional<std::vector<Source>>("ignoreSources", p.ignoreSources, j);
5142 getOptional<std::string>("languageCode", p.languageCode, j);
5143 getOptional<std::string>("synVoice", p.synVoice, j);
5144
5145 getOptional<PacketCapturer>("rxCapture", p.rxCapture, j);
5146 getOptional<PacketCapturer>("txCapture", p.txCapture, j);
5147
5148 getOptional<uint16_t>("blobRtpPayloadType", p.blobRtpPayloadType, j, ENGAGE_DEFAULT_BLOB_RTP_PAYLOAD_TYPE);
5149
5150 getOptional<Group::InboundAliasGenerationPolicy_t>("inboundAliasGenerationPolicy", p.inboundAliasGenerationPolicy, j, Group::InboundAliasGenerationPolicy_t::iagpAnonymousAlias);
5151
5152 getOptional<AudioGate>("gateIn", p.gateIn, j);
5153
5154 getOptional<bool>("ignoreAudioTraffic", p.ignoreAudioTraffic, j, false);
5155
5156 FROMJSON_BASE_IMPL();
5157 }
5158
5159
5160 //-----------------------------------------------------------
5161 JSON_SERIALIZED_CLASS(Mission)
5163 {
5164 IMPLEMENT_JSON_SERIALIZATION()
5165 IMPLEMENT_JSON_DOCUMENTATION(Mission)
5166
5167 public:
5168 std::string id;
5169 std::string name;
5170 std::vector<Group> groups;
5171 std::chrono::system_clock::time_point begins;
5172 std::chrono::system_clock::time_point ends;
5173 std::string certStoreId;
5174 int multicastFailoverPolicy;
5175 Rallypoint rallypoint;
5176
5177 void clear()
5178 {
5179 id.clear();
5180 name.clear();
5181 groups.clear();
5182 certStoreId.clear();
5183 multicastFailoverPolicy = 0;
5184 rallypoint.clear();
5185 }
5186 };
5187
5188 static void to_json(nlohmann::json& j, const Mission& p)
5189 {
5190 j = nlohmann::json{
5191 TOJSON_IMPL(id),
5192 TOJSON_IMPL(name),
5193 TOJSON_IMPL(groups),
5194 TOJSON_IMPL(certStoreId),
5195 TOJSON_IMPL(multicastFailoverPolicy),
5196 TOJSON_IMPL(rallypoint)
5197 };
5198 }
5199
5200 static void from_json(const nlohmann::json& j, Mission& p)
5201 {
5202 p.clear();
5203 j.at("id").get_to(p.id);
5204 j.at("name").get_to(p.name);
5205
5206 // Groups are optional
5207 try
5208 {
5209 j.at("groups").get_to(p.groups);
5210 }
5211 catch(...)
5212 {
5213 p.groups.clear();
5214 }
5215
5216 FROMJSON_IMPL(certStoreId, std::string, EMPTY_STRING);
5217 FROMJSON_IMPL(multicastFailoverPolicy, int, 0);
5218 getOptional<Rallypoint>("rallypoint", p.rallypoint, j);
5219 }
5220
5221 //-----------------------------------------------------------
5222 JSON_SERIALIZED_CLASS(LicenseDescriptor)
5233 {
5234 IMPLEMENT_JSON_SERIALIZATION()
5235 IMPLEMENT_JSON_DOCUMENTATION(LicenseDescriptor)
5236
5237 public:
5243 static const int STATUS_OK = 0;
5244 static const int ERR_NULL_ENTITLEMENT_KEY = -1;
5245 static const int ERR_NULL_LICENSE_KEY = -2;
5246 static const int ERR_INVALID_LICENSE_KEY_LEN = -3;
5247 static const int ERR_LICENSE_KEY_VERIFICATION_FAILURE = -4;
5248 static const int ERR_ACTIVATION_CODE_VERIFICATION_FAILURE = -5;
5249 static const int ERR_INVALID_EXPIRATION_DATE = -6;
5250 static const int ERR_GENERAL_FAILURE = -7;
5251 static const int ERR_NOT_INITIALIZED = -8;
5252 static const int ERR_REQUIRES_ACTIVATION = -9;
5253 static const int ERR_LICENSE_NOT_SUITED_FOR_ACTIVATION = -10;
5261 static const uint8_t LIC_CARGO_FLAG_LIMIT_TO_FEATURES = 0x01;
5272 std::string entitlement;
5273
5280 std::string key;
5281
5283 std::string activationCode;
5284
5286 std::string deviceId;
5287
5289 int type;
5290
5292 time_t expires;
5293
5295 std::string expiresFormatted;
5296
5301 uint32_t flags;
5302
5304 std::string cargo;
5305
5307 uint8_t cargoFlags;
5308
5314
5316 std::string manufacturerId;
5317
5319 {
5320 clear();
5321 }
5322
5323 void clear()
5324 {
5325 entitlement.clear();
5326 key.clear();
5327 activationCode.clear();
5328 type = 0;
5329 expires = 0;
5330 expiresFormatted.clear();
5331 flags = 0;
5332 cargo.clear();
5333 cargoFlags = 0;
5334 deviceId.clear();
5335 status = ERR_NOT_INITIALIZED;
5336 manufacturerId.clear();
5337 }
5338 };
5339
5340 static void to_json(nlohmann::json& j, const LicenseDescriptor& p)
5341 {
5342 j = nlohmann::json{
5343 //TOJSON_IMPL(entitlement),
5344 {"entitlement", "*entitlement*"},
5345 TOJSON_IMPL(key),
5346 TOJSON_IMPL(activationCode),
5347 TOJSON_IMPL(type),
5348 TOJSON_IMPL(expires),
5349 TOJSON_IMPL(expiresFormatted),
5350 TOJSON_IMPL(flags),
5351 TOJSON_IMPL(deviceId),
5352 TOJSON_IMPL(status),
5353 //TOJSON_IMPL(manufacturerId),
5354 {"manufacturerId", "*manufacturerId*"},
5355 TOJSON_IMPL(cargo),
5356 TOJSON_IMPL(cargoFlags)
5357 };
5358 }
5359
5360 static void from_json(const nlohmann::json& j, LicenseDescriptor& p)
5361 {
5362 p.clear();
5363 FROMJSON_IMPL(entitlement, std::string, EMPTY_STRING);
5364 FROMJSON_IMPL(key, std::string, EMPTY_STRING);
5365 FROMJSON_IMPL(activationCode, std::string, EMPTY_STRING);
5366 FROMJSON_IMPL(type, int, 0);
5367 FROMJSON_IMPL(expires, time_t, 0);
5368 FROMJSON_IMPL(expiresFormatted, std::string, EMPTY_STRING);
5369 FROMJSON_IMPL(flags, uint32_t, 0);
5370 FROMJSON_IMPL(deviceId, std::string, EMPTY_STRING);
5371 FROMJSON_IMPL(status, int, LicenseDescriptor::ERR_NOT_INITIALIZED);
5372 FROMJSON_IMPL(manufacturerId, std::string, EMPTY_STRING);
5373 FROMJSON_IMPL(cargo, std::string, EMPTY_STRING);
5374 FROMJSON_IMPL(cargoFlags, uint8_t, 0);
5375 }
5376
5377
5378 //-----------------------------------------------------------
5379 JSON_SERIALIZED_CLASS(EngineNetworkingRpUdpStreaming)
5392 {
5393 IMPLEMENT_JSON_SERIALIZATION()
5394 IMPLEMENT_JSON_DOCUMENTATION(EngineNetworkingRpUdpStreaming)
5395
5396 public:
5399
5401 int port;
5402
5405
5408
5410 int ttl;
5411
5413 {
5414 clear();
5415 }
5416
5417 void clear()
5418 {
5419 enabled = false;
5420 port = 0;
5421 keepaliveIntervalSecs = 15;
5422 priority = TxPriority_t::priVoice;
5423 ttl = 64;
5424 }
5425
5426 virtual void initForDocumenting()
5427 {
5428 }
5429 };
5430
5431 static void to_json(nlohmann::json& j, const EngineNetworkingRpUdpStreaming& p)
5432 {
5433 j = nlohmann::json{
5434 TOJSON_IMPL(enabled),
5435 TOJSON_IMPL(port),
5436 TOJSON_IMPL(keepaliveIntervalSecs),
5437 TOJSON_IMPL(priority),
5438 TOJSON_IMPL(ttl)
5439 };
5440 }
5441 static void from_json(const nlohmann::json& j, EngineNetworkingRpUdpStreaming& p)
5442 {
5443 p.clear();
5444 getOptional<bool>("enabled", p.enabled, j, false);
5445 getOptional<int>("port", p.port, j, 0);
5446 getOptional<int>("keepaliveIntervalSecs", p.keepaliveIntervalSecs, j, 15);
5447 getOptional<TxPriority_t>("priority", p.priority, j, TxPriority_t::priVoice);
5448 getOptional<int>("ttl", p.ttl, j, 64);
5449 }
5450
5451 //-----------------------------------------------------------
5452 JSON_SERIALIZED_CLASS(EnginePolicyNetworking)
5462 {
5463 IMPLEMENT_JSON_SERIALIZATION()
5464 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyNetworking)
5465
5466 public:
5468 std::string defaultNic;
5469
5472
5475
5478
5481
5484
5487
5490
5492 {
5493 clear();
5494 }
5495
5496 void clear()
5497 {
5498 defaultNic.clear();
5499 multicastRejoinSecs = 8;
5500 rallypointRtTestIntervalMs = 60000;
5501 logRtpJitterBufferStats = false;
5502 preventMulticastFailover = false;
5503 addressResolutionPolicy = AddressResolutionPolicy_t::arpIpv6ThenIpv4;
5504
5505 rpUdpStreaming.clear();
5506 rtpProfile.clear();
5507 }
5508 };
5509
5510 static void to_json(nlohmann::json& j, const EnginePolicyNetworking& p)
5511 {
5512 j = nlohmann::json{
5513 TOJSON_IMPL(defaultNic),
5514 TOJSON_IMPL(multicastRejoinSecs),
5515
5516 TOJSON_IMPL(rallypointRtTestIntervalMs),
5517 TOJSON_IMPL(logRtpJitterBufferStats),
5518 TOJSON_IMPL(preventMulticastFailover),
5519
5520 TOJSON_IMPL(rpUdpStreaming),
5521 TOJSON_IMPL(rtpProfile),
5522 TOJSON_IMPL(addressResolutionPolicy)
5523 };
5524 }
5525 static void from_json(const nlohmann::json& j, EnginePolicyNetworking& p)
5526 {
5527 p.clear();
5528 FROMJSON_IMPL(defaultNic, std::string, EMPTY_STRING);
5529 FROMJSON_IMPL(multicastRejoinSecs, int, 8);
5530 FROMJSON_IMPL(rallypointRtTestIntervalMs, int, 60000);
5531 FROMJSON_IMPL(logRtpJitterBufferStats, bool, false);
5532 FROMJSON_IMPL(preventMulticastFailover, bool, false);
5533
5534 getOptional<EngineNetworkingRpUdpStreaming>("rpUdpStreaming", p.rpUdpStreaming, j);
5535 getOptional<RtpProfile>("rtpProfile", p.rtpProfile, j);
5536 getOptional<AddressResolutionPolicy_t>("addressResolutionPolicy", p.addressResolutionPolicy, j, AddressResolutionPolicy_t::arpIpv6ThenIpv4);
5537 }
5538
5539 //-----------------------------------------------------------
5540 JSON_SERIALIZED_CLASS(Aec)
5551 {
5552 IMPLEMENT_JSON_SERIALIZATION()
5553 IMPLEMENT_JSON_DOCUMENTATION(Aec)
5554
5555 public:
5561 typedef enum
5562 {
5564 aecmDefault = 0,
5565
5567 aecmLow = 1,
5568
5570 aecmMedium = 2,
5571
5573 aecmHigh = 3,
5574
5576 aecmVeryHigh = 4,
5577
5579 aecmHighest = 5
5580 } Mode_t;
5581
5584
5587
5590
5592 bool cng;
5593
5594 Aec()
5595 {
5596 clear();
5597 }
5598
5599 void clear()
5600 {
5601 enabled = false;
5602 mode = aecmDefault;
5603 speakerTailMs = 60;
5604 cng = true;
5605 }
5606 };
5607
5608 static void to_json(nlohmann::json& j, const Aec& p)
5609 {
5610 j = nlohmann::json{
5611 TOJSON_IMPL(enabled),
5612 TOJSON_IMPL(mode),
5613 TOJSON_IMPL(speakerTailMs),
5614 TOJSON_IMPL(cng)
5615 };
5616 }
5617 static void from_json(const nlohmann::json& j, Aec& p)
5618 {
5619 p.clear();
5620 FROMJSON_IMPL(enabled, bool, false);
5621 FROMJSON_IMPL(mode, Aec::Mode_t, Aec::Mode_t::aecmDefault);
5622 FROMJSON_IMPL(speakerTailMs, int, 60);
5623 FROMJSON_IMPL(cng, bool, true);
5624 }
5625
5626 //-----------------------------------------------------------
5627 JSON_SERIALIZED_CLASS(Vad)
5638 {
5639 IMPLEMENT_JSON_SERIALIZATION()
5640 IMPLEMENT_JSON_DOCUMENTATION(Vad)
5641
5642 public:
5648 typedef enum
5649 {
5651 vamDefault = 0,
5652
5654 vamLowBitRate = 1,
5655
5657 vamAggressive = 2,
5658
5660 vamVeryAggressive = 3
5661 } Mode_t;
5662
5665
5668
5669 Vad()
5670 {
5671 clear();
5672 }
5673
5674 void clear()
5675 {
5676 enabled = false;
5677 mode = vamDefault;
5678 }
5679 };
5680
5681 static void to_json(nlohmann::json& j, const Vad& p)
5682 {
5683 j = nlohmann::json{
5684 TOJSON_IMPL(enabled),
5685 TOJSON_IMPL(mode)
5686 };
5687 }
5688 static void from_json(const nlohmann::json& j, Vad& p)
5689 {
5690 p.clear();
5691 FROMJSON_IMPL(enabled, bool, false);
5692 FROMJSON_IMPL(mode, Vad::Mode_t, Vad::Mode_t::vamDefault);
5693 }
5694
5695 //-----------------------------------------------------------
5696 JSON_SERIALIZED_CLASS(Bridge)
5707 {
5708 IMPLEMENT_JSON_SERIALIZATION()
5709 IMPLEMENT_JSON_DOCUMENTATION(Bridge)
5710
5711 public:
5713 std::string id;
5714
5716 std::string name;
5717
5719 std::vector<std::string> groups;
5720
5723
5724 Bridge()
5725 {
5726 clear();
5727 }
5728
5729 void clear()
5730 {
5731 id.clear();
5732 name.clear();
5733 groups.clear();
5734 enabled = true;
5735 }
5736 };
5737
5738 static void to_json(nlohmann::json& j, const Bridge& p)
5739 {
5740 j = nlohmann::json{
5741 TOJSON_IMPL(id),
5742 TOJSON_IMPL(name),
5743 TOJSON_IMPL(groups),
5744 TOJSON_IMPL(enabled)
5745 };
5746 }
5747 static void from_json(const nlohmann::json& j, Bridge& p)
5748 {
5749 p.clear();
5750 FROMJSON_IMPL(id, std::string, EMPTY_STRING);
5751 FROMJSON_IMPL(name, std::string, EMPTY_STRING);
5752 getOptional<std::vector<std::string>>("groups", p.groups, j);
5753 FROMJSON_IMPL(enabled, bool, true);
5754 }
5755
5756 //-----------------------------------------------------------
5757 JSON_SERIALIZED_CLASS(AndroidAudio)
5768 {
5769 IMPLEMENT_JSON_SERIALIZATION()
5770 IMPLEMENT_JSON_DOCUMENTATION(AndroidAudio)
5771
5772 public:
5773 constexpr static int INVALID_SESSION_ID = -9999;
5774
5776 int api;
5777
5780
5783
5799
5807
5817
5820
5823
5824
5825 AndroidAudio()
5826 {
5827 clear();
5828 }
5829
5830 void clear()
5831 {
5832 api = 0;
5833 sharingMode = 0;
5834 performanceMode = 12;
5835 usage = 2;
5836 contentType = 1;
5837 inputPreset = 7;
5838 sessionId = AndroidAudio::INVALID_SESSION_ID;
5839 engineMode = 0;
5840 }
5841 };
5842
5843 static void to_json(nlohmann::json& j, const AndroidAudio& p)
5844 {
5845 j = nlohmann::json{
5846 TOJSON_IMPL(api),
5847 TOJSON_IMPL(sharingMode),
5848 TOJSON_IMPL(performanceMode),
5849 TOJSON_IMPL(usage),
5850 TOJSON_IMPL(contentType),
5851 TOJSON_IMPL(inputPreset),
5852 TOJSON_IMPL(sessionId),
5853 TOJSON_IMPL(engineMode)
5854 };
5855 }
5856 static void from_json(const nlohmann::json& j, AndroidAudio& p)
5857 {
5858 p.clear();
5859 FROMJSON_IMPL(api, int, 0);
5860 FROMJSON_IMPL(sharingMode, int, 0);
5861 FROMJSON_IMPL(performanceMode, int, 12);
5862 FROMJSON_IMPL(usage, int, 2);
5863 FROMJSON_IMPL(contentType, int, 1);
5864 FROMJSON_IMPL(inputPreset, int, 7);
5865 FROMJSON_IMPL(sessionId, int, AndroidAudio::INVALID_SESSION_ID);
5866 FROMJSON_IMPL(engineMode, int, 0);
5867 }
5868
5869 //-----------------------------------------------------------
5870 JSON_SERIALIZED_CLASS(EnginePolicyAudio)
5881 {
5882 IMPLEMENT_JSON_SERIALIZATION()
5883 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyAudio)
5884
5885 public:
5888
5891
5894
5897
5900
5903
5906
5909
5912
5915
5918
5921
5924
5927
5928
5930 {
5931 clear();
5932 }
5933
5934 void clear()
5935 {
5936 enabled = true;
5937 hardwareEnabled = true;
5938 internalRate = 16000;
5939 internalChannels = 2;
5940 muteTxOnTx = false;
5941 aec.clear();
5942 vad.clear();
5943 android.clear();
5944 inputAgc.clear();
5945 outputAgc.clear();
5946 denoiseInput = false;
5947 denoiseOutput = false;
5948 saveInputPcm = false;
5949 saveOutputPcm = false;
5950 }
5951 };
5952
5953 static void to_json(nlohmann::json& j, const EnginePolicyAudio& p)
5954 {
5955 j = nlohmann::json{
5956 TOJSON_IMPL(enabled),
5957 TOJSON_IMPL(hardwareEnabled),
5958 TOJSON_IMPL(internalRate),
5959 TOJSON_IMPL(internalChannels),
5960 TOJSON_IMPL(muteTxOnTx),
5961 TOJSON_IMPL(aec),
5962 TOJSON_IMPL(vad),
5963 TOJSON_IMPL(android),
5964 TOJSON_IMPL(inputAgc),
5965 TOJSON_IMPL(outputAgc),
5966 TOJSON_IMPL(denoiseInput),
5967 TOJSON_IMPL(denoiseOutput),
5968 TOJSON_IMPL(saveInputPcm),
5969 TOJSON_IMPL(saveOutputPcm)
5970 };
5971 }
5972 static void from_json(const nlohmann::json& j, EnginePolicyAudio& p)
5973 {
5974 p.clear();
5975 getOptional<bool>("enabled", p.enabled, j, true);
5976 getOptional<bool>("hardwareEnabled", p.hardwareEnabled, j, true);
5977 FROMJSON_IMPL(internalRate, int, 16000);
5978 FROMJSON_IMPL(internalChannels, int, 2);
5979
5980 FROMJSON_IMPL(muteTxOnTx, bool, false);
5981 getOptional<Aec>("aec", p.aec, j);
5982 getOptional<Vad>("vad", p.vad, j);
5983 getOptional<AndroidAudio>("android", p.android, j);
5984 getOptional<Agc>("inputAgc", p.inputAgc, j);
5985 getOptional<Agc>("outputAgc", p.outputAgc, j);
5986 FROMJSON_IMPL(denoiseInput, bool, false);
5987 FROMJSON_IMPL(denoiseOutput, bool, false);
5988 FROMJSON_IMPL(saveInputPcm, bool, false);
5989 FROMJSON_IMPL(saveOutputPcm, bool, false);
5990 }
5991
5992 //-----------------------------------------------------------
5993 JSON_SERIALIZED_CLASS(SecurityCertificate)
6004 {
6005 IMPLEMENT_JSON_SERIALIZATION()
6006 IMPLEMENT_JSON_DOCUMENTATION(SecurityCertificate)
6007
6008 public:
6009
6015 std::string certificate;
6016
6018 std::string key;
6019
6021 {
6022 clear();
6023 }
6024
6025 void clear()
6026 {
6027 certificate.clear();
6028 key.clear();
6029 }
6030 };
6031
6032 static void to_json(nlohmann::json& j, const SecurityCertificate& p)
6033 {
6034 j = nlohmann::json{
6035 TOJSON_IMPL(certificate),
6036 TOJSON_IMPL(key)
6037 };
6038 }
6039 static void from_json(const nlohmann::json& j, SecurityCertificate& p)
6040 {
6041 p.clear();
6042 FROMJSON_IMPL(certificate, std::string, EMPTY_STRING);
6043 FROMJSON_IMPL(key, std::string, EMPTY_STRING);
6044 }
6045
6046 // This is where spell checking stops
6047 //-----------------------------------------------------------
6048 JSON_SERIALIZED_CLASS(EnginePolicySecurity)
6049
6050
6060 {
6061 IMPLEMENT_JSON_SERIALIZATION()
6062 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicySecurity)
6063
6064 public:
6065
6077
6085 std::vector<std::string> caCertificates;
6086
6088 {
6089 clear();
6090 }
6091
6092 void clear()
6093 {
6094 certificate.clear();
6095 caCertificates.clear();
6096 }
6097 };
6098
6099 static void to_json(nlohmann::json& j, const EnginePolicySecurity& p)
6100 {
6101 j = nlohmann::json{
6102 TOJSON_IMPL(certificate),
6103 TOJSON_IMPL(caCertificates)
6104 };
6105 }
6106 static void from_json(const nlohmann::json& j, EnginePolicySecurity& p)
6107 {
6108 p.clear();
6109 getOptional("certificate", p.certificate, j);
6110 getOptional<std::vector<std::string>>("caCertificates", p.caCertificates, j);
6111 }
6112
6113 //-----------------------------------------------------------
6114 JSON_SERIALIZED_CLASS(EnginePolicyLogging)
6125 {
6126 IMPLEMENT_JSON_SERIALIZATION()
6127 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyLogging)
6128
6129 public:
6130
6147
6150
6152 {
6153 clear();
6154 }
6155
6156 void clear()
6157 {
6158 maxLevel = 4; // ILogger::Level::debug
6159 enableSyslog = false;
6160 }
6161 };
6162
6163 static void to_json(nlohmann::json& j, const EnginePolicyLogging& p)
6164 {
6165 j = nlohmann::json{
6166 TOJSON_IMPL(maxLevel),
6167 TOJSON_IMPL(enableSyslog)
6168 };
6169 }
6170 static void from_json(const nlohmann::json& j, EnginePolicyLogging& p)
6171 {
6172 p.clear();
6173 getOptional("maxLevel", p.maxLevel, j, 4); // ILogger::Level::debug
6174 getOptional("enableSyslog", p.enableSyslog, j);
6175 }
6176
6177
6178 //-----------------------------------------------------------
6179 JSON_SERIALIZED_CLASS(EnginePolicyDatabase)
6181 {
6182 IMPLEMENT_JSON_SERIALIZATION()
6183 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyDatabase)
6184
6185 public:
6186 typedef enum
6187 {
6188 dbtFixedMemory = 0,
6189 dbtPagedMemory = 1,
6190 dbtFixedFile = 2
6191 } DatabaseType_t;
6192
6193 DatabaseType_t type;
6194 std::string fixedFileName;
6195 bool forceMaintenance;
6196 bool reclaimSpace;
6197
6199 {
6200 clear();
6201 }
6202
6203 void clear()
6204 {
6205 type = DatabaseType_t::dbtFixedMemory;
6206 fixedFileName.clear();
6207 forceMaintenance = false;
6208 reclaimSpace = false;
6209 }
6210 };
6211
6212 static void to_json(nlohmann::json& j, const EnginePolicyDatabase& p)
6213 {
6214 j = nlohmann::json{
6215 TOJSON_IMPL(type),
6216 TOJSON_IMPL(fixedFileName),
6217 TOJSON_IMPL(forceMaintenance),
6218 TOJSON_IMPL(reclaimSpace)
6219 };
6220 }
6221 static void from_json(const nlohmann::json& j, EnginePolicyDatabase& p)
6222 {
6223 p.clear();
6224 FROMJSON_IMPL(type, EnginePolicyDatabase::DatabaseType_t, EnginePolicyDatabase::DatabaseType_t::dbtFixedMemory);
6225 FROMJSON_IMPL(fixedFileName, std::string, EMPTY_STRING);
6226 FROMJSON_IMPL(forceMaintenance, bool, false);
6227 FROMJSON_IMPL(reclaimSpace, bool, false);
6228 }
6229
6230
6231 //-----------------------------------------------------------
6232 JSON_SERIALIZED_CLASS(SecureSignature)
6241 {
6242 IMPLEMENT_JSON_SERIALIZATION()
6243 IMPLEMENT_JSON_DOCUMENTATION(SecureSignature)
6244
6245 public:
6246
6248 std::string certificate;
6249
6250 // /** @brief Contains the PEM-formatted text of the certificate's public key */
6251 //std::string publicKey;
6252
6254 std::string signature;
6255
6257 {
6258 clear();
6259 }
6260
6261 void clear()
6262 {
6263 certificate.clear();
6264 //publicKey.clear();
6265 signature.clear();
6266 }
6267 };
6268
6269 static void to_json(nlohmann::json& j, const SecureSignature& p)
6270 {
6271 j = nlohmann::json{
6272 TOJSON_IMPL(certificate),
6273 //TOJSON_IMPL(publicKey),
6274 TOJSON_IMPL(signature)
6275 };
6276 }
6277 static void from_json(const nlohmann::json& j, SecureSignature& p)
6278 {
6279 p.clear();
6280 FROMJSON_IMPL(certificate, std::string, EMPTY_STRING);
6281 //FROMJSON_IMPL(publicKey, std::string, EMPTY_STRING);
6282 FROMJSON_IMPL(signature, std::string, EMPTY_STRING);
6283 }
6284
6285 //-----------------------------------------------------------
6286 JSON_SERIALIZED_CLASS(NamedAudioDevice)
6288 {
6289 IMPLEMENT_JSON_SERIALIZATION()
6290 IMPLEMENT_JSON_DOCUMENTATION(NamedAudioDevice)
6291
6292 public:
6293 std::string name;
6294 std::string manufacturer;
6295 std::string model;
6296 std::string id;
6297 std::string serialNumber;
6298 std::string type;
6299 std::string extra;
6300 bool isDefault;
6301
6303 {
6304 clear();
6305 }
6306
6307 void clear()
6308 {
6309 name.clear();
6310 manufacturer.clear();
6311 model.clear();
6312 id.clear();
6313 serialNumber.clear();
6314 type.clear();
6315 extra.clear();
6316 isDefault = false;
6317 }
6318 };
6319
6320 static void to_json(nlohmann::json& j, const NamedAudioDevice& p)
6321 {
6322 j = nlohmann::json{
6323 TOJSON_IMPL(name),
6324 TOJSON_IMPL(manufacturer),
6325 TOJSON_IMPL(model),
6326 TOJSON_IMPL(id),
6327 TOJSON_IMPL(serialNumber),
6328 TOJSON_IMPL(type),
6329 TOJSON_IMPL(extra),
6330 TOJSON_IMPL(isDefault),
6331 };
6332 }
6333 static void from_json(const nlohmann::json& j, NamedAudioDevice& p)
6334 {
6335 p.clear();
6336 getOptional<std::string>("name", p.name, j, EMPTY_STRING);
6337 getOptional<std::string>("manufacturer", p.manufacturer, j, EMPTY_STRING);
6338 getOptional<std::string>("model", p.model, j, EMPTY_STRING);
6339 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
6340 getOptional<std::string>("serialNumber", p.serialNumber, j, EMPTY_STRING);
6341 getOptional<std::string>("type", p.type, j, EMPTY_STRING);
6342 getOptional<std::string>("extra", p.extra, j, EMPTY_STRING);
6343 getOptional<bool>("isDefault", p.isDefault, j, false);
6344 }
6345
6346
6347 //-----------------------------------------------------------
6348 JSON_SERIALIZED_CLASS(EnginePolicyNamedAudioDevices)
6350 {
6351 IMPLEMENT_JSON_SERIALIZATION()
6352 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyNamedAudioDevices)
6353
6354 public:
6355 std::vector<NamedAudioDevice> inputs;
6356 std::vector<NamedAudioDevice> outputs;
6357
6359 {
6360 clear();
6361 }
6362
6363 void clear()
6364 {
6365 inputs.clear();
6366 outputs.clear();
6367 }
6368 };
6369
6370 static void to_json(nlohmann::json& j, const EnginePolicyNamedAudioDevices& p)
6371 {
6372 j = nlohmann::json{
6373 TOJSON_IMPL(inputs),
6374 TOJSON_IMPL(outputs)
6375 };
6376 }
6377 static void from_json(const nlohmann::json& j, EnginePolicyNamedAudioDevices& p)
6378 {
6379 p.clear();
6380 getOptional<std::vector<NamedAudioDevice>>("inputs", p.inputs, j);
6381 getOptional<std::vector<NamedAudioDevice>>("outputs", p.outputs, j);
6382 }
6383
6384 //-----------------------------------------------------------
6385 JSON_SERIALIZED_CLASS(Licensing)
6398 {
6399 IMPLEMENT_JSON_SERIALIZATION()
6400 IMPLEMENT_JSON_DOCUMENTATION(Licensing)
6401
6402 public:
6403
6405 std::string entitlement;
6406
6408 std::string key;
6409
6411 std::string activationCode;
6412
6414 std::string deviceId;
6415
6417 std::string manufacturerId;
6418
6419 Licensing()
6420 {
6421 clear();
6422 }
6423
6424 void clear()
6425 {
6426 entitlement.clear();
6427 key.clear();
6428 activationCode.clear();
6429 deviceId.clear();
6430 manufacturerId.clear();
6431 }
6432 };
6433
6434 static void to_json(nlohmann::json& j, const Licensing& p)
6435 {
6436 j = nlohmann::json{
6437 TOJSON_IMPL(entitlement),
6438 TOJSON_IMPL(key),
6439 TOJSON_IMPL(activationCode),
6440 TOJSON_IMPL(deviceId),
6441 TOJSON_IMPL(manufacturerId)
6442 };
6443 }
6444 static void from_json(const nlohmann::json& j, Licensing& p)
6445 {
6446 p.clear();
6447 FROMJSON_IMPL(entitlement, std::string, EMPTY_STRING);
6448 FROMJSON_IMPL(key, std::string, EMPTY_STRING);
6449 FROMJSON_IMPL(activationCode, std::string, EMPTY_STRING);
6450 FROMJSON_IMPL(deviceId, std::string, EMPTY_STRING);
6451 FROMJSON_IMPL(manufacturerId, std::string, EMPTY_STRING);
6452 }
6453
6454 //-----------------------------------------------------------
6455 JSON_SERIALIZED_CLASS(DiscoveryMagellan)
6466 {
6467 IMPLEMENT_JSON_SERIALIZATION()
6468 IMPLEMENT_JSON_DOCUMENTATION(DiscoveryMagellan)
6469
6470 public:
6471
6474
6476 std::string interfaceName;
6477
6480
6483
6485 {
6486 clear();
6487 }
6488
6489 void clear()
6490 {
6491 enabled = false;
6492 interfaceName.clear();
6493 security.clear();
6494 tls.clear();
6495 }
6496 };
6497
6498 static void to_json(nlohmann::json& j, const DiscoveryMagellan& p)
6499 {
6500 j = nlohmann::json{
6501 TOJSON_IMPL(enabled),
6502 TOJSON_IMPL(interfaceName),
6503 TOJSON_IMPL(security),
6504 TOJSON_IMPL(tls)
6505 };
6506 }
6507 static void from_json(const nlohmann::json& j, DiscoveryMagellan& p)
6508 {
6509 p.clear();
6510 getOptional("enabled", p.enabled, j, false);
6511 getOptional<Tls>("tls", p.tls, j);
6512 getOptional<SecurityCertificate>("security", p.security, j);
6513 FROMJSON_IMPL(interfaceName, std::string, EMPTY_STRING);
6514 }
6515
6516 //-----------------------------------------------------------
6517 JSON_SERIALIZED_CLASS(DiscoverySsdp)
6528 {
6529 IMPLEMENT_JSON_SERIALIZATION()
6530 IMPLEMENT_JSON_DOCUMENTATION(DiscoverySsdp)
6531
6532 public:
6533
6536
6538 std::string interfaceName;
6539
6542
6544 std::vector<std::string> searchTerms;
6545
6548
6551
6553 {
6554 clear();
6555 }
6556
6557 void clear()
6558 {
6559 enabled = false;
6560 interfaceName.clear();
6561 address.clear();
6562 searchTerms.clear();
6563 ageTimeoutMs = 30000;
6564 advertising.clear();
6565 }
6566 };
6567
6568 static void to_json(nlohmann::json& j, const DiscoverySsdp& p)
6569 {
6570 j = nlohmann::json{
6571 TOJSON_IMPL(enabled),
6572 TOJSON_IMPL(interfaceName),
6573 TOJSON_IMPL(address),
6574 TOJSON_IMPL(searchTerms),
6575 TOJSON_IMPL(ageTimeoutMs),
6576 TOJSON_IMPL(advertising)
6577 };
6578 }
6579 static void from_json(const nlohmann::json& j, DiscoverySsdp& p)
6580 {
6581 p.clear();
6582 getOptional("enabled", p.enabled, j, false);
6583 getOptional<std::string>("interfaceName", p.interfaceName, j);
6584
6585 getOptional<NetworkAddress>("address", p.address, j);
6586 if(p.address.address.empty())
6587 {
6588 p.address.address = "255.255.255.255";
6589 }
6590 if(p.address.port <= 0)
6591 {
6592 p.address.port = 1900;
6593 }
6594
6595 getOptional<std::vector<std::string>>("searchTerms", p.searchTerms, j);
6596 getOptional<int>("ageTimeoutMs", p.ageTimeoutMs, j, 30000);
6597 getOptional<Advertising>("advertising", p.advertising, j);
6598 }
6599
6600 //-----------------------------------------------------------
6601 JSON_SERIALIZED_CLASS(DiscoverySap)
6612 {
6613 IMPLEMENT_JSON_SERIALIZATION()
6614 IMPLEMENT_JSON_DOCUMENTATION(DiscoverySap)
6615
6616 public:
6619
6621 std::string interfaceName;
6622
6625
6628
6631
6632 DiscoverySap()
6633 {
6634 clear();
6635 }
6636
6637 void clear()
6638 {
6639 enabled = false;
6640 interfaceName.clear();
6641 address.clear();
6642 ageTimeoutMs = 30000;
6643 advertising.clear();
6644 }
6645 };
6646
6647 static void to_json(nlohmann::json& j, const DiscoverySap& p)
6648 {
6649 j = nlohmann::json{
6650 TOJSON_IMPL(enabled),
6651 TOJSON_IMPL(interfaceName),
6652 TOJSON_IMPL(address),
6653 TOJSON_IMPL(ageTimeoutMs),
6654 TOJSON_IMPL(advertising)
6655 };
6656 }
6657 static void from_json(const nlohmann::json& j, DiscoverySap& p)
6658 {
6659 p.clear();
6660 getOptional("enabled", p.enabled, j, false);
6661 getOptional<std::string>("interfaceName", p.interfaceName, j);
6662 getOptional<NetworkAddress>("address", p.address, j);
6663 if(p.address.address.empty())
6664 {
6665 p.address.address = "224.2.127.254";
6666 }
6667 if(p.address.port <= 0)
6668 {
6669 p.address.port = 9875;
6670 }
6671
6672 getOptional<int>("ageTimeoutMs", p.ageTimeoutMs, j, 30000);
6673 getOptional<Advertising>("advertising", p.advertising, j);
6674 }
6675
6676 //-----------------------------------------------------------
6677 JSON_SERIALIZED_CLASS(DiscoveryCistech)
6690 {
6691 IMPLEMENT_JSON_SERIALIZATION()
6692 IMPLEMENT_JSON_DOCUMENTATION(DiscoveryCistech)
6693
6694 public:
6695 bool enabled;
6696 std::string interfaceName;
6697 NetworkAddress address;
6698 int ageTimeoutMs;
6699
6701 {
6702 clear();
6703 }
6704
6705 void clear()
6706 {
6707 enabled = false;
6708 interfaceName.clear();
6709 address.clear();
6710 ageTimeoutMs = 30000;
6711 }
6712 };
6713
6714 static void to_json(nlohmann::json& j, const DiscoveryCistech& p)
6715 {
6716 j = nlohmann::json{
6717 TOJSON_IMPL(enabled),
6718 TOJSON_IMPL(interfaceName),
6719 TOJSON_IMPL(address),
6720 TOJSON_IMPL(ageTimeoutMs)
6721 };
6722 }
6723 static void from_json(const nlohmann::json& j, DiscoveryCistech& p)
6724 {
6725 p.clear();
6726 getOptional("enabled", p.enabled, j, false);
6727 getOptional<std::string>("interfaceName", p.interfaceName, j);
6728 getOptional<NetworkAddress>("address", p.address, j);
6729 getOptional<int>("ageTimeoutMs", p.ageTimeoutMs, j, 30000);
6730 }
6731
6732
6733 //-----------------------------------------------------------
6734 JSON_SERIALIZED_CLASS(DiscoveryTrellisware)
6745 {
6746 IMPLEMENT_JSON_SERIALIZATION()
6747 IMPLEMENT_JSON_DOCUMENTATION(DiscoveryTrellisware)
6748
6749 public:
6750
6753
6756
6758 {
6759 clear();
6760 }
6761
6762 void clear()
6763 {
6764 enabled = false;
6765 security.clear();
6766 }
6767 };
6768
6769 static void to_json(nlohmann::json& j, const DiscoveryTrellisware& p)
6770 {
6771 j = nlohmann::json{
6772 TOJSON_IMPL(enabled),
6773 TOJSON_IMPL(security)
6774 };
6775 }
6776 static void from_json(const nlohmann::json& j, DiscoveryTrellisware& p)
6777 {
6778 p.clear();
6779 getOptional("enabled", p.enabled, j, false);
6780 getOptional<SecurityCertificate>("security", p.security, j);
6781 }
6782
6783 //-----------------------------------------------------------
6784 JSON_SERIALIZED_CLASS(DiscoveryConfiguration)
6795 {
6796 IMPLEMENT_JSON_SERIALIZATION()
6797 IMPLEMENT_JSON_DOCUMENTATION(DiscoveryConfiguration)
6798
6799 public:
6802
6805
6808
6811
6814
6816 {
6817 clear();
6818 }
6819
6820 void clear()
6821 {
6822 magellan.clear();
6823 ssdp.clear();
6824 sap.clear();
6825 cistech.clear();
6826 }
6827 };
6828
6829 static void to_json(nlohmann::json& j, const DiscoveryConfiguration& p)
6830 {
6831 j = nlohmann::json{
6832 TOJSON_IMPL(magellan),
6833 TOJSON_IMPL(ssdp),
6834 TOJSON_IMPL(sap),
6835 TOJSON_IMPL(cistech),
6836 TOJSON_IMPL(trellisware)
6837 };
6838 }
6839 static void from_json(const nlohmann::json& j, DiscoveryConfiguration& p)
6840 {
6841 p.clear();
6842 getOptional<DiscoveryMagellan>("magellan", p.magellan, j);
6843 getOptional<DiscoverySsdp>("ssdp", p.ssdp, j);
6844 getOptional<DiscoverySap>("sap", p.sap, j);
6845 getOptional<DiscoveryCistech>("cistech", p.cistech, j);
6846 getOptional<DiscoveryTrellisware>("trellisware", p.trellisware, j);
6847 }
6848
6849
6850 //-----------------------------------------------------------
6851 JSON_SERIALIZED_CLASS(EnginePolicyInternals)
6864 {
6865 IMPLEMENT_JSON_SERIALIZATION()
6866 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyInternals)
6867
6868 public:
6871
6874
6877
6878 int maxRxSecs;
6879
6880 int logTaskQueueStatsIntervalMs;
6881
6882 bool enableLazySpeakerClosure;
6883
6886
6889
6892
6895
6898
6901
6904
6907
6909 {
6910 clear();
6911 }
6912
6913 void clear()
6914 {
6915 watchdog.clear();
6916 housekeeperIntervalMs = 1000;
6917 logTaskQueueStatsIntervalMs = 0;
6918 maxTxSecs = 30;
6919 maxRxSecs = 0;
6920 enableLazySpeakerClosure = false;
6921 rpClusterStrategy = RallypointCluster::ConnectionStrategy_t::csRoundRobin;
6922 rpClusterRolloverSecs = 10;
6923 rtpExpirationCheckIntervalMs = 250;
6924 rpConnectionTimeoutSecs = 5;
6925 stickyTidHangSecs = 10;
6926 uriStreamingIntervalMs = 60;
6927 delayedMicrophoneClosureSecs = 15;
6928 tuning.clear();
6929 }
6930 };
6931
6932 static void to_json(nlohmann::json& j, const EnginePolicyInternals& p)
6933 {
6934 j = nlohmann::json{
6935 TOJSON_IMPL(watchdog),
6936 TOJSON_IMPL(housekeeperIntervalMs),
6937 TOJSON_IMPL(logTaskQueueStatsIntervalMs),
6938 TOJSON_IMPL(maxTxSecs),
6939 TOJSON_IMPL(maxRxSecs),
6940 TOJSON_IMPL(enableLazySpeakerClosure),
6941 TOJSON_IMPL(rpClusterStrategy),
6942 TOJSON_IMPL(rpClusterRolloverSecs),
6943 TOJSON_IMPL(rtpExpirationCheckIntervalMs),
6944 TOJSON_IMPL(rpConnectionTimeoutSecs),
6945 TOJSON_IMPL(stickyTidHangSecs),
6946 TOJSON_IMPL(uriStreamingIntervalMs),
6947 TOJSON_IMPL(delayedMicrophoneClosureSecs),
6948 TOJSON_IMPL(tuning)
6949 };
6950 }
6951 static void from_json(const nlohmann::json& j, EnginePolicyInternals& p)
6952 {
6953 p.clear();
6954 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
6955 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
6956 getOptional<int>("logTaskQueueStatsIntervalMs", p.logTaskQueueStatsIntervalMs, j, 0);
6957 getOptional<int>("maxTxSecs", p.maxTxSecs, j, 30);
6958 getOptional<int>("maxRxSecs", p.maxRxSecs, j, 0);
6959 getOptional<bool>("enableLazySpeakerClosure", p.enableLazySpeakerClosure, j, false);
6960 getOptional<RallypointCluster::ConnectionStrategy_t>("rpClusterStrategy", p.rpClusterStrategy, j, RallypointCluster::ConnectionStrategy_t::csRoundRobin);
6961 getOptional<int>("rpClusterRolloverSecs", p.rpClusterRolloverSecs, j, 10);
6962 getOptional<int>("rtpExpirationCheckIntervalMs", p.rtpExpirationCheckIntervalMs, j, 250);
6963 getOptional<int>("rpConnectionTimeoutSecs", p.rpConnectionTimeoutSecs, j, 5);
6964 getOptional<int>("stickyTidHangSecs", p.stickyTidHangSecs, j, 10);
6965 getOptional<int>("uriStreamingIntervalMs", p.uriStreamingIntervalMs, j, 60);
6966 getOptional<int>("delayedMicrophoneClosureSecs", p.delayedMicrophoneClosureSecs, j, 15);
6967 getOptional<TuningSettings>("tuning", p.tuning, j);
6968 }
6969
6970 //-----------------------------------------------------------
6971 JSON_SERIALIZED_CLASS(EnginePolicyTimelines)
6984 {
6985 IMPLEMENT_JSON_SERIALIZATION()
6986 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicyTimelines)
6987
6988 public:
6989
6996
6998 std::string storageRoot;
6999
7002
7005
7008
7011
7014
7017
7020
7029
7032
7035
7038
7040 {
7041 clear();
7042 }
7043
7044 void clear()
7045 {
7046 enabled = true;
7047 storageRoot.clear();
7048 maxStorageMb = 1024; // 1 Gigabyte
7049 maxMemMb = maxStorageMb;
7050 maxAudioEventMemMb = maxMemMb;
7051 maxDiskMb = maxStorageMb;
7052 maxEventAgeSecs = (86400 * 30); // 30 days
7053 groomingIntervalSecs = (60 * 30); // 30 minutes
7054 maxEvents = 1000;
7055 autosaveIntervalSecs = 5;
7056 security.clear();
7057 disableSigningAndVerification = false;
7058 ephemeral = false;
7059 }
7060 };
7061
7062 static void to_json(nlohmann::json& j, const EnginePolicyTimelines& p)
7063 {
7064 j = nlohmann::json{
7065 TOJSON_IMPL(enabled),
7066 TOJSON_IMPL(storageRoot),
7067 TOJSON_IMPL(maxMemMb),
7068 TOJSON_IMPL(maxAudioEventMemMb),
7069 TOJSON_IMPL(maxDiskMb),
7070 TOJSON_IMPL(maxEventAgeSecs),
7071 TOJSON_IMPL(maxEvents),
7072 TOJSON_IMPL(groomingIntervalSecs),
7073 TOJSON_IMPL(autosaveIntervalSecs),
7074 TOJSON_IMPL(security),
7075 TOJSON_IMPL(disableSigningAndVerification),
7076 TOJSON_IMPL(ephemeral)
7077 };
7078 }
7079 static void from_json(const nlohmann::json& j, EnginePolicyTimelines& p)
7080 {
7081 p.clear();
7082 getOptional<bool>("enabled", p.enabled, j, true);
7083 getOptional<std::string>("storageRoot", p.storageRoot, j, EMPTY_STRING);
7084
7085 getOptional<int>("maxStorageMb", p.maxStorageMb, j, 1024);
7086 getOptional<int>("maxMemMb", p.maxMemMb, j, p.maxStorageMb);
7087 getOptional<int>("maxAudioEventMemMb", p.maxAudioEventMemMb, j, p.maxMemMb);
7088 getOptional<int>("maxDiskMb", p.maxDiskMb, j, p.maxStorageMb);
7089 getOptional<long>("maxEventAgeSecs", p.maxEventAgeSecs, j, (86400 * 30));
7090 getOptional<long>("groomingIntervalSecs", p.groomingIntervalSecs, j, (60 * 30));
7091 getOptional<long>("autosaveIntervalSecs", p.autosaveIntervalSecs, j, 5);
7092 getOptional<int>("maxEvents", p.maxEvents, j, 1000);
7093 getOptional<SecurityCertificate>("security", p.security, j);
7094 getOptional<bool>("disableSigningAndVerification", p.disableSigningAndVerification, j, false);
7095 getOptional<bool>("ephemeral", p.ephemeral, j, false);
7096 }
7097
7098
7099 //-----------------------------------------------------------
7100 JSON_SERIALIZED_CLASS(RtpMapEntry)
7111 {
7112 IMPLEMENT_JSON_SERIALIZATION()
7113 IMPLEMENT_JSON_DOCUMENTATION(RtpMapEntry)
7114
7115 public:
7117 std::string name;
7118
7121
7124
7125 RtpMapEntry()
7126 {
7127 clear();
7128 }
7129
7130 void clear()
7131 {
7132 name.clear();
7133 engageType = -1;
7134 rtpPayloadType = -1;
7135 }
7136 };
7137
7138 static void to_json(nlohmann::json& j, const RtpMapEntry& p)
7139 {
7140 j = nlohmann::json{
7141 TOJSON_IMPL(name),
7142 TOJSON_IMPL(engageType),
7143 TOJSON_IMPL(rtpPayloadType)
7144 };
7145 }
7146 static void from_json(const nlohmann::json& j, RtpMapEntry& p)
7147 {
7148 p.clear();
7149 getOptional<std::string>("name", p.name, j, EMPTY_STRING);
7150 getOptional<int>("engageType", p.engageType, j, -1);
7151 getOptional<int>("rtpPayloadType", p.rtpPayloadType, j, -1);
7152 }
7153
7154 //-----------------------------------------------------------
7155 JSON_SERIALIZED_CLASS(ExternalModule)
7166 {
7167 IMPLEMENT_JSON_SERIALIZATION()
7168 IMPLEMENT_JSON_DOCUMENTATION(ExternalModule)
7169
7170 public:
7172 std::string name;
7173
7175 std::string file;
7176
7178 nlohmann::json configuration;
7179
7181 {
7182 clear();
7183 }
7184
7185 void clear()
7186 {
7187 name.clear();
7188 file.clear();
7189 configuration.clear();
7190 }
7191 };
7192
7193 static void to_json(nlohmann::json& j, const ExternalModule& p)
7194 {
7195 j = nlohmann::json{
7196 TOJSON_IMPL(name),
7197 TOJSON_IMPL(file)
7198 };
7199
7200 if(!p.configuration.empty())
7201 {
7202 j["configuration"] = p.configuration;
7203 }
7204 }
7205 static void from_json(const nlohmann::json& j, ExternalModule& p)
7206 {
7207 p.clear();
7208 getOptional<std::string>("name", p.name, j, EMPTY_STRING);
7209 getOptional<std::string>("file", p.file, j, EMPTY_STRING);
7210
7211 try
7212 {
7213 p.configuration = j.at("configuration");
7214 }
7215 catch(...)
7216 {
7217 p.configuration.clear();
7218 }
7219 }
7220
7221
7222 //-----------------------------------------------------------
7223 JSON_SERIALIZED_CLASS(ExternalCodecDescriptor)
7234 {
7235 IMPLEMENT_JSON_SERIALIZATION()
7236 IMPLEMENT_JSON_DOCUMENTATION(ExternalCodecDescriptor)
7237
7238 public:
7241
7244
7247
7250
7252 {
7253 clear();
7254 }
7255
7256 void clear()
7257 {
7258 rtpPayloadType = -1;
7259 samplingRate = -1;
7260 channels = -1;
7261 rtpTsMultiplier = 0;
7262 }
7263 };
7264
7265 static void to_json(nlohmann::json& j, const ExternalCodecDescriptor& p)
7266 {
7267 j = nlohmann::json{
7268 TOJSON_IMPL(rtpPayloadType),
7269 TOJSON_IMPL(samplingRate),
7270 TOJSON_IMPL(channels),
7271 TOJSON_IMPL(rtpTsMultiplier)
7272 };
7273 }
7274 static void from_json(const nlohmann::json& j, ExternalCodecDescriptor& p)
7275 {
7276 p.clear();
7277
7278 getOptional<int>("rtpPayloadType", p.rtpPayloadType, j, -1);
7279 getOptional<int>("samplingRate", p.samplingRate, j, -1);
7280 getOptional<int>("channels", p.channels, j, -1);
7281 getOptional<int>("rtpTsMultiplier", p.rtpTsMultiplier, j, -1);
7282 }
7283
7284 //-----------------------------------------------------------
7285 JSON_SERIALIZED_CLASS(EngineStatusReportConfiguration)
7296 {
7297 IMPLEMENT_JSON_SERIALIZATION()
7298 IMPLEMENT_JSON_DOCUMENTATION(EngineStatusReportConfiguration)
7299
7300 public:
7302 std::string fileName;
7303
7306
7309
7311 std::string runCmd;
7312
7315
7318
7320 {
7321 clear();
7322 }
7323
7324 void clear()
7325 {
7326 fileName.clear();
7327 intervalSecs = 60;
7328 enabled = false;
7329 includeMemoryDetail = false;
7330 includeTaskQueueDetail = false;
7331 runCmd.clear();
7332 }
7333 };
7334
7335 static void to_json(nlohmann::json& j, const EngineStatusReportConfiguration& p)
7336 {
7337 j = nlohmann::json{
7338 TOJSON_IMPL(fileName),
7339 TOJSON_IMPL(intervalSecs),
7340 TOJSON_IMPL(enabled),
7341 TOJSON_IMPL(includeMemoryDetail),
7342 TOJSON_IMPL(includeTaskQueueDetail),
7343 TOJSON_IMPL(runCmd)
7344 };
7345 }
7346 static void from_json(const nlohmann::json& j, EngineStatusReportConfiguration& p)
7347 {
7348 p.clear();
7349 getOptional<std::string>("fileName", p.fileName, j);
7350 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
7351 getOptional<bool>("enabled", p.enabled, j, false);
7352 getOptional<std::string>("runCmd", p.runCmd, j);
7353 getOptional<bool>("includeMemoryDetail", p.includeMemoryDetail, j, false);
7354 getOptional<bool>("includeTaskQueueDetail", p.includeTaskQueueDetail, j, false);
7355 }
7356
7357 //-----------------------------------------------------------
7358 JSON_SERIALIZED_CLASS(EnginePolicy)
7371 {
7372 IMPLEMENT_JSON_SERIALIZATION()
7373 IMPLEMENT_JSON_DOCUMENTATION(EnginePolicy)
7374
7375 public:
7376
7378 std::string dataDirectory;
7379
7382
7385
7388
7391
7394
7397
7400
7403
7406
7409
7412
7414 std::vector<ExternalModule> externalCodecs;
7415
7417 std::vector<RtpMapEntry> rtpMap;
7418
7421
7422 EnginePolicy()
7423 {
7424 clear();
7425 }
7426
7427 void clear()
7428 {
7429 dataDirectory.clear();
7430 licensing.clear();
7431 security.clear();
7432 networking.clear();
7433 audio.clear();
7434 discovery.clear();
7435 logging.clear();
7436 internals.clear();
7437 timelines.clear();
7438 database.clear();
7439 featureset.clear();
7440 namedAudioDevices.clear();
7441 externalCodecs.clear();
7442 rtpMap.clear();
7443 statusReport.clear();
7444 }
7445 };
7446
7447 static void to_json(nlohmann::json& j, const EnginePolicy& p)
7448 {
7449 j = nlohmann::json{
7450 TOJSON_IMPL(dataDirectory),
7451 TOJSON_IMPL(licensing),
7452 TOJSON_IMPL(security),
7453 TOJSON_IMPL(networking),
7454 TOJSON_IMPL(audio),
7455 TOJSON_IMPL(discovery),
7456 TOJSON_IMPL(logging),
7457 TOJSON_IMPL(internals),
7458 TOJSON_IMPL(timelines),
7459 TOJSON_IMPL(database),
7460 TOJSON_IMPL(featureset),
7461 TOJSON_IMPL(namedAudioDevices),
7462 TOJSON_IMPL(externalCodecs),
7463 TOJSON_IMPL(rtpMap),
7464 TOJSON_IMPL(statusReport)
7465 };
7466 }
7467 static void from_json(const nlohmann::json& j, EnginePolicy& p)
7468 {
7469 p.clear();
7470 FROMJSON_IMPL_SIMPLE(dataDirectory);
7471 FROMJSON_IMPL_SIMPLE(licensing);
7472 FROMJSON_IMPL_SIMPLE(security);
7473 FROMJSON_IMPL_SIMPLE(networking);
7474 FROMJSON_IMPL_SIMPLE(audio);
7475 FROMJSON_IMPL_SIMPLE(discovery);
7476 FROMJSON_IMPL_SIMPLE(logging);
7477 FROMJSON_IMPL_SIMPLE(internals);
7478 FROMJSON_IMPL_SIMPLE(timelines);
7479 FROMJSON_IMPL_SIMPLE(database);
7480 FROMJSON_IMPL_SIMPLE(featureset);
7481 FROMJSON_IMPL_SIMPLE(namedAudioDevices);
7482 FROMJSON_IMPL_SIMPLE(externalCodecs);
7483 FROMJSON_IMPL_SIMPLE(rtpMap);
7484 FROMJSON_IMPL_SIMPLE(statusReport);
7485 }
7486
7487
7488 //-----------------------------------------------------------
7489 JSON_SERIALIZED_CLASS(TalkgroupAsset)
7500 {
7501 IMPLEMENT_JSON_SERIALIZATION()
7502 IMPLEMENT_JSON_DOCUMENTATION(TalkgroupAsset)
7503
7504 public:
7505
7507 std::string nodeId;
7508
7511
7513 {
7514 clear();
7515 }
7516
7517 void clear()
7518 {
7519 nodeId.clear();
7520 group.clear();
7521 }
7522 };
7523
7524 static void to_json(nlohmann::json& j, const TalkgroupAsset& p)
7525 {
7526 j = nlohmann::json{
7527 TOJSON_IMPL(nodeId),
7528 TOJSON_IMPL(group)
7529 };
7530 }
7531 static void from_json(const nlohmann::json& j, TalkgroupAsset& p)
7532 {
7533 p.clear();
7534 getOptional<std::string>("nodeId", p.nodeId, j);
7535 getOptional<Group>("group", p.group, j);
7536 }
7537
7538 //-----------------------------------------------------------
7539 JSON_SERIALIZED_CLASS(EngageDiscoveredGroup)
7548 {
7549 IMPLEMENT_JSON_SERIALIZATION()
7550 IMPLEMENT_JSON_DOCUMENTATION(EngageDiscoveredGroup)
7551
7552 public:
7554 std::string id;
7555
7557 int type;
7558
7561
7564
7566 {
7567 clear();
7568 }
7569
7570 void clear()
7571 {
7572 id.clear();
7573 type = 0;
7574 rx.clear();
7575 tx.clear();
7576 }
7577 };
7578
7579 static void to_json(nlohmann::json& j, const EngageDiscoveredGroup& p)
7580 {
7581 j = nlohmann::json{
7582 TOJSON_IMPL(id),
7583 TOJSON_IMPL(type),
7584 TOJSON_IMPL(rx),
7585 TOJSON_IMPL(tx)
7586 };
7587 }
7588 static void from_json(const nlohmann::json& j, EngageDiscoveredGroup& p)
7589 {
7590 p.clear();
7591 getOptional<std::string>("id", p.id, j);
7592 getOptional<int>("type", p.type, j, 0);
7593 getOptional<NetworkAddress>("rx", p.rx, j);
7594 getOptional<NetworkAddress>("tx", p.tx, j);
7595 }
7596
7597 //-----------------------------------------------------------
7598 JSON_SERIALIZED_CLASS(RallypointPeer)
7609 {
7610 IMPLEMENT_JSON_SERIALIZATION()
7611 IMPLEMENT_JSON_DOCUMENTATION(RallypointPeer)
7612
7613 public:
7615 std::string id;
7616
7619
7622
7625
7628
7631
7633 {
7634 clear();
7635 }
7636
7637 void clear()
7638 {
7639 id.clear();
7640 enabled = true;
7641 host.clear();
7642 certificate.clear();
7643 connectionTimeoutSecs = 0;
7644 forceIsMeshLeaf = false;
7645 }
7646 };
7647
7648 static void to_json(nlohmann::json& j, const RallypointPeer& p)
7649 {
7650 j = nlohmann::json{
7651 TOJSON_IMPL(id),
7652 TOJSON_IMPL(enabled),
7653 TOJSON_IMPL(host),
7654 TOJSON_IMPL(certificate),
7655 TOJSON_IMPL(connectionTimeoutSecs),
7656 TOJSON_IMPL(forceIsMeshLeaf)
7657 };
7658 }
7659 static void from_json(const nlohmann::json& j, RallypointPeer& p)
7660 {
7661 p.clear();
7662 j.at("id").get_to(p.id);
7663 getOptional<bool>("enabled", p.enabled, j, true);
7664 getOptional<NetworkAddress>("host", p.host, j);
7665 getOptional<SecurityCertificate>("certificate", p.certificate, j);
7666 getOptional<int>("connectionTimeoutSecs", p.connectionTimeoutSecs, j, 0);
7667 getOptional<bool>("forceIsMeshLeaf", p.forceIsMeshLeaf, j, false);
7668 }
7669
7670 //-----------------------------------------------------------
7671 JSON_SERIALIZED_CLASS(RallypointServerLimits)
7682 {
7683 IMPLEMENT_JSON_SERIALIZATION()
7684 IMPLEMENT_JSON_DOCUMENTATION(RallypointServerLimits)
7685
7686 public:
7688 uint32_t maxClients;
7689
7691 uint32_t maxPeers;
7692
7695
7698
7701
7704
7707
7710
7713
7716
7719
7722
7725
7728
7731
7733 {
7734 clear();
7735 }
7736
7737 void clear()
7738 {
7739 maxClients = 0;
7740 maxPeers = 0;
7741 maxMulticastReflectors = 0;
7742 maxRegisteredStreams = 0;
7743 maxStreamPaths = 0;
7744 maxRxPacketsPerSec = 0;
7745 maxTxPacketsPerSec = 0;
7746 maxRxBytesPerSec = 0;
7747 maxTxBytesPerSec = 0;
7748 maxQOpsPerSec = 0;
7749 maxInboundBacklog = 64;
7750 lowPriorityQueueThreshold = 64;
7751 normalPriorityQueueThreshold = 256;
7752 denyNewConnectionCpuThreshold = 75;
7753 warnAtCpuThreshold = 65;
7754 }
7755 };
7756
7757 static void to_json(nlohmann::json& j, const RallypointServerLimits& p)
7758 {
7759 j = nlohmann::json{
7760 TOJSON_IMPL(maxClients),
7761 TOJSON_IMPL(maxPeers),
7762 TOJSON_IMPL(maxMulticastReflectors),
7763 TOJSON_IMPL(maxRegisteredStreams),
7764 TOJSON_IMPL(maxStreamPaths),
7765 TOJSON_IMPL(maxRxPacketsPerSec),
7766 TOJSON_IMPL(maxTxPacketsPerSec),
7767 TOJSON_IMPL(maxRxBytesPerSec),
7768 TOJSON_IMPL(maxTxBytesPerSec),
7769 TOJSON_IMPL(maxQOpsPerSec),
7770 TOJSON_IMPL(maxInboundBacklog),
7771 TOJSON_IMPL(lowPriorityQueueThreshold),
7772 TOJSON_IMPL(normalPriorityQueueThreshold),
7773 TOJSON_IMPL(denyNewConnectionCpuThreshold),
7774 TOJSON_IMPL(warnAtCpuThreshold)
7775 };
7776 }
7777 static void from_json(const nlohmann::json& j, RallypointServerLimits& p)
7778 {
7779 p.clear();
7780 getOptional<uint32_t>("maxClients", p.maxClients, j, 0);
7781 getOptional<uint32_t>("maxPeers", p.maxPeers, j, 0);
7782 getOptional<uint32_t>("maxMulticastReflectors", p.maxMulticastReflectors, j, 0);
7783 getOptional<uint32_t>("maxRegisteredStreams", p.maxRegisteredStreams, j, 0);
7784 getOptional<uint32_t>("maxStreamPaths", p.maxStreamPaths, j, 0);
7785 getOptional<uint32_t>("maxRxPacketsPerSec", p.maxRxPacketsPerSec, j, 0);
7786 getOptional<uint32_t>("maxTxPacketsPerSec", p.maxTxPacketsPerSec, j, 0);
7787 getOptional<uint32_t>("maxRxBytesPerSec", p.maxRxBytesPerSec, j, 0);
7788 getOptional<uint32_t>("maxTxBytesPerSec", p.maxTxBytesPerSec, j, 0);
7789 getOptional<uint32_t>("maxQOpsPerSec", p.maxQOpsPerSec, j, 0);
7790 getOptional<uint32_t>("maxInboundBacklog", p.maxInboundBacklog, j, 64);
7791 getOptional<uint32_t>("lowPriorityQueueThreshold", p.lowPriorityQueueThreshold, j, 64);
7792 getOptional<uint32_t>("normalPriorityQueueThreshold", p.normalPriorityQueueThreshold, j, 256);
7793 getOptional<uint32_t>("denyNewConnectionCpuThreshold", p.denyNewConnectionCpuThreshold, j, 75);
7794 getOptional<uint32_t>("warnAtCpuThreshold", p.warnAtCpuThreshold, j, 65);
7795 }
7796
7797 //-----------------------------------------------------------
7798 JSON_SERIALIZED_CLASS(RallypointServerStatusReportConfiguration)
7809 {
7810 IMPLEMENT_JSON_SERIALIZATION()
7811 IMPLEMENT_JSON_DOCUMENTATION(RallypointServerStatusReportConfiguration)
7812
7813 public:
7815 std::string fileName;
7816
7819
7822
7825
7828
7831
7833 std::string runCmd;
7834
7836 {
7837 clear();
7838 }
7839
7840 void clear()
7841 {
7842 fileName.clear();
7843 intervalSecs = 60;
7844 enabled = false;
7845 includeLinks = false;
7846 includePeerLinkDetails = false;
7847 includeClientLinkDetails = false;
7848 runCmd.clear();
7849 }
7850 };
7851
7852 static void to_json(nlohmann::json& j, const RallypointServerStatusReportConfiguration& p)
7853 {
7854 j = nlohmann::json{
7855 TOJSON_IMPL(fileName),
7856 TOJSON_IMPL(intervalSecs),
7857 TOJSON_IMPL(enabled),
7858 TOJSON_IMPL(includeLinks),
7859 TOJSON_IMPL(includePeerLinkDetails),
7860 TOJSON_IMPL(includeClientLinkDetails),
7861 TOJSON_IMPL(runCmd)
7862 };
7863 }
7864 static void from_json(const nlohmann::json& j, RallypointServerStatusReportConfiguration& p)
7865 {
7866 p.clear();
7867 getOptional<std::string>("fileName", p.fileName, j);
7868 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
7869 getOptional<bool>("enabled", p.enabled, j, false);
7870 getOptional<bool>("includeLinks", p.includeLinks, j, false);
7871 getOptional<bool>("includePeerLinkDetails", p.includePeerLinkDetails, j, false);
7872 getOptional<bool>("includeClientLinkDetails", p.includeClientLinkDetails, j, false);
7873 getOptional<std::string>("runCmd", p.runCmd, j);
7874 }
7875
7876 //-----------------------------------------------------------
7877 JSON_SERIALIZED_CLASS(RallypointServerLinkGraph)
7879 {
7880 IMPLEMENT_JSON_SERIALIZATION()
7881 IMPLEMENT_JSON_DOCUMENTATION(RallypointServerLinkGraph)
7882
7883 public:
7885 std::string fileName;
7886
7889
7892
7895
7900
7902 std::string coreRpStyling;
7903
7905 std::string leafRpStyling;
7906
7908 std::string clientStyling;
7909
7911 std::string runCmd;
7912
7914 {
7915 clear();
7916 }
7917
7918 void clear()
7919 {
7920 fileName.clear();
7921 minRefreshSecs = 5;
7922 enabled = false;
7923 includeDigraphEnclosure = true;
7924 includeClients = false;
7925 coreRpStyling = "[shape=hexagon color=firebrick style=filled]";
7926 leafRpStyling = "[shape=box color=gray style=filled]";
7927 clientStyling.clear();
7928 runCmd.clear();
7929 }
7930 };
7931
7932 static void to_json(nlohmann::json& j, const RallypointServerLinkGraph& p)
7933 {
7934 j = nlohmann::json{
7935 TOJSON_IMPL(fileName),
7936 TOJSON_IMPL(minRefreshSecs),
7937 TOJSON_IMPL(enabled),
7938 TOJSON_IMPL(includeDigraphEnclosure),
7939 TOJSON_IMPL(includeClients),
7940 TOJSON_IMPL(coreRpStyling),
7941 TOJSON_IMPL(leafRpStyling),
7942 TOJSON_IMPL(clientStyling),
7943 TOJSON_IMPL(runCmd)
7944 };
7945 }
7946 static void from_json(const nlohmann::json& j, RallypointServerLinkGraph& p)
7947 {
7948 p.clear();
7949 getOptional<std::string>("fileName", p.fileName, j);
7950 getOptional<int>("minRefreshSecs", p.minRefreshSecs, j, 5);
7951 getOptional<bool>("enabled", p.enabled, j, false);
7952 getOptional<bool>("includeDigraphEnclosure", p.includeDigraphEnclosure, j, true);
7953 getOptional<bool>("includeClients", p.includeClients, j, false);
7954 getOptional<std::string>("coreRpStyling", p.coreRpStyling, j, "[shape=hexagon color=firebrick style=filled]");
7955 getOptional<std::string>("leafRpStyling", p.leafRpStyling, j, "[shape=box color=gray style=filled]");
7956 getOptional<std::string>("clientStyling", p.clientStyling, j);
7957 getOptional<std::string>("runCmd", p.runCmd, j);
7958 }
7959
7960
7961 //-----------------------------------------------------------
7962 JSON_SERIALIZED_CLASS(RallypointServerRouteMap)
7964 {
7965 IMPLEMENT_JSON_SERIALIZATION()
7966 IMPLEMENT_JSON_DOCUMENTATION(RallypointServerRouteMap)
7967
7968 public:
7970 std::string fileName;
7971
7974
7977
7979 std::string runCmd;
7980
7982 {
7983 clear();
7984 }
7985
7986 void clear()
7987 {
7988 fileName.clear();
7989 minRefreshSecs = 5;
7990 enabled = false;
7991 }
7992 };
7993
7994 static void to_json(nlohmann::json& j, const RallypointServerRouteMap& p)
7995 {
7996 j = nlohmann::json{
7997 TOJSON_IMPL(fileName),
7998 TOJSON_IMPL(minRefreshSecs),
7999 TOJSON_IMPL(enabled),
8000 TOJSON_IMPL(runCmd)
8001 };
8002 }
8003 static void from_json(const nlohmann::json& j, RallypointServerRouteMap& p)
8004 {
8005 p.clear();
8006 getOptional<std::string>("fileName", p.fileName, j);
8007 getOptional<int>("minRefreshSecs", p.minRefreshSecs, j, 5);
8008 getOptional<bool>("enabled", p.enabled, j, false);
8009 getOptional<std::string>("runCmd", p.runCmd, j);
8010 }
8011
8012
8013 //-----------------------------------------------------------
8014 JSON_SERIALIZED_CLASS(ExternalHealthCheckResponder)
8025 {
8026 IMPLEMENT_JSON_SERIALIZATION()
8027 IMPLEMENT_JSON_DOCUMENTATION(ExternalHealthCheckResponder)
8028
8029 public:
8030
8033
8036
8038 {
8039 clear();
8040 }
8041
8042 void clear()
8043 {
8044 listenPort = 0;
8045 immediateClose = true;
8046 }
8047 };
8048
8049 static void to_json(nlohmann::json& j, const ExternalHealthCheckResponder& p)
8050 {
8051 j = nlohmann::json{
8052 TOJSON_IMPL(listenPort),
8053 TOJSON_IMPL(immediateClose)
8054 };
8055 }
8056 static void from_json(const nlohmann::json& j, ExternalHealthCheckResponder& p)
8057 {
8058 p.clear();
8059 getOptional<int>("listenPort", p.listenPort, j, 0);
8060 getOptional<bool>("immediateClose", p.immediateClose, j, true);
8061 }
8062
8063
8064 //-----------------------------------------------------------
8065 JSON_SERIALIZED_CLASS(PeeringConfiguration)
8074 {
8075 IMPLEMENT_JSON_SERIALIZATION()
8076 IMPLEMENT_JSON_DOCUMENTATION(PeeringConfiguration)
8077
8078 public:
8079
8081 std::string id;
8082
8085
8087 std::string comments;
8088
8090 std::vector<RallypointPeer> peers;
8091
8093 {
8094 clear();
8095 }
8096
8097 void clear()
8098 {
8099 id.clear();
8100 version = 0;
8101 comments.clear();
8102 }
8103 };
8104
8105 static void to_json(nlohmann::json& j, const PeeringConfiguration& p)
8106 {
8107 j = nlohmann::json{
8108 TOJSON_IMPL(id),
8109 TOJSON_IMPL(version),
8110 TOJSON_IMPL(comments),
8111 TOJSON_IMPL(peers)
8112 };
8113 }
8114 static void from_json(const nlohmann::json& j, PeeringConfiguration& p)
8115 {
8116 p.clear();
8117 getOptional<std::string>("id", p.id, j);
8118 getOptional<int>("version", p.version, j, 0);
8119 getOptional<std::string>("comments", p.comments, j);
8120 getOptional<std::vector<RallypointPeer>>("peers", p.peers, j);
8121 }
8122
8123 //-----------------------------------------------------------
8124 JSON_SERIALIZED_CLASS(IgmpSnooping)
8133 {
8134 IMPLEMENT_JSON_SERIALIZATION()
8135 IMPLEMENT_JSON_DOCUMENTATION(IgmpSnooping)
8136
8137 public:
8138
8141
8144
8147
8148
8149 IgmpSnooping()
8150 {
8151 clear();
8152 }
8153
8154 void clear()
8155 {
8156 enabled = false;
8157 queryIntervalMs = 125000;
8158 subscriptionTimeoutMs = 0;
8159 }
8160 };
8161
8162 static void to_json(nlohmann::json& j, const IgmpSnooping& p)
8163 {
8164 j = nlohmann::json{
8165 TOJSON_IMPL(enabled),
8166 TOJSON_IMPL(queryIntervalMs),
8167 TOJSON_IMPL(subscriptionTimeoutMs)
8168 };
8169 }
8170 static void from_json(const nlohmann::json& j, IgmpSnooping& p)
8171 {
8172 p.clear();
8173 getOptional<bool>("enabled", p.enabled, j);
8174 getOptional<int>("queryIntervalMs", p.queryIntervalMs, j, 125000);
8175 getOptional<int>("subscriptionTimeoutMs", p.subscriptionTimeoutMs, j, 0);
8176 }
8177
8178
8179 //-----------------------------------------------------------
8180 JSON_SERIALIZED_CLASS(RallypointReflector)
8188 {
8189 IMPLEMENT_JSON_SERIALIZATION()
8190 IMPLEMENT_JSON_DOCUMENTATION(RallypointReflector)
8191
8192 public:
8194 typedef enum
8195 {
8197 drNone = 0,
8198
8200 drRxOnly = 1,
8201
8203 drTxOnly = 2
8204 } DirectionRestriction_t;
8205
8209 std::string id;
8210
8213
8216
8219
8221 std::vector<NetworkAddress> additionalTx;
8222
8225
8227 {
8228 clear();
8229 }
8230
8231 void clear()
8232 {
8233 id.clear();
8234 rx.clear();
8235 tx.clear();
8236 multicastInterfaceName.clear();
8237 additionalTx.clear();
8238 directionRestriction = drNone;
8239 }
8240 };
8241
8242 static void to_json(nlohmann::json& j, const RallypointReflector& p)
8243 {
8244 j = nlohmann::json{
8245 TOJSON_IMPL(id),
8246 TOJSON_IMPL(rx),
8247 TOJSON_IMPL(tx),
8248 TOJSON_IMPL(multicastInterfaceName),
8249 TOJSON_IMPL(additionalTx),
8250 TOJSON_IMPL(directionRestriction)
8251 };
8252 }
8253 static void from_json(const nlohmann::json& j, RallypointReflector& p)
8254 {
8255 p.clear();
8256 j.at("id").get_to(p.id);
8257 j.at("rx").get_to(p.rx);
8258 j.at("tx").get_to(p.tx);
8259 getOptional<std::string>("multicastInterfaceName", p.multicastInterfaceName, j);
8260 getOptional<std::vector<NetworkAddress>>("additionalTx", p.additionalTx, j);
8261 getOptional<RallypointReflector::DirectionRestriction_t>("directionRestriction", p.directionRestriction, j, RallypointReflector::DirectionRestriction_t::drNone);
8262 }
8263
8264
8265 //-----------------------------------------------------------
8266 JSON_SERIALIZED_CLASS(RallypointUdpStreamingIpvX)
8274 {
8275 IMPLEMENT_JSON_SERIALIZATION()
8276 IMPLEMENT_JSON_DOCUMENTATION(RallypointUdpStreamingIpvX)
8277
8278 public:
8281
8284
8286 {
8287 clear();
8288 }
8289
8290 void clear()
8291 {
8292 enabled = true;
8293 external.clear();
8294 }
8295 };
8296
8297 static void to_json(nlohmann::json& j, const RallypointUdpStreamingIpvX& p)
8298 {
8299 j = nlohmann::json{
8300 TOJSON_IMPL(enabled),
8301 TOJSON_IMPL(external)
8302 };
8303 }
8304 static void from_json(const nlohmann::json& j, RallypointUdpStreamingIpvX& p)
8305 {
8306 p.clear();
8307 getOptional<bool>("enabled", p.enabled, j, true);
8308 getOptional<NetworkAddress>("external", p.external, j);
8309 }
8310
8311 //-----------------------------------------------------------
8312 JSON_SERIALIZED_CLASS(RallypointUdpStreaming)
8320 {
8321 IMPLEMENT_JSON_SERIALIZATION()
8322 IMPLEMENT_JSON_DOCUMENTATION(RallypointUdpStreaming)
8323
8324 public:
8326 typedef enum
8327 {
8329 ctUnknown = 0,
8330
8332 ctSharedKeyAes256FullIv = 1,
8333
8335 ctSharedKeyAes256IdxIv = 2,
8336
8338 ctSharedKeyChaCha20FullIv = 3,
8339
8341 ctSharedKeyChaCha20IdxIv = 4
8342 } CryptoType_t;
8343
8346
8349
8352
8355
8358
8361
8364
8366 int ttl;
8367
8368
8370 {
8371 clear();
8372 }
8373
8374 void clear()
8375 {
8376 enabled = true;
8377 cryptoType = CryptoType_t::ctSharedKeyAes256FullIv;
8378 listenPort = 7444;
8379 ipv4.clear();
8380 ipv6.clear();
8381 keepaliveIntervalSecs = 15;
8382 priority = TxPriority_t::priVoice;
8383 ttl = 64;
8384 }
8385 };
8386
8387 static void to_json(nlohmann::json& j, const RallypointUdpStreaming& p)
8388 {
8389 j = nlohmann::json{
8390 TOJSON_IMPL(enabled),
8391 TOJSON_IMPL(cryptoType),
8392 TOJSON_IMPL(listenPort),
8393 TOJSON_IMPL(keepaliveIntervalSecs),
8394 TOJSON_IMPL(ipv4),
8395 TOJSON_IMPL(ipv6),
8396 TOJSON_IMPL(priority),
8397 TOJSON_IMPL(ttl)
8398 };
8399 }
8400 static void from_json(const nlohmann::json& j, RallypointUdpStreaming& p)
8401 {
8402 p.clear();
8403 getOptional<bool>("enabled", p.enabled, j, true);
8404 getOptional<RallypointUdpStreaming::CryptoType_t>("cryptoType", p.cryptoType, j, RallypointUdpStreaming::CryptoType_t::ctSharedKeyAes256FullIv);
8405 getOptional<int>("listenPort", p.listenPort, j, 7444);
8406 getOptional<int>("keepaliveIntervalSecs", p.keepaliveIntervalSecs, j, 15);
8407 getOptional<RallypointUdpStreamingIpvX>("ipv4", p.ipv4, j);
8408 getOptional<RallypointUdpStreamingIpvX>("ipv6", p.ipv6, j);
8409 getOptional<TxPriority_t>("priority", p.priority, j, TxPriority_t::priVoice);
8410 getOptional<int>("ttl", p.ttl, j, 64);
8411 }
8412
8413 //-----------------------------------------------------------
8414 JSON_SERIALIZED_CLASS(RallypointRpRtTimingBehavior)
8422 {
8423 IMPLEMENT_JSON_SERIALIZATION()
8424 IMPLEMENT_JSON_DOCUMENTATION(RallypointRpRtTimingBehavior)
8425
8426 public:
8428 typedef enum
8429 {
8432
8435
8438
8441
8443 btDrop = 99
8444 } BehaviorType_t;
8445
8448
8450 uint32_t atOrAboveMs;
8451
8453 std::string runCmd;
8454
8456 {
8457 clear();
8458 }
8459
8460 void clear()
8461 {
8462 behavior = btNone;
8463 atOrAboveMs = 0;
8464 runCmd.clear();
8465 }
8466 };
8467
8468 static void to_json(nlohmann::json& j, const RallypointRpRtTimingBehavior& p)
8469 {
8470 j = nlohmann::json{
8471 TOJSON_IMPL(behavior),
8472 TOJSON_IMPL(atOrAboveMs),
8473 TOJSON_IMPL(runCmd)
8474 };
8475 }
8476 static void from_json(const nlohmann::json& j, RallypointRpRtTimingBehavior& p)
8477 {
8478 p.clear();
8479 getOptional<RallypointRpRtTimingBehavior::BehaviorType_t>("behavior", p.behavior, j, RallypointRpRtTimingBehavior::BehaviorType_t::btNone);
8480 getOptional<uint32_t>("atOrAboveMs", p.atOrAboveMs, j, 0);
8481 getOptional<std::string>("runCmd", p.runCmd, j);
8482 }
8483
8484
8485 //-----------------------------------------------------------
8486 JSON_SERIALIZED_CLASS(RallypointWebsocketSettings)
8494 {
8495 IMPLEMENT_JSON_SERIALIZATION()
8496 IMPLEMENT_JSON_DOCUMENTATION(RallypointWebsocketSettings)
8497
8498 public:
8501
8504
8507
8510
8512 {
8513 clear();
8514 }
8515
8516 void clear()
8517 {
8518 enabled = false;
8519 listenPort = 8443;
8520 certificate.clear();
8521 requireClientCertificate = false;
8522 }
8523 };
8524
8525 static void to_json(nlohmann::json& j, const RallypointWebsocketSettings& p)
8526 {
8527 j = nlohmann::json{
8528 TOJSON_IMPL(enabled),
8529 TOJSON_IMPL(listenPort),
8530 TOJSON_IMPL(certificate),
8531 TOJSON_IMPL(requireClientCertificate)
8532 };
8533 }
8534 static void from_json(const nlohmann::json& j, RallypointWebsocketSettings& p)
8535 {
8536 p.clear();
8537 getOptional<bool>("enabled", p.enabled, j, false);
8538 getOptional<int>("listenPort", p.listenPort, j, 8443);
8539 getOptional<SecurityCertificate>("certificate", p.certificate, j);
8540 getOptional<bool>("requireClientCertificate", p.requireClientCertificate, j, false);
8541 }
8542
8543
8544
8545 //-----------------------------------------------------------
8546 JSON_SERIALIZED_CLASS(RallypointAdvertisingSettings)
8554 {
8555 IMPLEMENT_JSON_SERIALIZATION()
8556 IMPLEMENT_JSON_DOCUMENTATION(RallypointAdvertisingSettings)
8557
8558 public:
8561
8563 std::string hostName;
8564
8566 std::string serviceName;
8567
8569 std::string interfaceName;
8570
8572 int port;
8573
8575 int ttl;
8576
8578 {
8579 clear();
8580 }
8581
8582 void clear()
8583 {
8584 enabled = false;
8585 hostName.clear();
8586 serviceName = "_rallypoint._tcp.local.";
8587 interfaceName.clear();
8588 port = 0;
8589 ttl = 60;
8590 }
8591 };
8592
8593 static void to_json(nlohmann::json& j, const RallypointAdvertisingSettings& p)
8594 {
8595 j = nlohmann::json{
8596 TOJSON_IMPL(enabled),
8597 TOJSON_IMPL(hostName),
8598 TOJSON_IMPL(serviceName),
8599 TOJSON_IMPL(interfaceName),
8600 TOJSON_IMPL(port),
8601 TOJSON_IMPL(ttl)
8602 };
8603 }
8604 static void from_json(const nlohmann::json& j, RallypointAdvertisingSettings& p)
8605 {
8606 p.clear();
8607 getOptional<bool>("enabled", p.enabled, j, false);
8608 getOptional<std::string>("hostName", p.hostName, j);
8609 getOptional<std::string>("serviceName", p.serviceName, j, "_rallypoint._tcp.local.");
8610 getOptional<std::string>("interfaceName", p.interfaceName, j);
8611
8612 getOptional<int>("port", p.port, j, 0);
8613 getOptional<int>("ttl", p.ttl, j, 60);
8614 }
8615
8616
8617 //-----------------------------------------------------------
8618 JSON_SERIALIZED_CLASS(RallypointExtendedGroupRestriction)
8626 {
8627 IMPLEMENT_JSON_SERIALIZATION()
8628 IMPLEMENT_JSON_DOCUMENTATION(RallypointExtendedGroupRestriction)
8629
8630 public:
8632 std::string id;
8633
8635 std::vector<StringRestrictionList> restrictions;
8636
8638 {
8639 clear();
8640 }
8641
8642 void clear()
8643 {
8644 id.clear();
8645 restrictions.clear();
8646 }
8647 };
8648
8649 static void to_json(nlohmann::json& j, const RallypointExtendedGroupRestriction& p)
8650 {
8651 j = nlohmann::json{
8652 TOJSON_IMPL(id),
8653 TOJSON_IMPL(restrictions)
8654 };
8655 }
8656 static void from_json(const nlohmann::json& j, RallypointExtendedGroupRestriction& p)
8657 {
8658 p.clear();
8659 getOptional<std::string>("id", p.id, j);
8660 getOptional<std::vector<StringRestrictionList>>("restrictions", p.restrictions, j);
8661 }
8662
8663
8664 //-----------------------------------------------------------
8665 JSON_SERIALIZED_CLASS(RallypointServer)
8675 {
8676 IMPLEMENT_JSON_SERIALIZATION()
8677 IMPLEMENT_JSON_DOCUMENTATION(RallypointServer)
8678
8679 public:
8682
8685
8687 std::string id;
8688
8691
8694
8696 std::string interfaceName;
8697
8700
8703
8706
8709
8712
8715
8718
8721
8724
8727
8730
8733
8736
8739
8742
8745
8747 PeeringConfiguration peeringConfiguration; // NOTE: This is NOT serialized
8748
8751
8754
8757
8760
8762 std::vector<RallypointReflector> staticReflectors;
8763
8766
8769
8772
8775
8778
8781
8783 std::vector<RallypointExtendedGroupRestriction> extendedGroupRestrictions;
8784
8787
8790
8793
8796
8798 uint32_t sysFlags;
8799
8802
8805
8808
8811
8814
8817
8820
8822 std::vector<RallypointRpRtTimingBehavior> peerRtBehaviors;
8823
8826
8829
8832
8835
8838
8840 std::string meshName;
8841
8843 std::vector<std::string> extraMeshes;
8844
8847
8849 {
8850 clear();
8851 }
8852
8853 void clear()
8854 {
8855 fipsCrypto.clear();
8856 watchdog.clear();
8857 id.clear();
8858 listenPort = 7443;
8859 interfaceName.clear();
8860 certificate.clear();
8861 allowMulticastForwarding = false;
8862 peeringConfiguration.clear();
8863 peeringConfigurationFileName.clear();
8864 peeringConfigurationFileCommand.clear();
8865 peeringConfigurationFileCheckSecs = 60;
8866 ioPools = -1;
8867 statusReport.clear();
8868 limits.clear();
8869 linkGraph.clear();
8870 externalHealthCheckResponder.clear();
8871 allowPeerForwarding = false;
8872 multicastInterfaceName.clear();
8873 tls.clear();
8874 discovery.clear();
8875 forwardDiscoveredGroups = false;
8876 forwardMulticastAddressing = false;
8877 isMeshLeaf = false;
8878 disableMessageSigning = false;
8879 multicastRestrictions.clear();
8880 igmpSnooping.clear();
8881 staticReflectors.clear();
8882 tcpTxOptions.clear();
8883 multicastTxOptions.clear();
8884 certStoreFileName.clear();
8885 certStorePasswordHex.clear();
8886 groupRestrictions.clear();
8887 configurationCheckSignalName = "rts.7b392d1.${id}";
8888 licensing.clear();
8889 featureset.clear();
8890 udpStreaming.clear();
8891 sysFlags = 0;
8892 normalTaskQueueBias = 0;
8893 enableLeafReflectionReverseSubscription = false;
8894 disableLoopDetection = false;
8895 maxSecurityLevel = 0;
8896 routeMap.clear();
8897 maxOutboundPeerConnectionIntervalDeltaSecs = 15;
8898 peerRtTestIntervalMs = 60000;
8899 peerRtBehaviors.clear();
8900 websocket.clear();
8901 nsm.clear();
8902 advertising.clear();
8903 extendedGroupRestrictions.clear();
8904 groupRestrictionAccessPolicyType = GroupRestrictionAccessPolicyType_t::graptPermissive;
8905 ipFamily = IpFamilyType_t::ifIpUnspec;
8906 rxCapture.clear();
8907 txCapture.clear();
8908 meshName.clear();
8909 extraMeshes.clear();
8910 tuning.clear();
8911 }
8912 };
8913
8914 static void to_json(nlohmann::json& j, const RallypointServer& p)
8915 {
8916 j = nlohmann::json{
8917 TOJSON_IMPL(fipsCrypto),
8918 TOJSON_IMPL(watchdog),
8919 TOJSON_IMPL(id),
8920 TOJSON_IMPL(listenPort),
8921 TOJSON_IMPL(interfaceName),
8922 TOJSON_IMPL(certificate),
8923 TOJSON_IMPL(allowMulticastForwarding),
8924 // TOJSON_IMPL(peeringConfiguration), // NOTE: Not serialized!
8925 TOJSON_IMPL(peeringConfigurationFileName),
8926 TOJSON_IMPL(peeringConfigurationFileCommand),
8927 TOJSON_IMPL(peeringConfigurationFileCheckSecs),
8928 TOJSON_IMPL(ioPools),
8929 TOJSON_IMPL(statusReport),
8930 TOJSON_IMPL(limits),
8931 TOJSON_IMPL(linkGraph),
8932 TOJSON_IMPL(externalHealthCheckResponder),
8933 TOJSON_IMPL(allowPeerForwarding),
8934 TOJSON_IMPL(multicastInterfaceName),
8935 TOJSON_IMPL(tls),
8936 TOJSON_IMPL(discovery),
8937 TOJSON_IMPL(forwardDiscoveredGroups),
8938 TOJSON_IMPL(forwardMulticastAddressing),
8939 TOJSON_IMPL(isMeshLeaf),
8940 TOJSON_IMPL(disableMessageSigning),
8941 TOJSON_IMPL(multicastRestrictions),
8942 TOJSON_IMPL(igmpSnooping),
8943 TOJSON_IMPL(staticReflectors),
8944 TOJSON_IMPL(tcpTxOptions),
8945 TOJSON_IMPL(multicastTxOptions),
8946 TOJSON_IMPL(certStoreFileName),
8947 TOJSON_IMPL(certStorePasswordHex),
8948 TOJSON_IMPL(groupRestrictions),
8949 TOJSON_IMPL(configurationCheckSignalName),
8950 TOJSON_IMPL(featureset),
8951 TOJSON_IMPL(licensing),
8952 TOJSON_IMPL(udpStreaming),
8953 TOJSON_IMPL(sysFlags),
8954 TOJSON_IMPL(normalTaskQueueBias),
8955 TOJSON_IMPL(enableLeafReflectionReverseSubscription),
8956 TOJSON_IMPL(disableLoopDetection),
8957 TOJSON_IMPL(maxSecurityLevel),
8958 TOJSON_IMPL(routeMap),
8959 TOJSON_IMPL(maxOutboundPeerConnectionIntervalDeltaSecs),
8960 TOJSON_IMPL(peerRtTestIntervalMs),
8961 TOJSON_IMPL(peerRtBehaviors),
8962 TOJSON_IMPL(websocket),
8963 TOJSON_IMPL(nsm),
8964 TOJSON_IMPL(advertising),
8965 TOJSON_IMPL(extendedGroupRestrictions),
8966 TOJSON_IMPL(groupRestrictionAccessPolicyType),
8967 TOJSON_IMPL(ipFamily),
8968 TOJSON_IMPL(rxCapture),
8969 TOJSON_IMPL(txCapture),
8970 TOJSON_IMPL(meshName),
8971 TOJSON_IMPL(extraMeshes),
8972 TOJSON_IMPL(tuning)
8973 };
8974 }
8975 static void from_json(const nlohmann::json& j, RallypointServer& p)
8976 {
8977 p.clear();
8978 getOptional<FipsCryptoSettings>("fipsCrypto", p.fipsCrypto, j);
8979 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
8980 getOptional<std::string>("id", p.id, j);
8981 getOptional<SecurityCertificate>("certificate", p.certificate, j);
8982 getOptional<std::string>("interfaceName", p.interfaceName, j);
8983 getOptional<int>("listenPort", p.listenPort, j, 7443);
8984 getOptional<bool>("allowMulticastForwarding", p.allowMulticastForwarding, j, false);
8985 //getOptional<PeeringConfiguration>("peeringConfiguration", p.peeringConfiguration, j); // NOTE: Not serialized!
8986 getOptional<std::string>("peeringConfigurationFileName", p.peeringConfigurationFileName, j);
8987 getOptional<std::string>("peeringConfigurationFileCommand", p.peeringConfigurationFileCommand, j);
8988 getOptional<int>("peeringConfigurationFileCheckSecs", p.peeringConfigurationFileCheckSecs, j, 60);
8989 getOptional<int>("ioPools", p.ioPools, j, -1);
8990 getOptional<RallypointServerStatusReportConfiguration>("statusReport", p.statusReport, j);
8991 getOptional<RallypointServerLimits>("limits", p.limits, j);
8992 getOptional<RallypointServerLinkGraph>("linkGraph", p.linkGraph, j);
8993 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
8994 getOptional<bool>("allowPeerForwarding", p.allowPeerForwarding, j, false);
8995 getOptional<std::string>("multicastInterfaceName", p.multicastInterfaceName, j);
8996 getOptional<Tls>("tls", p.tls, j);
8997 getOptional<DiscoveryConfiguration>("discovery", p.discovery, j);
8998 getOptional<bool>("forwardDiscoveredGroups", p.forwardDiscoveredGroups, j, false);
8999 getOptional<bool>("forwardMulticastAddressing", p.forwardMulticastAddressing, j, false);
9000 getOptional<bool>("isMeshLeaf", p.isMeshLeaf, j, false);
9001 getOptional<bool>("disableMessageSigning", p.disableMessageSigning, j, false);
9002 getOptional<NetworkAddressRestrictionList>("multicastRestrictions", p.multicastRestrictions, j);
9003 getOptional<IgmpSnooping>("igmpSnooping", p.igmpSnooping, j);
9004 getOptional<std::vector<RallypointReflector>>("staticReflectors", p.staticReflectors, j);
9005 getOptional<TcpNetworkTxOptions>("tcpTxOptions", p.tcpTxOptions, j);
9006 getOptional<NetworkTxOptions>("multicastTxOptions", p.multicastTxOptions, j);
9007 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
9008 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
9009 getOptional<StringRestrictionList>("groupRestrictions", p.groupRestrictions, j);
9010 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.7b392d1.${id}");
9011 getOptional<Licensing>("licensing", p.licensing, j);
9012 getOptional<Featureset>("featureset", p.featureset, j);
9013 getOptional<RallypointUdpStreaming>("udpStreaming", p.udpStreaming, j);
9014 getOptional<uint32_t>("sysFlags", p.sysFlags, j, 0);
9015 getOptional<uint32_t>("normalTaskQueueBias", p.normalTaskQueueBias, j, 0);
9016 getOptional<bool>("enableLeafReflectionReverseSubscription", p.enableLeafReflectionReverseSubscription, j, false);
9017 getOptional<bool>("disableLoopDetection", p.disableLoopDetection, j, false);
9018 getOptional<uint32_t>("maxSecurityLevel", p.maxSecurityLevel, j, 0);
9019 getOptional<RallypointServerRouteMap>("routeMap", p.routeMap, j);
9020 getOptional<uint32_t>("maxOutboundPeerConnectionIntervalDeltaSecs", p.maxOutboundPeerConnectionIntervalDeltaSecs, j, 15);
9021 getOptional<int>("peerRtTestIntervalMs", p.peerRtTestIntervalMs, j, 60000);
9022 getOptional<std::vector<RallypointRpRtTimingBehavior>>("peerRtBehaviors", p.peerRtBehaviors, j);
9023 getOptional<RallypointWebsocketSettings>("websocket", p.websocket, j);
9024 getOptional<NsmConfiguration>("nsm", p.nsm, j);
9025 getOptional<RallypointAdvertisingSettings>("advertising", p.advertising, j);
9026 getOptional<std::vector<RallypointExtendedGroupRestriction>>("extendedGroupRestrictions", p.extendedGroupRestrictions, j);
9027 getOptional<GroupRestrictionAccessPolicyType_t>("groupRestrictionAccessPolicyType", p.groupRestrictionAccessPolicyType, j, GroupRestrictionAccessPolicyType_t::graptPermissive);
9028 getOptional<IpFamilyType_t>("ipFamily", p.ipFamily, j, IpFamilyType_t::ifIpUnspec);
9029 getOptional<PacketCapturer>("rxCapture", p.rxCapture, j);
9030 getOptional<PacketCapturer>("txCapture", p.txCapture, j);
9031 getOptional<std::string>("meshName", p.meshName, j);
9032 getOptional<std::vector<std::string>>("extraMeshes", p.extraMeshes, j);
9033 getOptional<TuningSettings>("tuning", p.tuning, j);
9034 }
9035
9036 //-----------------------------------------------------------
9037 JSON_SERIALIZED_CLASS(PlatformDiscoveredService)
9048 {
9049 IMPLEMENT_JSON_SERIALIZATION()
9050 IMPLEMENT_JSON_DOCUMENTATION(PlatformDiscoveredService)
9051
9052 public:
9053
9055 std::string id;
9056
9058 std::string type;
9059
9061 std::string name;
9062
9065
9067 std::string uri;
9068
9071
9073 {
9074 clear();
9075 }
9076
9077 void clear()
9078 {
9079 id.clear();
9080 type.clear();
9081 name.clear();
9082 address.clear();
9083 uri.clear();
9084 configurationVersion = 0;
9085 }
9086 };
9087
9088 static void to_json(nlohmann::json& j, const PlatformDiscoveredService& p)
9089 {
9090 j = nlohmann::json{
9091 TOJSON_IMPL(id),
9092 TOJSON_IMPL(type),
9093 TOJSON_IMPL(name),
9094 TOJSON_IMPL(address),
9095 TOJSON_IMPL(uri),
9096 TOJSON_IMPL(configurationVersion)
9097 };
9098 }
9099 static void from_json(const nlohmann::json& j, PlatformDiscoveredService& p)
9100 {
9101 p.clear();
9102 getOptional<std::string>("id", p.id, j);
9103 getOptional<std::string>("type", p.type, j);
9104 getOptional<std::string>("name", p.name, j);
9105 getOptional<NetworkAddress>("address", p.address, j);
9106 getOptional<std::string>("uri", p.uri, j);
9107 getOptional<uint32_t>("configurationVersion", p.configurationVersion, j, 0);
9108 }
9109
9110
9111 //-----------------------------------------------------------
9113 {
9114 public:
9115 typedef enum
9116 {
9117 etUndefined = 0,
9118 etAudio = 1,
9119 etLocation = 2,
9120 etUser = 3
9121 } EventType_t;
9122
9123 typedef enum
9124 {
9125 dNone = 0,
9126 dInbound = 1,
9127 dOutbound = 2,
9128 dBoth = 3,
9129 dUndefined = 4,
9130 } Direction_t;
9131 };
9132
9133
9134 //-----------------------------------------------------------
9135 JSON_SERIALIZED_CLASS(TimelineQueryParameters)
9146 {
9147 IMPLEMENT_JSON_SERIALIZATION()
9148 IMPLEMENT_JSON_DOCUMENTATION(TimelineQueryParameters)
9149
9150 public:
9151
9154
9157
9160
9163
9166
9169
9172
9174 std::string onlyAlias;
9175
9177 std::string onlyNodeId;
9178
9181
9183 std::string sql;
9184
9186 {
9187 clear();
9188 }
9189
9190 void clear()
9191 {
9192 maxCount = 50;
9193 mostRecentFirst = true;
9194 startedOnOrAfter = 0;
9195 endedOnOrBefore = 0;
9196 onlyDirection = 0;
9197 onlyType = 0;
9198 onlyCommitted = true;
9199 onlyAlias.clear();
9200 onlyNodeId.clear();
9201 sql.clear();
9202 onlyTxId = 0;
9203 }
9204 };
9205
9206 static void to_json(nlohmann::json& j, const TimelineQueryParameters& p)
9207 {
9208 j = nlohmann::json{
9209 TOJSON_IMPL(maxCount),
9210 TOJSON_IMPL(mostRecentFirst),
9211 TOJSON_IMPL(startedOnOrAfter),
9212 TOJSON_IMPL(endedOnOrBefore),
9213 TOJSON_IMPL(onlyDirection),
9214 TOJSON_IMPL(onlyType),
9215 TOJSON_IMPL(onlyCommitted),
9216 TOJSON_IMPL(onlyAlias),
9217 TOJSON_IMPL(onlyNodeId),
9218 TOJSON_IMPL(onlyTxId),
9219 TOJSON_IMPL(sql)
9220 };
9221 }
9222 static void from_json(const nlohmann::json& j, TimelineQueryParameters& p)
9223 {
9224 p.clear();
9225 getOptional<long>("maxCount", p.maxCount, j, 50);
9226 getOptional<bool>("mostRecentFirst", p.mostRecentFirst, j, false);
9227 getOptional<uint64_t>("startedOnOrAfter", p.startedOnOrAfter, j, 0);
9228 getOptional<uint64_t>("endedOnOrBefore", p.endedOnOrBefore, j, 0);
9229 getOptional<int>("onlyDirection", p.onlyDirection, j, 0);
9230 getOptional<int>("onlyType", p.onlyType, j, 0);
9231 getOptional<bool>("onlyCommitted", p.onlyCommitted, j, true);
9232 getOptional<std::string>("onlyAlias", p.onlyAlias, j, EMPTY_STRING);
9233 getOptional<std::string>("onlyNodeId", p.onlyNodeId, j, EMPTY_STRING);
9234 getOptional<int>("onlyTxId", p.onlyTxId, j, 0);
9235 getOptional<std::string>("sql", p.sql, j, EMPTY_STRING);
9236 }
9237
9238 //-----------------------------------------------------------
9239 JSON_SERIALIZED_CLASS(CertStoreCertificate)
9247 {
9248 IMPLEMENT_JSON_SERIALIZATION()
9249 IMPLEMENT_JSON_DOCUMENTATION(CertStoreCertificate)
9250
9251 public:
9253 std::string id;
9254
9256 std::string certificatePem;
9257
9259 std::string privateKeyPem;
9260
9263
9265 std::string tags;
9266
9268 {
9269 clear();
9270 }
9271
9272 void clear()
9273 {
9274 id.clear();
9275 certificatePem.clear();
9276 privateKeyPem.clear();
9277 internalData = nullptr;
9278 tags.clear();
9279 }
9280 };
9281
9282 static void to_json(nlohmann::json& j, const CertStoreCertificate& p)
9283 {
9284 j = nlohmann::json{
9285 TOJSON_IMPL(id),
9286 TOJSON_IMPL(certificatePem),
9287 TOJSON_IMPL(privateKeyPem),
9288 TOJSON_IMPL(tags)
9289 };
9290 }
9291 static void from_json(const nlohmann::json& j, CertStoreCertificate& p)
9292 {
9293 p.clear();
9294 j.at("id").get_to(p.id);
9295 j.at("certificatePem").get_to(p.certificatePem);
9296 getOptional<std::string>("privateKeyPem", p.privateKeyPem, j, EMPTY_STRING);
9297 getOptional<std::string>("tags", p.tags, j, EMPTY_STRING);
9298 }
9299
9300 //-----------------------------------------------------------
9301 JSON_SERIALIZED_CLASS(CertStore)
9309 {
9310 IMPLEMENT_JSON_SERIALIZATION()
9311 IMPLEMENT_JSON_DOCUMENTATION(CertStore)
9312
9313 public:
9315 std::string id;
9316
9318 std::vector<CertStoreCertificate> certificates;
9319
9321 std::vector<KvPair> kvp;
9322
9323 CertStore()
9324 {
9325 clear();
9326 }
9327
9328 void clear()
9329 {
9330 id.clear();
9331 certificates.clear();
9332 kvp.clear();
9333 }
9334 };
9335
9336 static void to_json(nlohmann::json& j, const CertStore& p)
9337 {
9338 j = nlohmann::json{
9339 TOJSON_IMPL(id),
9340 TOJSON_IMPL(certificates),
9341 TOJSON_IMPL(kvp)
9342 };
9343 }
9344 static void from_json(const nlohmann::json& j, CertStore& p)
9345 {
9346 p.clear();
9347 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9348 getOptional<std::vector<CertStoreCertificate>>("certificates", p.certificates, j);
9349 getOptional<std::vector<KvPair>>("kvp", p.kvp, j);
9350 }
9351
9352 //-----------------------------------------------------------
9353 JSON_SERIALIZED_CLASS(CertStoreCertificateElement)
9361 {
9362 IMPLEMENT_JSON_SERIALIZATION()
9363 IMPLEMENT_JSON_DOCUMENTATION(CertStoreCertificateElement)
9364
9365 public:
9367 std::string id;
9368
9371
9373 std::string certificatePem;
9374
9376 std::string tags;
9377
9379 {
9380 clear();
9381 }
9382
9383 void clear()
9384 {
9385 id.clear();
9386 hasPrivateKey = false;
9387 tags.clear();
9388 }
9389 };
9390
9391 static void to_json(nlohmann::json& j, const CertStoreCertificateElement& p)
9392 {
9393 j = nlohmann::json{
9394 TOJSON_IMPL(id),
9395 TOJSON_IMPL(hasPrivateKey),
9396 TOJSON_IMPL(tags)
9397 };
9398
9399 if(!p.certificatePem.empty())
9400 {
9401 j["certificatePem"] = p.certificatePem;
9402 }
9403 }
9404 static void from_json(const nlohmann::json& j, CertStoreCertificateElement& p)
9405 {
9406 p.clear();
9407 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9408 getOptional<bool>("hasPrivateKey", p.hasPrivateKey, j, false);
9409 getOptional<std::string>("certificatePem", p.certificatePem, j, EMPTY_STRING);
9410 getOptional<std::string>("tags", p.tags, j, EMPTY_STRING);
9411 }
9412
9413 //-----------------------------------------------------------
9414 JSON_SERIALIZED_CLASS(CertStoreDescriptor)
9422 {
9423 IMPLEMENT_JSON_SERIALIZATION()
9424 IMPLEMENT_JSON_DOCUMENTATION(CertStoreDescriptor)
9425
9426 public:
9428 std::string id;
9429
9431 std::string fileName;
9432
9435
9438
9440 std::vector<CertStoreCertificateElement> certificates;
9441
9443 std::vector<KvPair> kvp;
9444
9446 {
9447 clear();
9448 }
9449
9450 void clear()
9451 {
9452 id.clear();
9453 fileName.clear();
9454 version = 0;
9455 flags = 0;
9456 certificates.clear();
9457 kvp.clear();
9458 }
9459 };
9460
9461 static void to_json(nlohmann::json& j, const CertStoreDescriptor& p)
9462 {
9463 j = nlohmann::json{
9464 TOJSON_IMPL(id),
9465 TOJSON_IMPL(fileName),
9466 TOJSON_IMPL(version),
9467 TOJSON_IMPL(flags),
9468 TOJSON_IMPL(certificates),
9469 TOJSON_IMPL(kvp)
9470 };
9471 }
9472 static void from_json(const nlohmann::json& j, CertStoreDescriptor& p)
9473 {
9474 p.clear();
9475 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9476 getOptional<std::string>("fileName", p.fileName, j, EMPTY_STRING);
9477 getOptional<int>("version", p.version, j, 0);
9478 getOptional<int>("flags", p.flags, j, 0);
9479 getOptional<std::vector<CertStoreCertificateElement>>("certificates", p.certificates, j);
9480 getOptional<std::vector<KvPair>>("kvp", p.kvp, j);
9481 }
9482
9483 //-----------------------------------------------------------
9484 JSON_SERIALIZED_CLASS(CertificateSubjectElement)
9492 {
9493 IMPLEMENT_JSON_SERIALIZATION()
9494 IMPLEMENT_JSON_DOCUMENTATION(CertificateSubjectElement)
9495
9496 public:
9498 std::string name;
9499
9501 std::string value;
9502
9504 {
9505 clear();
9506 }
9507
9508 void clear()
9509 {
9510 name.clear();
9511 value.clear();
9512 }
9513 };
9514
9515 static void to_json(nlohmann::json& j, const CertificateSubjectElement& p)
9516 {
9517 j = nlohmann::json{
9518 TOJSON_IMPL(name),
9519 TOJSON_IMPL(value)
9520 };
9521 }
9522 static void from_json(const nlohmann::json& j, CertificateSubjectElement& p)
9523 {
9524 p.clear();
9525 getOptional<std::string>("name", p.name, j, EMPTY_STRING);
9526 getOptional<std::string>("value", p.value, j, EMPTY_STRING);
9527 }
9528
9529
9530 //-----------------------------------------------------------
9531 JSON_SERIALIZED_CLASS(CertificateDescriptor)
9539 {
9540 IMPLEMENT_JSON_SERIALIZATION()
9541 IMPLEMENT_JSON_DOCUMENTATION(CertificateDescriptor)
9542
9543 public:
9545 std::string subject;
9546
9548 std::string issuer;
9549
9552
9555
9557 std::string notBefore;
9558
9560 std::string notAfter;
9561
9563 std::string serial;
9564
9566 std::string fingerprint;
9567
9569 std::vector<CertificateSubjectElement> subjectElements;
9570
9572 std::string certificatePem;
9573
9575 std::string publicKeyPem;
9576
9578 {
9579 clear();
9580 }
9581
9582 void clear()
9583 {
9584 subject.clear();
9585 issuer.clear();
9586 selfSigned = false;
9587 version = 0;
9588 notBefore.clear();
9589 notAfter.clear();
9590 serial.clear();
9591 fingerprint.clear();
9592 subjectElements.clear();
9593 certificatePem.clear();
9594 publicKeyPem.clear();
9595 }
9596 };
9597
9598 static void to_json(nlohmann::json& j, const CertificateDescriptor& p)
9599 {
9600 j = nlohmann::json{
9601 TOJSON_IMPL(subject),
9602 TOJSON_IMPL(issuer),
9603 TOJSON_IMPL(selfSigned),
9604 TOJSON_IMPL(version),
9605 TOJSON_IMPL(notBefore),
9606 TOJSON_IMPL(notAfter),
9607 TOJSON_IMPL(serial),
9608 TOJSON_IMPL(fingerprint),
9609 TOJSON_IMPL(subjectElements),
9610 TOJSON_IMPL(certificatePem),
9611 TOJSON_IMPL(publicKeyPem)
9612 };
9613 }
9614 static void from_json(const nlohmann::json& j, CertificateDescriptor& p)
9615 {
9616 p.clear();
9617 getOptional<std::string>("subject", p.subject, j, EMPTY_STRING);
9618 getOptional<std::string>("issuer", p.issuer, j, EMPTY_STRING);
9619 getOptional<bool>("selfSigned", p.selfSigned, j, false);
9620 getOptional<int>("version", p.version, j, 0);
9621 getOptional<std::string>("notBefore", p.notBefore, j, EMPTY_STRING);
9622 getOptional<std::string>("notAfter", p.notAfter, j, EMPTY_STRING);
9623 getOptional<std::string>("serial", p.serial, j, EMPTY_STRING);
9624 getOptional<std::string>("fingerprint", p.fingerprint, j, EMPTY_STRING);
9625 getOptional<std::string>("certificatePem", p.certificatePem, j, EMPTY_STRING);
9626 getOptional<std::string>("publicKeyPem", p.publicKeyPem, j, EMPTY_STRING);
9627 getOptional<std::vector<CertificateSubjectElement>>("subjectElements", p.subjectElements, j);
9628 }
9629
9630
9631 //-----------------------------------------------------------
9632 JSON_SERIALIZED_CLASS(RiffDescriptor)
9643 {
9644 IMPLEMENT_JSON_SERIALIZATION()
9645 IMPLEMENT_JSON_DOCUMENTATION(RiffDescriptor)
9646
9647 public:
9649 std::string file;
9650
9653
9656
9659
9661 std::string meta;
9662
9664 std::string certPem;
9665
9668
9670 std::string signature;
9671
9673 {
9674 clear();
9675 }
9676
9677 void clear()
9678 {
9679 file.clear();
9680 verified = false;
9681 channels = 0;
9682 sampleCount = 0;
9683 meta.clear();
9684 certPem.clear();
9685 certDescriptor.clear();
9686 signature.clear();
9687 }
9688 };
9689
9690 static void to_json(nlohmann::json& j, const RiffDescriptor& p)
9691 {
9692 j = nlohmann::json{
9693 TOJSON_IMPL(file),
9694 TOJSON_IMPL(verified),
9695 TOJSON_IMPL(channels),
9696 TOJSON_IMPL(sampleCount),
9697 TOJSON_IMPL(meta),
9698 TOJSON_IMPL(certPem),
9699 TOJSON_IMPL(certDescriptor),
9700 TOJSON_IMPL(signature)
9701 };
9702 }
9703
9704 static void from_json(const nlohmann::json& j, RiffDescriptor& p)
9705 {
9706 p.clear();
9707 FROMJSON_IMPL(file, std::string, EMPTY_STRING);
9708 FROMJSON_IMPL(verified, bool, false);
9709 FROMJSON_IMPL(channels, int, 0);
9710 FROMJSON_IMPL(sampleCount, int, 0);
9711 FROMJSON_IMPL(meta, std::string, EMPTY_STRING);
9712 FROMJSON_IMPL(certPem, std::string, EMPTY_STRING);
9713 getOptional<CertificateDescriptor>("certDescriptor", p.certDescriptor, j);
9714 FROMJSON_IMPL(signature, std::string, EMPTY_STRING);
9715 }
9716
9717
9718 //-----------------------------------------------------------
9719 JSON_SERIALIZED_CLASS(BridgeCreationDetail)
9727 {
9728 IMPLEMENT_JSON_SERIALIZATION()
9729 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(BridgeCreationDetail)
9730 IMPLEMENT_JSON_DOCUMENTATION(BridgeCreationDetail)
9731
9732 public:
9734 typedef enum
9735 {
9737 csUndefined = 0,
9738
9740 csOk = 1,
9741
9743 csNoJson = -1,
9744
9746 csAlreadyExists = -3,
9747
9749 csInvalidConfiguration = -4,
9750
9752 csInvalidJson = -5,
9753
9755 csInsufficientGroups = -6,
9756
9758 csTooManyGroups = -7,
9759
9761 csDuplicateGroup = -8,
9762
9764 csLocalLoopDetected = -9,
9765 } CreationStatus_t;
9766
9768 std::string id;
9769
9772
9774 {
9775 clear();
9776 }
9777
9778 void clear()
9779 {
9780 id.clear();
9781 status = csUndefined;
9782 }
9783 };
9784
9785 static void to_json(nlohmann::json& j, const BridgeCreationDetail& p)
9786 {
9787 j = nlohmann::json{
9788 TOJSON_IMPL(id),
9789 TOJSON_IMPL(status)
9790 };
9791 }
9792 static void from_json(const nlohmann::json& j, BridgeCreationDetail& p)
9793 {
9794 p.clear();
9795 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9796 getOptional<BridgeCreationDetail::CreationStatus_t>("status", p.status, j, BridgeCreationDetail::CreationStatus_t::csUndefined);
9797 }
9798 //-----------------------------------------------------------
9799 JSON_SERIALIZED_CLASS(GroupConnectionDetail)
9807 {
9808 IMPLEMENT_JSON_SERIALIZATION()
9809 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupConnectionDetail)
9810 IMPLEMENT_JSON_DOCUMENTATION(GroupConnectionDetail)
9811
9812 public:
9814 typedef enum
9815 {
9817 ctUndefined = 0,
9818
9820 ctDirectDatagram = 1,
9821
9823 ctRallypoint = 2
9824 } ConnectionType_t;
9825
9827 std::string id;
9828
9831
9833 std::string peer;
9834
9837
9839 std::string reason;
9840
9842 {
9843 clear();
9844 }
9845
9846 void clear()
9847 {
9848 id.clear();
9849 connectionType = ctUndefined;
9850 peer.clear();
9851 asFailover = false;
9852 reason.clear();
9853 }
9854 };
9855
9856 static void to_json(nlohmann::json& j, const GroupConnectionDetail& p)
9857 {
9858 j = nlohmann::json{
9859 TOJSON_IMPL(id),
9860 TOJSON_IMPL(connectionType),
9861 TOJSON_IMPL(peer),
9862 TOJSON_IMPL(asFailover),
9863 TOJSON_IMPL(reason)
9864 };
9865
9866 if(p.asFailover)
9867 {
9868 j["asFailover"] = p.asFailover;
9869 }
9870 }
9871 static void from_json(const nlohmann::json& j, GroupConnectionDetail& p)
9872 {
9873 p.clear();
9874 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9875 getOptional<GroupConnectionDetail::ConnectionType_t>("connectionType", p.connectionType, j, GroupConnectionDetail::ConnectionType_t::ctUndefined);
9876 getOptional<std::string>("peer", p.peer, j, EMPTY_STRING);
9877 getOptional<bool>("asFailover", p.asFailover, j, false);
9878 getOptional<std::string>("reason", p.reason, j, EMPTY_STRING);
9879 }
9880
9881 //-----------------------------------------------------------
9882 JSON_SERIALIZED_CLASS(GroupTxDetail)
9890 {
9891 IMPLEMENT_JSON_SERIALIZATION()
9892 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupTxDetail)
9893 IMPLEMENT_JSON_DOCUMENTATION(GroupTxDetail)
9894
9895 public:
9897 typedef enum
9898 {
9900 txsUndefined = 0,
9901
9903 txsTxStarted = 1,
9904
9906 txsTxEnded = 2,
9907
9909 txsNotAnAudioGroup = -1,
9910
9912 txsNotJoined = -2,
9913
9915 txsNotConnected = -3,
9916
9918 txsAlreadyTransmitting = -4,
9919
9921 txsInvalidParams = -5,
9922
9924 txsPriorityTooLow = -6,
9925
9927 txsRxActiveOnNonFdx = -7,
9928
9930 txsCannotSubscribeToInput = -8,
9931
9933 txsInvalidId = -9,
9934
9936 txsTxEndedWithFailure = -10,
9937 } TxStatus_t;
9938
9940 std::string id;
9941
9944
9947
9950
9953
9955 uint32_t txId;
9956
9958 {
9959 clear();
9960 }
9961
9962 void clear()
9963 {
9964 id.clear();
9965 status = txsUndefined;
9966 localPriority = 0;
9967 remotePriority = 0;
9968 nonFdxMsHangRemaining = 0;
9969 txId = 0;
9970 }
9971 };
9972
9973 static void to_json(nlohmann::json& j, const GroupTxDetail& p)
9974 {
9975 j = nlohmann::json{
9976 TOJSON_IMPL(id),
9977 TOJSON_IMPL(status),
9978 TOJSON_IMPL(localPriority),
9979 TOJSON_IMPL(txId)
9980 };
9981
9982 // Include remote priority if status is related to that
9983 if(p.status == GroupTxDetail::TxStatus_t::txsPriorityTooLow)
9984 {
9985 j["remotePriority"] = p.remotePriority;
9986 }
9987 else if(p.status == GroupTxDetail::TxStatus_t::txsRxActiveOnNonFdx)
9988 {
9989 j["nonFdxMsHangRemaining"] = p.nonFdxMsHangRemaining;
9990 }
9991 }
9992 static void from_json(const nlohmann::json& j, GroupTxDetail& p)
9993 {
9994 p.clear();
9995 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
9996 getOptional<GroupTxDetail::TxStatus_t>("status", p.status, j, GroupTxDetail::TxStatus_t::txsUndefined);
9997 getOptional<int>("localPriority", p.localPriority, j, 0);
9998 getOptional<int>("remotePriority", p.remotePriority, j, 0);
9999 getOptional<long>("nonFdxMsHangRemaining", p.nonFdxMsHangRemaining, j, 0);
10000 getOptional<uint32_t>("txId", p.txId, j, 0);
10001 }
10002
10003 //-----------------------------------------------------------
10004 JSON_SERIALIZED_CLASS(GroupCreationDetail)
10012 {
10013 IMPLEMENT_JSON_SERIALIZATION()
10014 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupCreationDetail)
10015 IMPLEMENT_JSON_DOCUMENTATION(GroupCreationDetail)
10016
10017 public:
10019 typedef enum
10020 {
10022 csUndefined = 0,
10023
10025 csOk = 1,
10026
10028 csNoJson = -1,
10029
10031 csConflictingRpListAndCluster = -2,
10032
10034 csAlreadyExists = -3,
10035
10037 csInvalidConfiguration = -4,
10038
10040 csInvalidJson = -5,
10041
10043 csCryptoFailure = -6,
10044
10046 csAudioInputFailure = -7,
10047
10049 csAudioOutputFailure = -8,
10050
10052 csUnsupportedAudioEncoder = -9,
10053
10055 csNoLicense = -10,
10056
10058 csInvalidTransport = -11,
10059 } CreationStatus_t;
10060
10062 std::string id;
10063
10066
10068 {
10069 clear();
10070 }
10071
10072 void clear()
10073 {
10074 id.clear();
10075 status = csUndefined;
10076 }
10077 };
10078
10079 static void to_json(nlohmann::json& j, const GroupCreationDetail& p)
10080 {
10081 j = nlohmann::json{
10082 TOJSON_IMPL(id),
10083 TOJSON_IMPL(status)
10084 };
10085 }
10086 static void from_json(const nlohmann::json& j, GroupCreationDetail& p)
10087 {
10088 p.clear();
10089 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
10090 getOptional<GroupCreationDetail::CreationStatus_t>("status", p.status, j, GroupCreationDetail::CreationStatus_t::csUndefined);
10091 }
10092
10093
10094 //-----------------------------------------------------------
10095 JSON_SERIALIZED_CLASS(GroupReconfigurationDetail)
10103 {
10104 IMPLEMENT_JSON_SERIALIZATION()
10105 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupReconfigurationDetail)
10106 IMPLEMENT_JSON_DOCUMENTATION(GroupReconfigurationDetail)
10107
10108 public:
10110 typedef enum
10111 {
10113 rsUndefined = 0,
10114
10116 rsOk = 1,
10117
10119 rsNoJson = -1,
10120
10122 rsInvalidConfiguration = -2,
10123
10125 rsInvalidJson = -3,
10126
10128 rsAudioInputFailure = -4,
10129
10131 rsAudioOutputFailure = -5,
10132
10134 rsDoesNotExist = -6,
10135
10137 rsAudioInputInUse = -7,
10138
10140 rsAudioDisabledForGroup = -8,
10141
10143 rsGroupIsNotAudio = -9
10144 } ReconfigurationStatus_t;
10145
10147 std::string id;
10148
10151
10153 {
10154 clear();
10155 }
10156
10157 void clear()
10158 {
10159 id.clear();
10160 status = rsUndefined;
10161 }
10162 };
10163
10164 static void to_json(nlohmann::json& j, const GroupReconfigurationDetail& p)
10165 {
10166 j = nlohmann::json{
10167 TOJSON_IMPL(id),
10168 TOJSON_IMPL(status)
10169 };
10170 }
10171 static void from_json(const nlohmann::json& j, GroupReconfigurationDetail& p)
10172 {
10173 p.clear();
10174 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
10175 getOptional<GroupReconfigurationDetail::ReconfigurationStatus_t>("status", p.status, j, GroupReconfigurationDetail::ReconfigurationStatus_t::rsUndefined);
10176 }
10177
10178
10179 //-----------------------------------------------------------
10180 JSON_SERIALIZED_CLASS(GroupHealthReport)
10188 {
10189 IMPLEMENT_JSON_SERIALIZATION()
10190 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupHealthReport)
10191 IMPLEMENT_JSON_DOCUMENTATION(GroupHealthReport)
10192
10193 public:
10194 std::string id;
10195 uint64_t lastErrorTs;
10196 uint64_t decryptionErrors;
10197 uint64_t encryptionErrors;
10198 uint64_t unsupportDecoderErrors;
10199 uint64_t decoderFailures;
10200 uint64_t decoderStartFailures;
10201 uint64_t inboundRtpPacketAllocationFailures;
10202 uint64_t inboundRtpPacketLoadFailures;
10203 uint64_t latePacketsDiscarded;
10204 uint64_t jitterBufferInsertionFailures;
10205 uint64_t presenceDeserializationFailures;
10206 uint64_t notRtpErrors;
10207 uint64_t generalErrors;
10208 uint64_t inboundRtpProcessorAllocationFailures;
10209
10211 {
10212 clear();
10213 }
10214
10215 void clear()
10216 {
10217 id.clear();
10218 lastErrorTs = 0;
10219 decryptionErrors = 0;
10220 encryptionErrors = 0;
10221 unsupportDecoderErrors = 0;
10222 decoderFailures = 0;
10223 decoderStartFailures = 0;
10224 inboundRtpPacketAllocationFailures = 0;
10225 inboundRtpPacketLoadFailures = 0;
10226 latePacketsDiscarded = 0;
10227 jitterBufferInsertionFailures = 0;
10228 presenceDeserializationFailures = 0;
10229 notRtpErrors = 0;
10230 generalErrors = 0;
10231 inboundRtpProcessorAllocationFailures = 0;
10232 }
10233 };
10234
10235 static void to_json(nlohmann::json& j, const GroupHealthReport& p)
10236 {
10237 j = nlohmann::json{
10238 TOJSON_IMPL(id),
10239 TOJSON_IMPL(lastErrorTs),
10240 TOJSON_IMPL(decryptionErrors),
10241 TOJSON_IMPL(encryptionErrors),
10242 TOJSON_IMPL(unsupportDecoderErrors),
10243 TOJSON_IMPL(decoderFailures),
10244 TOJSON_IMPL(decoderStartFailures),
10245 TOJSON_IMPL(inboundRtpPacketAllocationFailures),
10246 TOJSON_IMPL(inboundRtpPacketLoadFailures),
10247 TOJSON_IMPL(latePacketsDiscarded),
10248 TOJSON_IMPL(jitterBufferInsertionFailures),
10249 TOJSON_IMPL(presenceDeserializationFailures),
10250 TOJSON_IMPL(notRtpErrors),
10251 TOJSON_IMPL(generalErrors),
10252 TOJSON_IMPL(inboundRtpProcessorAllocationFailures)
10253 };
10254 }
10255 static void from_json(const nlohmann::json& j, GroupHealthReport& p)
10256 {
10257 p.clear();
10258 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
10259 getOptional<uint64_t>("lastErrorTs", p.lastErrorTs, j, 0);
10260 getOptional<uint64_t>("decryptionErrors", p.decryptionErrors, j, 0);
10261 getOptional<uint64_t>("encryptionErrors", p.encryptionErrors, j, 0);
10262 getOptional<uint64_t>("unsupportDecoderErrors", p.unsupportDecoderErrors, j, 0);
10263 getOptional<uint64_t>("decoderFailures", p.decoderFailures, j, 0);
10264 getOptional<uint64_t>("decoderStartFailures", p.decoderStartFailures, j, 0);
10265 getOptional<uint64_t>("inboundRtpPacketAllocationFailures", p.inboundRtpPacketAllocationFailures, j, 0);
10266 getOptional<uint64_t>("inboundRtpPacketLoadFailures", p.inboundRtpPacketLoadFailures, j, 0);
10267 getOptional<uint64_t>("latePacketsDiscarded", p.latePacketsDiscarded, j, 0);
10268 getOptional<uint64_t>("jitterBufferInsertionFailures", p.jitterBufferInsertionFailures, j, 0);
10269 getOptional<uint64_t>("presenceDeserializationFailures", p.presenceDeserializationFailures, j, 0);
10270 getOptional<uint64_t>("notRtpErrors", p.notRtpErrors, j, 0);
10271 getOptional<uint64_t>("generalErrors", p.generalErrors, j, 0);
10272 getOptional<uint64_t>("inboundRtpProcessorAllocationFailures", p.inboundRtpProcessorAllocationFailures, j, 0);
10273 }
10274
10275 //-----------------------------------------------------------
10276 JSON_SERIALIZED_CLASS(InboundProcessorStats)
10284 {
10285 IMPLEMENT_JSON_SERIALIZATION()
10286 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(InboundProcessorStats)
10287 IMPLEMENT_JSON_DOCUMENTATION(InboundProcessorStats)
10288
10289 public:
10290 uint32_t ssrc;
10291 double jitter;
10292 uint64_t minRtpSamplesInQueue;
10293 uint64_t maxRtpSamplesInQueue;
10294 uint64_t totalSamplesTrimmed;
10295 uint64_t underruns;
10296 uint64_t overruns;
10297 uint64_t samplesInQueue;
10298 uint64_t totalPacketsReceived;
10299 uint64_t totalPacketsLost;
10300 uint64_t totalPacketsDiscarded;
10301
10303 {
10304 clear();
10305 }
10306
10307 void clear()
10308 {
10309 ssrc = 0;
10310 jitter = 0.0;
10311 minRtpSamplesInQueue = 0;
10312 maxRtpSamplesInQueue = 0;
10313 totalSamplesTrimmed = 0;
10314 underruns = 0;
10315 overruns = 0;
10316 samplesInQueue = 0;
10317 totalPacketsReceived = 0;
10318 totalPacketsLost = 0;
10319 totalPacketsDiscarded = 0;
10320 }
10321 };
10322
10323 static void to_json(nlohmann::json& j, const InboundProcessorStats& p)
10324 {
10325 j = nlohmann::json{
10326 TOJSON_IMPL(ssrc),
10327 TOJSON_IMPL(jitter),
10328 TOJSON_IMPL(minRtpSamplesInQueue),
10329 TOJSON_IMPL(maxRtpSamplesInQueue),
10330 TOJSON_IMPL(totalSamplesTrimmed),
10331 TOJSON_IMPL(underruns),
10332 TOJSON_IMPL(overruns),
10333 TOJSON_IMPL(samplesInQueue),
10334 TOJSON_IMPL(totalPacketsReceived),
10335 TOJSON_IMPL(totalPacketsLost),
10336 TOJSON_IMPL(totalPacketsDiscarded)
10337 };
10338 }
10339 static void from_json(const nlohmann::json& j, InboundProcessorStats& p)
10340 {
10341 p.clear();
10342 getOptional<uint32_t>("ssrc", p.ssrc, j, 0);
10343 getOptional<double>("jitter", p.jitter, j, 0.0);
10344 getOptional<uint64_t>("minRtpSamplesInQueue", p.minRtpSamplesInQueue, j, 0);
10345 getOptional<uint64_t>("maxRtpSamplesInQueue", p.maxRtpSamplesInQueue, j, 0);
10346 getOptional<uint64_t>("totalSamplesTrimmed", p.totalSamplesTrimmed, j, 0);
10347 getOptional<uint64_t>("underruns", p.underruns, j, 0);
10348 getOptional<uint64_t>("overruns", p.overruns, j, 0);
10349 getOptional<uint64_t>("samplesInQueue", p.samplesInQueue, j, 0);
10350 getOptional<uint64_t>("totalPacketsReceived", p.totalPacketsReceived, j, 0);
10351 getOptional<uint64_t>("totalPacketsLost", p.totalPacketsLost, j, 0);
10352 getOptional<uint64_t>("totalPacketsDiscarded", p.totalPacketsDiscarded, j, 0);
10353 }
10354
10355 //-----------------------------------------------------------
10356 JSON_SERIALIZED_CLASS(TrafficCounter)
10364 {
10365 IMPLEMENT_JSON_SERIALIZATION()
10366 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(TrafficCounter)
10367 IMPLEMENT_JSON_DOCUMENTATION(TrafficCounter)
10368
10369 public:
10370 uint64_t packets;
10371 uint64_t bytes;
10372 uint64_t errors;
10373
10375 {
10376 clear();
10377 }
10378
10379 void clear()
10380 {
10381 packets = 0;
10382 bytes = 0;
10383 errors = 0;
10384 }
10385 };
10386
10387 static void to_json(nlohmann::json& j, const TrafficCounter& p)
10388 {
10389 j = nlohmann::json{
10390 TOJSON_IMPL(packets),
10391 TOJSON_IMPL(bytes),
10392 TOJSON_IMPL(errors)
10393 };
10394 }
10395 static void from_json(const nlohmann::json& j, TrafficCounter& p)
10396 {
10397 p.clear();
10398 getOptional<uint64_t>("packets", p.packets, j, 0);
10399 getOptional<uint64_t>("bytes", p.bytes, j, 0);
10400 getOptional<uint64_t>("errors", p.errors, j, 0);
10401 }
10402
10403 //-----------------------------------------------------------
10404 JSON_SERIALIZED_CLASS(GroupStats)
10412 {
10413 IMPLEMENT_JSON_SERIALIZATION()
10414 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(GroupStats)
10415 IMPLEMENT_JSON_DOCUMENTATION(GroupStats)
10416
10417 public:
10418 std::string id;
10419 //std::vector<InboundProcessorStats> rtpInbounds;
10420 TrafficCounter rxTraffic;
10421 TrafficCounter txTraffic;
10422
10423 GroupStats()
10424 {
10425 clear();
10426 }
10427
10428 void clear()
10429 {
10430 id.clear();
10431 //rtpInbounds.clear();
10432 rxTraffic.clear();
10433 txTraffic.clear();
10434 }
10435 };
10436
10437 static void to_json(nlohmann::json& j, const GroupStats& p)
10438 {
10439 j = nlohmann::json{
10440 TOJSON_IMPL(id),
10441 //TOJSON_IMPL(rtpInbounds),
10442 TOJSON_IMPL(rxTraffic),
10443 TOJSON_IMPL(txTraffic)
10444 };
10445 }
10446 static void from_json(const nlohmann::json& j, GroupStats& p)
10447 {
10448 p.clear();
10449 getOptional<std::string>("id", p.id, j, EMPTY_STRING);
10450 //getOptional<std::vector<InboundProcessorStats>>("rtpInbounds", p.rtpInbounds, j);
10451 getOptional<TrafficCounter>("rxTraffic", p.rxTraffic, j);
10452 getOptional<TrafficCounter>("txTraffic", p.txTraffic, j);
10453 }
10454
10455 //-----------------------------------------------------------
10456 JSON_SERIALIZED_CLASS(RallypointConnectionDetail)
10464 {
10465 IMPLEMENT_JSON_SERIALIZATION()
10466 IMPLEMENT_WRAPPED_JSON_SERIALIZATION(RallypointConnectionDetail)
10467 IMPLEMENT_JSON_DOCUMENTATION(RallypointConnectionDetail)
10468
10469 public:
10471 std::string internalId;
10472
10474 std::string host;
10475
10477 int port;
10478
10481
10484
10486 {
10487 clear();
10488 }
10489
10490 void clear()
10491 {
10492 internalId.clear();
10493 host.clear();
10494 port = 0;
10495 msToNextConnectionAttempt = 0;
10496 serverProcessingMs = -1.0f;
10497 }
10498 };
10499
10500 static void to_json(nlohmann::json& j, const RallypointConnectionDetail& p)
10501 {
10502 j = nlohmann::json{
10503 TOJSON_IMPL(internalId),
10504 TOJSON_IMPL(host),
10505 TOJSON_IMPL(port)
10506 };
10507
10508 if(p.msToNextConnectionAttempt > 0)
10509 {
10510 j["msToNextConnectionAttempt"] = p.msToNextConnectionAttempt;
10511 }
10512
10513 if(p.serverProcessingMs >= 0.0)
10514 {
10515 j["serverProcessingMs"] = p.serverProcessingMs;
10516 }
10517 }
10518 static void from_json(const nlohmann::json& j, RallypointConnectionDetail& p)
10519 {
10520 p.clear();
10521 getOptional<std::string>("internalId", p.internalId, j, EMPTY_STRING);
10522 getOptional<std::string>("host", p.host, j, EMPTY_STRING);
10523 getOptional<int>("port", p.port, j, 0);
10524 getOptional<uint64_t>("msToNextConnectionAttempt", p.msToNextConnectionAttempt, j, 0);
10525 getOptional<float>("serverProcessingMs", p.serverProcessingMs, j, -1.0);
10526 }
10527
10528 //-----------------------------------------------------------
10529 JSON_SERIALIZED_CLASS(TranslationSession)
10540 {
10541 IMPLEMENT_JSON_SERIALIZATION()
10542 IMPLEMENT_JSON_DOCUMENTATION(TranslationSession)
10543
10544 public:
10546 std::string id;
10547
10549 std::string name;
10550
10552 std::vector<std::string> groups;
10553
10556
10558 {
10559 clear();
10560 }
10561
10562 void clear()
10563 {
10564 id.clear();
10565 name.clear();
10566 groups.clear();
10567 enabled = true;
10568 }
10569 };
10570
10571 static void to_json(nlohmann::json& j, const TranslationSession& p)
10572 {
10573 j = nlohmann::json{
10574 TOJSON_IMPL(id),
10575 TOJSON_IMPL(name),
10576 TOJSON_IMPL(groups),
10577 TOJSON_IMPL(enabled)
10578 };
10579 }
10580 static void from_json(const nlohmann::json& j, TranslationSession& p)
10581 {
10582 p.clear();
10583 FROMJSON_IMPL(id, std::string, EMPTY_STRING);
10584 FROMJSON_IMPL(name, std::string, EMPTY_STRING);
10585 getOptional<std::vector<std::string>>("groups", p.groups, j);
10586 FROMJSON_IMPL(enabled, bool, true);
10587 }
10588
10589 //-----------------------------------------------------------
10590 JSON_SERIALIZED_CLASS(TranslationConfiguration)
10601 {
10602 IMPLEMENT_JSON_SERIALIZATION()
10603 IMPLEMENT_JSON_DOCUMENTATION(TranslationConfiguration)
10604
10605 public:
10607 std::vector<TranslationSession> sessions;
10608
10610 std::vector<Group> groups;
10611
10613 {
10614 clear();
10615 }
10616
10617 void clear()
10618 {
10619 sessions.clear();
10620 groups.clear();
10621 }
10622 };
10623
10624 static void to_json(nlohmann::json& j, const TranslationConfiguration& p)
10625 {
10626 j = nlohmann::json{
10627 TOJSON_IMPL(sessions),
10628 TOJSON_IMPL(groups)
10629 };
10630 }
10631 static void from_json(const nlohmann::json& j, TranslationConfiguration& p)
10632 {
10633 p.clear();
10634 getOptional<std::vector<TranslationSession>>("sessions", p.sessions, j);
10635 getOptional<std::vector<Group>>("groups", p.groups, j);
10636 }
10637
10638 //-----------------------------------------------------------
10639 JSON_SERIALIZED_CLASS(LingoServerStatusReportConfiguration)
10650 {
10651 IMPLEMENT_JSON_SERIALIZATION()
10652 IMPLEMENT_JSON_DOCUMENTATION(LingoServerStatusReportConfiguration)
10653
10654 public:
10656 std::string fileName;
10657
10660
10663
10665 std::string runCmd;
10666
10669
10672
10675
10677 {
10678 clear();
10679 }
10680
10681 void clear()
10682 {
10683 fileName.clear();
10684 intervalSecs = 60;
10685 enabled = false;
10686 includeGroupDetail = false;
10687 includeSessionDetail = false;
10688 includeSessionGroupDetail = false;
10689 runCmd.clear();
10690 }
10691 };
10692
10693 static void to_json(nlohmann::json& j, const LingoServerStatusReportConfiguration& p)
10694 {
10695 j = nlohmann::json{
10696 TOJSON_IMPL(fileName),
10697 TOJSON_IMPL(intervalSecs),
10698 TOJSON_IMPL(enabled),
10699 TOJSON_IMPL(includeGroupDetail),
10700 TOJSON_IMPL(includeSessionDetail),
10701 TOJSON_IMPL(includeSessionGroupDetail),
10702 TOJSON_IMPL(runCmd)
10703 };
10704 }
10705 static void from_json(const nlohmann::json& j, LingoServerStatusReportConfiguration& p)
10706 {
10707 p.clear();
10708 getOptional<std::string>("fileName", p.fileName, j);
10709 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
10710 getOptional<bool>("enabled", p.enabled, j, false);
10711 getOptional<std::string>("runCmd", p.runCmd, j);
10712 getOptional<bool>("includeGroupDetail", p.includeGroupDetail, j, false);
10713 getOptional<bool>("includeSessionDetail", p.includeSessionDetail, j, false);
10714 getOptional<bool>("includeSessionGroupDetail", p.includeSessionGroupDetail, j, false);
10715 }
10716
10717 //-----------------------------------------------------------
10718 JSON_SERIALIZED_CLASS(LingoServerInternals)
10731 {
10732 IMPLEMENT_JSON_SERIALIZATION()
10733 IMPLEMENT_JSON_DOCUMENTATION(LingoServerInternals)
10734
10735 public:
10738
10741
10744
10746 {
10747 clear();
10748 }
10749
10750 void clear()
10751 {
10752 watchdog.clear();
10753 tuning.clear();
10754 housekeeperIntervalMs = 1000;
10755 }
10756 };
10757
10758 static void to_json(nlohmann::json& j, const LingoServerInternals& p)
10759 {
10760 j = nlohmann::json{
10761 TOJSON_IMPL(watchdog),
10762 TOJSON_IMPL(housekeeperIntervalMs),
10763 TOJSON_IMPL(tuning)
10764 };
10765 }
10766 static void from_json(const nlohmann::json& j, LingoServerInternals& p)
10767 {
10768 p.clear();
10769 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
10770 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
10771 getOptional<TuningSettings>("tuning", p.tuning, j);
10772 }
10773
10774 //-----------------------------------------------------------
10775 JSON_SERIALIZED_CLASS(LingoServerConfiguration)
10785 {
10786 IMPLEMENT_JSON_SERIALIZATION()
10787 IMPLEMENT_JSON_DOCUMENTATION(LingoServerConfiguration)
10788
10789 public:
10791 std::string id;
10792
10795
10798
10801
10804
10807
10810
10813
10816
10819
10822
10825
10828
10831
10834
10836 {
10837 clear();
10838 }
10839
10840 void clear()
10841 {
10842 id.clear();
10843 serviceConfigurationFileCheckSecs = 60;
10844 lingoConfigurationFileName.clear();
10845 lingoConfigurationFileCommand.clear();
10846 lingoConfigurationFileCheckSecs = 60;
10847 statusReport.clear();
10848 externalHealthCheckResponder.clear();
10849 internals.clear();
10850 certStoreFileName.clear();
10851 certStorePasswordHex.clear();
10852 enginePolicy.clear();
10853 configurationCheckSignalName = "rts.22f4ec3.${id}";
10854 fipsCrypto.clear();
10855 proxy.clear();
10856 nsm.clear();
10857 }
10858 };
10859
10860 static void to_json(nlohmann::json& j, const LingoServerConfiguration& p)
10861 {
10862 j = nlohmann::json{
10863 TOJSON_IMPL(id),
10864 TOJSON_IMPL(serviceConfigurationFileCheckSecs),
10865 TOJSON_IMPL(lingoConfigurationFileName),
10866 TOJSON_IMPL(lingoConfigurationFileCommand),
10867 TOJSON_IMPL(lingoConfigurationFileCheckSecs),
10868 TOJSON_IMPL(statusReport),
10869 TOJSON_IMPL(externalHealthCheckResponder),
10870 TOJSON_IMPL(internals),
10871 TOJSON_IMPL(certStoreFileName),
10872 TOJSON_IMPL(certStorePasswordHex),
10873 TOJSON_IMPL(enginePolicy),
10874 TOJSON_IMPL(configurationCheckSignalName),
10875 TOJSON_IMPL(fipsCrypto),
10876 TOJSON_IMPL(proxy),
10877 TOJSON_IMPL(nsm)
10878 };
10879 }
10880 static void from_json(const nlohmann::json& j, LingoServerConfiguration& p)
10881 {
10882 p.clear();
10883 getOptional<std::string>("id", p.id, j);
10884 getOptional<int>("serviceConfigurationFileCheckSecs", p.serviceConfigurationFileCheckSecs, j, 60);
10885 getOptional<std::string>("lingoConfigurationFileName", p.lingoConfigurationFileName, j);
10886 getOptional<std::string>("lingoConfigurationFileCommand", p.lingoConfigurationFileCommand, j);
10887 getOptional<int>("lingoConfigurationFileCheckSecs", p.lingoConfigurationFileCheckSecs, j, 60);
10888 getOptional<LingoServerStatusReportConfiguration>("statusReport", p.statusReport, j);
10889 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
10890 getOptional<LingoServerInternals>("internals", p.internals, j);
10891 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
10892 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
10893 j.at("enginePolicy").get_to(p.enginePolicy);
10894 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.22f4ec3.${id}");
10895 getOptional<FipsCryptoSettings>("fipsCrypo", p.fipsCrypto, j);
10896 getOptional<NetworkAddress>("proxy", p.proxy, j);
10897 getOptional<NsmConfiguration>("nsm", p.nsm, j);
10898 }
10899
10900
10901 //-----------------------------------------------------------
10902 JSON_SERIALIZED_CLASS(VoiceToVoiceSession)
10913 {
10914 IMPLEMENT_JSON_SERIALIZATION()
10915 IMPLEMENT_JSON_DOCUMENTATION(VoiceToVoiceSession)
10916
10917 public:
10919 std::string id;
10920
10922 std::string name;
10923
10925 std::vector<std::string> groups;
10926
10929
10931 {
10932 clear();
10933 }
10934
10935 void clear()
10936 {
10937 id.clear();
10938 name.clear();
10939 groups.clear();
10940 enabled = true;
10941 }
10942 };
10943
10944 static void to_json(nlohmann::json& j, const VoiceToVoiceSession& p)
10945 {
10946 j = nlohmann::json{
10947 TOJSON_IMPL(id),
10948 TOJSON_IMPL(name),
10949 TOJSON_IMPL(groups),
10950 TOJSON_IMPL(enabled)
10951 };
10952 }
10953 static void from_json(const nlohmann::json& j, VoiceToVoiceSession& p)
10954 {
10955 p.clear();
10956 FROMJSON_IMPL(id, std::string, EMPTY_STRING);
10957 FROMJSON_IMPL(name, std::string, EMPTY_STRING);
10958 getOptional<std::vector<std::string>>("groups", p.groups, j);
10959 FROMJSON_IMPL(enabled, bool, true);
10960 }
10961
10962 //-----------------------------------------------------------
10963 JSON_SERIALIZED_CLASS(LingoConfiguration)
10974 {
10975 IMPLEMENT_JSON_SERIALIZATION()
10976 IMPLEMENT_JSON_DOCUMENTATION(LingoConfiguration)
10977
10978 public:
10980 std::vector<VoiceToVoiceSession> voiceToVoiceSessions;
10981
10983 std::vector<Group> groups;
10984
10986 {
10987 clear();
10988 }
10989
10990 void clear()
10991 {
10992 voiceToVoiceSessions.clear();
10993 groups.clear();
10994 }
10995 };
10996
10997 static void to_json(nlohmann::json& j, const LingoConfiguration& p)
10998 {
10999 j = nlohmann::json{
11000 TOJSON_IMPL(voiceToVoiceSessions),
11001 TOJSON_IMPL(groups)
11002 };
11003 }
11004 static void from_json(const nlohmann::json& j, LingoConfiguration& p)
11005 {
11006 p.clear();
11007 getOptional<std::vector<VoiceToVoiceSession>>("voiceToVoiceSessions", p.voiceToVoiceSessions, j);
11008 getOptional<std::vector<Group>>("groups", p.groups, j);
11009 }
11010
11011 //-----------------------------------------------------------
11012 JSON_SERIALIZED_CLASS(BridgingConfiguration)
11023 {
11024 IMPLEMENT_JSON_SERIALIZATION()
11025 IMPLEMENT_JSON_DOCUMENTATION(BridgingConfiguration)
11026
11027 public:
11029 std::vector<Bridge> bridges;
11030
11032 std::vector<Group> groups;
11033
11035 {
11036 clear();
11037 }
11038
11039 void clear()
11040 {
11041 bridges.clear();
11042 groups.clear();
11043 }
11044 };
11045
11046 static void to_json(nlohmann::json& j, const BridgingConfiguration& p)
11047 {
11048 j = nlohmann::json{
11049 TOJSON_IMPL(bridges),
11050 TOJSON_IMPL(groups)
11051 };
11052 }
11053 static void from_json(const nlohmann::json& j, BridgingConfiguration& p)
11054 {
11055 p.clear();
11056 getOptional<std::vector<Bridge>>("bridges", p.bridges, j);
11057 getOptional<std::vector<Group>>("groups", p.groups, j);
11058 }
11059
11060 //-----------------------------------------------------------
11061 JSON_SERIALIZED_CLASS(BridgingServerStatusReportConfiguration)
11072 {
11073 IMPLEMENT_JSON_SERIALIZATION()
11074 IMPLEMENT_JSON_DOCUMENTATION(BridgingServerStatusReportConfiguration)
11075
11076 public:
11078 std::string fileName;
11079
11082
11085
11087 std::string runCmd;
11088
11091
11094
11097
11099 {
11100 clear();
11101 }
11102
11103 void clear()
11104 {
11105 fileName.clear();
11106 intervalSecs = 60;
11107 enabled = false;
11108 includeGroupDetail = false;
11109 includeBridgeDetail = false;
11110 includeBridgeGroupDetail = false;
11111 runCmd.clear();
11112 }
11113 };
11114
11115 static void to_json(nlohmann::json& j, const BridgingServerStatusReportConfiguration& p)
11116 {
11117 j = nlohmann::json{
11118 TOJSON_IMPL(fileName),
11119 TOJSON_IMPL(intervalSecs),
11120 TOJSON_IMPL(enabled),
11121 TOJSON_IMPL(includeGroupDetail),
11122 TOJSON_IMPL(includeBridgeDetail),
11123 TOJSON_IMPL(includeBridgeGroupDetail),
11124 TOJSON_IMPL(runCmd)
11125 };
11126 }
11127 static void from_json(const nlohmann::json& j, BridgingServerStatusReportConfiguration& p)
11128 {
11129 p.clear();
11130 getOptional<std::string>("fileName", p.fileName, j);
11131 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
11132 getOptional<bool>("enabled", p.enabled, j, false);
11133 getOptional<std::string>("runCmd", p.runCmd, j);
11134 getOptional<bool>("includeGroupDetail", p.includeGroupDetail, j, false);
11135 getOptional<bool>("includeBridgeDetail", p.includeBridgeDetail, j, false);
11136 getOptional<bool>("includeBridgeGroupDetail", p.includeBridgeGroupDetail, j, false);
11137 }
11138
11139 //-----------------------------------------------------------
11140 JSON_SERIALIZED_CLASS(BridgingServerInternals)
11153 {
11154 IMPLEMENT_JSON_SERIALIZATION()
11155 IMPLEMENT_JSON_DOCUMENTATION(BridgingServerInternals)
11156
11157 public:
11160
11163
11166
11168 {
11169 clear();
11170 }
11171
11172 void clear()
11173 {
11174 watchdog.clear();
11175 tuning.clear();
11176 housekeeperIntervalMs = 1000;
11177 }
11178 };
11179
11180 static void to_json(nlohmann::json& j, const BridgingServerInternals& p)
11181 {
11182 j = nlohmann::json{
11183 TOJSON_IMPL(watchdog),
11184 TOJSON_IMPL(housekeeperIntervalMs),
11185 TOJSON_IMPL(tuning)
11186 };
11187 }
11188 static void from_json(const nlohmann::json& j, BridgingServerInternals& p)
11189 {
11190 p.clear();
11191 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
11192 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
11193 getOptional<TuningSettings>("tuning", p.tuning, j);
11194 }
11195
11196 //-----------------------------------------------------------
11197 JSON_SERIALIZED_CLASS(BridgingServerConfiguration)
11207 {
11208 IMPLEMENT_JSON_SERIALIZATION()
11209 IMPLEMENT_JSON_DOCUMENTATION(BridgingServerConfiguration)
11210
11211 public:
11213 typedef enum
11214 {
11216 omRaw = 0,
11217
11219 omPayloadTransformation = 1,
11220
11222 omAnonymousMixing = 2,
11223
11225 omLanguageTranslation = 3
11226 } OpMode_t;
11227
11229 std::string id;
11230
11233
11236
11239
11242
11245
11248
11251
11254
11257
11260
11263
11266
11269
11272
11274 {
11275 clear();
11276 }
11277
11278 void clear()
11279 {
11280 id.clear();
11281 mode = omRaw;
11282 serviceConfigurationFileCheckSecs = 60;
11283 bridgingConfigurationFileName.clear();
11284 bridgingConfigurationFileCommand.clear();
11285 bridgingConfigurationFileCheckSecs = 60;
11286 statusReport.clear();
11287 externalHealthCheckResponder.clear();
11288 internals.clear();
11289 certStoreFileName.clear();
11290 certStorePasswordHex.clear();
11291 enginePolicy.clear();
11292 configurationCheckSignalName = "rts.6cc0651.${id}";
11293 fipsCrypto.clear();
11294 nsm.clear();
11295 }
11296 };
11297
11298 static void to_json(nlohmann::json& j, const BridgingServerConfiguration& p)
11299 {
11300 j = nlohmann::json{
11301 TOJSON_IMPL(id),
11302 TOJSON_IMPL(mode),
11303 TOJSON_IMPL(serviceConfigurationFileCheckSecs),
11304 TOJSON_IMPL(bridgingConfigurationFileName),
11305 TOJSON_IMPL(bridgingConfigurationFileCommand),
11306 TOJSON_IMPL(bridgingConfigurationFileCheckSecs),
11307 TOJSON_IMPL(statusReport),
11308 TOJSON_IMPL(externalHealthCheckResponder),
11309 TOJSON_IMPL(internals),
11310 TOJSON_IMPL(certStoreFileName),
11311 TOJSON_IMPL(certStorePasswordHex),
11312 TOJSON_IMPL(enginePolicy),
11313 TOJSON_IMPL(configurationCheckSignalName),
11314 TOJSON_IMPL(fipsCrypto),
11315 TOJSON_IMPL(nsm)
11316 };
11317 }
11318 static void from_json(const nlohmann::json& j, BridgingServerConfiguration& p)
11319 {
11320 p.clear();
11321 getOptional<std::string>("id", p.id, j);
11322 getOptional<BridgingServerConfiguration::OpMode_t>("mode", p.mode, j, BridgingServerConfiguration::OpMode_t::omRaw);
11323 getOptional<int>("serviceConfigurationFileCheckSecs", p.serviceConfigurationFileCheckSecs, j, 60);
11324 getOptional<std::string>("bridgingConfigurationFileName", p.bridgingConfigurationFileName, j);
11325 getOptional<std::string>("bridgingConfigurationFileCommand", p.bridgingConfigurationFileCommand, j);
11326 getOptional<int>("bridgingConfigurationFileCheckSecs", p.bridgingConfigurationFileCheckSecs, j, 60);
11327 getOptional<BridgingServerStatusReportConfiguration>("statusReport", p.statusReport, j);
11328 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
11329 getOptional<BridgingServerInternals>("internals", p.internals, j);
11330 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
11331 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
11332 j.at("enginePolicy").get_to(p.enginePolicy);
11333 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.6cc0651.${id}");
11334 getOptional<FipsCryptoSettings>("fipsCrypto", p.fipsCrypto, j);
11335 getOptional<NsmConfiguration>("nsm", p.nsm, j);
11336 }
11337
11338
11339 //-----------------------------------------------------------
11340 JSON_SERIALIZED_CLASS(EarGroupsConfiguration)
11351 {
11352 IMPLEMENT_JSON_SERIALIZATION()
11353 IMPLEMENT_JSON_DOCUMENTATION(EarGroupsConfiguration)
11354
11355 public:
11357 std::vector<Group> groups;
11358
11360 {
11361 clear();
11362 }
11363
11364 void clear()
11365 {
11366 groups.clear();
11367 }
11368 };
11369
11370 static void to_json(nlohmann::json& j, const EarGroupsConfiguration& p)
11371 {
11372 j = nlohmann::json{
11373 TOJSON_IMPL(groups)
11374 };
11375 }
11376 static void from_json(const nlohmann::json& j, EarGroupsConfiguration& p)
11377 {
11378 p.clear();
11379 getOptional<std::vector<Group>>("groups", p.groups, j);
11380 }
11381
11382 //-----------------------------------------------------------
11383 JSON_SERIALIZED_CLASS(EarServerStatusReportConfiguration)
11394 {
11395 IMPLEMENT_JSON_SERIALIZATION()
11396 IMPLEMENT_JSON_DOCUMENTATION(EarServerStatusReportConfiguration)
11397
11398 public:
11400 std::string fileName;
11401
11404
11407
11409 std::string runCmd;
11410
11413
11415 {
11416 clear();
11417 }
11418
11419 void clear()
11420 {
11421 fileName.clear();
11422 intervalSecs = 60;
11423 enabled = false;
11424 includeGroupDetail = false;
11425 runCmd.clear();
11426 }
11427 };
11428
11429 static void to_json(nlohmann::json& j, const EarServerStatusReportConfiguration& p)
11430 {
11431 j = nlohmann::json{
11432 TOJSON_IMPL(fileName),
11433 TOJSON_IMPL(intervalSecs),
11434 TOJSON_IMPL(enabled),
11435 TOJSON_IMPL(includeGroupDetail),
11436 TOJSON_IMPL(runCmd)
11437 };
11438 }
11439 static void from_json(const nlohmann::json& j, EarServerStatusReportConfiguration& p)
11440 {
11441 p.clear();
11442 getOptional<std::string>("fileName", p.fileName, j);
11443 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
11444 getOptional<bool>("enabled", p.enabled, j, false);
11445 getOptional<std::string>("runCmd", p.runCmd, j);
11446 getOptional<bool>("includeGroupDetail", p.includeGroupDetail, j, false);
11447 }
11448
11449 //-----------------------------------------------------------
11450 JSON_SERIALIZED_CLASS(EarServerInternals)
11463 {
11464 IMPLEMENT_JSON_SERIALIZATION()
11465 IMPLEMENT_JSON_DOCUMENTATION(EarServerInternals)
11466
11467 public:
11470
11473
11476
11478 {
11479 clear();
11480 }
11481
11482 void clear()
11483 {
11484 watchdog.clear();
11485 tuning.clear();
11486 housekeeperIntervalMs = 1000;
11487 }
11488 };
11489
11490 static void to_json(nlohmann::json& j, const EarServerInternals& p)
11491 {
11492 j = nlohmann::json{
11493 TOJSON_IMPL(watchdog),
11494 TOJSON_IMPL(housekeeperIntervalMs),
11495 TOJSON_IMPL(tuning)
11496 };
11497 }
11498 static void from_json(const nlohmann::json& j, EarServerInternals& p)
11499 {
11500 p.clear();
11501 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
11502 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
11503 getOptional<TuningSettings>("tuning", p.tuning, j);
11504 }
11505
11506 //-----------------------------------------------------------
11507 JSON_SERIALIZED_CLASS(EarServerConfiguration)
11517 {
11518 IMPLEMENT_JSON_SERIALIZATION()
11519 IMPLEMENT_JSON_DOCUMENTATION(EarServerConfiguration)
11520
11521 public:
11522
11524 std::string id;
11525
11528
11531
11534
11537
11540
11543
11546
11549
11552
11555
11558
11561
11564
11566 {
11567 clear();
11568 }
11569
11570 void clear()
11571 {
11572 id.clear();
11573 serviceConfigurationFileCheckSecs = 60;
11574 groupsConfigurationFileName.clear();
11575 groupsConfigurationFileCommand.clear();
11576 groupsConfigurationFileCheckSecs = 60;
11577 statusReport.clear();
11578 externalHealthCheckResponder.clear();
11579 internals.clear();
11580 certStoreFileName.clear();
11581 certStorePasswordHex.clear();
11582 enginePolicy.clear();
11583 configurationCheckSignalName = "rts.9a164fa.${id}";
11584 fipsCrypto.clear();
11585 nsm.clear();
11586 }
11587 };
11588
11589 static void to_json(nlohmann::json& j, const EarServerConfiguration& p)
11590 {
11591 j = nlohmann::json{
11592 TOJSON_IMPL(id),
11593 TOJSON_IMPL(serviceConfigurationFileCheckSecs),
11594 TOJSON_IMPL(groupsConfigurationFileName),
11595 TOJSON_IMPL(groupsConfigurationFileCommand),
11596 TOJSON_IMPL(groupsConfigurationFileCheckSecs),
11597 TOJSON_IMPL(statusReport),
11598 TOJSON_IMPL(externalHealthCheckResponder),
11599 TOJSON_IMPL(internals),
11600 TOJSON_IMPL(certStoreFileName),
11601 TOJSON_IMPL(certStorePasswordHex),
11602 TOJSON_IMPL(enginePolicy),
11603 TOJSON_IMPL(configurationCheckSignalName),
11604 TOJSON_IMPL(fipsCrypto),
11605 TOJSON_IMPL(nsm)
11606 };
11607 }
11608 static void from_json(const nlohmann::json& j, EarServerConfiguration& p)
11609 {
11610 p.clear();
11611 getOptional<std::string>("id", p.id, j);
11612 getOptional<int>("serviceConfigurationFileCheckSecs", p.serviceConfigurationFileCheckSecs, j, 60);
11613 getOptional<std::string>("groupsConfigurationFileName", p.groupsConfigurationFileName, j);
11614 getOptional<std::string>("groupsConfigurationFileCommand", p.groupsConfigurationFileCommand, j);
11615 getOptional<int>("groupsConfigurationFileCheckSecs", p.groupsConfigurationFileCheckSecs, j, 60);
11616 getOptional<EarServerStatusReportConfiguration>("statusReport", p.statusReport, j);
11617 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
11618 getOptional<EarServerInternals>("internals", p.internals, j);
11619 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
11620 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
11621 j.at("enginePolicy").get_to(p.enginePolicy);
11622 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.9a164fa.${id}");
11623 getOptional<FipsCryptoSettings>("fipsCrypto", p.fipsCrypto, j);
11624 getOptional<NsmConfiguration>("nsm", p.nsm, j);
11625 }
11626
11627//-----------------------------------------------------------
11628 JSON_SERIALIZED_CLASS(EngageSemGroupsConfiguration)
11639 {
11640 IMPLEMENT_JSON_SERIALIZATION()
11641 IMPLEMENT_JSON_DOCUMENTATION(EngageSemGroupsConfiguration)
11642
11643 public:
11645 std::vector<Group> groups;
11646
11648 {
11649 clear();
11650 }
11651
11652 void clear()
11653 {
11654 groups.clear();
11655 }
11656 };
11657
11658 static void to_json(nlohmann::json& j, const EngageSemGroupsConfiguration& p)
11659 {
11660 j = nlohmann::json{
11661 TOJSON_IMPL(groups)
11662 };
11663 }
11664 static void from_json(const nlohmann::json& j, EngageSemGroupsConfiguration& p)
11665 {
11666 p.clear();
11667 getOptional<std::vector<Group>>("groups", p.groups, j);
11668 }
11669
11670 //-----------------------------------------------------------
11671 JSON_SERIALIZED_CLASS(EngageSemServerStatusReportConfiguration)
11682 {
11683 IMPLEMENT_JSON_SERIALIZATION()
11684 IMPLEMENT_JSON_DOCUMENTATION(EngageSemServerStatusReportConfiguration)
11685
11686 public:
11688 std::string fileName;
11689
11692
11695
11697 std::string runCmd;
11698
11701
11703 {
11704 clear();
11705 }
11706
11707 void clear()
11708 {
11709 fileName.clear();
11710 intervalSecs = 60;
11711 enabled = false;
11712 includeGroupDetail = false;
11713 runCmd.clear();
11714 }
11715 };
11716
11717 static void to_json(nlohmann::json& j, const EngageSemServerStatusReportConfiguration& p)
11718 {
11719 j = nlohmann::json{
11720 TOJSON_IMPL(fileName),
11721 TOJSON_IMPL(intervalSecs),
11722 TOJSON_IMPL(enabled),
11723 TOJSON_IMPL(includeGroupDetail),
11724 TOJSON_IMPL(runCmd)
11725 };
11726 }
11727 static void from_json(const nlohmann::json& j, EngageSemServerStatusReportConfiguration& p)
11728 {
11729 p.clear();
11730 getOptional<std::string>("fileName", p.fileName, j);
11731 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
11732 getOptional<bool>("enabled", p.enabled, j, false);
11733 getOptional<std::string>("runCmd", p.runCmd, j);
11734 getOptional<bool>("includeGroupDetail", p.includeGroupDetail, j, false);
11735 }
11736
11737 //-----------------------------------------------------------
11738 JSON_SERIALIZED_CLASS(EngageSemServerInternals)
11751 {
11752 IMPLEMENT_JSON_SERIALIZATION()
11753 IMPLEMENT_JSON_DOCUMENTATION(EngageSemServerInternals)
11754
11755 public:
11758
11761
11764
11766 {
11767 clear();
11768 }
11769
11770 void clear()
11771 {
11772 watchdog.clear();
11773 tuning.clear();
11774 housekeeperIntervalMs = 1000;
11775 }
11776 };
11777
11778 static void to_json(nlohmann::json& j, const EngageSemServerInternals& p)
11779 {
11780 j = nlohmann::json{
11781 TOJSON_IMPL(watchdog),
11782 TOJSON_IMPL(housekeeperIntervalMs),
11783 TOJSON_IMPL(tuning)
11784 };
11785 }
11786 static void from_json(const nlohmann::json& j, EngageSemServerInternals& p)
11787 {
11788 p.clear();
11789 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
11790 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
11791 getOptional<TuningSettings>("tuning", p.tuning, j);
11792 }
11793
11794 //-----------------------------------------------------------
11795 JSON_SERIALIZED_CLASS(EngageSemServerConfiguration)
11805 {
11806 IMPLEMENT_JSON_SERIALIZATION()
11807 IMPLEMENT_JSON_DOCUMENTATION(EngageSemServerConfiguration)
11808
11809 public:
11810
11812 std::string id;
11813
11816
11819
11822
11825
11828
11831
11834
11837
11840
11843
11846
11849
11852
11853 int maxQueueLen;
11854 int minQueuingMs;
11855 int maxQueuingMs;
11856 int minPriority;
11857 int maxPriority;
11858
11860 {
11861 clear();
11862 }
11863
11864 void clear()
11865 {
11866 id.clear();
11867 serviceConfigurationFileCheckSecs = 60;
11868 groupsConfigurationFileName.clear();
11869 groupsConfigurationFileCommand.clear();
11870 groupsConfigurationFileCheckSecs = 60;
11871 statusReport.clear();
11872 externalHealthCheckResponder.clear();
11873 internals.clear();
11874 certStoreFileName.clear();
11875 certStorePasswordHex.clear();
11876 enginePolicy.clear();
11877 configurationCheckSignalName = "rts.9a164fa.${id}";
11878 fipsCrypto.clear();
11879 nsm.clear();
11880
11881 maxQueueLen = 64;
11882 minQueuingMs = 0;
11883 maxQueuingMs = 15000;
11884 minPriority = 0;
11885 maxPriority = 255;
11886 }
11887 };
11888
11889 static void to_json(nlohmann::json& j, const EngageSemServerConfiguration& p)
11890 {
11891 j = nlohmann::json{
11892 TOJSON_IMPL(id),
11893 TOJSON_IMPL(serviceConfigurationFileCheckSecs),
11894 TOJSON_IMPL(groupsConfigurationFileName),
11895 TOJSON_IMPL(groupsConfigurationFileCommand),
11896 TOJSON_IMPL(groupsConfigurationFileCheckSecs),
11897 TOJSON_IMPL(statusReport),
11898 TOJSON_IMPL(externalHealthCheckResponder),
11899 TOJSON_IMPL(internals),
11900 TOJSON_IMPL(certStoreFileName),
11901 TOJSON_IMPL(certStorePasswordHex),
11902 TOJSON_IMPL(enginePolicy),
11903 TOJSON_IMPL(configurationCheckSignalName),
11904 TOJSON_IMPL(fipsCrypto),
11905 TOJSON_IMPL(nsm),
11906 TOJSON_IMPL(maxQueueLen),
11907 TOJSON_IMPL(minQueuingMs),
11908 TOJSON_IMPL(maxQueuingMs),
11909 TOJSON_IMPL(minPriority),
11910 TOJSON_IMPL(maxPriority)
11911 };
11912 }
11913 static void from_json(const nlohmann::json& j, EngageSemServerConfiguration& p)
11914 {
11915 p.clear();
11916 getOptional<std::string>("id", p.id, j);
11917 getOptional<int>("serviceConfigurationFileCheckSecs", p.serviceConfigurationFileCheckSecs, j, 60);
11918 getOptional<std::string>("groupsConfigurationFileName", p.groupsConfigurationFileName, j);
11919 getOptional<std::string>("groupsConfigurationFileCommand", p.groupsConfigurationFileCommand, j);
11920 getOptional<int>("groupsConfigurationFileCheckSecs", p.groupsConfigurationFileCheckSecs, j, 60);
11921 getOptional<EngageSemServerStatusReportConfiguration>("statusReport", p.statusReport, j);
11922 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
11923 getOptional<EngageSemServerInternals>("internals", p.internals, j);
11924 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
11925 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
11926 j.at("enginePolicy").get_to(p.enginePolicy);
11927 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.9a164fa.${id}");
11928 getOptional<FipsCryptoSettings>("fipsCrypto", p.fipsCrypto, j);
11929 getOptional<NsmConfiguration>("nsm", p.nsm, j);
11930 getOptional<int>("maxQueueLen", p.maxQueueLen, j, 64);
11931 getOptional<int>("minQueuingMs", p.minQueuingMs, j, 0);
11932 getOptional<int>("maxQueuingMs", p.maxQueuingMs, j, 15000);
11933 getOptional<int>("minPriority", p.minPriority, j, 0);
11934 getOptional<int>("maxPriority", p.maxPriority, j, 255);
11935 }
11936
11937 //-----------------------------------------------------------
11938 JSON_SERIALIZED_CLASS(EngateGroup)
11948 class EngateGroup : public Group
11949 {
11950 IMPLEMENT_JSON_SERIALIZATION()
11951 IMPLEMENT_JSON_DOCUMENTATION(EngateGroup)
11952
11953 public:
11954 bool useVad;
11955 uint32_t inputHangMs;
11956 uint32_t inputActivationPowerThreshold;
11957 uint32_t inputDeactivationPowerThreshold;
11958
11959 EngateGroup()
11960 {
11961 clear();
11962 }
11963
11964 void clear()
11965 {
11966 Group::clear();
11967 useVad = false;
11968 inputHangMs = 750;
11969 inputActivationPowerThreshold = 700;
11970 inputDeactivationPowerThreshold = 125;
11971 }
11972 };
11973
11974 static void to_json(nlohmann::json& j, const EngateGroup& p)
11975 {
11976 nlohmann::json g;
11977 to_json(g, static_cast<const Group&>(p));
11978
11979 j = nlohmann::json{
11980 TOJSON_IMPL(useVad),
11981 TOJSON_IMPL(inputHangMs),
11982 TOJSON_IMPL(inputActivationPowerThreshold),
11983 TOJSON_IMPL(inputDeactivationPowerThreshold)
11984 };
11985 }
11986 static void from_json(const nlohmann::json& j, EngateGroup& p)
11987 {
11988 p.clear();
11989 from_json(j, static_cast<Group&>(p));
11990 getOptional<uint32_t>("inputHangMs", p.inputHangMs, j, 750);
11991 getOptional<uint32_t>("inputActivationPowerThreshold", p.inputActivationPowerThreshold, j, 700);
11992 getOptional<uint32_t>("inputDeactivationPowerThreshold", p.inputDeactivationPowerThreshold, j, 125);
11993 }
11994
11995 //-----------------------------------------------------------
11996 JSON_SERIALIZED_CLASS(EngateGroupsConfiguration)
12007 {
12008 IMPLEMENT_JSON_SERIALIZATION()
12009 IMPLEMENT_JSON_DOCUMENTATION(EngateGroupsConfiguration)
12010
12011 public:
12013 std::vector<EngateGroup> groups;
12014
12016 {
12017 clear();
12018 }
12019
12020 void clear()
12021 {
12022 groups.clear();
12023 }
12024 };
12025
12026 static void to_json(nlohmann::json& j, const EngateGroupsConfiguration& p)
12027 {
12028 j = nlohmann::json{
12029 TOJSON_IMPL(groups)
12030 };
12031 }
12032 static void from_json(const nlohmann::json& j, EngateGroupsConfiguration& p)
12033 {
12034 p.clear();
12035 getOptional<std::vector<EngateGroup>>("groups", p.groups, j);
12036 }
12037
12038 //-----------------------------------------------------------
12039 JSON_SERIALIZED_CLASS(EngateServerStatusReportConfiguration)
12050 {
12051 IMPLEMENT_JSON_SERIALIZATION()
12052 IMPLEMENT_JSON_DOCUMENTATION(EngateServerStatusReportConfiguration)
12053
12054 public:
12056 std::string fileName;
12057
12060
12063
12065 std::string runCmd;
12066
12069
12071 {
12072 clear();
12073 }
12074
12075 void clear()
12076 {
12077 fileName.clear();
12078 intervalSecs = 60;
12079 enabled = false;
12080 includeGroupDetail = false;
12081 runCmd.clear();
12082 }
12083 };
12084
12085 static void to_json(nlohmann::json& j, const EngateServerStatusReportConfiguration& p)
12086 {
12087 j = nlohmann::json{
12088 TOJSON_IMPL(fileName),
12089 TOJSON_IMPL(intervalSecs),
12090 TOJSON_IMPL(enabled),
12091 TOJSON_IMPL(includeGroupDetail),
12092 TOJSON_IMPL(runCmd)
12093 };
12094 }
12095 static void from_json(const nlohmann::json& j, EngateServerStatusReportConfiguration& p)
12096 {
12097 p.clear();
12098 getOptional<std::string>("fileName", p.fileName, j);
12099 getOptional<int>("intervalSecs", p.intervalSecs, j, 60);
12100 getOptional<bool>("enabled", p.enabled, j, false);
12101 getOptional<std::string>("runCmd", p.runCmd, j);
12102 getOptional<bool>("includeGroupDetail", p.includeGroupDetail, j, false);
12103 }
12104
12105 //-----------------------------------------------------------
12106 JSON_SERIALIZED_CLASS(EngateServerInternals)
12119 {
12120 IMPLEMENT_JSON_SERIALIZATION()
12121 IMPLEMENT_JSON_DOCUMENTATION(EngateServerInternals)
12122
12123 public:
12126
12129
12132
12134 {
12135 clear();
12136 }
12137
12138 void clear()
12139 {
12140 watchdog.clear();
12141 tuning.clear();
12142 housekeeperIntervalMs = 1000;
12143 }
12144 };
12145
12146 static void to_json(nlohmann::json& j, const EngateServerInternals& p)
12147 {
12148 j = nlohmann::json{
12149 TOJSON_IMPL(watchdog),
12150 TOJSON_IMPL(housekeeperIntervalMs),
12151 TOJSON_IMPL(tuning)
12152 };
12153 }
12154 static void from_json(const nlohmann::json& j, EngateServerInternals& p)
12155 {
12156 p.clear();
12157 getOptional<WatchdogSettings>("watchdog", p.watchdog, j);
12158 getOptional<int>("housekeeperIntervalMs", p.housekeeperIntervalMs, j, 1000);
12159 getOptional<TuningSettings>("tuning", p.tuning, j);
12160 }
12161
12162 //-----------------------------------------------------------
12163 JSON_SERIALIZED_CLASS(EngateServerConfiguration)
12173 {
12174 IMPLEMENT_JSON_SERIALIZATION()
12175 IMPLEMENT_JSON_DOCUMENTATION(EngateServerConfiguration)
12176
12177 public:
12178
12180 std::string id;
12181
12184
12187
12190
12193
12196
12199
12202
12205
12208
12211
12214
12217
12220
12222 {
12223 clear();
12224 }
12225
12226 void clear()
12227 {
12228 id.clear();
12229 serviceConfigurationFileCheckSecs = 60;
12230 groupsConfigurationFileName.clear();
12231 groupsConfigurationFileCommand.clear();
12232 groupsConfigurationFileCheckSecs = 60;
12233 statusReport.clear();
12234 externalHealthCheckResponder.clear();
12235 internals.clear();
12236 certStoreFileName.clear();
12237 certStorePasswordHex.clear();
12238 enginePolicy.clear();
12239 configurationCheckSignalName = "rts.9a164fa.${id}";
12240 fipsCrypto.clear();
12241 nsm.clear();
12242 }
12243 };
12244
12245 static void to_json(nlohmann::json& j, const EngateServerConfiguration& p)
12246 {
12247 j = nlohmann::json{
12248 TOJSON_IMPL(id),
12249 TOJSON_IMPL(serviceConfigurationFileCheckSecs),
12250 TOJSON_IMPL(groupsConfigurationFileName),
12251 TOJSON_IMPL(groupsConfigurationFileCommand),
12252 TOJSON_IMPL(groupsConfigurationFileCheckSecs),
12253 TOJSON_IMPL(statusReport),
12254 TOJSON_IMPL(externalHealthCheckResponder),
12255 TOJSON_IMPL(internals),
12256 TOJSON_IMPL(certStoreFileName),
12257 TOJSON_IMPL(certStorePasswordHex),
12258 TOJSON_IMPL(enginePolicy),
12259 TOJSON_IMPL(configurationCheckSignalName),
12260 TOJSON_IMPL(fipsCrypto),
12261 TOJSON_IMPL(nsm)
12262 };
12263 }
12264 static void from_json(const nlohmann::json& j, EngateServerConfiguration& p)
12265 {
12266 p.clear();
12267 getOptional<std::string>("id", p.id, j);
12268 getOptional<int>("serviceConfigurationFileCheckSecs", p.serviceConfigurationFileCheckSecs, j, 60);
12269 getOptional<std::string>("groupsConfigurationFileName", p.groupsConfigurationFileName, j);
12270 getOptional<std::string>("groupsConfigurationFileCommand", p.groupsConfigurationFileCommand, j);
12271 getOptional<int>("groupsConfigurationFileCheckSecs", p.groupsConfigurationFileCheckSecs, j, 60);
12272 getOptional<EngateServerStatusReportConfiguration>("statusReport", p.statusReport, j);
12273 getOptional<ExternalHealthCheckResponder>("externalHealthCheckResponder", p.externalHealthCheckResponder, j);
12274 getOptional<EngateServerInternals>("internals", p.internals, j);
12275 getOptional<std::string>("certStoreFileName", p.certStoreFileName, j);
12276 getOptional<std::string>("certStorePasswordHex", p.certStorePasswordHex, j);
12277 j.at("enginePolicy").get_to(p.enginePolicy);
12278 getOptional<std::string>("configurationCheckSignalName", p.configurationCheckSignalName, j, "rts.9a164fa.${id}");
12279 getOptional<FipsCryptoSettings>("fipsCrypto", p.fipsCrypto, j);
12280 getOptional<NsmConfiguration>("nsm", p.nsm, j);
12281 }
12282
12283 //-----------------------------------------------------------
12284 static inline void dumpExampleConfigurations(const char *path)
12285 {
12286 WatchdogSettings::document();
12287 FileRecordingRequest::document();
12288 Feature::document();
12289 Featureset::document();
12290 Agc::document();
12291 RtpPayloadTypeTranslation::document();
12292 NetworkInterfaceDevice::document();
12293 ListOfNetworkInterfaceDevice::document();
12294 RtpHeader::document();
12295 BlobInfo::document();
12296 TxAudioUri::document();
12297 AdvancedTxParams::document();
12298 Identity::document();
12299 Location::document();
12300 Power::document();
12301 Connectivity::document();
12302 PresenceDescriptorGroupItem::document();
12303 PresenceDescriptor::document();
12304 NetworkTxOptions::document();
12305 TcpNetworkTxOptions::document();
12306 NetworkAddress::document();
12307 NetworkAddressRxTx::document();
12308 NetworkAddressRestrictionList::document();
12309 StringRestrictionList::document();
12310 Rallypoint::document();
12311 RallypointCluster::document();
12312 NetworkDeviceDescriptor::document();
12313 TxAudio::document();
12314 AudioDeviceDescriptor::document();
12315 ListOfAudioDeviceDescriptor::document();
12316 Audio::document();
12317 TalkerInformation::document();
12318 GroupTalkers::document();
12319 Presence::document();
12320 Advertising::document();
12321 GroupPriorityTranslation::document();
12322 GroupTimeline::document();
12323 GroupAppTransport::document();
12324 RtpProfile::document();
12325 Group::document();
12326 Mission::document();
12327 LicenseDescriptor::document();
12328 EngineNetworkingRpUdpStreaming::document();
12329 EnginePolicyNetworking::document();
12330 Aec::document();
12331 Vad::document();
12332 Bridge::document();
12333 AndroidAudio::document();
12334 EnginePolicyAudio::document();
12335 SecurityCertificate::document();
12336 EnginePolicySecurity::document();
12337 EnginePolicyLogging::document();
12338 EnginePolicyDatabase::document();
12339 NamedAudioDevice::document();
12340 EnginePolicyNamedAudioDevices::document();
12341 Licensing::document();
12342 DiscoveryMagellan::document();
12343 DiscoverySsdp::document();
12344 DiscoverySap::document();
12345 DiscoveryCistech::document();
12346 DiscoveryTrellisware::document();
12347 DiscoveryConfiguration::document();
12348 EnginePolicyInternals::document();
12349 EnginePolicyTimelines::document();
12350 RtpMapEntry::document();
12351 ExternalModule::document();
12352 ExternalCodecDescriptor::document();
12353 EnginePolicy::document();
12354 TalkgroupAsset::document();
12355 EngageDiscoveredGroup::document();
12356 RallypointPeer::document();
12357 RallypointServerLimits::document();
12358 RallypointServerStatusReportConfiguration::document();
12359 RallypointServerLinkGraph::document();
12360 ExternalHealthCheckResponder::document();
12361 Tls::document();
12362 PeeringConfiguration::document();
12363 IgmpSnooping::document();
12364 RallypointReflector::document();
12365 RallypointUdpStreaming::document();
12366 RallypointServer::document();
12367 PlatformDiscoveredService::document();
12368 TimelineQueryParameters::document();
12369 CertStoreCertificate::document();
12370 CertStore::document();
12371 CertStoreCertificateElement::document();
12372 CertStoreDescriptor::document();
12373 CertificateDescriptor::document();
12374 BridgeCreationDetail::document();
12375 GroupConnectionDetail::document();
12376 GroupTxDetail::document();
12377 GroupCreationDetail::document();
12378 GroupReconfigurationDetail::document();
12379 GroupHealthReport::document();
12380 InboundProcessorStats::document();
12381 TrafficCounter::document();
12382 GroupStats::document();
12383 RallypointConnectionDetail::document();
12384 BridgingConfiguration::document();
12385 BridgingServerStatusReportConfiguration::document();
12386 BridgingServerInternals::document();
12387 BridgingServerConfiguration::document();
12388 EarGroupsConfiguration::document();
12389 EarServerStatusReportConfiguration::document();
12390 EarServerInternals::document();
12391 EarServerConfiguration::document();
12392 RangerPackets::document();
12393 TransportImpairment::document();
12394
12395 EngageSemGroupsConfiguration::document();
12396 EngageSemServerStatusReportConfiguration::document();
12397 EngageSemServerInternals::document();
12398 EngageSemServerConfiguration::document();
12399 }
12400}
12401
12402#ifndef WIN32
12403 #pragma GCC diagnostic pop
12404#endif
12405
12406#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....
int txnTimeoutSecs
[Optional, Default: 0] Number of seconds after which to time out delivery to the target node
PayloadType_t
Payload type. BlobInfo RTP supported Payload types.
std::string txnId
[Optional but required if txnTimeoutSecs is > 0]
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.
TuningSettings tuning
[Optional] Low-level tuning
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< KvPair > kvp
Array of kv pairs.
std::vector< KvPair > kvp
[Optional] Array of KV pairs
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.
TuningSettings tuning
[Optional] Low-level tuning
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.
TuningSettings tuning
[Optional] Low-level tuning
int housekeeperIntervalMs
[Optional, Default: 1000] Interval at which to run the housekeeper thread.
TODO: Configuration for the EFC server status report file.
std::vector< EngateGroup > groups
Array of groups in the configuration.
EngateServerStatusReportConfiguration statusReport
Details for producing a status report.
ExternalHealthCheckResponder externalHealthCheckResponder
Details concerning the server's interaction with an external health-checker such as a load-balancer.
std::string certStorePasswordHex
Hex password for the certificate store (if any)
std::string groupsConfigurationFileName
Name of a file containing the ear configuration.
EngateServerInternals internals
Internal settings.
int groupsConfigurationFileCheckSecs
Number of seconds between checks to see if the configuration has been updated. Default is 60.
FipsCryptoSettings fipsCrypto
[Optional] Settings for the FIPS crypto.
std::string certStoreFileName
Path to the certificate store.
NsmConfiguration nsm
[Optional] Settings for NSM.
std::string configurationCheckSignalName
Name to use for signalling a configuration check.
EnginePolicy enginePolicy
The policy to be used for the underlying Engage Engine.
int serviceConfigurationFileCheckSecs
Number of seconds between checks to see if the service configuration has been updated....
std::string id
A unqiue identifier for the EAR server.
std::string groupsConfigurationFileCommand
Command-line to execute that returns a configuration.
TuningSettings tuning
[Optional] Low-level tuning
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 engate 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 saveOutputPcm
[Optional, Default: false] If true, input audio is written to a PCM file in the data directory
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 saveInputPcm
[Optional, Default: false] If true, input audio is written to a PCM file in the data directory
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.
EngineStatusReportConfiguration statusReport
Optional statusReport - details for the status report.
EnginePolicyInternals internals
Internal settings.
EnginePolicySecurity security
Security settings.
EnginePolicyTimelines timelines
Timelines settings.
EnginePolicyNetworking networking
Security settings.
TuningSettings tuning
[Optional] Low-level tuning
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.
int maxDiskMb
Specifies the maximum disk space to use - defaults to maxStorageMb.
SecurityCertificate security
The certificate to use for signing the recording.
int maxAudioEventMemMb
Specifies the maximum number of megabytes to allow for a single audio event's memory block - defaults...
long maxEventAgeSecs
Maximum age of an event after which it is to be erased.
int maxMemMb
Specifies the maximum memory to use - defaults to maxStorageMb.
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 for the translation server status report file.
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 curves
[Optional] Specifies the NIST-approved curves to be used for FIPS
std::string path
Path where the crypto engine module is located
std::string ciphers
[Optional] Specifies the NIST-approved ciphers to be used for FIPS
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.
int queryIntervalMs
[Optional, Default 125000] Interval between sending IGMP membership queries. If 0,...
int subscriptionTimeoutMs
[Optional, Default 0] Typically calculated according to RFC specifications. Set a value here to manua...
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.
TuningSettings tuning
[Optional] Low-level tuning
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
int port
[Default: RP port] The multicast network interface for mDNS
bool enabled
[Default: false] Advertising is enabled
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.
float serverProcessingMs
Server processing time in milliseconds - used for roundtrip reports.
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
[Optional] Vector of additional TX addresses .
NetworkAddress tx
The network address for transmitting network traffic to.
DirectionRestriction_t directionRestriction
[Optional] Restriction of direction of traffic flow
DirectionRestriction_t
Enum describing direction(s) for the reflector.
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
std::string meshName
[Optional] This Rallypoint's mesh name
uint32_t maxOutboundPeerConnectionIntervalDeltaSecs
[Optional, Default 15] Sets the delta value for the maximum number of seconds to delay when attemptin...
TuningSettings tuning
[Optional] Low-level tuning
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.
std::vector< std::string > extraMeshes
[Optional] List of additional meshes that can be reached via this RP
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
bool requireClientCertificate
[Default: false] Indicates whether the client is required to present a certificate
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.
uint32_t ssrc
The RTS SSRC 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.
ManufacturedAliasType_t manufacturedAliasType
The method used to "manufacture" the alias.
ManufacturedAliasType_t
Manufactured alias type If an alias is "manufactured" then the alias is not a real user but is instea...
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.
uint32_t maxActiveBlobObjects
[Optional, Default 0 (no max)] Maximum number of blob objects allowed to be active
uint32_t maxActiveRtpProcessors
[Optional, Default 0 (no max)] Maximum number concurrent RTP processors
uint32_t maxPooledBufferMb
[Optional, Default 0 (no max)] Maximum number of buffer bytes allowed to be pooled
uint32_t maxActiveBufferObjects
[Optional, Default 0 (no max)] Maximum number of buffer objects allowed to be active
uint32_t maxPooledBufferObjects
[Optional, Default 0 (no max)] Maximum number of buffer objects allowed to be pooled
uint32_t maxPooledRtpObjects
[Optional, Default 0 (no max)] Maximum number of RTP objects allowed to be pooled
uint32_t maxPooledBlobMb
[Optional, Default 0 (no max)] Maximum number of blob bytes allowed to be pooled
uint32_t maxPooledRtpMb
[Optional, Default 0 (no max)] Maximum number of RTP bytes allowed to be pooled
uint32_t maxActiveRtpObjects
[Optional, Default 0 (no max)] Maximum number of RTP objects allowed to be active
uint32_t maxPooledBlobObjects
[Optional, Default 0 (no max)] Maximum number of blob objects allowed to be pooled
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...