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