ISSUE ID:- (RICAPP-176).
[ric-app/bouncer.git] / Bouncer / src / xapp-mgmt / msgs_proc.hpp
1 /*
2 # ==================================================================================
3 # Copyright (c) 2020 HCL Technologies Limited.
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
20 #pragma once
21
22 #ifndef XAPP_MSG_XAPP_MSG_HPP_
23 #define XAPP_MSG_XAPP_MSG_HPP_
24
25 #include <iostream>
26 #include<rmr/rmr.h>
27 #include <rmr/RIC_message_types.h>
28 #include <mdclog/mdclog.h>
29
30 #include "a1_helper.hpp"
31 #include "e2ap_control.hpp"
32 #include "e2ap_control_response.hpp"
33 #include "e2ap_indication.hpp"
34 #include "subscription_delete_request.hpp"
35 #include "subscription_delete_response.hpp"
36 #include "subscription_helper.hpp"
37 #include "subscription_request.hpp"
38 #include "subscription_request.hpp"
39 #include "subscription_response.hpp"
40 #include "e2sm_subscription.hpp"
41 #include "subs_mgmt.hpp"
42
43 #define MAX_RMR_RECV_SIZE 2<<15
44
45 class XappMsgHandler{
46
47 private:
48         std::string xapp_id;
49         SubscriptionHandler *_ref_sub_handler;
50 public:
51         //constructor for xapp_id.
52          XappMsgHandler(std::string xid){xapp_id=xid; _ref_sub_handler=NULL;};
53          XappMsgHandler(std::string xid, SubscriptionHandler &subhandler){xapp_id=xid; _ref_sub_handler=&subhandler;};
54
55          void operator() (rmr_mbuf_t *, bool*);
56
57          void register_handler();
58          bool encode_subscription_delete_request(unsigned char*, size_t* );
59
60          bool decode_subscription_response(unsigned char*, size_t );
61
62          //bool a1_policy_handler(char *, int* , a1_policy_helper &);
63
64          void testfunction() {std::cout << "<<<<<<<<<<<<<<<<<<IN TEST FUNCTION<<<<<<<<<<<<<<<" << std::endl;}
65 };
66
67
68 #endif /* XAPP_MSG_XAPP_MSG_HPP_ */