Updated INFO.yaml file
[ric-app/kpimon.git] / src / kpi-xapp.hpp
1 /*\r
2 ==================================================================================\r
3 \r
4         Copyright (c) 2018-2019 SAMSUNG and AT&T Intellectual Property.\r
5 \r
6    Licensed under the Apache License, Version 2.0 (the "License");\r
7    you may not use this file except in compliance with the License.\r
8    You may obtain a copy of the License at\r
9 \r
10        http://www.apache.org/licenses/LICENSE-2.0\r
11 \r
12    Unless required by applicable law or agreed to in writing, software\r
13    distributed under the License is distributed on an "AS IS" BASIS,\r
14    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
15    See the License for the specific language governing permissions and\r
16    limitations under the License.\r
17 ==================================================================================\r
18 */\r
19 \r
20 #pragma once\r
21 #ifndef KPI_XAPP_\r
22 #define KPI_XAPP_\r
23 \r
24 #include <limits>\r
25 #include <map>\r
26 #include <getopt.h>\r
27 #include <csignal>\r
28 #include <cstdlib>\r
29 #include <time.h>\r
30 #include <errno.h>\r
31 #include <xapp_utils.hpp>\r
32 #include <rmr/RIC_message_types.h>\r
33 #include <e2sm.hpp>\r
34 #include "message_processor_class.hpp"\r
35 \r
36 #define MAX_SLEEP 86400\r
37 #define MAX_SUBSCRIPTION_ATTEMPTS 10\r
38 //================================================\r
39 \r
40 \r
41 // configuration parameters \r
42 struct configuration {\r
43   \r
44   char name[128] = "kpi-xapp";\r
45   char port[16] = "tcp:4560";\r
46 \r
47   int redis_port = 6379;\r
48   \r
49   int num_threads = 1;\r
50   std::unique_ptr<XaPP> my_xapp;\r
51   int log_level = MDCLOG_WARN;\r
52 \r
53   void fill_gnodeb_list(char * gNodeB_string){\r
54     gNodeB_list.clear();\r
55     char * gnb = strtok(gNodeB_string, ",");\r
56     while(gnb != NULL){\r
57       gNodeB_list.push_back(gnb);\r
58       gnb = strtok(NULL, ",");\r
59     }\r
60 \r
61   };\r
62 \r
63   std::vector<string> gNodeB_list;\r
64 \r
65 };\r
66 \r
67 void usage(char *command);\r
68 void get_environment_config(configuration & config_instance);\r
69 void get_command_line_config(int argc, char **argv, configuration &config_instance);\r
70 #endif\r