aa858b241becdf5c5215444ed2f8908e75932b7a
[sim/e2-interface.git] / e2sim / previous / e2apv1sim / ricsim / src / ASN1 / lib / asn_e2ap.hpp
1 /*****************************************************************************
2 #                                                                            *
3 # Copyright 2019 AT&T Intellectual Property                                  *
4 # Copyright 2019 Nokia                                                       *
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 ASN_E2AP_HPP
21 #define ASN_E2AP_HPP
22
23 #include <stdbool.h>
24 #include <stddef.h>
25 #include <stdint.h>
26
27 #include "e2ap_config.hpp"
28
29 typedef struct c__dummy01 e2ap_pdu_t;
30
31 /*-----------------------------------------------------------------------
32                               COMMON ROUTINES
33 -------------------------------------------------------------------------
34 */
35 e2ap_pdu_t* new_e2ap_pdu(void);
36
37 void e2ap_asn_print(e2ap_pdu_t* pdu, char* buf, size_t buf_size);
38
39 int e2ap_asn_per_encode(e2ap_pdu_t* pdu, unsigned char* buf, size_t buf_size,
40                       char* err_buf, size_t err_buf_size);
41
42 int e2ap_asn_per_decode(e2ap_pdu_t* pdu, unsigned char const* buf, size_t buf_size,
43                                           char* err_buf, size_t err_buf_size);
44
45 int e2ap_get_index(e2ap_pdu_t* pdu);
46
47 int e2ap_get_procedureCode(e2ap_pdu_t* pdu);
48
49 /*-----------------------------------------------------------------------
50                               MESSAGE GENERATORS
51 -------------------------------------------------------------------------
52 */
53
54 //X2Setup
55 bool e2ap_init_X2SetupRequest(e2ap_pdu_t* pdu);
56
57 bool e2ap_create_X2SetupRequest(e2ap_pdu_t* pdu, eNB_config &cfg);
58
59 bool e2ap_create_X2SetupResponse(e2ap_pdu_t* pdu, eNB_config &cfg);
60
61 bool e2ap_create_X2SetupFailure(e2ap_pdu_t* pdu);
62
63 //ENDCX2Setup
64 bool e2ap_create_ENDCX2SetupRequest(e2ap_pdu_t* pdu, eNB_config &cfg);
65
66 bool e2ap_create_ENDCX2SetupResponse(e2ap_pdu_t* pdu, gNB_config &cfg);
67
68 bool e2ap_create_ENDCX2SetupFailure(e2ap_pdu_t* pdu);
69
70 //RIC Subscription
71 bool e2ap_create_RICsubscriptionRequest(e2ap_pdu_t* pdu, RICsubscription_params_t &params);
72
73 bool e2ap_parse_RICsubscriptionRequest(e2ap_pdu_t* pdu, RICsubscription_params_t &params);
74
75 bool e2ap_create_RICsubscriptionResponse(e2ap_pdu_t* pdu, RICsubscription_params_t &params);
76
77 bool e2ap_create_RICsubscriptionFailure(e2ap_pdu_t* pdu, RICsubscription_params_t &params);
78
79 /*-----------------------------------------------------------------------
80                               TESTS
81 -------------------------------------------------------------------------
82 */
83 void test_E2AP_X2Setup_codec(void);
84
85 #endif