#define included_stat_segment_h
#include <stdatomic.h>
-
-/* Default socket to exchange segment fd */
-#define STAT_SEGMENT_SOCKET_FILE "/run/vpp/stats.sock"
-
-typedef enum
-{
- STAT_DIR_TYPE_ILLEGAL = 0,
- STAT_DIR_TYPE_SCALAR_INDEX,
- STAT_DIR_TYPE_COUNTER_VECTOR_SIMPLE,
- STAT_DIR_TYPE_COUNTER_VECTOR_COMBINED,
- STAT_DIR_TYPE_ERROR_INDEX,
-} stat_directory_type_t;
+#include <vlib/vlib.h>
+#include <vppinfra/socket.h>
+#include <vpp-api/client/stat_client.h>
typedef enum
{
return ((char *) start + offset);
}
+typedef struct
+{
+ /* statistics segment */
+ uword *directory_vector_by_name;
+ stat_segment_directory_entry_t *directory_vector;
+ clib_spinlock_t *stat_segment_lockp;
+ clib_socket_t *socket;
+ u8 *socket_name;
+ ssize_t memory_size;
+ u8 node_counters_enabled;
+ void *heap;
+ stat_segment_shared_header_t *shared_header; /* pointer to shared memory segment */
+ int memfd;
+
+ u64 last_input_packets;
+} stat_segment_main_t;
+
+extern stat_segment_main_t stat_segment_main;
+
#endif