Separated E2Sim lib from E2SM-specific code
[sim/e2-interface.git] / e2sim / src / encoding / encode_e2apv1.hpp
1
2 /*****************************************************************************
3 #                                                                            *
4 # Copyright 2020 AT&T Intellectual Property                                  *
5 #                                                                            *
6 # Licensed under the Apache License, Version 2.0 (the "License");            *
7 # you may not use this file except in compliance with the License.           *
8 # You may obtain a copy of the License at                                    *
9 #                                                                            *
10 #      http://www.apache.org/licenses/LICENSE-2.0                            *
11 #                                                                            *
12 # Unless required by applicable law or agreed to in writing, software        *
13 # distributed under the License is distributed on an "AS IS" BASIS,          *
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
15 # See the License for the specific language governing permissions and        *
16 # limitations under the License.                                             *
17 #                                                                            *
18 ******************************************************************************/
19
20 #ifndef ENCODE_E2APV1_HPP
21 #define ENCODE_E2APV1_HPP
22
23 #include <vector>
24
25
26 extern "C" {
27
28 #include "E2AP-PDU.h"
29 #include "OCTET_STRING.h"
30
31 }
32
33 namespace encoding {
34
35   struct ran_func_info {
36     long ranFunctionId;
37     OCTET_STRING_t *ranFunctionDesc;
38     long ranFunctionRev;
39   };
40   
41   long get_function_id_from_subscription(E2AP_PDU_t *e2ap_pdu);
42   
43   void buildSubsReq(E2AP_PDU_t *pdu);
44   
45   void generate_e2apv1_setup_request_parameterized(E2AP_PDU_t *setup_req_pdu, std::vector<ran_func_info> all_funcs);
46   
47   void generate_e2apv1_setup_response(E2AP_PDU_t *setup_resp_pdu);
48   
49   void generate_e2apv1_subscription_request(E2AP_PDU_t *sub_req_pdu);
50   
51   void generate_e2apv1_subscription_response(E2AP_PDU_t *sub_resp_pdu, E2AP_PDU_t *sub_req_pdu);
52   
53   void generate_e2apv1_subscription_response_success(E2AP_PDU *e2ap_pdu, long reqActionIdsAccepted[], long reqActionIdsRejected[], int accept_size, int reject_size, long reqRequestorId, long reqInstanceId);
54   
55   void generate_e2apv1_indication_request_parameterized(E2AP_PDU *e2ap_pdu, long requestorId, long instanceId, long ranFunctionId, long actionId, long seqNum, uint8_t *ind_header_buf, int header_length, uint8_t *ind_message_buf, int message_length);
56   
57 }
58
59 #endif