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
常顺宇
OpenXG-RAN
Commits
e468376d
Commit
e468376d
authored
Jul 11, 2019
by
luaihui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add forwarding and end marker
parent
46537af2
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1080 additions
and
10 deletions
+1080
-10
common/utils/itti_analyzer/filters.xml
common/utils/itti_analyzer/filters.xml
+4
-0
common/utils/itti_analyzer/filters_ue_enb.xml
common/utils/itti_analyzer/filters_ue_enb.xml
+4
-0
common/utils/ocp_itti/intertask_interface.h
common/utils/ocp_itti/intertask_interface.h
+2
-0
openair2/COMMON/gtpv1_u_messages_def.h
openair2/COMMON/gtpv1_u_messages_def.h
+4
-0
openair2/COMMON/gtpv1_u_messages_types.h
openair2/COMMON/gtpv1_u_messages_types.h
+67
-0
openair2/RRC/LTE/rrc_defs.h
openair2/RRC/LTE/rrc_defs.h
+22
-0
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+204
-4
openair2/RRC/LTE/rrc_eNB_GTPV1U.c
openair2/RRC/LTE/rrc_eNB_GTPV1U.c
+89
-0
openair2/RRC/LTE/rrc_eNB_GTPV1U.h
openair2/RRC/LTE/rrc_eNB_GTPV1U.h
+12
-0
openair2/RRC/LTE/rrc_eNB_S1AP.c
openair2/RRC/LTE/rrc_eNB_S1AP.c
+64
-0
openair2/RRC/LTE/rrc_eNB_S1AP.h
openair2/RRC/LTE/rrc_eNB_S1AP.h
+1
-0
openair2/X2AP/x2ap_eNB_generate_messages.c
openair2/X2AP/x2ap_eNB_generate_messages.c
+21
-0
openair2/X2AP/x2ap_eNB_handler.c
openair2/X2AP/x2ap_eNB_handler.c
+52
-0
openair3/GTPV1-U/gtpv1u_eNB.c
openair3/GTPV1-U/gtpv1u_eNB.c
+504
-1
openair3/GTPV1-U/gtpv1u_eNB_defs.h
openair3/GTPV1-U/gtpv1u_eNB_defs.h
+8
-0
openair3/GTPV1-U/gtpv1u_eNB_task.h
openair3/GTPV1-U/gtpv1u_eNB_task.h
+11
-0
openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c
openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c
+8
-2
openair3/S1AP/s1ap_eNB_handlers.c
openair3/S1AP/s1ap_eNB_handlers.c
+1
-1
openair3/UDP/udp_eNB_task.c
openair3/UDP/udp_eNB_task.c
+2
-2
No files found.
common/utils/itti_analyzer/filters.xml
View file @
e468376d
...
...
@@ -91,6 +91,8 @@
<TASK_MAC_ENB
enabled=
"1"
/>
<TASK_RLC_ENB
enabled=
"1"
/>
<TASK_PDCP_ENB
enabled=
"1"
/>
<TASK_DATA_FORWARDING
enabled=
"1"
/>
<TASK_END_MARKER
enabled=
"1"
/>
<TASK_RRC_ENB
enabled=
"1"
/>
<TASK_RAL_ENB
enabled=
"1"
/>
<TASK_S1AP
enabled=
"1"
/>
...
...
@@ -114,6 +116,8 @@
<TASK_MAC_ENB
enabled=
"1"
/>
<TASK_RLC_ENB
enabled=
"1"
/>
<TASK_PDCP_ENB
enabled=
"1"
/>
<TASK_DATA_FORWARDING
enabled=
"1"
/>
<TASK_END_MARKER
enabled=
"1"
/>
<TASK_RRC_ENB
enabled=
"1"
/>
<TASK_RAL_ENB
enabled=
"1"
/>
<TASK_S1AP
enabled=
"1"
/>
...
...
common/utils/itti_analyzer/filters_ue_enb.xml
View file @
e468376d
...
...
@@ -130,6 +130,8 @@
<TASK_MAC_ENB
enabled=
"1"
/>
<TASK_RLC_ENB
enabled=
"1"
/>
<TASK_PDCP_ENB
enabled=
"1"
/>
<TASK_DATA_FORWARDING
enabled=
"1"
/>
<TASK_END_MARKER
enabled=
"1"
/>
<TASK_RRC_ENB
enabled=
"1"
/>
<TASK_RAL_ENB
enabled=
"1"
/>
<TASK_S1AP
enabled=
"1"
/>
...
...
@@ -153,6 +155,8 @@
<TASK_MAC_ENB
enabled=
"1"
/>
<TASK_RLC_ENB
enabled=
"1"
/>
<TASK_PDCP_ENB
enabled=
"1"
/>
<TASK_DATA_FORWARDING
enabled=
"1"
/>
<TASK_END_MARKER
enabled=
"1"
/>
<TASK_RRC_ENB
enabled=
"1"
/>
<TASK_RAL_ENB
enabled=
"1"
/>
<TASK_S1AP
enabled=
"1"
/>
...
...
common/utils/ocp_itti/intertask_interface.h
View file @
e468376d
...
...
@@ -283,6 +283,8 @@ typedef struct {
TASK_DEF(TASK_RLC_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_ENB_NB_IoT, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_PDCP_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_DATA_FORWARDING, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_END_MARKER, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, NULL,NULL)\
TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200, NULL, NULL) \
...
...
openair2/COMMON/gtpv1_u_messages_def.h
View file @
e468376d
...
...
@@ -25,4 +25,8 @@ MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_del
MESSAGE_DEF
(
GTPV1U_ENB_DELETE_TUNNEL_RESP
,
MESSAGE_PRIORITY_MED
,
gtpv1u_enb_delete_tunnel_resp_t
,
Gtpv1uDeleteTunnelResp
)
MESSAGE_DEF
(
GTPV1U_ENB_TUNNEL_DATA_IND
,
MESSAGE_PRIORITY_MED
,
gtpv1u_enb_tunnel_data_ind_t
,
Gtpv1uTunnelDataInd
)
MESSAGE_DEF
(
GTPV1U_ENB_TUNNEL_DATA_REQ
,
MESSAGE_PRIORITY_MED
,
gtpv1u_enb_tunnel_data_req_t
,
Gtpv1uTunnelDataReq
)
MESSAGE_DEF
(
GTPV1U_ENB_DATA_FORWARDING_REQ
,
MESSAGE_PRIORITY_MED
,
gtpv1u_enb_data_forwarding_req_t
,
Gtpv1uDataForwardingReq
)
MESSAGE_DEF
(
GTPV1U_ENB_DATA_FORWARDING_IND
,
MESSAGE_PRIORITY_MED
,
gtpv1u_enb_data_forwarding_ind_t
,
Gtpv1uDataForwardingInd
)
MESSAGE_DEF
(
GTPV1U_ENB_END_MARKER_REQ
,
MESSAGE_PRIORITY_MED
,
gtpv1u_enb_end_marker_req_t
,
Gtpv1uEndMarkerReq
)
MESSAGE_DEF
(
GTPV1U_ENB_END_MARKER_IND
,
MESSAGE_PRIORITY_MED
,
gtpv1u_enb_end_marker_ind_t
,
Gtpv1uEndMarkerInd
)
MESSAGE_DEF
(
GTPV1U_ENB_S1_REQ
,
MESSAGE_PRIORITY_MED
,
Gtpv1uS1Req
,
gtpv1uS1Req
)
openair2/COMMON/gtpv1_u_messages_types.h
View file @
e468376d
...
...
@@ -33,10 +33,33 @@
#define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp
#define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd
#define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq
#define GTPV1U_ENB_DATA_FORWARDING_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingReq
#define GTPV1U_ENB_DATA_FORWARDING_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingInd
#define GTPV1U_ENB_END_MARKER_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerReq
#define GTPV1U_ENB_END_MARKER_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerInd
#define GTPV1U_ENB_S1_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uS1Req
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
typedef
struct
gtpv1u_enb_create_x2u_tunnel_req_s
{
rnti_t
rnti
;
int
num_tunnels
;
teid_t
tenb_X2u_teid
[
GTPV1U_MAX_BEARERS_PER_UE
];
///< Tunnel Endpoint Identifier
ebi_t
eps_bearer_id
[
GTPV1U_MAX_BEARERS_PER_UE
];
transport_layer_addr_t
enb_addr
[
GTPV1U_MAX_BEARERS_PER_UE
];
}
gtpv1u_enb_create_x2u_tunnel_req_t
;
typedef
struct
gtpv1u_enb_create_x2u_tunnel_resp_s
{
uint8_t
status
;
///< Status of S1U endpoint creation (Failed = 0xFF or Success = 0x0)
rnti_t
rnti
;
int
num_tunnels
;
teid_t
enb_X2u_teid
[
GTPV1U_MAX_BEARERS_PER_UE
];
///< Tunnel Endpoint Identifier
ebi_t
eps_bearer_id
[
GTPV1U_MAX_BEARERS_PER_UE
];
transport_layer_addr_t
enb_addr
;
}
gtpv1u_enb_create_x2u_tunnel_resp_t
;
typedef
struct
gtpv1u_enb_create_tunnel_req_s
{
rnti_t
rnti
;
int
num_tunnels
;
...
...
@@ -99,6 +122,50 @@ typedef struct gtpv1u_enb_tunnel_data_req_s {
rb_id_t
rab_id
;
}
gtpv1u_enb_tunnel_data_req_t
;
typedef
struct
gtpv1u_enb_data_forwarding_req_s
{
uint8_t
*
buffer
;
uint32_t
length
;
uint32_t
offset
;
///< start of message offset in buffer
rnti_t
rnti
;
rb_id_t
rab_id
;
}
gtpv1u_enb_data_forwarding_req_t
;
typedef
struct
gtpv1u_enb_data_forwarding_ind_s
{
uint32_t
frame
;
uint8_t
enb_flag
;
uint32_t
rb_id
;
uint32_t
muip
;
uint32_t
confirmp
;
uint32_t
sdu_size
;
uint8_t
*
sdu_p
;
uint8_t
mode
;
uint16_t
rnti
;
uint8_t
module_id
;
uint8_t
eNB_index
;
}
gtpv1u_enb_data_forwarding_ind_t
;
typedef
struct
gtpv1u_enb_end_marker_req_s
{
uint8_t
*
buffer
;
uint32_t
length
;
uint32_t
offset
;
///< start of message offset in buffer
rnti_t
rnti
;
rb_id_t
rab_id
;
}
gtpv1u_enb_end_marker_req_t
;
typedef
struct
gtpv1u_enb_end_marker_ind_s
{
uint32_t
frame
;
uint8_t
enb_flag
;
uint32_t
rb_id
;
uint32_t
muip
;
uint32_t
confirmp
;
uint32_t
sdu_size
;
uint8_t
*
sdu_p
;
uint8_t
mode
;
uint16_t
rnti
;
uint8_t
module_id
;
uint8_t
eNB_index
;
}
gtpv1u_enb_end_marker_ind_t
;
typedef
struct
{
in_addr_t
enb_ip_address_for_S1u_S12_S4_up
;
tcp_udp_port_t
enb_port_for_S1u_S12_S4_up
;
...
...
openair2/RRC/LTE/rrc_defs.h
View file @
e468376d
...
...
@@ -348,11 +348,24 @@ typedef enum HO_STATE_e {
HO_COMPLETE
,
// initiated by the target eNB
HO_REQUEST
,
HO_ACK
,
HO_FORWARDING
,
HO_CONFIGURED
,
HO_END_MARKER
,
HO_FORWARDING_COMPLETE
,
HO_RELEASE
,
HO_CANCEL
}
HO_STATE_t
;
typedef
enum
DATA_FORWARDING_STATE_e
{
FORWARDING_EMPTY
=
0
,
FORWARDING_NO_EMPTY
}
DATA_FORWARDING_STATE_t
;
typedef
enum
DATA_ENDMARK_STATE_e
{
ENDMARK_EMPTY
=
0
,
ENDMARK_NO_EMPTY
}
DATA_ENDMARK_STATE_t
;
typedef
enum
SL_TRIGGER_e
{
SL_RECEIVE_COMMUNICATION
=
0
,
SL_TRANSMIT_RELAY_ONE_TO_ONE
,
...
...
@@ -477,6 +490,9 @@ typedef struct HANDOVER_INFO_s {
uint8_t
buf
[
RRC_BUF_SIZE
];
/* ASN.1 encoded handoverCommandMessage */
int
size
;
/* size of above message in bytes */
int
x2_id
;
/* X2AP UE ID in the target eNB */
uint32_t
x2u_teid
;
DATA_FORWARDING_STATE_t
forwarding_state
;
DATA_ENDMARK_STATE_t
endmark_state
;
}
HANDOVER_INFO
;
typedef
struct
PER_EVENT_s
{
...
...
@@ -693,6 +709,12 @@ typedef struct eNB_RRC_UE_s {
uint32_t
enb_gtp_teid
[
S1AP_MAX_E_RAB
];
transport_layer_addr_t
enb_gtp_addrs
[
S1AP_MAX_E_RAB
];
rb_id_t
enb_gtp_ebi
[
S1AP_MAX_E_RAB
];
/* Total number of e_rab already setup in the list */
uint8_t
nb_x2u_e_rabs
;
// LG: For GTPV1 TUNNELS(X2U)
uint32_t
enb_gtp_x2u_teid
[
S1AP_MAX_E_RAB
];
transport_layer_addr_t
enb_gtp_x2u_addrs
[
S1AP_MAX_E_RAB
];
rb_id_t
enb_gtp_x2u_ebi
[
S1AP_MAX_E_RAB
];
uint32_t
ul_failure_timer
;
uint32_t
ue_release_timer
;
uint32_t
ue_release_timer_thres
;
...
...
openair2/RRC/LTE/rrc_eNB.c
View file @
e468376d
This diff is collapsed.
Click to expand it.
openair2/RRC/LTE/rrc_eNB_GTPV1U.c
View file @
e468376d
...
...
@@ -27,14 +27,19 @@
* \email: lionel.gauthier@eurecom.fr
*/
//#if defined(ENABLE_USE_MME)
# include "rrc_defs.h"
# include "rrc_extern.h"
# include "RRC/LTE/MESSAGES/asn1_msg.h"
# include "rrc_eNB_GTPV1U.h"
# include "rrc_eNB_UE_context.h"
# include "msc.h"
//# if defined(ENABLE_ITTI)
# include "asn1_conversions.h"
# include "intertask_interface.h"
//#endif
# include "common/ran_context.h"
extern
RAN_CONTEXT_t
RC
;
...
...
@@ -88,6 +93,88 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
}
}
//------------------------------------------------------------------------------
boolean_t
gtpv_data_req
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
rb_id_t
rb_idP
,
const
mui_t
muiP
,
const
confirm_t
confirmP
,
const
sdu_size_t
sdu_sizeP
,
uint8_t
*
const
buffer_pP
,
const
pdcp_transmission_mode_t
modeP
,
uint32_t
task_id
)
//------------------------------------------------------------------------------
{
if
(
sdu_sizeP
==
0
)
{
LOG_I
(
GTPU
,
"gtpv_data_req sdu_sizeP == 0"
);
return
FALSE
;
}
LOG_D
(
GTPU
,
"gtpv_data_req ue rnti %x sdu_sizeP %d rb id %d"
,
ctxt_pP
->
rnti
,
sdu_sizeP
,
rb_idP
);
#if defined(ENABLE_ITTI)
{
MessageDef
*
message_p
;
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
uint8_t
*
message_buffer
;
if
(
task_id
==
TASK_DATA_FORWARDING
){
LOG_I
(
GTPU
,
"gtpv_data_req task_id = TASK_DATA_FORWARDING
\n
"
);
message_buffer
=
itti_malloc
(
TASK_GTPV1_U
,
TASK_DATA_FORWARDING
,
sdu_sizeP
);
memcpy
(
message_buffer
,
buffer_pP
,
sdu_sizeP
);
message_p
=
itti_alloc_new_message
(
TASK_GTPV1_U
,
GTPV1U_ENB_DATA_FORWARDING_IND
);
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
frame
=
ctxt_pP
->
frame
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
enb_flag
=
ctxt_pP
->
enb_flag
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
rb_id
=
rb_idP
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
muip
=
muiP
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
confirmp
=
confirmP
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
sdu_size
=
sdu_sizeP
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
sdu_p
=
message_buffer
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
mode
=
modeP
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
module_id
=
ctxt_pP
->
module_id
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
rnti
=
ctxt_pP
->
rnti
;
GTPV1U_ENB_DATA_FORWARDING_IND
(
message_p
).
eNB_index
=
ctxt_pP
->
eNB_index
;
itti_send_msg_to_task
(
TASK_DATA_FORWARDING
,
ctxt_pP
->
instance
,
message_p
);
return
TRUE
;
// TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
}
else
if
(
task_id
==
TASK_END_MARKER
){
LOG_I
(
GTPU
,
"gtpv_data_req task_id = TASK_END_MARKER
\n
"
);
message_buffer
=
itti_malloc
(
TASK_GTPV1_U
,
TASK_END_MARKER
,
sdu_sizeP
);
memcpy
(
message_buffer
,
buffer_pP
,
sdu_sizeP
);
message_p
=
itti_alloc_new_message
(
TASK_GTPV1_U
,
GTPV1U_ENB_END_MARKER_IND
);
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
frame
=
ctxt_pP
->
frame
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
enb_flag
=
ctxt_pP
->
enb_flag
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
rb_id
=
rb_idP
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
muip
=
muiP
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
confirmp
=
confirmP
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
sdu_size
=
sdu_sizeP
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
sdu_p
=
message_buffer
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
mode
=
modeP
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
module_id
=
ctxt_pP
->
module_id
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
rnti
=
ctxt_pP
->
rnti
;
GTPV1U_ENB_END_MARKER_IND
(
message_p
).
eNB_index
=
ctxt_pP
->
eNB_index
;
itti_send_msg_to_task
(
TASK_END_MARKER
,
ctxt_pP
->
instance
,
message_p
);
return
TRUE
;
// TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
}
}
#endif
return
TRUE
;
}
//#endif
void
rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ
(
module_id_t
enb_mod_idP
,
const
rrc_eNB_ue_context_t
*
const
ue_context_pP
...
...
@@ -112,3 +199,5 @@ void rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(
}
itti_send_msg_to_task
(
TASK_GTPV1_U
,
ENB_MODULE_ID_TO_INSTANCE
(
enb_mod_idP
),
msg
);
}
openair2/RRC/LTE/rrc_eNB_GTPV1U.h
View file @
e468376d
...
...
@@ -53,4 +53,16 @@ void rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(
const
rrc_eNB_ue_context_t
*
const
ue_context_pP
);
boolean_t
gtpv_data_req
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
rb_id_t
rb_idP
,
const
mui_t
muiP
,
const
confirm_t
confirmP
,
const
sdu_size_t
sdu_sizeP
,
uint8_t
*
const
buffer_pP
,
const
pdcp_transmission_mode_t
modeP
,
uint32_t
task_id
);
#endif
/* RRC_ENB_GTPV1U_H_ */
openair2/RRC/LTE/rrc_eNB_S1AP.c
View file @
e468376d
...
...
@@ -2040,6 +2040,70 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
return
0
;
}
int
rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ
(
instance_t
instance
,
rrc_eNB_ue_context_t
*
const
ue_context_target_p
)
{
gtpv1u_enb_create_x2u_tunnel_req_t
create_tunnel_req
;
gtpv1u_enb_create_x2u_tunnel_resp_t
create_tunnel_resp
;
uint8_t
e_rab_done
;
uint8_t
inde_list
[
NB_RB_MAX
-
3
]
=
{
0
};
LOG_I
(
RRC
,
"[eNB %d] rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ: rnti %u nb_of_e_rabs %d
\n
"
,
instance
,
ue_context_target_p
->
ue_context
.
rnti
,
ue_context_target_p
->
ue_context
.
nb_of_e_rabs
);
if
(
ue_context_target_p
==
NULL
)
{
return
(
-
1
);
}
else
{
/* Save e RAB information for later */
{
int
i
;
memset
(
&
create_tunnel_req
,
0
,
sizeof
(
create_tunnel_req
));
uint8_t
nb_e_rabs_tosetup
=
ue_context_target_p
->
ue_context
.
nb_of_e_rabs
;
e_rab_done
=
0
;
for
(
i
=
0
;
i
<
nb_e_rabs_tosetup
;
i
++
)
{
if
(
ue_context_target_p
->
ue_context
.
e_rab
[
i
].
status
>=
E_RAB_STATUS_DONE
)
continue
;
create_tunnel_req
.
eps_bearer_id
[
e_rab_done
]
=
ue_context_target_p
->
ue_context
.
e_rab
[
i
].
param
.
e_rab_id
;
LOG_I
(
RRC
,
"x2 tunnel setup: local index %d UE id %x, eps id %d
\n
"
,
i
,
ue_context_target_p
->
ue_context
.
rnti
,
create_tunnel_req
.
eps_bearer_id
[
i
]
);
inde_list
[
i
]
=
e_rab_done
;
e_rab_done
++
;
}
create_tunnel_req
.
rnti
=
ue_context_target_p
->
ue_context
.
rnti
;
// warning put zero above
create_tunnel_req
.
num_tunnels
=
e_rab_done
;
// NN: not sure if we should create a new tunnel: need to check teid, etc.
gtpv1u_create_x2u_tunnel
(
instance
,
&
create_tunnel_req
,
&
create_tunnel_resp
);
ue_context_target_p
->
ue_context
.
nb_x2u_e_rabs
=
create_tunnel_resp
.
num_tunnels
;
for
(
i
=
0
;
i
<
create_tunnel_resp
.
num_tunnels
;
i
++
)
{
ue_context_target_p
->
ue_context
.
enb_gtp_x2u_teid
[
inde_list
[
i
]]
=
create_tunnel_resp
.
enb_X2u_teid
[
i
];
ue_context_target_p
->
ue_context
.
enb_gtp_x2u_addrs
[
inde_list
[
i
]]
=
create_tunnel_resp
.
enb_addr
;
ue_context_target_p
->
ue_context
.
enb_gtp_x2u_ebi
[
inde_list
[
i
]]
=
create_tunnel_resp
.
eps_bearer_id
[
i
];
LOG_I
(
RRC
,
"rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ tunnel (%u, %u) bearer UE context index %u, msg index %u, eps bearer id %u, gtp addr len %d
\n
"
,
create_tunnel_resp
.
enb_X2u_teid
[
i
],
ue_context_target_p
->
ue_context
.
enb_gtp_x2u_teid
[
inde_list
[
i
]],
inde_list
[
i
],
i
,
create_tunnel_resp
.
eps_bearer_id
[
i
],
create_tunnel_resp
.
enb_addr
.
length
);
}
}
return
(
0
);
}
}
int
rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK
(
MessageDef
*
msg_p
,
const
char
*
msg_name
,
instance_t
instance
)
{
uint16_t
ue_initial_id
;
uint32_t
eNB_ue_s1ap_id
;
...
...
openair2/RRC/LTE/rrc_eNB_S1AP.h
View file @
e468376d
...
...
@@ -278,6 +278,7 @@ int rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(const protocol_ctxt_t *const ctxt_p
int
rrc_eNB_send_PATH_SWITCH_REQ
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_eNB_ue_context_t
*
const
ue_context_pP
);
int
rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ
(
instance_t
instance
,
rrc_eNB_ue_context_t
*
const
ue_context_target_p
);
int
rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK
(
MessageDef
*
msg_p
,
const
char
*
msg_name
,
instance_t
instance
);
int
rrc_eNB_send_X2AP_UE_CONTEXT_RELEASE
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_eNB_ue_context_t
*
const
ue_context_pP
);
...
...
openair2/X2AP/x2ap_eNB_generate_messages.c
View file @
e468376d
...
...
@@ -797,6 +797,27 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p,
e_RABs_Admitted_Item
=
&
e_RABS_Admitted_ItemIEs
->
value
.
choice
.
E_RABs_Admitted_Item
;
{
e_RABs_Admitted_Item
->
e_RAB_ID
=
x2ap_handover_req_ack
->
e_rabs_tobesetup
[
i
].
e_rab_id
;
e_RABs_Admitted_Item
->
uL_GTP_TunnelEndpoint
=
NULL
;
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
=
(
X2AP_GTPtunnelEndpoint_t
*
)
calloc
(
1
,
sizeof
(
*
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
));
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
size
=
(
uint8_t
)
x2ap_handover_req_ack
->
e_rabs_tobesetup
[
i
].
eNB_addr
.
length
;
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
bits_unused
=
0
;
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
buf
=
calloc
(
1
,
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
size
);
memcpy
(
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
buf
,
x2ap_handover_req_ack
->
e_rabs_tobesetup
[
i
].
eNB_addr
.
buffer
,
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
size
);
X2AP_DEBUG
(
"X2 handover response target ip addr. length %lu bits_unused %d buf %d.%d.%d.%d
\n
"
,
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
size
,
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
bits_unused
,
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
buf
[
0
],
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
buf
[
1
],
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
buf
[
2
],
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
buf
[
3
]);
INT32_TO_OCTET_STRING
(
x2ap_handover_req_ack
->
e_rabs_tobesetup
[
i
].
gtp_teid
,
&
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
gTP_TEID
);
}
ASN_SEQUENCE_ADD
(
&
ie
->
value
.
choice
.
E_RABs_Admitted_List
.
list
,
e_RABS_Admitted_ItemIEs
);
}
...
...
openair2/X2AP/x2ap_eNB_handler.c
View file @
e468376d
...
...
@@ -749,6 +749,8 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
{
X2AP_HandoverRequestAcknowledge_t
*
x2HandoverRequestAck
;
X2AP_HandoverRequestAcknowledge_IEs_t
*
ie
;
X2AP_E_RABs_Admitted_ItemIEs_t
*
e_RABS_Admitted_ItemIEs
;
X2AP_E_RABs_Admitted_Item_t
*
e_RABs_Admitted_Item
;
x2ap_eNB_instance_t
*
instance_p
;
x2ap_eNB_data_t
*
x2ap_eNB_data
;
...
...
@@ -816,6 +818,56 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
X2AP_HANDOVER_REQ_ACK
(
msg
).
rnti
=
rnti
;
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_HandoverRequestAcknowledge_IEs_t
,
ie
,
x2HandoverRequestAck
,
X2AP_ProtocolIE_ID_id_E_RABs_Admitted_List
,
true
);
if
(
ie
==
NULL
)
{
X2AP_ERROR
(
"%s %d: ie is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
return
-
1
;
}
else
{
if
(
ie
->
value
.
choice
.
E_RABs_Admitted_List
.
list
.
count
>
0
)
{
uint8_t
nb_e_rabs_tobesetup
;
nb_e_rabs_tobesetup
=
ie
->
value
.
choice
.
E_RABs_Admitted_List
.
list
.
count
;
X2AP_HANDOVER_REQ_ACK
(
msg
).
nb_e_rabs_tobesetup
=
nb_e_rabs_tobesetup
;
for
(
int
i
=
0
;
i
<
nb_e_rabs_tobesetup
;
i
++
)
{
e_RABS_Admitted_ItemIEs
=
(
X2AP_E_RABs_Admitted_ItemIEs_t
*
)
ie
->
value
.
choice
.
E_RABs_Admitted_List
.
list
.
array
[
i
];
e_RABs_Admitted_Item
=
&
e_RABS_Admitted_ItemIEs
->
value
.
choice
.
E_RABs_Admitted_Item
;
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
e_rab_id
=
e_RABs_Admitted_Item
->
e_RAB_ID
;
X2AP_ERROR
(
"x2u tunnel: index %d e_rab_id %d
\n
"
,
i
,
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
e_rab_id
);
if
(
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
==
NULL
){
X2AP_DEBUG
(
"%s %d: X2AP_E_RABs_Admitted_Item_t->dL_GTP_TunnelEndpoint is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
continue
;
}
memcpy
(
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
eNB_addr
.
buffer
,
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
buf
,
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
size
);
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
eNB_addr
.
length
=
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
transportLayerAddress
.
size
;
OCTET_STRING_TO_INT32
(
&
e_RABs_Admitted_Item
->
dL_GTP_TunnelEndpoint
->
gTP_TEID
,
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
gtp_teid
);
X2AP_DEBUG
(
"x2u tunnel: index %d target enb ip %d.%d.%d.%d length %d gtp teid %u
\n
"
,
i
,
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
eNB_addr
.
buffer
[
0
],
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
eNB_addr
.
buffer
[
1
],
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
eNB_addr
.
buffer
[
2
],
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
eNB_addr
.
buffer
[
3
],
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
eNB_addr
.
length
,
X2AP_HANDOVER_REQ_ACK
(
msg
).
e_rabs_tobesetup
[
i
].
gtp_teid
);
}
}
}
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_HandoverRequestAcknowledge_IEs_t
,
ie
,
x2HandoverRequestAck
,
X2AP_ProtocolIE_ID_id_TargeteNBtoSource_eNBTransparentContainer
,
true
);
...
...
openair3/GTPV1-U/gtpv1u_eNB.c
View file @
e468376d
This diff is collapsed.
Click to expand it.
openair3/GTPV1-U/gtpv1u_eNB_defs.h
View file @
e468376d
...
...
@@ -40,6 +40,11 @@
#define GTPV1U_MAX_BEARERS_ID (max_val_LTE_DRB_Identity - GTPV1U_BEARER_OFFSET)
#define GTPV1U_SOURCE_ENB (0)
#define GTPV1U_TARGET_ENB (1)
#define GTPV1U_MSG_FROM_SOURCE_ENB (0)
#define GTPV1U_MSG_FROM_SPGW (1)
typedef
enum
{
BEARER_DOWN
=
0
,
BEARER_IN_CONFIG
,
...
...
@@ -65,6 +70,9 @@ typedef struct gtpv1u_bearer_s {
teid_t
teid_sgw
;
///< Remote TEID
in_addr_t
sgw_ip_addr
;
struct
in6_addr
sgw_ip6_addr
;
teid_t
teid_teNB
;
in_addr_t
tenb_ip_addr
;
///< target eNB ipv4
struct
in6_addr
tenb_ip6_addr
;
///< target eNB ipv6
tcp_udp_port_t
port
;
//NwGtpv1uStackSessionHandleT stack_session;
bearer_state_t
state
;
...
...
openair3/GTPV1-U/gtpv1u_eNB_task.h
View file @
e468376d
...
...
@@ -44,6 +44,12 @@ int gtpv1u_eNB_init(void);
void
*
gtpv1u_eNB_process_itti_msg
(
void
*
);
void
*
gtpv1u_eNB_task
(
void
*
args
);
int
gtpv1u_create_x2u_tunnel
(
const
instance_t
instanceP
,
const
gtpv1u_enb_create_x2u_tunnel_req_t
*
const
create_tunnel_req_pP
,
gtpv1u_enb_create_x2u_tunnel_resp_t
*
const
create_tunnel_resp_pP
);
int
gtpv1u_create_s1u_tunnel
(
const
instance_t
instanceP
,
...
...
@@ -55,4 +61,9 @@ gtpv1u_update_s1u_tunnel(
const
instance_t
instanceP
,
const
gtpv1u_enb_create_tunnel_req_t
*
const
create_tunnel_req_pP
,
const
rnti_t
prior_rnti
);
int
gtpv1u_delete_x2u_tunnel
(
const
instance_t
instanceP
,
const
gtpv1u_enb_delete_tunnel_req_t
*
const
req_pP
,
int
enbflag
);
#endif
/* GTPV1U_ENB_TASK_H_ */
openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c
View file @
e468376d
...
...
@@ -893,8 +893,14 @@ nwGtpv1uProcessUdpReq( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle,
break
;
case
NW_GTP_END_MARKER
:
GTPU_DEBUG
(
"NW_GTP_END_MARKER
\n
"
);
ret
=
NW_GTPV1U_OK
;
#if defined(LOG_GTPU) && LOG_GTPU > 0
for
(
int
i
=
1
;
i
<=
udpDataLen
;
i
++
){
printf
(
"%02x "
,
udpData
[
i
-
1
]);
if
(
i
%
20
==
0
)
printf
(
"
\n
"
);
}
#endif
GTPU_INFO
(
"NW_GTP_END_MARKER
\n
"
);
ret
=
nwGtpv1uProcessGpdu
(
thiz
,
udpData
,
udpDataLen
,
peerIp
);
break
;
default:
...
...
openair3/S1AP/s1ap_eNB_handlers.c
View file @
e468376d
...
...
@@ -1518,7 +1518,7 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
if
(
stream
==
0
)
{
S1AP_ERROR
(
"[SCTP %d] Received s1 path switch request ack on stream (%d)
\n
"
,
assoc_id
,
stream
);
return
-
1
;
//
return -1;
}
if
((
mme_desc_p
=
s1ap_eNB_get_MME
(
NULL
,
assoc_id
,
0
))
==
NULL
)
{
...
...
openair3/UDP/udp_eNB_task.c
View file @
e468376d
...
...
@@ -371,13 +371,13 @@ void *udp_eNB_task(void *args_p)
udp_sd
=
udp_sock_p
->
sd
;
pthread_mutex_unlock
(
&
udp_socket_list_mutex
);
#if defined(LOG_UDP) && LOG_UDP > 0
//
#if defined(LOG_UDP) && LOG_UDP > 0
LOG_D
(
UDP_
,
"[%d] Sending message of size %u to "
IPV4_ADDR
" and port %u
\n
"
,
udp_sd
,
udp_data_req_p
->
buffer_length
,
IPV4_ADDR_FORMAT
(
udp_data_req_p
->
peer_address
),
udp_data_req_p
->
peer_port
);
#endif
//
#endif
bytes_written
=
sendto
(
udp_sd
,
&
udp_data_req_p
->
buffer
[
udp_data_req_p
->
buffer_offset
],
...
...
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