Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "e2ap_xapp.h"
#include <assert.h> // for assert
#include <stdio.h> // for NULL
#include "lib/ap/dec/e2ap_msg_dec_generic.h" // for e2ap_msg_dec_gen
#include "lib/ap/enc/e2ap_msg_enc_generic.h" // for e2ap_enc_control_reques...
#include "lib/ap/free/e2ap_msg_free.h" // for e2ap_free_control_request
//#include "msg_handler_ric.h"
//#include "lib/ap/free/e2ap_msg_free.h"
//#include "lib/ep/e2ap_ep.h"
//#include "lib/ap/dec/e2ap_msg_dec_generic.h"
//#include "lib/ap/enc/e2ap_msg_enc_generic.h"
//#include <assert.h>
//#include <stdio.h>
void e2ap_msg_free_xapp(e2ap_xapp_t* ap, e2ap_msg_t* msg)
{
assert(ap != NULL);
assert(msg != NULL);
const e2_msg_type_t msg_type = msg->type;
if(msg_type == NONE_E2_MSG_TYPE)
return;
ap->base.type.free_msg[msg_type](msg);
}
void e2ap_free_subscription_request_xapp(e2ap_xapp_t* ap, ric_subscription_request_t* sr)
{
assert(ap != NULL);
assert(sr != NULL);
e2ap_free_subscription_request(sr);
}
void e2ap_free_control_request_xapp(e2ap_xapp_t* ap, ric_control_request_t* ctrl_req)
{
assert(ap != NULL);
assert(ctrl_req != NULL);
e2ap_free_control_request(ctrl_req);
}
e2ap_msg_t e2ap_msg_dec_xapp(e2ap_xapp_t* ap, byte_array_t ba)
{
assert(ap != NULL);
e2ap_msg_t msg = e2ap_msg_dec_gen(&ap->base.type, ba);
return msg;
}
byte_array_t e2ap_msg_enc_xapp(e2ap_xapp_t* ap, e2ap_msg_t* msg)
{
assert(ap != NULL);
assert(msg != NULL);
const e2_msg_type_t msg_type = msg->type;
assert(msg_type < NONE_E2_MSG_TYPE);
byte_array_t ba = ap->base.type.enc_msg[msg_type](msg);
return ba;
}
byte_array_t e2ap_enc_subscription_request_xapp(e2ap_xapp_t* ap, ric_subscription_request_t* sr)
{
assert(ap != NULL);
assert(sr != NULL);
return e2ap_enc_subscription_request_gen(&ap->base.type, sr);
}
byte_array_t e2ap_enc_subscription_delete_request_xapp(e2ap_xapp_t* ap, ric_subscription_delete_request_t* sd)
{
assert(ap != NULL);
assert(sd != NULL);
return e2ap_enc_subscription_delete_request_gen(&ap->base.type, sd);
}
byte_array_t e2ap_enc_setup_request_xapp(e2ap_xapp_t* ap, e2_setup_request_t* sr)
{
assert(ap != NULL);
assert(sr != NULL);
return e2ap_enc_setup_request_gen(&ap->base.type, sr);
}
byte_array_t e2ap_enc_control_request_xapp(e2ap_xapp_t* ap, ric_control_request_t* ctrl_req)
{
assert(ap != NULL);
assert(ctrl_req != NULL);
return e2ap_enc_control_request_gen(&ap->base.type,ctrl_req);
}
byte_array_t e2ap_enc_e42_setup_request_xapp(e2ap_xapp_t* ap, e42_setup_request_t* sr)
{
assert(ap != NULL);
assert(sr != NULL);
return e2ap_enc_e42_setup_request_gen(&ap->base.type, sr);
}
byte_array_t e2ap_enc_e42_subscription_request_xapp(e2ap_xapp_t* ap, e42_ric_subscription_request_t* sr)
{
assert(ap != NULL);
assert(sr != NULL);
return e2ap_enc_e42_subscription_request_gen(&ap->base.type, sr);
}
byte_array_t e2ap_enc_ric_subscription_delete_xapp(e2ap_xapp_t* ap, ric_subscription_delete_request_t* sdr)
{
assert(ap != NULL);
assert(sdr != NULL);
return e2ap_enc_subscription_delete_request_gen(&ap->base.type, sdr);
}
byte_array_t e2ap_enc_e42_ric_subscription_delete_xapp(e2ap_xapp_t* ap, e42_ric_subscription_delete_request_t* sdr)
{
assert(ap != NULL);
assert(sdr != NULL);
return e2ap_enc_e42_subscription_delete_request_gen(&ap->base.type, sdr);
}
byte_array_t e2ap_enc_e42_control_request_xapp(e2ap_xapp_t* ap, e42_ric_control_request_t* cr)
{
assert(ap != NULL);
assert(cr != NULL);
return e2ap_enc_e42_control_request_gen(&ap->base.type, cr);
}