#include <map>
#include <sys/inotify.h>
#include <csignal>
+#include <future>
#include <rmr/rmr.h>
#include <rmr/RIC_message_types.h>
#include "cxxopts.hpp"
//#include "config-cpp/include/config-cpp/config-cpp.h"
+#include <zlib.h>
+#include <prometheus/counter.h>
+#include <prometheus/exposer.h>
+#include <prometheus/gateway.h>
+#include <prometheus/registry.h>
+using namespace prometheus;
#include "mapWrapper.h"
-#include "statCollector.h"
#include "base64.h"
#define MAXEVENTS 128
-#define RECEIVE_SCTP_BUFFER_SIZE (128 * 1024)
-#define RECEIVE_XAPP_BUFFER_SIZE RECEIVE_SCTP_BUFFER_SIZE
+#define RECEIVE_SCTP_BUFFER_SIZE (256 * 1024)
+#define RECEIVE_XAPP_BUFFER_SIZE RECEIVE_SCTP_BUFFER_SIZE
typedef mapWrapper Sctp_Map_t;
#define KA_MESSAGE_SIZE 2048
typedef struct sctp_params {
+ int epollTimeOut = -1;
uint16_t rmrPort = 0;
uint16_t sctpPort = SRC_PORT;
int epoll_fd = 0;
string configFilePath {};
string configFileName {};
bool trace = true;
- //shared_timed_mutex fence; // moved to mapWrapper
+ string prometheusMode {"pull"};
+ string prometheusPushAddress {"127.0.0.1:7676"};
+ shared_ptr<prometheus::Registry> prometheusRegistry;
+ string prometheusPort {"8088"};
+ Family<Counter> *prometheusFamily;
+ Gateway *prometheusGateway = nullptr;
+ Exposer *prometheusExposer = nullptr;
} sctp_params_t;
+// RAN to RIC
+#define IN_INITI 0 //INITIATING
+#define IN_SUCC 1 //SUCCESSFULL
+#define IN_UN_SUCC 2 //UN-Successfull
+
+// RIC To RAN
+#define OUT_INITI 3 //INITIATING
+#define OUT_SUCC 4 //SUCCESSFULL
+#define OUT_UN_SUCC 5 //UN-Successfull
+
+#define MSG_COUNTER 0
+#define BYTES_COUNTER 1
+
typedef struct ConnectedCU {
int fileDescriptor = 0;
char hostName[NI_MAXHOST] {};
bool isConnected = false;
bool gotSetup = false;
sctp_params_t *sctpParams = nullptr;
+ Counter *counters[6][2][ProcedureCode_id_RICsubscriptionDelete + 1] {};
} ConnectedCU_t ;
+
#define MAX_RMR_BUFF_ARRY 32
typedef struct RmrMessagesBuffer {
char ka_message[KA_MESSAGE_SIZE] {};
long outLen = 0;
unsigned char base64Data[RECEIVE_SCTP_BUFFER_SIZE * 2] {};
char buffer[RECEIVE_SCTP_BUFFER_SIZE * 8] {};
- StatCollector *statCollector = nullptr;
} ReportingMessages_t;
cxxopts::ParseResult parse(int argc, char *argv[], sctp_params_t &pSctpParams);