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
alex037yang
OpenXG-RAN
Commits
54aa295e
Commit
54aa295e
authored
Sep 07, 2018
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use f1ap_encoder.c file for F1AP encoding functionality
parent
e82cae08
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
101 deletions
+20
-101
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-0
openair2/F1AP/CU_F1AP.c
openair2/F1AP/CU_F1AP.c
+0
-40
openair2/F1AP/DU_F1AP.c
openair2/F1AP/DU_F1AP.c
+2
-41
openair2/F1AP/f1ap_encoder.c
openair2/F1AP/f1ap_encoder.c
+17
-20
No files found.
cmake_targets/CMakeLists.txt
View file @
54aa295e
...
@@ -543,6 +543,7 @@ add_library(F1AP
...
@@ -543,6 +543,7 @@ add_library(F1AP
#${F1AP_DIR}/test.c
#${F1AP_DIR}/test.c
${
F1AP_DIR
}
/DU_F1AP.c
${
F1AP_DIR
}
/DU_F1AP.c
${
F1AP_DIR
}
/CU_F1AP.c
${
F1AP_DIR
}
/CU_F1AP.c
${
F1AP_DIR
}
/f1ap_encoder.c
${
F1AP_DIR
}
/f1ap_decoder.c
${
F1AP_DIR
}
/f1ap_decoder.c
${
F1AP_DIR
}
/f1ap_handlers.c
${
F1AP_DIR
}
/f1ap_handlers.c
${
F1AP_DIR
}
/sctp_du.c
${
F1AP_DIR
}
/sctp_du.c
...
...
openair2/F1AP/CU_F1AP.c
View file @
54aa295e
...
@@ -334,46 +334,6 @@ void CU_send_F1_SETUP_RESPONSE(void) {
...
@@ -334,46 +334,6 @@ void CU_send_F1_SETUP_RESPONSE(void) {
}
}
int
f1ap_encode_pdu
(
F1AP_F1AP_PDU_t
*
pdu
,
uint8_t
**
buffer
,
uint32_t
*
length
)
{
DevAssert
(
pdu
!=
NULL
);
DevAssert
(
buffer
!=
NULL
);
DevAssert
(
length
!=
NULL
);
xer_fprint
(
stdout
,
&
asn_DEF_F1AP_F1AP_PDU
,
pdu
);
ssize_t
encoded
;
// asn_DEF_F1AP_F1SetupRequest
// asn_DEF_F1AP_F1AP_PDU
/* We can safely free list of IE from sptr */
//ASN_STRUCT_FREE_CONTENTS_ONLY(&asn_DEF_F1AP_F1SetupRequest, pdu);
if
((
encoded
=
aper_encode_to_new_buffer
(
&
asn_DEF_F1AP_F1AP_PDU
,
0
,
pdu
,
(
void
**
)
buffer
))
<
0
)
{
printf
(
"
\n
encoded len = %ld
\n
"
,
encoded
);
return
-
1
;
}
printf
(
"encoded len = %ld
\n
"
,
encoded
);
printf
(
"buffer =
\n
"
);
int
i_ret
;
for
(
i_ret
=
0
;
i_ret
<
encoded
;
i_ret
++
)
{
printf
(
"%x "
,
*
((
*
buffer
)
+
i_ret
));
}
printf
(
"
\n
"
);
*
length
=
encoded
;
// ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, pdu);
return
encoded
;
}
// int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) {
// int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) {
// //LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n");
// //LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n");
...
...
openair2/F1AP/DU_F1AP.c
View file @
54aa295e
...
@@ -33,6 +33,8 @@
...
@@ -33,6 +33,8 @@
#include "conversions.h"
#include "conversions.h"
#include "f1ap_common.h"
#include "f1ap_common.h"
#include "du_f1ap_defs.h"
#include "du_f1ap_defs.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "platform_types.h"
#include "platform_types.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log.h"
#include "sctp_du.h"
#include "sctp_du.h"
...
@@ -506,47 +508,6 @@ void DU_send_F1_SETUP_REQUEST(module_id_t enb_mod_idP, module_id_t du_mod_idP, f
...
@@ -506,47 +508,6 @@ void DU_send_F1_SETUP_REQUEST(module_id_t enb_mod_idP, module_id_t du_mod_idP, f
}
}
// ==============================================================================
int
f1ap_encode_pdu
(
F1AP_F1AP_PDU_t
*
pdu
,
uint8_t
**
buffer
,
uint32_t
*
length
)
{
DevAssert
(
pdu
!=
NULL
);
DevAssert
(
buffer
!=
NULL
);
DevAssert
(
length
!=
NULL
);
xer_fprint
(
stdout
,
&
asn_DEF_F1AP_F1AP_PDU
,
pdu
);
ssize_t
encoded
;
// asn_DEF_F1AP_F1SetupRequest
// asn_DEF_F1AP_F1AP_PDU
/* We can safely free list of IE from sptr */
//ASN_STRUCT_FREE_CONTENTS_ONLY(&asn_DEF_F1AP_F1SetupRequest, pdu);
if
((
encoded
=
aper_encode_to_new_buffer
(
&
asn_DEF_F1AP_F1AP_PDU
,
0
,
pdu
,
(
void
**
)
buffer
))
<
0
)
{
printf
(
"encoded len = %ld
\n
"
,
encoded
);
return
-
1
;
}
printf
(
"encoded len = %ld
\n
"
,
encoded
);
printf
(
"buffer =
\n
"
);
int
i_ret
;
for
(
i_ret
=
0
;
i_ret
<
encoded
;
i_ret
++
)
{
printf
(
"%x "
,
*
((
*
buffer
)
+
i_ret
));
}
printf
(
"
\n
"
);
*
length
=
encoded
;
//ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, pdu);
return
encoded
;
}
// int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) {
// int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) {
// //LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n");
// //LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n");
...
...
openair2/F1AP/f1ap_encoder.c
View file @
54aa295e
...
@@ -41,9 +41,9 @@
...
@@ -41,9 +41,9 @@
#include "intertask_interface.h"
#include "intertask_interface.h"
#include "f1ap_common.h"
#include "f1ap_common.h"
#include "f1ap_ies_defs.h"
#include "f1ap_encoder.h"
#include "f1ap_encoder.h"
/*
static inline int f1ap_encode_initiating(f1ap_message *message,
static inline int f1ap_encode_initiating(f1ap_message *message,
uint8_t **buffer,
uint8_t **buffer,
uint32_t *len);
uint32_t *len);
...
@@ -77,32 +77,29 @@ int f1ap_encode_ue_context_release_request(
...
@@ -77,32 +77,29 @@ int f1ap_encode_ue_context_release_request(
F1ap_UEContextReleaseRequestIEs_t *f1ap_UEContextReleaseRequestIEs,
F1ap_UEContextReleaseRequestIEs_t *f1ap_UEContextReleaseRequestIEs,
uint8_t **buffer,
uint8_t **buffer,
uint32_t *length);
uint32_t *length);
*/
int
f1ap_encode_pdu
(
f1ap_message
*
message
,
uint8_t
**
buffer
,
uint32_t
*
len
)
int
f1ap_encode_pdu
(
F1AP_F1AP_PDU_t
*
pdu
,
uint8_t
**
buffer
,
uint32_t
*
length
)
{
{
DevAssert
(
message
!=
NULL
);
ssize_t
encoded
;
DevAssert
(
pdu
!=
NULL
);
DevAssert
(
buffer
!=
NULL
);
DevAssert
(
buffer
!=
NULL
);
DevAssert
(
len
!=
NULL
);
DevAssert
(
length
!=
NULL
);
switch
(
message
->
direction
)
{
// Need Check (present)?
case
F1AP_F1AP_PDU_PR_initiatingMessage
:
return
f1ap_encode_initiating
(
message
,
buffer
,
len
);
case
F1AP_F1AP_PDU_PR_successfulOutcome
:
return
f1ap_encode_successfull_outcome
(
message
,
buffer
,
len
);
case
F1AP_F1AP_PDU_PR_unsuccessfulOutcome
:
//xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
return
f1ap_encode_unsuccessfull_outcome
(
message
,
buffer
,
len
);
encoded
=
aper_encode_to_new_buffer
(
&
asn_DEF_F1AP_F1AP_PDU
,
0
,
pdu
,
(
void
**
)
buffer
);
default:
if
(
encoded
<
0
)
{
F1AP_DEBUG
(
"Unknown message outcome (%d) or not implemented"
,
LOG_E
(
F1AP
,
"Failed to encode F1AP message
\n
"
);
(
int
)
message
->
direction
);
return
-
1
;
break
;
}
}
*
length
=
encoded
;
return
-
1
;
/* Is the following needed? I moved the code here from CU_F1AP.c/DU_F1AP.c */
// ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, pdu);
return
encoded
;
}
}
/*
static inline
static inline
int f1ap_encode_initiating(f1ap_message *f1ap_message_p,
int f1ap_encode_initiating(f1ap_message *f1ap_message_p,
uint8_t **buffer, uint32_t *len)
uint8_t **buffer, uint32_t *len)
...
@@ -379,4 +376,4 @@ int f1ap_encode_ue_context_release_request(
...
@@ -379,4 +376,4 @@ int f1ap_encode_ue_context_release_request(
&asn_DEF_F1ap_UEContextReleaseRequest,
&asn_DEF_F1ap_UEContextReleaseRequest,
ue_context_release_request_p);
ue_context_release_request_p);
}
}
*/
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