1976b7992505941446ea17f9ad97b41043fd3624
[ric-app/bouncer.git] / Bouncer / src / xapp-asn / e2sm / e2sm_indication.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 /* Classes to handle E2 service model based on e2sm-Bouncer-v001.asn */
21 #ifndef SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_
22 #define SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_
23
24 #include <sstream>
25 #include <e2sm_helpers.hpp>
26 #include <mdclog/mdclog.h>
27 #include <vector>
28
29 #include <E2SM-Bouncer-IndicationHeader.h>
30 #include <E2SM-Bouncer-IndicationMessage.h>
31 #include <E2SM-Bouncer-IndicationHeader-Format1.h>
32 #include <E2SM-Bouncer-IndicationMessage-Format1.h>
33 #include <B-Header.h>
34 #include <B-Message.h>
35
36 class e2sm_indication {
37 public:
38         e2sm_indication(void);
39   ~e2sm_indication(void);
40
41   bool set_fields(E2SM_Bouncer_IndicationHeader_t *, e2sm_indication_helper &);
42   bool set_fields(E2SM_Bouncer_IndicationMessage_t *, e2sm_indication_helper &);
43
44   bool get_fields(E2SM_Bouncer_IndicationHeader_t *, e2sm_indication_helper &);
45   bool get_fields(E2SM_Bouncer_IndicationMessage_t *, e2sm_indication_helper &);
46
47   bool encode_indication_header(unsigned char *, size_t *, e2sm_indication_helper &);
48   bool encode_indication_message(unsigned char*, size_t *, e2sm_indication_helper &);
49
50
51   std::string  get_error (void) const {return error_string ;};
52
53 private:
54
55   E2SM_Bouncer_IndicationHeader_t * indication_head; // used for encoding
56   E2SM_Bouncer_IndicationMessage_t* indication_msg;
57   E2SM_Bouncer_IndicationHeader_Format1_t head_fmt1;
58   E2SM_Bouncer_IndicationMessage_Format1_t msg_fmt1;
59
60
61   size_t errbuf_len;
62   char errbuf[128];
63   std::string error_string;
64 };
65
66
67
68
69 #endif /* SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_ */