Issue-ID: SIM-18
[sim/e2-interface.git] / e2sim / e2apv1sim / e2sim / e2sim.hpp
1 #ifndef E2SIM_HPP
2 #define E2SIM_HPP
3
4 #include <unordered_map>
5
6 extern "C" {
7 #include "E2AP-PDU.h"
8 #include "OCTET_STRING.h"
9 }
10
11 typedef void (*SubscriptionCallback)(E2AP_PDU_t*);
12
13 class E2Sim;
14 class E2Sim {
15
16 private:
17
18   std::unordered_map<long, OCTET_STRING_t*> ran_functions_registered;
19   std::unordered_map<long, SubscriptionCallback> subscription_callbacks;
20
21   void wait_for_sctp_data();
22   
23 public:
24
25   SubscriptionCallback get_subscription_callback(long func_id);
26   
27   void register_e2sm(long func_id, OCTET_STRING_t* ostr);
28
29   void register_subscription_callback(long func_id, SubscriptionCallback cb);
30   
31   void encode_and_send_sctp_data(E2AP_PDU_t* pdu);
32
33   int run_loop(int argc, char* argv[]);
34
35 };
36
37 #endif