mbgtools-lx  4.2.8
cfg_hlp.h
Go to the documentation of this file.
1 
2 /**************************************************************************
3  *
4  * $Id: cfg_hlp.h 1.6 2018/09/20 11:22:11 martin REL_M $
5  *
6  * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
7  *
8  * Description:
9  * Definitions and prototypes for configuration programs.
10  *
11  * WARNING: Changing the constants defined here affects the size of
12  * the related structures and arrays, and thus would break compatibility
13  * if used in DLLs / shared object libraries.
14  *
15  * Care must be taken that the number of objects supported by
16  * any particular device (which can be only determined at runtime)
17  * does not exceed the max. number of objects specified here
18  * for the configuration programs.
19  *
20  * -----------------------------------------------------------------------
21  * $Log: cfg_hlp.h $
22  * Revision 1.6 2018/09/20 11:22:11 martin
23  * Renamed some global variables to more common names.
24  * Added string initializer tables and associated macros
25  * for some PTP configuration stuff.
26  * Revision 1.5 2018/07/05 10:37:05Z martin
27  * Renamed setup_port_info_from_port_settings()
28  * to setup_port_info_from_port_parm().
29  * Initializer for OS targets added by philipp.
30  * Database feature support added by philipp.
31  * I/O helper structures and API refuctored by philipp.
32  * Firmware management wrapper structs added by philipp.
33  * Syslog option added to monitoring feature by philipp.
34  * Service feature and API added by philipp.
35  * Return random UID for TLVs under Windows.
36  * MBG_EVENT stuff integrated with common/general monitoring
37  * stuff by philipp.
38  * Monitoring events refactored and tainted config support
39  * added by philipp.
40  * Exclude some function from build in kernel mode.
41  * Fixed build for NetBSD.
42  * Supporting MBG_TGT_NO_TGT.
43  * Updated function prototypes.
44  * Revision 1.4 2017/07/05 13:22:00 martin
45  * Definitions for TLV, IMS, and GPIO provided by philipp.
46  * Definitions for ALL_XPB_INFO, ALL_NET_CFG_INFO,
47  * ALL_PTP_V2_COMMON_DATASETS, ALL_PTP_V1_COMMON_DATASETS,
48  * ALL_UCAP and associated stuff provided by thomas-b.
49  * Definitions for xmulti_ref and IO PORT, SNMP and MONITORING,
50  * and associated stuff provided by philipp and thomas-b.
51  * New definitions COMP_SIG_MODES and PCPS_TIME_EXT_FLAGS.
52  * New inline functions device_id_is_serial() and
53  * device_id_is_lan().
54  * Moved inline function num_bits_set() and a lot of
55  * global configuration variables here.
56  * Older defines N_SUPP_DEV, PCPS_MAX_DDEVS, and MBG_MAX_DEVICES
57  * have been obsoleted by new defines N_SUPP_DEV_BUS, N_SUPP_DEV_EXT,
58  * and N_SUPP_DEV_TOTAL.
59  * Updated function prototypes.
60  * Revision 1.3 2013/09/25 10:02:15 martin
61  * Added ALL_PTP_CFG_INFO, ALL_GNSS_SAT_INFO_IDX and
62  * related definitions.
63  * Added doxygen comments.
64  * Revision 1.2 2012/10/02 18:16:26 martin
65  * Modified some typedefs to be more compliant with the underlying types.
66  * Revision 1.1 2011/09/21 15:59:59 martin
67  * Initial revision.
68  *
69  **************************************************************************/
70 
71 #ifndef _CFG_HLP_H
72 #define _CFG_HLP_H
73 
74 
75 /* Other headers to be included */
76 
77 #include <gpsdefs.h>
78 #include <mbgklist.h>
79 
80 #if !defined( MBG_TGT_KERNEL )
81  #include <stdlib.h>
82  #include <string.h>
83 #endif
84 
85 #if defined( _PRELIMINARY_CODE )
86  #if defined( MBG_TGT_POSIX )
87  #include <sys/stat.h>
88  #include <time.h>
89  #endif // MBG_TGT_POSIX
90 
91  #if defined( MBG_TGT_LINUX )
92  #include <sys/sysinfo.h>
93  #endif // MBG_TGT_LINUX
94 
95 #endif // _PRELIMINARY_CODE
96 
97 #ifdef _CFG_HLP
98  #define _ext
99  #define _DO_INIT
100 #else
101  #define _ext extern
102 #endif
103 
104 
105 /* Start of header body */
106 
107 #ifdef __cplusplus
108 extern "C" {
109 #endif
110 
111 
112 #if 1 // ### TODO cleanup
113 
114 #define N_SUPP_DEV_BUS 16
115 #define N_SUPP_DEV_EXT 1
116 
117 #define N_SUPP_DEV_TOTAL ( N_SUPP_DEV_BUS + N_SUPP_DEV_EXT )
118 
119 typedef struct _DEVICE_INFO
120 {
121  char *hw_id;
122  char fw_id[100];
123 
124 } DEVICE_INFO;
125 
127 
128 #endif
129 
130 
131 
136 #define MAX_PARM_PORT 10
138 
140 #define MAX_PARM_STR_TYPE 20
141 
143 #define MAX_PARM_POUT 10
144 
146 #define MAX_PARM_GNSS_SAT N_GNSS_TYPES
147 
149 #define MAX_PARM_PTP_UC_MASTER 3
150 
152 #define MAX_PARM_EXT_NTP_SRVR 20
153 
155 #define MAX_PARM_GPIO 10
156 
158 #define MAX_PARM_XMR 10
159 
161 #define MAX_EXT_NTP_SERVERS 20
162 
166 #define MAX_MBG_TIME_MON_MODULES 10
167 
171 #define MAX_MBG_TIME_MON_TARGETS 100
172 
173 
174 
177 
180 
190 typedef struct
191 {
192  ALL_PORT_INFO_IDX pii;
193  ALL_STR_TYPE_INFO_IDX stii;
195 
197 
198 
199 
207 typedef struct
208 {
212 } ALL_XBP_INFO;
213 
214 
215 
225 
226 
227 
236 typedef struct
237 {
245 
247 
248 
249 
258 typedef struct
259 {
265 
266 } ALL_SNMP_INFO;
267 
268 
269 
276 typedef struct mbg_event
277 {
278  unsigned idx;
282  /* Pointer for 3rd party to connect some data */
283  void *backref;
284  /* Pointer for the mallocer to connect some private data */
285  void *priv_data;
286  /*
287  * Can be used to free/release priv or cookie data (if necessary)
288  * or do other stuff before event gets freed. But NEVER use release
289  * to free the event itself!! This is done by the API right after calling
290  * release.
291  */
292  void (*release_priv)(struct mbg_event*);
293  void (*release_backref)(struct mbg_event*);
294 
295 } MBG_EVENT;
296 
297 typedef struct
298 {
299  unsigned num_events;
301 
302 } ALL_EVENTS;
303 
304 
312 typedef struct mbg_syslog_server
313 {
314  unsigned idx;
316 
317  /* Pointer for the mallocer to connect some private data */
318  void *priv_data;
319  /*
320  * Can be used to free/release priv or cookie data (if necessary)
321  * or do other stuff before event gets freed. But NEVER use release
322  * to free the event itself!! This is done by the API right after calling
323  * release.
324  */
325  void (*release_priv)(struct mbg_syslog_server*);
326 
328 
329 typedef struct
330 {
333 
335 
336 
346 typedef struct
347 {
352 
354 
355 
356 
359 
369 typedef struct
370 {
373  ALL_PTP_UC_MASTER_INFO_IDX all_ptp_uc_master_info_idx;
374 
376 
377 
378 
393 typedef struct
394 {
400 
402 
403 
404 
419 typedef struct
420 {
426 
428 
429 
430 
438 
439 
440 
447 typedef struct
448 {
452  ALL_GNSS_SAT_INFO_IDX gnss_sat_info_idx;
453 
454 } ALL_GNSS_INFO;
455 
456 
457 
460 
469 typedef struct
470 {
471  ALL_NTP_PEER_SETTINGS all_ntp_peer_settings;
472 
474 
475 
476 typedef struct
477 {
482 
485 
490 
492 
493 
494 typedef struct
495 {
500 
501 
502 
505 
508 
509 
510 
511 
514 
517 
518 
519 
520 typedef struct
521 {
526 
527 
528 typedef struct
529 {
534  /* ALL_XMULTI_REF_STATUS related flag if at least one ref type supports stats */
535  unsigned char has_stats;
536  /* ALL_XMULTI_REF_STATUS related flag if at least one ref type supports metrics */
537  unsigned char has_metrics;
539 
540 
541 
542 typedef struct
543 {
548 } ALL_IMS_INFO;
549 
550 
551 typedef struct
552 {
556 } ALL_IMS_STATE;
557 
558 
559 
560 typedef struct
561 {
564 } ALL_GPIO_INFO;
565 
566 
567 typedef struct
568 {
571 
572 
573 typedef struct mbg_io_port
574 {
575  unsigned idx;
579  /* Shortcut to settings in p_info */
581  void *priv_data;
582  void (*free_priv_data)(const struct mbg_io_port*, void*);
583 } MBG_IO_PORT;
584 
585 
586 typedef struct
587 {
589  unsigned num_ports;
592 
593 
594 #ifndef MAX_UCAP_ENTRIES
595 /*
596  * According to Andre's GPS firmware this is the maximum
597  * number of user captures that are preserved.
598  */
599 #define MAX_UCAP_ENTRIES 585
600 #endif
601 
602 typedef struct
603 {
604  struct mbg_klist_head head;
606 } UCAP_ENTRY;
607 
608 typedef struct
609 {
610  uint32_t num_ucaps;
611  struct mbg_klist_head list;
612 } ALL_UCAP_INFO;
613 
614 // User Captures via Network configuration, see ::MBG_XFEATURE_UCAP_NET
615 typedef struct
616 {
620 
621 
622 typedef struct mbg_user
623 {
624  unsigned idx;
627 
628  char salt[3];
629 
630  /* Pointer for 3rd party to connect some data */
631  void *backref;
632  /* Pointer for the mallocer to connect some private data */
633  void *priv_data;
634  /*
635  * Can be used to free/release priv or cookie data (if necessary)
636  * or do other stuff before user gets freed. But NEVER use release
637  * to free the user itself!! This is done by the API right after calling
638  * release.
639  */
640  void (*release_priv)(struct mbg_user*);
641  void (*release_backref)(struct mbg_user*);
642 
643 } MBG_USER;
644 
645 typedef struct
646 {
650 
651 } ALL_USER_INFO;
652 
653 
654 typedef struct mbg_service
655 {
656  unsigned idx;
659 
660  /* Pointer for 3rd party to connect some data */
661  void *backref;
662  /* Pointer for the mallocer to connect some private data */
663  void *priv_data;
664  /*
665  * Can be used to free/release priv or cookie data (if necessary)
666  * or do other stuff before service gets freed. But NEVER use release
667  * to free the service itself!! This is done by the API right after calling
668  * release.
669  */
670  void (*release_priv)(struct mbg_service*);
671  void (*release_backref)(struct mbg_service*);
672 
673 } MBG_SERVICE;
674 
675 typedef struct
676 {
679 
681 
682 
683 struct mbg_firmware;
684 struct mbg_firmware_ufu;
685 
686 
687 typedef struct mbg_firmware
688 {
689  unsigned idx;
692 
693  /* Pointer for the mallocer to connect some private data */
694  void *priv_data;
695  /*
696  * Can be used to free/release priv or cookie data (if necessary)
697  * or do other stuff before firmware gets freed. But NEVER use release
698  * to free the firmware itself!! This is done by the API right after calling
699  * release.
700  */
701  void (*release_priv)(struct mbg_firmware*);
702 
703 } MBG_FIRMWARE;
704 
705 
706 typedef struct mbg_firmware_ufu
707 {
708  unsigned idx;
710  const struct mbg_firmware *firmware;
711 
712  /* Pointer for the mallocer to connect some private data */
713  void *priv_data;
714  /*
715  * Can be used to free/release priv data (if necessary)
716  * or do other stuff before ufu gets freed. But NEVER use release
717  * to free the ufu itself!! This is done by the API right after calling
718  * release.
719  */
720  void (*release_priv)(struct mbg_firmware_ufu*);
721 
723 
724 
725 typedef struct
726 {
729 
731 
732 
733 typedef struct mbg_database
734 {
735  unsigned idx;
737 
738  /* Pointer for the mallocer to connect some private data */
739  void *priv_data;
740 
741  /*
742  * Can be used to free/release priv data (if necessary)
743  * or do other stuff before ufu gets freed. But NEVER use release
744  * to free the ufu itself!! This is done by the API right after calling
745  * release.
746  */
747  void (*release_priv)(struct mbg_database*);
748 
749 } MBG_DATABASE;
750 
751 
752 typedef struct
753 {
759 
761 
762 
763 typedef struct
764 {
765  unsigned codec;
766  const char *products;
767 
769 
772 #define MBG_EXT_SYS_INFO_CPU_CODECS \
773 { \
774  {HPS_USB_HOST_G1_V0, "microSYNC HSXXX"}, \
775  {HPS_USB_DEVICE_G1_V0, "HPS100"}, \
776  {HPS_USB_DEVICE_G1_V1, "SSP100"} \
777 }
778 
779 
793 {
799 };
800 
801 
808 {
811 };
812 
813 
820 {
822 };
823 
824 
825 
827 #ifdef _DO_INIT
829 #endif
830 ;
831 
833 #ifdef _DO_INIT
834  = MBG_BAUD_STRS
835 #endif
836 ;
837 
839 #ifdef _DO_INIT
841 #endif
842 ;
843 
844 _ext const char *str_unknown
845 #ifdef _DO_INIT
846  = "unknown"
847 #endif
848 ;
849 
850 
851 _ext const char *str_undefined
852 #ifdef _DO_INIT
853  = "(undefined)"
854 #endif
855 ;
856 
857 
858 _ext const char *str_not_spc
859 #ifdef _DO_INIT
860  = "not "
861 #endif
862 ;
863 
864 
865 
866 //### TODO
867 #define DEFAULT_MAX_STR_TYPE 2 // DEFAULT_N_STR_TYPE_GPS ?
868 
870 #ifdef _DO_INIT
871  = {
872  { DEFAULT_STR_MODES, "Default Time String", "Time", 0 },
873  { DEFAULT_STR_MODES_UCAP, "Capture String", "Cap", 0 }
874  }
875 #endif
876 ;
877 
878 
879 
881 #ifdef _DO_INIT
883 #endif
884 ;
885 
886 #define _get_gpio_type_name( _i ) \
887  ( ( (_i) < N_MBG_GPIO_TYPES ) ? mbg_gpio_type_names[_i] : str_unknown )
888 
889 
890 
892 #ifdef _DO_INIT
894 #endif
895 ;
896 
897 #define _get_gpio_port_state_name( _i ) \
898  ( ( (_i) < N_MBG_GPIO_PORT_STATES ) ? mbg_gpio_port_state_names[_i] : str_unknown )
899 
900 
901 
903 #ifdef _DO_INIT
905 #endif
906 ;
907 
908 #define _get_gpio_signal_shape_name( _i ) \
909  ( ( (_i) < N_MBG_GPIO_SIGNAL_SHAPES ) ? mbg_gpio_signal_shape_names[_i] : str_unknown )
910 
911 
912 
914 #ifdef _DO_INIT
916 #endif
917 ;
918 
919 #define _get_gpio_fixed_freq_str( _i ) \
920  ( ( (_i) < N_MBG_GPIO_FIXED_FREQ ) ? mbg_gpio_fixed_freq_strs[_i] : str_unknown )
921 
922 
923 
925 #ifdef _DO_INIT
927 #endif
928 ;
929 
930 #define _get_xmr_holdover_status_mode_name( _i ) \
931  ( ( (_i) < N_XMR_HOLDOVER_STATUS_MODES ) ? xmr_holdover_status_mode_names[_i] : str_unknown )
932 
933 
934 
935 _ext const char *ptp_role_strs[N_PTP_ROLES]
936 #ifdef _DO_INIT
937  = PTP_ROLE_STRS
938 #endif
939 ;
940 
941 #define _get_ptp_role_str_dflt( _i, _dflt ) \
942  ( ( (_i) < N_PTP_ROLES ) ? ptp_role_strs[_i] : _dflt )
943 
944 #define _get_ptp_role_str( _i ) \
945  _get_ptp_role_str_dflt( _i, str_unknown )
946 
947 
948 
950 #ifdef _DO_INIT
952 #endif
953 ;
954 
955 #define _get_ptp_nw_protocol_str_dflt( _i, _dflt ) \
956  ( ( (_i) < N_PTP_NW_PROT ) ? ptp_nw_protocol_strs[_i] : _dflt )
957 
958 #define _get_ptp_nw_protocol_str( _i ) \
959  _get_ptp_nw_protocol_str_dflt(_i, str_unknown )
960 
961 
962 
964 #ifdef _DO_INIT
966 #endif
967 ;
968 
969 #define _get_ptp_port_state_str_dflt( _i, _dflt ) \
970  ( ( (_i) < N_PTP_PORT_STATE ) ? ptp_port_state_strs[_i] : _dflt )
971 
972 #define _get_ptp_port_state_str( _i ) \
973  _get_ptp_port_state_str_dflt( _i, str_unknown )
974 
975 
976 
978 #ifdef _DO_INIT
980 #endif
981 ;
982 
983 #define _get_ptp_clock_accuracy_str_dflt( _i, _dflt ) \
984  ( ( ( (_i) >= PTP_CLOCK_ACCURACY_NUM_BIAS ) && ( (_i) < N_PTP_CLOCK_ACCURACY ) ) ? \
985  ptp_clock_accuracy_strs[(_i) - PTP_CLOCK_ACCURACY_NUM_BIAS] : _dflt )
986 
987 #define _get_ptp_clock_accuracy_str( _i ) \
988  _get_ptp_clock_accuracy_str( _i, str_unknown )
989 
990 
991 
993 #ifdef _DO_INIT
995 #endif
996 ;
997 
998 #define _get_ptp_delay_mechanism_str_dflt( _i, _dflt ) \
999  ( ( (_i) < N_PTP_DELAY_MECH ) ? ptp_delay_mechanism_strs[_i] : _dflt )
1000 
1001 #define _get_ptp_delay_mechanism_str( _i ) \
1002  _get_ptp_delay_mechanism_str_dflt( _i, str_unknown )
1003 
1004 
1005 
1006 
1007 // Terminated by { 0, NULL }
1009 #ifdef _DO_INIT
1011 #endif
1012 ;
1013 
1014 
1015 
1023 static __mbg_inline
1024 int num_bits_set( long val )
1025 {
1026  int bits_set = 0;
1027  size_t i;
1028 
1029  for ( i = 0; i < ( 8 * sizeof( val ) ); i++ )
1030  {
1031  if ( val & 1 )
1032  bits_set++;
1033 
1034  val >>= 1;
1035  }
1036 
1037  return bits_set;
1038 
1039 } // num_bits_set
1040 
1041 
1042 
1043 #if !defined( MBG_TGT_KERNEL )
1044 
1054 static __mbg_inline
1055 bool device_id_is_serial( const char *dev_id )
1056 {
1057  #if defined( MBG_TGT_NO_TGT )
1058  return false; //### FIXME
1059  #elif defined( MBG_TGT_WIN32 )
1060  //##++++ There may be also serial ports under Windows
1061  // which don't have "COM" in their name.
1062  return strstr( dev_id, "COM" ) != NULL;
1063  #elif defined( MBG_TGT_LINUX )
1064  return strstr( dev_id, "/dev/ttyS" ) != NULL // standard serial device
1065  || strstr( dev_id, "/dev/ttyUSB" ) != NULL; // serial-to-USB adapter
1066  #elif defined( MBG_TGT_FREEBSD )
1067  return strstr( dev_id, "/dev/ttyu" ) != NULL // dial-in device (standard), FreeBSD 10 and newer
1068  || strstr( dev_id, "/dev/cuau" ) != NULL // dial out device, FreeBSD 10 and newer
1069  || strstr( dev_id, "/dev/ttyd" ) != NULL // dial-in device (standard), before FreeBSD 10
1070  || strstr( dev_id, "/dev/cuad" ) != NULL; // dial-out device, before FreeBSD 10
1071  #elif defined( MBG_TGT_NETBSD )
1072  // TODO This is just an ugly hack which identifies
1073  // some traditional device names as serial ports.
1074  // There are quite a few other possible names.
1075  // See "man 4 com" and "man 4 tty".
1076  return strstr( dev_id, "/dev/tty0" ) != NULL // traditional dial-in devices
1077  || strstr( dev_id, "/dev/dty0" ) != NULL; // traditional dial-out devices
1078  #elif defined( MBG_TGT_QNX_NTO )
1079  return strstr( dev_id, "/dev/ser" ) != NULL;
1080  #elif defined( MBG_TGT_DOS )
1081  return strstr( dev_id, "COM" ) != NULL;
1082  #else
1083  #error device_id_is_serial() needs to be implemented for this platform
1084  #endif
1085 
1086 } // device_id_is_serial
1087 
1088 
1089 
1097 static __mbg_inline
1098 bool device_id_is_lan( const char *dev_id )
1099 {
1100  return strstr( dev_id, "LAN" ) != NULL;
1101 
1102 } // device_id_is_lan
1103 
1104 #endif // !defined( MBG_TGT_KERNEL )
1105 
1106 
1107 
1108 #if defined( _PRELIMINARY_CODE )
1109 
1110 static __mbg_inline
1112 {
1113 #if defined( MBG_TGT_LINUX )
1114  struct sysinfo info;
1115 
1116  // Linux specific, implement Windows equivalent
1117  sysinfo( &info );
1118  return ( (MBG_TLV_UID) ( ( time( NULL ) >> 16 ) | ( info.uptime << 16 ) ) );
1119 #else
1120  return rand();
1121 #endif
1122 } // mbg_tlv_create_id
1123 
1124 #endif // defined( _PRELIMINARY_CODE )
1125 
1126 
1127 
1128 #if !defined( MBG_TGT_KERNEL )
1129 
1130 /* ----- function prototypes begin ----- */
1131 
1132 /* This section was generated automatically */
1133 /* by MAKEHDR, do not remove the comments. */
1134 
1151  int chk_sw_rev_name( SW_REV *p, int verbose ) ;
1152 
1153  int get_str_idx( const char *search, const char *str_table[], int n_entries ) ;
1154  int get_baud_rate_idx( BAUD_RATE baud_rate ) ;
1155  int get_framing_idx( const char *framing ) ;
1172  void port_settings_from_port_parm_mode( PORT_SETTINGS *p_ps, uint8_t pp_mode, int cap_str_idx ) ;
1173 
1188  void port_parm_mode_from_port_settings( uint8_t *pp_mode, const PORT_SETTINGS *p_ps, int cap_str_idx ) ;
1189 
1202  void port_settings_from_port_parm( PORT_SETTINGS *p_ps, int port_idx, const PORT_PARM *p_pp, int cap_str_idx ) ;
1203 
1216  void port_parm_from_port_settings( PORT_PARM *p_pp, int port_idx, const PORT_SETTINGS *p_ps, int cap_str_idx ) ;
1217 
1218  uint32_t check_valid_port_info( const PORT_INFO *p_pi, const STR_TYPE_INFO_IDX str_type_info_idx[], int n_str_type ) ;
1219  int valid_port_info( const PORT_INFO *p_pi, const STR_TYPE_INFO_IDX str_type_info_idx[], int n_str_type ) ;
1239  int setup_port_info_from_port_parm( PORT_INFO_IDX pii[], const PORT_PARM *p_pp, const RECEIVER_INFO *p_ri ) ;
1240 
1242  int chk_set_n_gnss_supp( ALL_GNSS_INFO *p_agi ) ;
1249 
1256 
1257  void chk_free_dev_hw_id( DEVICE_INFO *p ) ;
1258  int alloc_dev_hw_id( DEVICE_INFO *p, size_t len ) ;
1259  const char *get_fw_id_from_hw_id( const char *hw_id ) ;
1260  const char *get_hw_id_from_fw_id( const char *fw_id ) ;
1270 
1280  void mbg_tlv_announce_init( MBG_TLV_ANNOUNCE *tlv, MBG_TLV_UID uid, MBG_TLV_TYPE tlv_feat_type, uint32_t total_bytes ) ;
1281 
1292  void mbg_tlv_init( MBG_TLV *tlv, MBG_TLV_UID uid, MBG_TLV_TYPE tlv_type, uint32_t total_bytes ) ;
1293 
1303  void mbg_tlv_rcv_state_init( MBG_TLV_RCV_STATE *state, MBG_TLV_UID uid, uint32_t total_bytes ) ;
1304 
1305  int mbg_snprint_revision( char *buf, size_t buflen, const char *prefix, const char *suffix, uint32_t rev) ;
1314  /*
1315  * Type is NOT an index of ::XMULTI_REF_INSTANCES::n_xmr_settings,
1316  * but of ::MULTI_REF_TYPES.
1317  * Depends on chk_dev_supp_xmulti_ref_ext_src_info.
1318  * @see chk_dev_supp_xmulti_ref_ext_src_info
1319  */
1321 
1322  /*
1323  * Type is NOT an index of ::XMULTI_REF_INSTANCES::n_xmr_settings,
1324  * but of ::MULTI_REF_TYPES.
1325  * Depends on chk_dev_supp_xmulti_ref_ext_src_info.
1326  * @see chk_dev_supp_xmulti_ref_ext_src_info
1327  */
1329 
1331  _NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_enabled( const ALL_IMS_STATE *ims_state, unsigned idx ) ;
1332  _NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_overload( const ALL_IMS_STATE *ims_state, unsigned idx ) ;
1333  _NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_pll_locked( const ALL_IMS_STATE *ims_state, unsigned idx ) ;
1334  _NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_supp_ass_idx( const ALL_GPIO_INFO *gpio_info, unsigned idx ) ;
1335  _NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_dep_on_ass_idx( const ALL_GPIO_INFO *gpio_info, unsigned idx ) ;
1348 
1356  void free_all_xbp_info ( ALL_XBP_INFO *p ) ;
1357 
1366 
1374  void free_all_net_status_info ( ALL_NET_STATUS_INFO *p ) ;
1375 
1381  void free_all_snmp_info ( ALL_SNMP_INFO *p ) ;
1382 
1389 
1396 
1402  void free_all_events( ALL_EVENTS *p ) ;
1403 
1413 
1423 
1432 
1441 
1450 
1458  void free_all_ntp_status( ALL_NTP_STATUS *p ) ;
1459 
1469  void free_all_ims_info( ALL_IMS_INFO *p ) ;
1470 
1480  void free_all_ims_state( ALL_IMS_STATE *p ) ;
1481 
1492  void free_all_gpio_info( ALL_GPIO_INFO *p ) ;
1493 
1505  void free_all_io_ports( ALL_MBG_IO_PORTS *p ) ;
1506 
1517  void free_all_gpio_state( ALL_GPIO_STATE *p ) ;
1518 
1524  UCAP_ENTRY* calloc_ucap_entry( void ) ;
1525 
1538  void free_all_ucap_info( ALL_UCAP_INFO *p ) ;
1539 
1548 
1556  void free_all_user_info( ALL_USER_INFO *p ) ;
1557 
1565  void free_all_svc_info( ALL_SERVICE_INFO *p ) ;
1566 
1575 
1584 
1595  void str_ntp_hex_to_ntp_tstamp( const char *s, NTP_TSTAMP *p ) ;
1596 
1603  void ntp_tstamp_to_nanotime_64( const NTP_TSTAMP *p_nts, NANO_TIME_64 *p_nt64 ) ;
1604 
1615  void str_ntp_hex_to_nano_time_64( const char *s, NANO_TIME_64 *p ) ;
1616 
1617 
1618 /* ----- function prototypes end ----- */
1619 
1620 #endif // !defined( MBG_TGT_KERNEL )
1621 
1622 #ifdef __cplusplus
1623 }
1624 #endif
1625 
1626 
1627 /* End of header body */
1628 
1629 #undef _ext
1630 #undef _DO_INIT
1631 
1632 #endif /* _CFG_HLP_H */
void mbg_tlv_announce_init(MBG_TLV_ANNOUNCE *tlv, MBG_TLV_UID uid, MBG_TLV_TYPE tlv_feat_type, uint32_t total_bytes)
Initializes a MBG_TLV_ANNOUNCE structure.
Definition: cfg_hlp.c:642
void free_all_svc_info(ALL_SERVICE_INFO *p)
Free an ALL_SERVICE_INFO structure.
Definition: cfg_hlp.c:1642
MBG_DATABASE_INFO info
Definition: cfg_hlp.h:736
const struct mbg_firmware * firmware
Backref to firmware.
Definition: cfg_hlp.h:710
PCPS_TIME_EXT_FLAG_BITS
Flag bits indicating if some extended status is available.
Definition: cfg_hlp.h:807
PTP_CFG_INFO ptp_cfg_info
Definition: cfg_hlp.h:371
int32_t BAUD_RATE
A data type to configure a serial port&#39;s baud rate.
Definition: gpsdefs.h:3190
NTP_REFCLK_STATE_IDX * refclk_states
Definition: cfg_hlp.h:497
MBG_IMS_FDM_STATE * fdm_state
Definition: cfg_hlp.h:554
MBG_IO_PORT * ports
Definition: cfg_hlp.h:590
NTP trusted key info, with index.
Definition: gpsdefs.h:16051
MBG_SYSLOG_SERVER * servers
Definition: cfg_hlp.h:332
MBG_GPIO_STATUS_IDX * states
Definition: cfg_hlp.h:569
const char * products
Definition: cfg_hlp.h:766
void free_all_ucap_net_info(ALL_UCAP_NET_INFO *p)
Free an ALL_UCAP_NET_INFO structure.
Definition: cfg_hlp.c:1583
unsigned char has_metrics
Definition: cfg_hlp.h:537
An entry for a table of parameters which can not be accessed by an enumerated index.
Definition: gpsdefs.h:12747
uint32_t num_ucaps
Definition: cfg_hlp.h:610
void free_all_net_cfg_info(ALL_NET_CFG_INFO *p)
Free an ALL_NET_CFG_INFO structure.
Definition: cfg_hlp.c:1018
void free_all_user_info(ALL_USER_INFO *p)
Free an ALL_USER_INFO structure.
Definition: cfg_hlp.c:1605
_NO_MBG_API_ATTR int _MBG_API chk_dev_xbp_supp_nodes(const ALL_XBP_INFO *info)
Definition: cfg_hlp.c:757
void free_all_snmp_info(ALL_SNMP_INFO *p)
Free an ALL_SNMP_INFO structure.
Definition: cfg_hlp.c:1084
_NO_MBG_API_ATTR int _MBG_API chk_dev_ntp_supp_server(const ALL_NTP_CFG_INFO *info)
Definition: cfg_hlp.c:798
XMULTI_REF_INFO_IDX * infos
Definition: cfg_hlp.h:523
unsigned idx
Definition: cfg_hlp.h:656
#define MBG_BAUD_RATES
An initializer for a table of baud rate values.
Definition: gpsdefs.h:3259
Structure that represents a timestamp in NTP Timestamp Format.
Definition: gpsdefs.h:16484
MBG_IO_PORT_LIMITS limits
Definition: cfg_hlp.h:588
Structure that contains an index value and the NTP peer state.
Definition: gpsdefs.h:17539
XMR_EXT_SRC_INFO_IDX * ext_src_infos
Definition: cfg_hlp.h:524
A The structure used to store the configuration of two serial ports.
Definition: gpsdefs.h:3929
const char * str_undefined
int mbg_snprint_revision(char *buf, size_t buflen, const char *prefix, const char *suffix, uint32_t rev)
Definition: cfg_hlp.c:709
XMR_HOLDOVER_STATUS * holdover_status
Definition: cfg_hlp.h:531
Information on a supported string format.
Definition: gpsdefs.h:3704
MBG_GPIO_CFG_LIMITS cfg_limits
Definition: cfg_hlp.h:562
All XBP information of a XBP supporting device.
Definition: cfg_hlp.h:207
MBG_SNMP_V12_INFO_IDX * v12_infos
Definition: cfg_hlp.h:261
MBG_EVENT_STATUS status
Definition: cfg_hlp.h:280
#define MAX_PARM_POUT
The max number of programmable pulse outputs supported by configuration programs. ...
Definition: cfg_hlp.h:143
int n_gnss_supp
Definition: cfg_hlp.h:450
MBG_NET_INTF_ADDR_INFO_IDX * addr_infos
Definition: cfg_hlp.h:240
static int verbose
Definition: mbghrtime.c:80
int valid_port_info(const PORT_INFO *p_pi, const STR_TYPE_INFO_IDX str_type_info_idx[], int n_str_type)
Definition: cfg_hlp.c:367
Definition: cfg_hlp.h:602
void free_all_gpio_info(ALL_GPIO_INFO *p)
Free memory allocated by mbgextio_get_all_gpio_info.
Definition: cfg_hlp.c:1445
PTPv1 current dataset containing information about the synchronization status of the device...
Definition: gpsdefs.h:14611
A timestamp with nanosecond resolution, but 64 bit size.
Definition: words.h:621
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_overload(const ALL_IMS_STATE *ims_state, unsigned idx)
Definition: cfg_hlp.c:907
PTP_UC_MASTER_CFG_LIMITS ptp_uc_master_cfg_limits
Definition: cfg_hlp.h:372
#define MAX_PARM_GPIO
The max number of GPIO ports supported by configuration programs.
Definition: cfg_hlp.h:155
Status information on a ref time source at a specific priority level.
Definition: gpsdefs.h:6885
IO Port Info.
Definition: gpsdefs.h:20806
#define PTP_ROLE_STRS
Name strings for defined PTP roles.
Definition: gpsdefs.h:12994
struct mbg_syslog_server MBG_SYSLOG_SERVER
All monitoring syslog data.
void chk_free_dev_hw_id(DEVICE_INFO *p)
Definition: cfg_hlp.c:502
struct mbg_firmware_ufu * ufus
Array of MBG_FW_INFO::num_ufus.
Definition: cfg_hlp.h:691
All monitoring event data.
Definition: cfg_hlp.h:276
void free_all_ptp_v1_common_datasets(ALL_PTP_V1_COMMON_DATASETS *p)
Free an ALL_PTP_V1_COMMON_DATASETS structure allocated by mbgextio_get_all_ptp_v1_common_datasets.
Definition: cfg_hlp.c:1267
MBG_IMS_FDM_OUTPUT_INFO_IDX * fdm_outinfo_idx
Definition: cfg_hlp.h:547
Configuration settings of a serial port.
Definition: gpsdefs.h:3507
const char * ptp_nw_protocol_strs[N_PTP_NW_PROT]
unsigned short uint16_t
Definition: words.h:213
GNSS_SAT_INFO_IDX ALL_GNSS_SAT_INFO_IDX[N_GNSS_TYPES]
An array of configuration settings for all programmable pulse outputs.
Definition: cfg_hlp.h:437
ALL_NET_CFG_INFO ALL_NET_STATUS_INFO
Definition: cfg_hlp.h:246
#define MAX_PARM_PORT
The max number of serial ports supported by configuration programs.
Definition: cfg_hlp.h:137
ALL_NTP_PEER_SETTINGS all_ntp_peer_settings
Definition: cfg_hlp.h:471
XMR_METRICS_IDX * metrics_idx
Definition: cfg_hlp.h:533
XMR holdover status.
Definition: gpsdefs.h:7157
number of defined protocols
Definition: gpsdefs.h:12651
Information on available XBP nodes.
Definition: gpsdefs.h:17926
NTP refclock info, with index.
Definition: gpsdefs.h:15795
static __mbg_inline int num_bits_set(long val)
Count the number of bits which are not 0.
Definition: cfg_hlp.h:1024
Peer settings for NTP devices to configure an upload NTP server.
Definition: gpsdefs.h:16358
MBG_GNSS_MODE_INFO gnss_mode_info
Definition: cfg_hlp.h:451
void free_all_ims_state(ALL_IMS_STATE *p)
Free memory allocated by mbgextio_get_all_ims_state.
Definition: cfg_hlp.c:1414
MBG_NET_NAME_IDX * dns_srch_doms
Definition: cfg_hlp.h:242
XMR timing metrics for a particular source, with index.
Definition: gpsdefs.h:7468
IO Port Settings.
Definition: gpsdefs.h:20689
PTPv1 parent dataset containing information about the master (parent) of the device.
Definition: gpsdefs.h:14670
IO Port Type Info.
Definition: gpsdefs.h:20974
void port_parm_from_port_settings(PORT_PARM *p_pp, int port_idx, const PORT_SETTINGS *p_ps, int cap_str_idx)
Set up a a legacy PORT_PARM structure from a PORT_SETTINGS structure.
Definition: cfg_hlp.c:272
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_src_info(const ALL_XMULTI_REF_INFO *info)
Definition: cfg_hlp.c:821
Current settings and general capabilities of a specific unicast master.
Definition: gpsdefs.h:14382
Query MBG_NET_INTF_ROUTE_INFO by its index.
Definition: gpsdefs.h:12344
Information on an XBP node with specific index.
Definition: gpsdefs.h:18044
#define N_SUPP_DEV_TOTAL
Definition: cfg_hlp.h:117
#define _NO_MBG_API_ATTR
Definition: mbg_tgt.h:1032
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_source_stats(const ALL_XMULTI_REF_INFO *info, int type)
Definition: cfg_hlp.c:849
MBG_PTP_V1_PORT_DATASET_IDX * port_datasets
Definition: cfg_hlp.h:399
PTPv1 time drop dataset.
Definition: gpsdefs.h:14737
NTP_SRV_MODE_INFO * srv_info
Definition: cfg_hlp.h:486
MBG_IO_PORT_STATUS status
Definition: cfg_hlp.h:577
MBG_PTP_V2_CURRENT_DATASET current_dataset
Definition: cfg_hlp.h:422
MBG_SNMP_V12_TRAP_INFO_IDX * v12_trap_infos
Definition: cfg_hlp.h:262
static __mbg_inline bool device_id_is_serial(const char *dev_id)
Check if a device ID refers to a serial port.
Definition: cfg_hlp.h:1055
void port_parm_mode_from_port_settings(uint8_t *pp_mode, const PORT_SETTINGS *p_ps, int cap_str_idx)
Convert a PORT_SETTINGS::mode to a legacy PORT_PARM::mode.
Definition: cfg_hlp.c:213
ALL_EVENTS * all_events
Definition: cfg_hlp.h:350
#define DEFAULT_STR_MODES
Definition: gpsdefs.h:3840
void free_all_ims_info(ALL_IMS_INFO *p)
Free memory allocated by mbgextio_get_all_ims_info.
Definition: cfg_hlp.c:1384
struct mbg_database MBG_DATABASE
General GPIO config info to be read from a device.
Definition: gpsdefs.h:7608
MBG_USER_MNGMNT_INFO user_mngmnt_info
Definition: cfg_hlp.h:647
uint32_t MBG_TLV_TYPE
A data type to hold one of the MBG_TLV_TYPES or MBG_TLV_FEAT_TYPES.
Definition: gpsdefs.h:18088
PCPS_TIME_EXT_FLAGS
Flag masks used with PCPS_TIME_EXT::flags.
Definition: cfg_hlp.h:819
void free_all_net_status_info(ALL_NET_STATUS_INFO *p)
Free an ALL_NET_STATUS_INFO structure.
Definition: cfg_hlp.c:1052
A generic structure used to specify FDM limits.
Definition: gpsdefs.h:10114
NTP_CLNT_MODE_INFO * clnt_info
Definition: cfg_hlp.h:483
MBG_PTP_V1_CURRENT_DATASET current_dataset
Definition: cfg_hlp.h:396
XMR statistics for a particular source, with index.
Definition: gpsdefs.h:7403
NTP_REFCLK_CFG_INFO_IDX * refclk_info_idx
Definition: cfg_hlp.h:487
MBG_FIRMWARE * firmwares
Definition: cfg_hlp.h:728
number of predefined fixed frequencies
Definition: gpsdefs.h:7908
MBG_UCAP_NET_RECV_INFO_IDX * recv_infos
Definition: cfg_hlp.h:618
#define PTP_NW_PROT_STRS
Name strings for the protocols possibly used with PTP.
Definition: gpsdefs.h:12678
All monitoring information.
Definition: cfg_hlp.h:346
IO Port Type Status.
Definition: gpsdefs.h:21183
Structure that represents the current system status of an NTP device.
Definition: gpsdefs.h:16872
unsigned idx
Definition: cfg_hlp.h:575
void free_all_database_info(ALL_DATABASE_INFO *p)
Free an ALL_DATABASE_INFO structure.
Definition: cfg_hlp.c:1722
void(* release_priv)(struct mbg_firmware *)
Definition: cfg_hlp.h:701
PTPv2 time properties dataset.
Definition: gpsdefs.h:15009
struct mbg_firmware MBG_FIRMWARE
_NO_MBG_API_ATTR int _MBG_API chk_dev_ntp_supp_client(const ALL_NTP_CFG_INFO *info)
Definition: cfg_hlp.c:786
const char * ptp_clock_accuracy_strs[N_PTP_CLOCK_ACCURACY - PTP_CLOCK_ACCURACY_NUM_BIAS]
void * priv_data
Definition: cfg_hlp.h:739
MBG_PTP_V1_DEFAULT_DATASET default_dataset
Definition: cfg_hlp.h:395
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_enabled(const ALL_IMS_STATE *ims_state, unsigned idx)
Definition: cfg_hlp.c:892
void free_all_ucap_info(ALL_UCAP_INFO *p)
Free memory allocated by mbgextio_get_all_ucap_info.
Definition: cfg_hlp.c:1556
Summary information on all supported GNSS systems.
Definition: cfg_hlp.h:447
#define _ext
Definition: cfg_hlp.h:101
unsigned idx
Definition: cfg_hlp.h:314
#define DEFAULT_GPIO_PORT_STATE_NAMES
String initializers for GPIO port state names.
Definition: gpsdefs.h:9355
unsigned idx
Definition: cfg_hlp.h:278
A GPIO port&#39;s current settings and limits, plus port index.
Definition: gpsdefs.h:9273
NTP symm key info, with index.
Definition: gpsdefs.h:15969
TLV structure containing information on current TLV transaction and its current data.
Definition: gpsdefs.h:18403
char * hw_id
Definition: cfg_hlp.h:121
void mbg_tlv_rcv_state_init(MBG_TLV_RCV_STATE *state, MBG_TLV_UID uid, uint32_t total_bytes)
Initializes MBG_TLV_RCV_STATE structure.
Definition: cfg_hlp.c:695
MBG_IMS_FDM_INFO * fdm_info
Definition: cfg_hlp.h:545
void * priv_data
Definition: cfg_hlp.h:713
int chk_set_n_gnss_supp(ALL_GNSS_INFO *p_agi)
Definition: cfg_hlp.c:440
void free_all_xbp_info(ALL_XBP_INFO *p)
Free an ALL_XBP_INFO structure.
Definition: cfg_hlp.c:993
#define MAX_PARM_GNSS_SAT
The max number of GNSS settings supported by configuration programs.
Definition: cfg_hlp.h:146
Information on a specific supported string format.
Definition: gpsdefs.h:3733
MBG_IO_PORT_SETTINGS * setts
Definition: cfg_hlp.h:580
XMR_STATS_IDX * stats_idx
Definition: cfg_hlp.h:532
#define MAX_PARM_PTP_UC_MASTER
The max number of PTP unicast masters supported by configuration programs.
Definition: cfg_hlp.h:149
Settings, features and flags for receivers of user captures via network.
Definition: gpsdefs.h:12613
the number of known modes
Definition: gpsdefs.h:7198
NTP_PEER_SETTINGS_IDX * peer_settings_idx
Definition: cfg_hlp.h:484
Client settings info of an NTP device.
Definition: gpsdefs.h:16260
const char * mbg_gpio_type_names[N_MBG_GPIO_TYPES]
#define MBG_BAUD_STRS
An initializer for a table of baud rate strings.
Definition: gpsdefs.h:3283
const char * mbg_gpio_signal_shape_names[N_MBG_GPIO_SIGNAL_SHAPES]
#define DEFAULT_GPIO_TYPES_SHORT_STRS
Definition: gpsdefs.h:7679
const char * ptp_role_strs[N_PTP_ROLES]
MBG_USER_INFO info
Definition: cfg_hlp.h:625
unsigned idx
Definition: cfg_hlp.h:735
ALL_PTP_UC_MASTER_INFO_IDX all_ptp_uc_master_info_idx
Definition: cfg_hlp.h:373
XBP_NODE_LIMITS * node_limits
Definition: cfg_hlp.h:210
antenna connection state
Definition: cfg_hlp.h:796
MBG_SNMP_V3_TRAP_INFO_IDX * v3_trap_infos
Definition: cfg_hlp.h:264
DEVICE_INFO device_list[(16+1)]
A structure to used to query the current configuration and capabilities of a PTP port.
Definition: gpsdefs.h:13342
number of known signal shapes
Definition: gpsdefs.h:7708
State of FDM device.
Definition: gpsdefs.h:10158
void * priv_data
Definition: cfg_hlp.h:318
#define DEFAULT_MAX_STR_TYPE
Definition: cfg_hlp.h:867
const char * get_hw_id_from_fw_id(const char *fw_id)
Definition: cfg_hlp.c:563
Specific FDM settings and limits.
Definition: gpsdefs.h:10316
void free_all_io_ports(ALL_MBG_IO_PORTS *p)
Free memory allocated by mbgextio_get_all_io_ports.
Definition: cfg_hlp.c:1471
Index structure for PTPv2 port dataset.
Definition: gpsdefs.h:15073
MBG_SYSLOG_INFO info
Definition: cfg_hlp.h:315
A structure used to transmit information on date and time.
Definition: gpsdefs.h:2713
PTPv2 default dataset.
Definition: gpsdefs.h:14865
Index structure for PTPv1 port dataset.
Definition: gpsdefs.h:14822
MBG_IMS_FDM_OUTPUT_STATE_IDX * fdm_output_state_idx
Definition: cfg_hlp.h:555
struct mbg_event MBG_EVENT
All monitoring event data.
MBG_EVENT_VALUE * dict_entries
Definition: cfg_hlp.h:281
MBG_NET_INTF_LINK_INFO_IDX * link_infos
Definition: cfg_hlp.h:239
PTPv2 parent dataset.
Definition: gpsdefs.h:14947
input signal strength
Definition: cfg_hlp.h:795
Generic state of an IMS device.
Definition: gpsdefs.h:9790
All network configuration parameters.
Definition: cfg_hlp.h:236
All PTPv2 common datasets for a PTP device.
Definition: cfg_hlp.h:419
MBG_FW_INFO info
Definition: cfg_hlp.h:690
number of known port states
Definition: gpsdefs.h:9345
XMULTI_REF_INSTANCES instances
Definition: cfg_hlp.h:522
int setup_default_str_type_info_idx(STR_TYPE_INFO_IDX stii[], const RECEIVER_INFO *p_ri)
Definition: cfg_hlp.c:422
static __mbg_inline MBG_TLV_UID mbg_tlv_create_id(void)
Definition: cfg_hlp.h:1111
MBG_NET_GLB_CFG_INFO glb_cfg_info
Definition: cfg_hlp.h:238
XBP_NODE_INFO_IDX * node_infos
Definition: cfg_hlp.h:211
void(* release_backref)(struct mbg_event *)
Definition: cfg_hlp.h:293
Number of known types.
Definition: gpsdefs.h:7674
Global configuration info of an NTP device (client/server)
Definition: gpsdefs.h:15246
Limits to be considered when specifying PTP unicast masters.
Definition: gpsdefs.h:14231
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_mrf_none(const ALL_XMULTI_REF_INFO *info)
Definition: cfg_hlp.c:810
#define PTP_DELAY_MECH_NAMES
Name strings for the PTP delay mechanisms.
Definition: gpsdefs.h:12794
const char * mbg_gpio_port_state_names[N_MBG_GPIO_PORT_STATES]
ALL_SYSLOG_INFO * all_syslog_info
Definition: cfg_hlp.h:351
unsigned idx
Definition: cfg_hlp.h:708
NTP_PEER_STATE_IDX * peer_states
Definition: cfg_hlp.h:498
const char * mbg_baud_rate_strs[N_MBG_BAUD_RATES]
struct mbg_service MBG_SERVICE
An IPv4 or IPv6 network address, plus index.
Definition: gpsdefs.h:11945
All PTP configuration parameters.
Definition: cfg_hlp.h:369
MBG_GPIO_STATUS_IDX ALL_GPIO_STATUS_IDX[10]
Status information on all GPIO ports.
Definition: cfg_hlp.h:507
Structure containing state information while reading TLV data.
Definition: gpsdefs.h:18330
MBG_PTP_V2_TIME_PROPERTIES_DATASET time_properties_dataset
Definition: cfg_hlp.h:424
void * backref
Definition: cfg_hlp.h:661
MBG_PTP_V2_DEFAULT_DATASET default_dataset
Definition: cfg_hlp.h:421
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_dep_on_ass_idx(const ALL_GPIO_INFO *gpio_info, unsigned idx)
Definition: cfg_hlp.c:950
void free_all_xmulti_ref_status(ALL_XMULTI_REF_STATUS *p)
Free an ALL_XMULTI_REF_STATUS structure.
Definition: cfg_hlp.c:1236
Global settings, features and flags for user captures via network.
Definition: gpsdefs.h:12493
unsigned idx
Definition: cfg_hlp.h:624
unsigned char uint8_t
Definition: words.h:210
MBG_FW_GLB_INFO glb_info
Definition: cfg_hlp.h:727
STAT_INFO stat_info
Definition: cfg_hlp.h:449
All PTPv1 common datasets for a PTP device.
Definition: cfg_hlp.h:393
IO Port Limits.
Definition: gpsdefs.h:20411
NTP orphan mode info.
Definition: gpsdefs.h:16188
MBG_USER_STATUS status
Definition: cfg_hlp.h:626
XMULTI_REF_STATUS_IDX ALL_XMULTI_REF_STATUS_IDX[10]
Status of all XMR inputs.
Definition: cfg_hlp.h:513
General info on supported XMR sources and instances.
Definition: gpsdefs.h:7054
ALL_GNSS_SAT_INFO_IDX gnss_sat_info_idx
Definition: cfg_hlp.h:452
struct mbg_user MBG_USER
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_supp_ass_idx(const ALL_GPIO_INFO *gpio_info, unsigned idx)
Definition: cfg_hlp.c:937
Network host or domain name, plus index.
Definition: gpsdefs.h:12003
void * priv_data
Definition: cfg_hlp.h:694
const char * ptp_delay_mechanism_strs[N_PTP_DELAY_MECH]
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_has_fdm(const ALL_IMS_INFO *info)
Definition: cfg_hlp.c:881
NTP_MISC_LIMITS * misc_limits
Definition: cfg_hlp.h:488
MBG_PTP_V2_PORT_DATASET_IDX * port_datasets
Definition: cfg_hlp.h:425
Current settings and general capabilities of a serial port.
Definition: gpsdefs.h:3618
XBP_LIMITS limits
Definition: cfg_hlp.h:209
unsigned idx
Definition: cfg_hlp.h:689
void free_all_gpio_state(ALL_GPIO_STATE *p)
Free memory allocated by mbgextio_get_all_gpio_state.
Definition: cfg_hlp.c:1511
int setup_gps_only_gnss_info_from_statinfo(ALL_GNSS_INFO *p_agi)
Setup GNSS info from stat_info so we can use the same printing routine.
Definition: cfg_hlp.c:482
const char * str_not_spc
PORT_PARM tmp_pp
used internally only, for compatibility
Definition: cfg_hlp.h:194
NTP_TRUSTED_KEY_INFO_IDX * trusted_key_info_idx
Definition: cfg_hlp.h:481
struct mbg_io_port MBG_IO_PORT
MBG_UCAP_NET_GLB_INFO glb_info
Definition: cfg_hlp.h:617
#define MBG_FRAMING_STRS
An initializer for a table of known framing strings.
Definition: gpsdefs.h:3361
MBG_IO_PORT_INFO p_info
Definition: cfg_hlp.h:576
NTP_GLB_INFO glb_info
Definition: cfg_hlp.h:478
One of several sets of satellite information for a particular GNSS type.
Definition: gpsdefs.h:10773
port link state
Definition: cfg_hlp.h:797
ALL_SNMP_INFO * all_snmp_info
Definition: cfg_hlp.h:349
the number of known baud rates
Definition: gpsdefs.h:3246
TTM ttm
Definition: cfg_hlp.h:605
number of defined roles
Definition: gpsdefs.h:12944
struct _DEVICE_INFO DEVICE_INFO
const PTP_TABLE ptp_time_source_table[]
MBG_SNMP_GLB_INFO glb_info
Definition: cfg_hlp.h:260
XMULTI_REF_INFO_IDX ALL_XMULTI_REF_INFO_IDX[10]
Configuration settings for all XMR inputs.
Definition: cfg_hlp.h:516
Peer settings for NTP devices.
Definition: gpsdefs.h:16393
MBG_IMS_FDM_LIMITS * fdm_limits
Definition: cfg_hlp.h:546
MBG_EVENT * events
Definition: cfg_hlp.h:300
const char * str_unknown
#define PTP_PORT_STATE_STRS
Name strings for the PTP port states.
Definition: gpsdefs.h:12729
void setup_gps_only_sat_info_idx_from_statinfo(ALL_GNSS_INFO *p_agi)
Setup GNSS info from stat_info so we can use the same printing routine
Definition: cfg_hlp.c:459
Generic state of an IMS sensor, with sensor index.
Definition: gpsdefs.h:9863
Reference source capabilities and current configuration for a specific priority level.
Definition: gpsdefs.h:6839
NTP_SYMM_KEY_LIMITS * symm_key_limits
Definition: cfg_hlp.h:479
POUT_INFO_IDX ALL_POUT_INFO_IDX[10]
An array of configuration settings for all programmable pulse outputs.
Definition: cfg_hlp.h:224
MBG_IO_PORT_TYPE_INFO * pt_infos
Definition: cfg_hlp.h:578
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_source_metrics(const ALL_XMULTI_REF_INFO *info, int type)
Definition: cfg_hlp.c:868
Definition: myutil.h:117
Status information on a specific GPIO port.
Definition: gpsdefs.h:9317
const char * mbg_gpio_fixed_freq_strs[N_MBG_GPIO_FIXED_FREQ]
int get_str_idx(const char *search, const char *str_table[], int n_entries)
Definition: cfg_hlp.c:113
void * priv_data
Definition: cfg_hlp.h:633
PTPv1 default dataset containing global information about the device.
Definition: gpsdefs.h:14581
#define MBG_GPIO_FIXED_FREQ_STRS
Initializers for an array of GPIO fixed frequency name strings.
Definition: gpsdefs.h:7937
MBG_PTP_V1_TIME_PROPERTIES_DATASET time_properties_dataset
Definition: cfg_hlp.h:398
_NO_MBG_API_ATTR int _MBG_API chk_dev_net_cfg_supp_stage_2(const ALL_NET_CFG_INFO *info)
Definition: cfg_hlp.c:774
MBG_SERVICE_STATUS status
Definition: cfg_hlp.h:658
MBG_FW_UFU_INFO info
Definition: cfg_hlp.h:709
uint32_t MBG_TLV_UID
A data type used to hold a unique ID (UID) for a TLV transaction.
Definition: gpsdefs.h:18075
void free_all_events(ALL_EVENTS *p)
Free an ALL_EVENTS structure.
Definition: cfg_hlp.c:1170
A structure initiating a TLV transfer.
Definition: gpsdefs.h:18348
const char * mbg_framing_strs[N_MBG_FRAMINGS]
MBG_PTP_V2_PARENT_DATASET parent_dataset
Definition: cfg_hlp.h:423
MBG_SNMP_V3_INFO_IDX * v3_infos
Definition: cfg_hlp.h:263
const char * xmr_holdover_status_mode_names[N_XMR_HOLDOVER_STATUS_MODES]
void * backref
Definition: cfg_hlp.h:283
_NO_MBG_API_ATTR int _MBG_API chk_dev_receiver_info(const RECEIVER_INFO *p)
Definition: cfg_hlp.c:733
void free_all_syslog_info(ALL_SYSLOG_INFO *p)
Free an ALL_SYSLOG_INFO structure.
Definition: cfg_hlp.c:1113
NTP_PEER_SETTINGS ALL_NTP_PEER_SETTINGS[20]
Configuration settings for all NTP server associations.
Definition: cfg_hlp.h:459
MBG_SYSLOG_GLB_INFO glb_info
Definition: cfg_hlp.h:331
uint32_t check_valid_port_info(const PORT_INFO *p_pi, const STR_TYPE_INFO_IDX str_type_info_idx[], int n_str_type)
Definition: cfg_hlp.c:287
void free_all_monitoring_info(ALL_MONITORING_INFO *p)
Free an ALL_MONITORING_INFO structure.
Definition: cfg_hlp.c:1146
void str_ntp_hex_to_ntp_tstamp(const char *s, NTP_TSTAMP *p)
Set up a NTP_TSTAMP structure from a hex string with a time in seconds and binary fractions...
Definition: cfg_hlp.c:1759
int chk_sw_rev_name(SW_REV *p, int verbose)
Check if a software revision name should be displayed.
Definition: cfg_hlp.c:89
void free_all_ntp_cfg_info(ALL_NTP_CFG_INFO *p)
Free an ALL_NTP_CFG_INFO structure.
Definition: cfg_hlp.c:1311
void * priv_data
Definition: cfg_hlp.h:581
#define PTP_CLOCK_ACCURACY_STRS
Name strings for PTP accuracy classes.
Definition: gpsdefs.h:12850
void(* release_priv)(struct mbg_firmware_ufu *)
Definition: cfg_hlp.h:720
void * backref
Definition: cfg_hlp.h:631
MBG_GPIO_INFO_IDX * infos
Definition: cfg_hlp.h:563
Satellite receiver status information.
Definition: gpsdefs.h:10591
MBG_GPIO_INFO_IDX ALL_GPIO_INFO_IDX[10]
Configuration settings for all GPIO ports.
Definition: cfg_hlp.h:504
NTP_SYS_STATE sys_state
Definition: cfg_hlp.h:496
MBG_NET_INTF_ROUTE_INFO_IDX * route_infos
Definition: cfg_hlp.h:243
see PCPS_TIME_EXT_FLAG_BIT_UTC_VALID
Definition: cfg_hlp.h:821
number of defined delay mechanisms
Definition: gpsdefs.h:12770
void * priv_data
Definition: cfg_hlp.h:285
Software revision information.
Definition: gpsdefs.h:732
MBG_IMS_STATE state
Definition: cfg_hlp.h:544
A structure used to report XBP features and limits.
Definition: gpsdefs.h:17875
Current settings and general capabilities of a specific serial port.
Definition: gpsdefs.h:3677
MBG_IO_PORT_TYPE_INFO * get_io_port_type_info(const MBG_IO_PORT *port, uint16_t port_type)
Returns the currently used MBG_IO_PORT_TYPE_INFO for the appropriate MBG_IO_PORT. ...
Definition: cfg_hlp.c:601
void free_all_ptp_v2_common_datasets(ALL_PTP_V2_COMMON_DATASETS *p)
Free an ALL_PTP_V2_COMMON_DATASETS structure allocated by mbgextio_get_all_ptp_v2_common_datasets.
Definition: cfg_hlp.c:1289
number of defined port states
Definition: gpsdefs.h:12722
All SNMP configuration information.
Definition: cfg_hlp.h:258
MBG_DATABASE * dbs
Definition: cfg_hlp.h:758
MBG_SERVICE * svcs
Definition: cfg_hlp.h:678
unsigned char has_stats
Definition: cfg_hlp.h:535
COMP_SIG_MODES
A mode specifying how to interpret a PCPS_SIG_VAL.
Definition: cfg_hlp.h:792
unsigned num_ports
Definition: cfg_hlp.h:589
MBG_IMS_SENSOR_STATE_IDX * sensor_state_idx
Definition: cfg_hlp.h:553
MBG_IP_ADDR_IDX * dns_srvrs
Definition: cfg_hlp.h:241
unsigned num_events
Definition: cfg_hlp.h:299
All NTP configuration parameters.
Definition: cfg_hlp.h:469
ALL_PORT_INFO_IDX pii
all serial port configuration settings
Definition: cfg_hlp.h:192
#define _MBG_API
Definition: mbg_tgt.h:1020
MBG_SERVICE_MGMT_INFO mgmt_info
Definition: cfg_hlp.h:677
#define DEFAULT_STR_MODES_UCAP
Definition: gpsdefs.h:3851
Query MBG_NET_INTF_ADDR_INFO by its index.
Definition: gpsdefs.h:12244
MBG_EVENT_INFO info
Definition: cfg_hlp.h:279
All monitoring syslog data.
Definition: cfg_hlp.h:312
NTP_MISC_ORPHAN_MODE_INFO * orphan_mode_info
Definition: cfg_hlp.h:489
MBG_MONITORING_LIMITS limits
Definition: cfg_hlp.h:348
UCAP_ENTRY * calloc_ucap_entry(void)
Definition: cfg_hlp.c:1531
void str_ntp_hex_to_nano_time_64(const char *s, NANO_TIME_64 *p)
Set up a NANO_TIME_64 structure from a hex string with a time in seconds and binary fractions...
Definition: cfg_hlp.c:1807
MBG_USER * users
system users for internal authentication
Definition: cfg_hlp.h:648
void(* release_backref)(struct mbg_service *)
Definition: cfg_hlp.h:671
PTP_UC_MASTER_INFO_IDX ALL_PTP_UC_MASTER_INFO_IDX[3]
Configuration settings for all unicast master specifications.
Definition: cfg_hlp.h:358
const char * get_fw_id_from_hw_id(const char *hw_id)
Definition: cfg_hlp.c:533
void(* release_backref)(struct mbg_user *)
Definition: cfg_hlp.h:641
int get_framing_idx(const char *framing)
Definition: cfg_hlp.c:145
BAUD_RATE mbg_baud_rates[N_MBG_BAUD_RATES]
MBG_USER * user_levels
global user levels for external authentication (i.e. radius/tacacs+)
Definition: cfg_hlp.h:649
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_pll_locked(const ALL_IMS_STATE *ims_state, unsigned idx)
Definition: cfg_hlp.c:922
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_holdover_status(const ALL_XMULTI_REF_INFO *info)
Definition: cfg_hlp.c:832
static __mbg_inline bool device_id_is_lan(const char *dev_id)
Check if a device ID refers to a LAN connection.
Definition: cfg_hlp.h:1098
STR_TYPE_INFO_IDX ALL_STR_TYPE_INFO_IDX[20]
An array of configuration settings for all serial string types.
Definition: cfg_hlp.h:179
Specific output settings and limits, plus index.
Definition: gpsdefs.h:10066
int alloc_dev_hw_id(DEVICE_INFO *p, size_t len)
Definition: cfg_hlp.c:515
int get_baud_rate_idx(BAUD_RATE baud_rate)
Definition: cfg_hlp.c:130
PORT_INFO_IDX ALL_PORT_INFO_IDX[10]
An array of configuration settings for all serial ports.
Definition: cfg_hlp.h:176
#define MAX_PARM_XMR
The max number of XMR sources supported by configuration programs.
Definition: cfg_hlp.h:158
#define PTP_TIME_SOURCE_TABLE
A table of PTP time source codes plus associated name strings.
Definition: gpsdefs.h:12902
#define MAX_EXT_NTP_SERVERS
The max number of external NTP servers supported by configuration programs.
Definition: cfg_hlp.h:161
void * priv_data
Definition: cfg_hlp.h:663
#define DEFAULT_GPIO_SIGNAL_SHAPE_NAMES
String initializers for GPIO signal shapes.
Definition: gpsdefs.h:7736
MBG_DATABASE_GLB_INFO glb_info
Definition: cfg_hlp.h:754
int setup_port_info_from_port_parm(PORT_INFO_IDX pii[], const PORT_PARM *p_pp, const RECEIVER_INFO *p_ri)
Setup an array of PORT_INFO_IDX structures from a PORT_PARM.
Definition: cfg_hlp.c:397
const char * ptp_port_state_strs[N_PTP_PORT_STATE]
MBG_PTP_V1_PARENT_DATASET parent_dataset
Definition: cfg_hlp.h:397
the number of known framings
Definition: gpsdefs.h:3346
Server settings info of an NTP device.
Definition: gpsdefs.h:16437
void free_all_xmulti_ref_info(ALL_XMULTI_REF_INFO *p)
Free an ALL_XMULTI_REF_INFO structure.
Definition: cfg_hlp.c:1210
General NTP symmetric key limits to be read from a device.
Definition: gpsdefs.h:15859
PCPS_TIME_EXT::utc_offs field is valid
Definition: cfg_hlp.h:809
struct mbg_firmware_ufu MBG_FIRMWARE_UFU
void mbg_tlv_init(MBG_TLV *tlv, MBG_TLV_UID uid, MBG_TLV_TYPE tlv_type, uint32_t total_bytes)
Initializes a MBG_TLV.
Definition: cfg_hlp.c:668
A structure used to identify a device type and supported features.
Definition: gpsdefs.h:873
PTPv2 current dataset.
Definition: gpsdefs.h:14901
#define XMR_HOLDOVER_STATUS_MODE_NAMES
String initializers for XMR holdover status mode.
Definition: gpsdefs.h:7207
STR_TYPE_INFO default_str_type_info[2]
Output state of FDM device plus index.
Definition: gpsdefs.h:9987
Global current network settings and supported features.
Definition: gpsdefs.h:11869
void port_settings_from_port_parm(PORT_SETTINGS *p_ps, int port_idx, const PORT_PARM *p_pp, int cap_str_idx)
Set up a PORT_SETTINGS structure from a legacy PORT_PARM structure.
Definition: cfg_hlp.c:245
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_has_status(const ALL_GPIO_INFO *info)
Checks whether GPIO supports status function.
Definition: cfg_hlp.c:974
General NTP misc limits to be read from a device.
Definition: gpsdefs.h:16101
void port_settings_from_port_parm_mode(PORT_SETTINGS *p_ps, uint8_t pp_mode, int cap_str_idx)
Convert PORT_PARM::mode to PORT_SETTINGS::mode.
Definition: cfg_hlp.c:170
signal value not used
Definition: cfg_hlp.h:794
#define MAX_PARM_STR_TYPE
The max number of serial string types supported by configuration programs.
Definition: cfg_hlp.h:140
void free_all_firmware_info(ALL_FIRMWARE_INFO *p)
Free an ALL_FIRMWARE_INFO structure.
Definition: cfg_hlp.c:1678
void free_all_ntp_status(ALL_NTP_STATUS *p)
Free an ALL_NTP_STATUS structure.
Definition: cfg_hlp.c:1357
ALL_STR_TYPE_INFO_IDX stii
all supported serial string types
Definition: cfg_hlp.h:193
MBG_SERVICE_INFO info
Definition: cfg_hlp.h:657
Current settings and general capabilities of a specific programmable pulse output.
Definition: gpsdefs.h:6351
void ntp_tstamp_to_nanotime_64(const NTP_TSTAMP *p_nts, NANO_TIME_64 *p_nt64)
Convert a NTP_TSTAMP structure to a NANO_TIME_64 structure.
Definition: cfg_hlp.c:1787
NTP_SYMM_KEY_INFO_IDX * symm_key_info_idx
Definition: cfg_hlp.h:480
XMULTI_REF_STATUS_IDX * status
Definition: cfg_hlp.h:530
char fw_id[100]
Definition: cfg_hlp.h:122
All configuration parameters for all serial ports.
Definition: cfg_hlp.h:190