15695c3a7a0326ad360acfd860b1bb281eb255f5
[ric-app/hw.git] / src / xapp-asn / e2ap / subscription_request.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 #pragma once
20
21 #ifndef S_REQUEST_
22 #define S_REQUEST_
23
24 #include <mdclog/mdclog.h>
25 #include <vector>
26 #include <sstream>
27
28 #include <asn_application.h>
29 #include <E2AP-PDU.h>
30 #include <InitiatingMessage.h>
31 #include <RICsubscriptionRequest.h>
32 #include <RICsubscriptionRequest.h>
33 #include <ProtocolIE-Field.h>
34 #include <ProtocolIE-SingleContainer.h>
35 #include <RICactions-ToBeSetup-List.h>
36 #include <RICsubsequentAction.h>
37 #include "subscription_helper.hpp"
38
39 #define NUM_SUBSCRIPTION_REQUEST_IES 3
40 #define INITIAL_REQUEST_LIST_SIZE 4
41   
42 class subscription_request{   
43 public:
44
45   subscription_request(std::string name);
46   subscription_request(void);
47   ~subscription_request(void);
48   
49   bool encode_e2ap_subscription(unsigned char *, size_t *,  subscription_helper &);
50   bool set_fields(InitiatingMessage_t *, subscription_helper &);
51   bool get_fields(InitiatingMessage_t *, subscription_helper &);
52     
53   std::string get_error(void) const{
54     return error_string;
55   }
56     
57 private:
58     
59   InitiatingMessage_t *initMsg;
60   E2AP_PDU_t * e2ap_pdu_obj;
61
62   RICsubscriptionRequest_IEs_t * IE_array;
63   RICaction_ToBeSetup_ItemIEs_t * action_array;
64   unsigned int action_array_size;  
65   char errbuf[128];
66   size_t errbuf_len = 128;
67   std::string _name;
68   std::string error_string;
69 };
70
71
72
73 #endif