Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
e19b7140
Commit
e19b7140
authored
Jun 11, 2024
by
Rúben Soares Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add utility functions related to PARAM.request
parent
5ef1217a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
0 deletions
+69
-0
nfapi/open-nFAPI/fapi/inc/nr_fapi_p5_utils.h
nfapi/open-nFAPI/fapi/inc/nr_fapi_p5_utils.h
+22
-0
nfapi/open-nFAPI/fapi/src/nr_fapi_p5_utils.c
nfapi/open-nFAPI/fapi/src/nr_fapi_p5_utils.c
+47
-0
No files found.
nfapi/open-nFAPI/fapi/inc/nr_fapi_p5_utils.h
View file @
e19b7140
...
...
@@ -34,5 +34,27 @@
#include "stdio.h"
#include "stdint.h"
#include "nr_fapi.h"
#include "nfapi/oai_integration/vendor_ext.h"
#define EQ_TLV(_tlv_a, _tlv_b) \
do { \
EQ(_tlv_a.tl.tag, _tlv_b.tl.tag); \
EQ(_tlv_a.value, _tlv_b.value); \
} while (0)
#define EQ(_a, _b) \
do { \
if ((_a) != (_b)) { \
return false; \
} \
} while (0)
void
copy_vendor_extension_value
(
nfapi_vendor_extension_tlv_t
*
dst
,
const
nfapi_vendor_extension_tlv_t
*
src
);
bool
eq_param_request
(
const
nfapi_nr_param_request_scf_t
*
unpacked_req
,
const
nfapi_nr_param_request_scf_t
*
req
);
void
free_param_request
(
nfapi_nr_param_request_scf_t
*
msg
);
void
copy_param_request
(
const
nfapi_nr_param_request_scf_t
*
src
,
nfapi_nr_param_request_scf_t
*
dst
);
#endif // OPENAIRINTERFACE_NR_FAPI_P5_UTILS_H
nfapi/open-nFAPI/fapi/src/nr_fapi_p5_utils.c
View file @
e19b7140
...
...
@@ -29,3 +29,50 @@
* \warning
*/
#include "nr_fapi_p5_utils.h"
void
copy_vendor_extension_value
(
nfapi_vendor_extension_tlv_t
*
dst
,
const
nfapi_vendor_extension_tlv_t
*
src
)
{
nfapi_tl_t
*
dst_tlv
=
(
nfapi_tl_t
*
)
dst
;
nfapi_tl_t
*
src_tlv
=
(
nfapi_tl_t
*
)
src
;
switch
(
dst_tlv
->
tag
)
{
case
VENDOR_EXT_TLV_2_TAG
:
{
vendor_ext_tlv_2
*
dst_ve
=
(
vendor_ext_tlv_2
*
)
dst_tlv
;
vendor_ext_tlv_2
*
src_ve
=
(
vendor_ext_tlv_2
*
)
src_tlv
;
dst_ve
->
dummy
=
src_ve
->
dummy
;
}
break
;
case
VENDOR_EXT_TLV_1_TAG
:
{
vendor_ext_tlv_1
*
dst_ve
=
(
vendor_ext_tlv_1
*
)
dst_tlv
;
vendor_ext_tlv_1
*
src_ve
=
(
vendor_ext_tlv_1
*
)
src_tlv
;
dst_ve
->
dummy
=
src_ve
->
dummy
;
}
break
;
}
}
bool
eq_param_request
(
const
nfapi_nr_param_request_scf_t
*
unpacked_req
,
const
nfapi_nr_param_request_scf_t
*
req
)
{
EQ
(
unpacked_req
->
header
.
message_id
,
req
->
header
.
message_id
);
EQ
(
unpacked_req
->
header
.
message_length
,
req
->
header
.
message_length
);
return
true
;
}
void
free_param_request
(
nfapi_nr_param_request_scf_t
*
msg
)
{
if
(
msg
->
vendor_extension
)
{
free
(
msg
->
vendor_extension
);
}
}
void
copy_param_request
(
const
nfapi_nr_param_request_scf_t
*
src
,
nfapi_nr_param_request_scf_t
*
dst
)
{
dst
->
header
.
message_id
=
src
->
header
.
message_id
;
dst
->
header
.
message_length
=
src
->
header
.
message_length
;
if
(
src
->
vendor_extension
)
{
dst
->
vendor_extension
=
calloc
(
1
,
sizeof
(
nfapi_vendor_extension_tlv_t
));
dst
->
vendor_extension
->
tag
=
src
->
vendor_extension
->
tag
;
dst
->
vendor_extension
->
length
=
src
->
vendor_extension
->
length
;
copy_vendor_extension_value
(
&
dst
->
vendor_extension
,
&
src
->
vendor_extension
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment