version 4.0.0 first support for new E2 ASN
[ric-plt/e2.git] / RIC-E2-TERMINATION / TEST / testAsn / ASN_LOG / LogTest.h
1 /*
2  * Copyright 2019 AT&T Intellectual Property
3  * Copyright 2019 Nokia
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 //
19 // Created by adi ENZEL on 11/26/19.
20 //
21
22 #ifndef E2_LOGTEST_H
23 #define E2_LOGTEST_H
24 #include <algorithm>
25
26 #include <cstdio>
27 #include <cerrno>
28 #include <cstdlib>
29 #include <cstring>
30 #include <random>
31 #include <sys/socket.h>
32 #include <arpa/inet.h>
33 #include <netinet/in_systm.h>
34 #include <netinet/in.h>
35 #include <netinet/ip.h>
36 #include <netinet/ip_icmp.h>
37 #include <netinet/sctp.h>
38 #include <thread>
39 #include <atomic>
40 #include <sys/param.h>
41 #include <sys/file.h>
42 #include <ctime>
43 #include <netdb.h>
44 #include <sys/epoll.h>
45 #include <mutex>
46 #include <shared_mutex>
47 #include <iterator>
48 #include <map>
49 #include <fstream>
50
51 #include "rapidjson/document.h"
52 #include "rapidjson/writer.h"
53 #include "rapidjson/stringbuffer.h"
54
55 using namespace std;
56 using namespace rapidjson;
57
58 class LogTest {
59 public:
60     LogTest() = default;
61
62     int openFile(string const& configFile) {
63         file.open(configFile.c_str());
64         if (!file) {
65             return -1;
66         }
67         return 0;
68     }
69
70     string getLine();
71     void getJsonDoc(string json);
72
73     string getBase64(Document &document);
74
75 private:
76     std::ifstream file;
77     Document document;
78 };
79
80
81 #endif //E2_LOGTEST_H