Implementation for supporting Service Update
[sim/e2-interface.git] / e2sim / previous / e2apv1sim / e2sim / encode_e2apv1.hpp
1 /*****************************************************************************
2 #                                                                            *
3 # Copyright 2019 AT&T Intellectual Property                                  *
4 # Copyright 2019 Nokia                                                       *
5 # Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved.      *
6 #                                                                            *
7 # Licensed under the Apache License, Version 2.0 (the "License");            *
8 # you may not use this file except in compliance with the License.           *
9 # You may obtain a copy of the License at                                    *
10 #                                                                            *
11 #      http://www.apache.org/licenses/LICENSE-2.0                            *
12 #                                                                            *
13 # Unless required by applicable law or agreed to in writing, software        *
14 # distributed under the License is distributed on an "AS IS" BASIS,          *
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
16 # See the License for the specific language governing permissions and        *
17 # limitations under the License.                                             *
18 #                                                                            *
19 ******************************************************************************/
20
21 #ifndef ENCODE_E2APV1_HPP
22 #define ENCODE_E2APV1_HPP
23 /*
24 #include <stdio.h>
25 #include <unistd.h>
26 #include <assert.h>
27 */
28
29 //#include <stdio>
30 //#include <unistd.h>
31 //#include <assert.h>
32 #include <vector>
33
34 //#include "e2sim_sctp.hpp"
35 //#include "e2ap_message_handler.hpp"
36 #include "encode_kpm.hpp"
37
38
39 extern "C" {
40   //#include "e2sim_defs.h"
41 #include "E2AP-PDU.h"
42
43
44 }
45
46 struct ran_func_info {
47   long ranFunctionId;
48   OCTET_STRING_t *ranFunctionDesc;
49   long ranFunctionRev;
50 };
51
52 long get_function_id_from_subscription(E2AP_PDU_t *e2ap_pdu);
53
54 void buildSubsReq(E2AP_PDU_t *pdu);
55
56 void generate_e2apv1_setup_request(E2AP_PDU_t *setup_req_pdu);
57
58 //void generate_e2apv1_setup_request_parameterized(E2AP_PDU_t *setup_req_pdu, long ranFuncId, uint8_t* ranFuncDesc, int ranFuncLength);
59 void generate_e2apv1_setup_request_parameterized(E2AP_PDU_t *setup_req_pdu, std::vector<ran_func_info> all_funcs);
60
61 void generate_e2apv1_setup_response(E2AP_PDU_t *setup_resp_pdu);
62
63 void generate_e2apv1_subscription_request(E2AP_PDU_t *sub_req_pdu);
64
65 void generate_e2apv1_subscription_response(E2AP_PDU_t *sub_resp_pdu, E2AP_PDU_t *sub_req_pdu);
66
67 void generate_e2apv1_indication_request(E2AP_PDU_t *ind_req_pdu);
68
69 void generate_e2apv1_subscription_response_success(E2AP_PDU *e2ap_pdu, long reqActionIdsAccepted[], long reqActionIdsRejected[], int accept_size, int reject_size, long reqRequestorId, long reqInstanceId);
70
71 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);
72
73 void generate_e2apv1_service_update(E2AP_PDU_t *e2ap_pdu);
74
75 #endif