/src/ocudu/lib/e1ap/common/e1ap_asn1_helpers.h
Line | Count | Source |
1 | | // SPDX-FileCopyrightText: Copyright (C) 2021-2026 Software Radio Systems Limited |
2 | | // SPDX-License-Identifier: BSD-3-Clause-Open-MPI |
3 | | // Portions of this file may implement 3GPP specifications, which may be subject to additional licensing requirements. |
4 | | |
5 | | #pragma once |
6 | | |
7 | | #include "e1ap_asn1_converters.h" |
8 | | #include "ocudu/asn1/e1ap/e1ap_pdu_contents.h" |
9 | | #include "ocudu/ran/bcd_helper.h" |
10 | | #include "ocudu/ran/qos/qos_prio_level.h" |
11 | | |
12 | | namespace ocudu { |
13 | | |
14 | | inline void fill_e1ap_cu_up_e1_setup_request(cu_up_e1_setup_request& req, |
15 | | const asn1::e1ap::gnb_cu_up_e1_setup_request_s& asn1_req) |
16 | 0 | { |
17 | 0 | req.gnb_cu_up_id = asn1_req->gnb_cu_up_id; |
18 | |
|
19 | 0 | if (asn1_req->gnb_cu_up_name_present) { |
20 | 0 | req.gnb_cu_up_name = asn1_req->gnb_cu_up_name.to_string(); |
21 | 0 | } |
22 | |
|
23 | 0 | req.cn_support = static_cast<cu_up_cn_support_t>(asn1_req->cn_support.value); |
24 | |
|
25 | 0 | for (const auto& asn1_plmn_item : asn1_req->supported_plmns) { |
26 | 0 | supported_plmns_item_t plmn; |
27 | 0 | plmn.plmn_id = asn1_plmn_item.plmn_id.to_string(); |
28 | |
|
29 | 0 | for (const auto& asn1_slice_support_item : asn1_plmn_item.slice_support_list) { |
30 | 0 | slice_support_item_t slice_support; |
31 | 0 | slice_support.s_nssai.sst = slice_service_type{(uint8_t)asn1_slice_support_item.snssai.sst.to_number()}; |
32 | |
|
33 | 0 | if (asn1_slice_support_item.snssai.sd_present) { |
34 | 0 | slice_support.s_nssai.sd = slice_differentiator::create(asn1_slice_support_item.snssai.sd.to_number()).value(); |
35 | 0 | } |
36 | |
|
37 | 0 | plmn.slice_support_list.push_back(slice_support); |
38 | 0 | } |
39 | |
|
40 | 0 | for (const auto& asn1_nr_cgi_support_item : asn1_plmn_item.nr_cgi_support_list) { |
41 | 0 | nr_cgi_support_item_t nr_cgi_support; |
42 | 0 | nr_cgi_support.nr_cgi = e1ap_asn1_to_cgi(asn1_nr_cgi_support_item.nr_cgi); |
43 | |
|
44 | 0 | plmn.nr_cgi_support_list.push_back(nr_cgi_support); |
45 | 0 | } |
46 | |
|
47 | 0 | if (asn1_plmn_item.qos_params_support_list_present) { |
48 | | // We only support ng ran qos support list |
49 | 0 | for (const auto& asn1_qos_support_item : asn1_plmn_item.qos_params_support_list.ng_ran_qos_support_list) { |
50 | 0 | ng_ran_qos_support_item_t qos_support_item; |
51 | |
|
52 | 0 | qos_support_item.non_dyn_5qi_desc.five_qi = |
53 | 0 | uint_to_five_qi(asn1_qos_support_item.non_dyn_5qi_descriptor.five_qi); |
54 | |
|
55 | 0 | if (asn1_qos_support_item.non_dyn_5qi_descriptor.qos_prio_level_present) { |
56 | 0 | qos_support_item.non_dyn_5qi_desc.qos_prio_level = |
57 | 0 | qos_prio_level_t{asn1_qos_support_item.non_dyn_5qi_descriptor.qos_prio_level}; |
58 | 0 | } |
59 | 0 | if (asn1_qos_support_item.non_dyn_5qi_descriptor.averaging_win_present) { |
60 | 0 | qos_support_item.non_dyn_5qi_desc.averaging_win = asn1_qos_support_item.non_dyn_5qi_descriptor.averaging_win; |
61 | 0 | } |
62 | 0 | if (asn1_qos_support_item.non_dyn_5qi_descriptor.max_data_burst_volume_present) { |
63 | 0 | qos_support_item.non_dyn_5qi_desc.max_data_burst_volume = |
64 | 0 | asn1_qos_support_item.non_dyn_5qi_descriptor.max_data_burst_volume; |
65 | 0 | } |
66 | |
|
67 | 0 | plmn.ng_ran_qos_support_list.push_back(qos_support_item); |
68 | 0 | } |
69 | 0 | } |
70 | |
|
71 | 0 | req.supported_plmns.push_back(plmn); |
72 | 0 | } |
73 | |
|
74 | 0 | if (asn1_req->gnb_cu_up_capacity_present) { |
75 | 0 | req.gnb_cu_up_capacity = asn1_req->gnb_cu_up_capacity; |
76 | 0 | } |
77 | 0 | } |
78 | | |
79 | | } // namespace ocudu |