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
wangjie
OpenXG-RAN
Commits
d8472426
Commit
d8472426
authored
Sep 20, 2018
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix_issue_350_gtpu_init
parent
957bd567
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1921 additions
and
2126 deletions
+1921
-2126
common/utils/ocp_itti/intertask_interface.cpp
common/utils/ocp_itti/intertask_interface.cpp
+20
-3
common/utils/ocp_itti/intertask_interface.h
common/utils/ocp_itti/intertask_interface.h
+5
-0
openair2/COMMON/gtpv1_u_messages_def.h
openair2/COMMON/gtpv1_u_messages_def.h
+1
-0
openair2/COMMON/gtpv1_u_messages_types.h
openair2/COMMON/gtpv1_u_messages_types.h
+5
-0
openair2/ENB_APP/enb_config.c
openair2/ENB_APP/enb_config.c
+1752
-1944
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+34
-20
openair2/RRC/LTE/rrc_proto.h
openair2/RRC/LTE/rrc_proto.h
+4
-0
openair3/GTPV1-U/gtpv1u_eNB.c
openair3/GTPV1-U/gtpv1u_eNB.c
+42
-143
openair3/GTPV1-U/gtpv1u_eNB_defs.h
openair3/GTPV1-U/gtpv1u_eNB_defs.h
+0
-2
openair3/GTPV1-U/gtpv1u_eNB_task.h
openair3/GTPV1-U/gtpv1u_eNB_task.h
+2
-0
openair3/S1AP/s1ap_eNB.c
openair3/S1AP/s1ap_eNB.c
+16
-5
openair3/S1AP/s1ap_eNB.h
openair3/S1AP/s1ap_eNB.h
+2
-0
openair3/SCTP/sctp_eNB_task.c
openair3/SCTP/sctp_eNB_task.c
+22
-8
openair3/SCTP/sctp_eNB_task.h
openair3/SCTP/sctp_eNB_task.h
+2
-0
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+14
-1
No files found.
common/utils/ocp_itti/intertask_interface.cpp
View file @
d8472426
...
@@ -115,11 +115,16 @@ extern "C" {
...
@@ -115,11 +115,16 @@ extern "C" {
task_list_t
*
t
=&
tasks
[
destination_task_id
];
task_list_t
*
t
=&
tasks
[
destination_task_id
];
pthread_mutex_lock
(
&
t
->
queue_cond_lock
);
pthread_mutex_lock
(
&
t
->
queue_cond_lock
);
int
ret
=
itti_send_msg_to_task_locked
(
destination_task_id
,
instance
,
message
);
int
ret
=
itti_send_msg_to_task_locked
(
destination_task_id
,
instance
,
message
);
pthread_mutex_unlock
(
&
t
->
queue_cond_lock
);
while
(
t
->
message_queue
.
size
()
>
0
&&
t
->
admin
.
func
!=
NULL
)
// while ( t->message_queue.size()>0 && t->admin.func != NULL )
if
(
t
->
message_queue
.
size
()
>
0
&&
t
->
admin
.
func
!=
NULL
)
{
if
(
t
->
message_queue
.
size
()
>
1
)
LOG_W
(
TMR
,
"queue in no thread mode is %ld
\n
"
,
t
->
message_queue
.
size
());
pthread_mutex_unlock
(
&
t
->
queue_cond_lock
);
t
->
admin
.
func
(
NULL
);
t
->
admin
.
func
(
NULL
);
}
else
{
pthread_mutex_unlock
(
&
t
->
queue_cond_lock
);
}
return
ret
;
return
ret
;
}
}
...
@@ -278,6 +283,18 @@ extern "C" {
...
@@ -278,6 +283,18 @@ extern "C" {
"Thread creation for task %d failed!
\n
"
,
task_id
);
"Thread creation for task %d failed!
\n
"
,
task_id
);
pthread_setname_np
(
t
->
thread
,
itti_get_task_name
(
task_id
)
);
pthread_setname_np
(
t
->
thread
,
itti_get_task_name
(
task_id
)
);
LOG_I
(
TMR
,
"Created Posix thread %s
\n
"
,
itti_get_task_name
(
task_id
)
);
LOG_I
(
TMR
,
"Created Posix thread %s
\n
"
,
itti_get_task_name
(
task_id
)
);
#if 1 // BMC test RT prio
{
int
policy
;
struct
sched_param
sparam
;
memset
(
&
sparam
,
0
,
sizeof
(
sparam
));
sparam
.
sched_priority
=
sched_get_priority_max
(
SCHED_FIFO
)
-
10
;
policy
=
SCHED_FIFO
;
if
(
pthread_setschedparam
(
t
->
thread
,
policy
,
&
sparam
)
!=
0
)
{
LOG_E
(
TMR
,
"task %s : Failed to set pthread priority
\n
"
,
itti_get_task_name
(
task_id
)
);
}
}
#endif
return
0
;
return
0
;
}
}
...
...
common/utils/ocp_itti/intertask_interface.h
View file @
d8472426
...
@@ -233,6 +233,11 @@ typedef struct IttiMsgText_s {
...
@@ -233,6 +233,11 @@ typedef struct IttiMsgText_s {
#include <openair3/S1AP/s1ap_eNB.h>
#include <openair3/S1AP/s1ap_eNB.h>
//#include <proto.h>
//#include <proto.h>
#include <openair3/GTPV1-U/gtpv1u_eNB_task.h>
void
*
rrc_enb_process_itti_msg
(
void
*
);
#include <openair3/SCTP/sctp_eNB_task.h>
#include <openair3/S1AP/s1ap_eNB.h>
/*
/*
static const char *const messages_definition_xml = {
static const char *const messages_definition_xml = {
#include <messages_xml.h>
#include <messages_xml.h>
...
...
openair2/COMMON/gtpv1_u_messages_def.h
View file @
d8472426
...
@@ -25,3 +25,4 @@ MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_del
...
@@ -25,3 +25,4 @@ 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_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_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_TUNNEL_DATA_REQ
,
MESSAGE_PRIORITY_MED
,
gtpv1u_enb_tunnel_data_req_t
,
Gtpv1uTunnelDataReq
)
MESSAGE_DEF
(
GTPV1U_ENB_S1_REQ
,
MESSAGE_PRIORITY_MED
,
Gtpv1uS1Req
,
gtpv1uS1Req
)
openair2/COMMON/gtpv1_u_messages_types.h
View file @
d8472426
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp
#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_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd
#define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq
#define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq
#define GTPV1U_ENB_S1_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uS1Req
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
...
@@ -98,4 +99,8 @@ typedef struct gtpv1u_enb_tunnel_data_req_s {
...
@@ -98,4 +99,8 @@ typedef struct gtpv1u_enb_tunnel_data_req_s {
rb_id_t
rab_id
;
rb_id_t
rab_id
;
}
gtpv1u_enb_tunnel_data_req_t
;
}
gtpv1u_enb_tunnel_data_req_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
;
}
Gtpv1uS1Req
;
#endif
/* GTPV1_U_MESSAGES_TYPES_H_ */
#endif
/* GTPV1_U_MESSAGES_TYPES_H_ */
openair2/ENB_APP/enb_config.c
View file @
d8472426
This source diff could not be displayed because it is too large. You can
view the blob
instead.
openair2/RRC/LTE/rrc_eNB.c
View file @
d8472426
...
@@ -7201,29 +7201,24 @@ void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
...
@@ -7201,29 +7201,24 @@ void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration
(
ctxt_pP
,
ue_context_pP
,
0
);
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration
(
ctxt_pP
,
ue_context_pP
,
0
);
}
}
//-----------------------------------------------------------------------------
void
*
rrc_enb_task
(
void
*
args_p
)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
{
void
rrc_enb_init
(
void
)
{
MessageDef
*
msg_p
;
const
char
*
msg_name_p
;
instance_t
instance
;
int
result
;
SRB_INFO
*
srb_info_p
;
int
CC_id
;
protocol_ctxt_t
ctxt
;
pthread_mutex_init
(
&
lock_ue_freelist
,
NULL
);
pthread_mutex_init
(
&
lock_ue_freelist
,
NULL
);
pthread_mutex_init
(
&
rrc_release_freelist
,
NULL
);
pthread_mutex_init
(
&
rrc_release_freelist
,
NULL
);
memset
(
&
rrc_release_info
,
0
,
sizeof
(
RRC_release_list_t
));
memset
(
&
rrc_release_info
,
0
,
sizeof
(
RRC_release_list_t
));
itti_mark_task_ready
(
TASK_RRC_ENB
);
}
LOG_I
(
RRC
,
"Entering main loop of RRC message task
\n
"
);
while
(
1
)
{
//-----------------------------------------------------------------------------
void
*
rrc_enb_process_itti_msg
(
void
*
notUsed
)
{
MessageDef
*
msg_p
;
const
char
*
msg_name_p
;
instance_t
instance
;
int
result
;
SRB_INFO
*
srb_info_p
;
int
CC_id
;
protocol_ctxt_t
ctxt
;
// Wait for a message
// Wait for a message
itti_receive_msg
(
TASK_RRC_ENB
,
&
msg_p
);
itti_receive_msg
(
TASK_RRC_ENB
,
&
msg_p
);
...
@@ -7363,9 +7358,28 @@ rrc_enb_task(
...
@@ -7363,9 +7358,28 @@ rrc_enb_task(
result
=
itti_free
(
ITTI_MSG_ORIGIN_ID
(
msg_p
),
msg_p
);
result
=
itti_free
(
ITTI_MSG_ORIGIN_ID
(
msg_p
),
msg_p
);
if
(
result
!=
EXIT_SUCCESS
)
{
if
(
result
!=
EXIT_SUCCESS
)
{
LOG_I
(
RRC
,
"Failed to free memory (%d)!
\n
"
,
result
);
LOG_I
(
RRC
,
"Failed to free memory (%d)!
\n
"
,
result
);
continue
;
}
}
msg_p
=
NULL
;
msg_p
=
NULL
;
return
NULL
;
}
//-----------------------------------------------------------------------------
void
*
rrc_enb_task
(
void
*
args_p
)
//-----------------------------------------------------------------------------
{
rrc_enb_init
();
itti_mark_task_ready
(
TASK_RRC_ENB
);
LOG_I
(
RRC
,
"Entering main loop of RRC message task
\n
"
);
while
(
1
)
{
(
void
)
rrc_enb_process_itti_msg
(
NULL
);
}
}
}
}
#endif
#endif
...
...
openair2/RRC/LTE/rrc_proto.h
View file @
d8472426
...
@@ -336,6 +336,10 @@ rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
...
@@ -336,6 +336,10 @@ rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t
*
ue_context_pP
);
rrc_eNB_ue_context_t
*
ue_context_pP
);
#if defined(ENABLE_ITTI)
#if defined(ENABLE_ITTI)
void
rrc_enb_init
(
void
);
void
*
rrc_enb_process_itti_msg
(
void
*
);
/**\brief RRC eNB task.
/**\brief RRC eNB task.
\param void *args_p Pointer on arguments to start the task. */
\param void *args_p Pointer on arguments to start the task. */
void
*
rrc_enb_task
(
void
*
args_p
);
void
*
rrc_enb_task
(
void
*
args_p
);
...
...
openair3/GTPV1-U/gtpv1u_eNB.c
View file @
d8472426
...
@@ -49,120 +49,13 @@
...
@@ -49,120 +49,13 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/ran_context.h"
#include "common/ran_context.h"
#include "gtpv1u_eNB_defs.h"
#include "gtpv1u_eNB_defs.h"
#include "gtpv1u_eNB_task.h"
#undef GTP_DUMP_SOCKET
#undef GTP_DUMP_SOCKET
/*
extern boolean_t pdcp_data_req(
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_buffer_sizeP,
unsigned char *const sdu_buffer_pP,
const pdcp_transmission_mode_t modeP
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,const uint32_t * const sourceL2Id
,const uint32_t * const destinationL2Id
#endif
);
const pdcp_transmission_mode_t modeP);
*/
extern
unsigned
char
NB_eNB_INST
;
extern
unsigned
char
NB_eNB_INST
;
extern
RAN_CONTEXT_t
RC
;
extern
RAN_CONTEXT_t
RC
;
static
int
gtpv1u_eNB_send_init_udp
(
uint16_t
port_number
);
NwGtpv1uRcT
gtpv1u_eNB_log_request
(
NwGtpv1uLogMgrHandleT
hLogMgr
,
uint32_t
logLevel
,
NwCharT
*
file
,
uint32_t
line
,
NwCharT
*
logStr
);
NwGtpv1uRcT
gtpv1u_eNB_send_udp_msg
(
NwGtpv1uUdpHandleT
udpHandle
,
uint8_t
*
buffer
,
uint32_t
buffer_len
,
uint32_t
buffer_offset
,
uint32_t
peerIpAddr
,
uint16_t
peerPort
);
NwGtpv1uRcT
gtpv1u_eNB_process_stack_req
(
NwGtpv1uUlpHandleT
hUlp
,
NwGtpv1uUlpApiT
*
pUlpApi
);
int
data_recv_callback
(
uint16_t
portP
,
uint32_t
address
,
uint8_t
*
buffer
,
uint32_t
length
,
void
*
arg_p
);
//int
//gtpv1u_create_tunnel_endpoint(
// gtpv1u_data_t *gtpv1u_data_pP,
// uint8_t ue_idP,
// uint8_t rab_idP,
// char *sgw_ip_addr_pP,
// uint16_t portP);
static
NwGtpv1uRcT
gtpv1u_start_timer_wrapper
(
NwGtpv1uTimerMgrHandleT
tmrMgrHandle
,
uint32_t
timeoutSec
,
uint32_t
timeoutUsec
,
uint32_t
tmrType
,
void
*
timeoutArg
,
NwGtpv1uTimerHandleT
*
hTmr
);
static
NwGtpv1uRcT
gtpv1u_stop_timer_wrapper
(
NwGtpv1uTimerMgrHandleT
tmrMgrHandle
,
NwGtpv1uTimerHandleT
hTmr
);
int
gtpv1u_initial_req
(
gtpv1u_data_t
*
gtpv1u_data_pP
,
teid_t
teidP
,
tcp_udp_port_t
portP
,
uint32_t
address
);
int
gtpv1u_new_data_req
(
uint8_t
enb_module_idP
,
rnti_t
ue_rntiP
,
uint8_t
rab_idP
,
uint8_t
*
buffer_pP
,
uint32_t
buf_lenP
,
uint32_t
buf_offsetP
);
int
gtpv1u_create_s1u_tunnel
(
const
instance_t
instanceP
,
const
gtpv1u_enb_create_tunnel_req_t
*
const
create_tunnel_req_pP
,
gtpv1u_enb_create_tunnel_resp_t
*
const
create_tunnel_resp_pP
);
static
int
gtpv1u_delete_s1u_tunnel
(
const
instance_t
instanceP
,
const
gtpv1u_enb_delete_tunnel_req_t
*
const
req_pP
);
static
int
gtpv1u_eNB_init
(
void
);
void
*
gtpv1u_eNB_task
(
void
*
args
);
//static gtpv1u_data_t gtpv1u_data_g;
#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0
#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0
#include <linux/if.h>
#include <linux/if.h>
static
int
gtpv1u_dump_socket_g
;
static
int
gtpv1u_dump_socket_g
;
...
@@ -215,11 +108,11 @@ static void gtpv1u_eNB_write_dump_socket(uint8_t *buffer_pP, uint32_t buffer_len
...
@@ -215,11 +108,11 @@ static void gtpv1u_eNB_write_dump_socket(uint8_t *buffer_pP, uint32_t buffer_len
#endif
#endif
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
static
int
gtpv1u_eNB_send_init_udp
(
uint16_t
port_number
)
static
int
gtpv1u_eNB_send_init_udp
(
const
Gtpv1uS1Req
*
req
)
{
{
// Create and alloc new message
// Create and alloc new message
MessageDef
*
message_p
;
MessageDef
*
message_p
;
struct
in_addr
addr
;
struct
in_addr
addr
=
{
0
}
;
message_p
=
itti_alloc_new_message
(
TASK_GTPV1_U
,
UDP_INIT
);
message_p
=
itti_alloc_new_message
(
TASK_GTPV1_U
,
UDP_INIT
);
...
@@ -227,12 +120,10 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
...
@@ -227,12 +120,10 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
return
-
1
;
return
-
1
;
}
}
UDP_INIT
(
message_p
).
port
=
port_number
;
UDP_INIT
(
message_p
).
port
=
req
->
enb_port_for_S1u_S12_S4_up
;
//LG UDP_INIT(message_p).address = "0.0.0.0"; //ANY address
addr
.
s_addr
=
req
->
enb_ip_address_for_S1u_S12_S4_up
;
addr
.
s_addr
=
RC
.
gtpv1u_data_g
->
enb_ip_address_for_S1u_S12_S4_up
;
UDP_INIT
(
message_p
).
address
=
inet_ntoa
(
addr
);
UDP_INIT
(
message_p
).
address
=
inet_ntoa
(
addr
);
LOG_I
(
GTPU
,
"Tx UDP_INIT IP addr %s (%x)
\n
"
,
UDP_INIT
(
message_p
).
address
,
RC
.
gtpv1u_data_g
->
enb_ip_address_for_S1u_S12_S4_up
);
LOG_I
(
GTPU
,
"Tx UDP_INIT IP addr %s (%x)
\n
"
,
UDP_INIT
(
message_p
).
address
,
UDP_INIT
(
message_p
).
port
);
MSC_LOG_EVENT
(
MSC_LOG_EVENT
(
MSC_GTPU_ENB
,
MSC_GTPU_ENB
,
...
@@ -242,6 +133,16 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
...
@@ -242,6 +133,16 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
return
itti_send_msg_to_task
(
TASK_UDP
,
INSTANCE_DEFAULT
,
message_p
);
return
itti_send_msg_to_task
(
TASK_UDP
,
INSTANCE_DEFAULT
,
message_p
);
}
}
static
int
gtpv1u_s1_req
(
const
instance_t
instanceP
,
const
Gtpv1uS1Req
*
const
req
)
{
memcpy
(
&
RC
.
gtpv1u_data_g
->
enb_ip_address_for_S1u_S12_S4_up
,
&
req
->
enb_ip_address_for_S1u_S12_S4_up
,
sizeof
(
req
->
enb_ip_address_for_S1u_S12_S4_up
));
gtpv1u_eNB_send_init_udp
(
req
);
return
0
;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
NwGtpv1uRcT
gtpv1u_eNB_log_request
(
NwGtpv1uLogMgrHandleT
hLogMgr
,
NwGtpv1uRcT
gtpv1u_eNB_log_request
(
NwGtpv1uLogMgrHandleT
hLogMgr
,
uint32_t
logLevel
,
uint32_t
logLevel
,
...
@@ -999,23 +900,17 @@ static int gtpv1u_delete_s1u_tunnel(
...
@@ -999,23 +900,17 @@ static int gtpv1u_delete_s1u_tunnel(
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
static
int
gtpv1u_eNB_init
(
void
)
int
gtpv1u_eNB_init
(
void
)
{
{
int
ret
;
NwGtpv1uRcT
rc
=
NW_GTPV1U_FAILURE
;
NwGtpv1uRcT
rc
=
NW_GTPV1U_FAILURE
;
NwGtpv1uUlpEntityT
ulp
;
NwGtpv1uUlpEntityT
ulp
;
NwGtpv1uUdpEntityT
udp
;
NwGtpv1uUdpEntityT
udp
;
NwGtpv1uLogMgrEntityT
log
;
NwGtpv1uLogMgrEntityT
log
;
NwGtpv1uTimerMgrEntityT
tmr
;
NwGtpv1uTimerMgrEntityT
tmr
;
// enb_properties_p = enb_config_get()->properties[0];
// enb_properties_p = enb_config_get()->properties[0];
RC
.
gtpv1u_data_g
=
(
gtpv1u_data_t
*
)
malloc
(
sizeof
(
gtpv1u_data_t
));
RC
.
gtpv1u_data_g
=
(
gtpv1u_data_t
*
)
calloc
(
sizeof
(
gtpv1u_data_t
),
1
);
memset
(
RC
.
gtpv1u_data_g
,
0
,
sizeof
(
gtpv1u_data_t
));
RCconfig_gtpu
();
LOG_I
(
GTPU
,
"Initializing GTPU stack %p
\n
"
,
&
RC
.
gtpv1u_data_g
);
LOG_I
(
GTPU
,
"Initializing GTPU stack %p
\n
"
,
&
RC
.
gtpv1u_data_g
);
//gtpv1u_data_g.gtpv1u_stack;
//gtpv1u_data_g.gtpv1u_stack;
/* Initialize UE hashtable */
/* Initialize UE hashtable */
...
@@ -1024,7 +919,6 @@ static int gtpv1u_eNB_init(void)
...
@@ -1024,7 +919,6 @@ static int gtpv1u_eNB_init(void)
RC
.
gtpv1u_data_g
->
teid_mapping
=
hashtable_create
(
256
,
NULL
,
NULL
);
RC
.
gtpv1u_data_g
->
teid_mapping
=
hashtable_create
(
256
,
NULL
,
NULL
);
AssertFatal
(
RC
.
gtpv1u_data_g
->
teid_mapping
!=
NULL
,
" ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create
\n
"
);
AssertFatal
(
RC
.
gtpv1u_data_g
->
teid_mapping
!=
NULL
,
" ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create
\n
"
);
// RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U;
// RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U;
RC
.
gtpv1u_data_g
->
ip_addr
=
NULL
;
//gtpv1u_data_g.udp_data;
//gtpv1u_data_g.udp_data;
RC
.
gtpv1u_data_g
->
seq_num
=
0
;
RC
.
gtpv1u_data_g
->
seq_num
=
0
;
...
@@ -1089,35 +983,21 @@ static int gtpv1u_eNB_init(void)
...
@@ -1089,35 +983,21 @@ static int gtpv1u_eNB_init(void)
}
}
#endif
#endif
ret
=
gtpv1u_eNB_send_init_udp
(
RC
.
gtpv1u_data_g
->
enb_port_for_S1u_S12_S4_up
);
if
(
ret
<
0
)
{
return
ret
;
}
LOG_D
(
GTPU
,
"Initializing GTPV1U interface for eNB: DONE
\n
"
);
LOG_D
(
GTPU
,
"Initializing GTPV1U interface for eNB: DONE
\n
"
);
return
0
;
return
0
;
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void
*
gtpv1u_eNB_task
(
void
*
args
)
void
*
gtpv1u_eNB_process_itti_msg
(
void
*
notUsed
)
{
{
int
rc
=
0
;
instance_t
instance
;
//const char *msg_name_p;
rc
=
gtpv1u_eNB_init
();
AssertFatal
(
rc
==
0
,
"gtpv1u_eNB_init Failed"
);
itti_mark_task_ready
(
TASK_GTPV1_U
);
MSC_START_USE
();
while
(
1
)
{
/* Trying to fetch a message from the message queue.
/* Trying to fetch a message from the message queue.
* If the queue is empty, this function will block till a
* If the queue is empty, this function will block till a
* message is sent to the task.
* message is sent to the task.
*/
*/
instance_t
instance
;
MessageDef
*
received_message_p
=
NULL
;
MessageDef
*
received_message_p
=
NULL
;
int
rc
=
0
;
itti_receive_msg
(
TASK_GTPV1_U
,
&
received_message_p
);
itti_receive_msg
(
TASK_GTPV1_U
,
&
received_message_p
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK
,
VCD_FUNCTION_IN
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK
,
VCD_FUNCTION_IN
);
DevAssert
(
received_message_p
!=
NULL
);
DevAssert
(
received_message_p
!=
NULL
);
...
@@ -1127,6 +1007,9 @@ void *gtpv1u_eNB_task(void *args)
...
@@ -1127,6 +1007,9 @@ void *gtpv1u_eNB_task(void *args)
switch
(
ITTI_MSG_ID
(
received_message_p
))
{
switch
(
ITTI_MSG_ID
(
received_message_p
))
{
case
GTPV1U_ENB_S1_REQ
:
gtpv1u_s1_req
(
instance
,
&
received_message_p
->
ittiMsg
.
gtpv1uS1Req
);
case
GTPV1U_ENB_DELETE_TUNNEL_REQ
:
{
case
GTPV1U_ENB_DELETE_TUNNEL_REQ
:
{
gtpv1u_delete_s1u_tunnel
(
instance
,
&
received_message_p
->
ittiMsg
.
Gtpv1uDeleteTunnelReq
);
gtpv1u_delete_s1u_tunnel
(
instance
,
&
received_message_p
->
ittiMsg
.
Gtpv1uDeleteTunnelReq
);
}
}
...
@@ -1258,6 +1141,22 @@ void *gtpv1u_eNB_task(void *args)
...
@@ -1258,6 +1141,22 @@ void *gtpv1u_eNB_task(void *args)
AssertFatal
(
rc
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
rc
);
AssertFatal
(
rc
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
rc
);
received_message_p
=
NULL
;
received_message_p
=
NULL
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK
,
VCD_FUNCTION_OUT
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK
,
VCD_FUNCTION_OUT
);
return
NULL
;
}
//-----------------------------------------------------------------------------
void
*
gtpv1u_eNB_task
(
void
*
args
)
{
int
rc
=
0
;
rc
=
gtpv1u_eNB_init
();
AssertFatal
(
rc
==
0
,
"gtpv1u_eNB_init Failed"
);
itti_mark_task_ready
(
TASK_GTPV1_U
);
MSC_START_USE
();
while
(
1
)
{
(
void
)
gtpv1u_eNB_process_itti_msg
(
NULL
);
}
}
return
NULL
;
return
NULL
;
...
...
openair3/GTPV1-U/gtpv1u_eNB_defs.h
View file @
d8472426
...
@@ -97,8 +97,6 @@ typedef struct gtpv1u_data_s {
...
@@ -97,8 +97,6 @@ typedef struct gtpv1u_data_s {
//RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head;
//RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head;
/* Local IP address to use */
/* Local IP address to use */
in_addr_t
enb_ip_address_for_S1u_S12_S4_up
;
in_addr_t
enb_ip_address_for_S1u_S12_S4_up
;
char
*
ip_addr
;
tcp_udp_port_t
enb_port_for_S1u_S12_S4_up
;
/* UDP internal data */
/* UDP internal data */
//udp_data_t udp_data;
//udp_data_t udp_data;
...
...
openair3/GTPV1-U/gtpv1u_eNB_task.h
View file @
d8472426
...
@@ -40,6 +40,8 @@ gtpv1u_new_data_req(
...
@@ -40,6 +40,8 @@ gtpv1u_new_data_req(
uint32_t buf_len,
uint32_t buf_len,
uint32_t buf_offset);*/
uint32_t buf_offset);*/
int
gtpv1u_eNB_init
(
void
);
void
*
gtpv1u_eNB_process_itti_msg
(
void
*
);
void
*
gtpv1u_eNB_task
(
void
*
args
);
void
*
gtpv1u_eNB_task
(
void
*
args
);
int
int
...
...
openair3/S1AP/s1ap_eNB.c
View file @
d8472426
...
@@ -286,19 +286,20 @@ void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
...
@@ -286,19 +286,20 @@ void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
}
}
void
*
s1ap_eNB_task
(
void
*
arg
)
void
s1ap_eNB_init
(
void
)
{
{
MessageDef
*
received_msg
=
NULL
;
int
result
;
S1AP_DEBUG
(
"Starting S1AP layer
\n
"
);
S1AP_DEBUG
(
"Starting S1AP layer
\n
"
);
s1ap_eNB_prepare_internal_data
();
s1ap_eNB_prepare_internal_data
();
itti_mark_task_ready
(
TASK_S1AP
);
itti_mark_task_ready
(
TASK_S1AP
);
MSC_START_USE
();
MSC_START_USE
();
}
while
(
1
)
{
void
*
s1ap_eNB_process_itti_msg
(
void
*
notUsed
)
{
MessageDef
*
received_msg
=
NULL
;
int
result
;
itti_receive_msg
(
TASK_S1AP
,
&
received_msg
);
itti_receive_msg
(
TASK_S1AP
,
&
received_msg
);
switch
(
ITTI_MSG_ID
(
received_msg
))
{
switch
(
ITTI_MSG_ID
(
received_msg
))
{
...
@@ -413,6 +414,16 @@ void *s1ap_eNB_task(void *arg)
...
@@ -413,6 +414,16 @@ void *s1ap_eNB_task(void *arg)
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
received_msg
=
NULL
;
received_msg
=
NULL
;
return
NULL
;
}
void
*
s1ap_eNB_task
(
void
*
arg
)
{
s1ap_eNB_init
();
while
(
1
)
{
(
void
)
s1ap_eNB_process_itti_msg
(
NULL
);
}
}
return
NULL
;
return
NULL
;
...
...
openair3/S1AP/s1ap_eNB.h
View file @
d8472426
...
@@ -39,6 +39,8 @@ extern s1ap_eNB_config_t s1ap_config;
...
@@ -39,6 +39,8 @@ extern s1ap_eNB_config_t s1ap_config;
#define EPC_MODE_ENABLED s1ap_config.mme_enabled
#define EPC_MODE_ENABLED s1ap_config.mme_enabled
void
*
s1ap_eNB_process_itti_msg
(
void
*
);
void
s1ap_eNB_init
(
void
);
void
*
s1ap_eNB_task
(
void
*
arg
);
void
*
s1ap_eNB_task
(
void
*
arg
);
uint32_t
s1ap_generate_eNB_id
(
void
);
uint32_t
s1ap_generate_eNB_id
(
void
);
...
...
openair3/SCTP/sctp_eNB_task.c
View file @
d8472426
...
@@ -1039,15 +1039,9 @@ sctp_eNB_flush_sockets(
...
@@ -1039,15 +1039,9 @@ sctp_eNB_flush_sockets(
}
}
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
*
sctp_eNB_task
(
void
*
arg
)
void
sctp_eNB_init
(
void
)
{
{
int
nb_events
;
struct
epoll_event
*
events
;
MessageDef
*
received_msg
=
NULL
;
int
result
;
SCTP_DEBUG
(
"Starting SCTP layer
\n
"
);
SCTP_DEBUG
(
"Starting SCTP layer
\n
"
);
STAILQ_INIT
(
&
sctp_cnx_list
);
STAILQ_INIT
(
&
sctp_cnx_list
);
...
@@ -1055,7 +1049,16 @@ void *sctp_eNB_task(void *arg)
...
@@ -1055,7 +1049,16 @@ void *sctp_eNB_task(void *arg)
itti_mark_task_ready
(
TASK_SCTP
);
itti_mark_task_ready
(
TASK_SCTP
);
MSC_START_USE
();
MSC_START_USE
();
while
(
1
)
{
}
//------------------------------------------------------------------------------
void
*
sctp_eNB_process_itti_msg
(
void
*
notUsed
)
{
int
nb_events
;
struct
epoll_event
*
events
;
MessageDef
*
received_msg
=
NULL
;
int
result
;
itti_receive_msg
(
TASK_SCTP
,
&
received_msg
);
itti_receive_msg
(
TASK_SCTP
,
&
received_msg
);
/* Check if there is a packet to handle */
/* Check if there is a packet to handle */
...
@@ -1142,6 +1145,17 @@ void *sctp_eNB_task(void *arg)
...
@@ -1142,6 +1145,17 @@ void *sctp_eNB_task(void *arg)
nb_events
=
itti_get_events
(
TASK_SCTP
,
&
events
);
nb_events
=
itti_get_events
(
TASK_SCTP
,
&
events
);
/* Now handle notifications for other sockets */
/* Now handle notifications for other sockets */
sctp_eNB_flush_sockets
(
events
,
nb_events
);
sctp_eNB_flush_sockets
(
events
,
nb_events
);
return
NULL
;
}
//------------------------------------------------------------------------------
void
*
sctp_eNB_task
(
void
*
arg
)
{
sctp_eNB_init
();
while
(
1
)
{
(
void
)
sctp_eNB_process_itti_msg
(
NULL
);
}
}
return
NULL
;
return
NULL
;
...
...
openair3/SCTP/sctp_eNB_task.h
View file @
d8472426
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
#ifndef SCTP_ENB_TASK_H_
#ifndef SCTP_ENB_TASK_H_
#define SCTP_ENB_TASK_H_
#define SCTP_ENB_TASK_H_
void
sctp_eNB_init
(
void
);
void
*
sctp_eNB_process_itti_msg
(
void
*
);
void
*
sctp_eNB_task
(
void
*
arg
);
void
*
sctp_eNB_task
(
void
*
arg
);
#endif
/* SCTP_ENB_TASK_H_ */
#endif
/* SCTP_ENB_TASK_H_ */
targets/RT/USER/lte-softmodem.c
View file @
d8472426
...
@@ -321,7 +321,15 @@ void signal_handler(int sig) {
...
@@ -321,7 +321,15 @@ void signal_handler(int sig) {
#define KBLU "\x1B[34m"
#define KBLU "\x1B[34m"
#define RESET "\033[0m"
#define RESET "\033[0m"
#if defined(ENABLE_ITTI)
void
signal_handler_itti
(
int
sig
)
{
// Call exit function
char
msg
[
256
];
memset
(
msg
,
0
,
256
);
sprintf
(
msg
,
"caught signal %s
\n
"
,
strsignal
(
sig
));
exit_function
(
__FILE__
,
__FUNCTION__
,
__LINE__
,
msg
);
}
#endif
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
{
...
@@ -963,6 +971,11 @@ int main( int argc, char **argv )
...
@@ -963,6 +971,11 @@ int main( int argc, char **argv )
signal
(
SIGINT
,
signal_handler
);
signal
(
SIGINT
,
signal_handler
);
#endif
#endif
#if defined(ENABLE_ITTI)
signal
(
SIGINT
,
signal_handler_itti
);
signal
(
SIGTERM
,
signal_handler_itti
);
signal
(
SIGABRT
,
signal_handler_itti
);
#endif
check_clock
();
check_clock
();
...
...
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