Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Li-Wei Liu
openairinterface5G
Commits
38d772d8
Commit
38d772d8
authored
Feb 15, 2019
by
frtabu
Browse files
nos1 et s1 execs identical, nos1 enforced based on exec name or --noS1 option
parent
6a47f9e7
Changes
36
Expand all
Hide whitespace changes
Inline
Side-by-side
cmake_targets/CMakeLists.txt
View file @
38d772d8
...
...
@@ -693,10 +693,10 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
##########################
# PDCP LAYER OPTIONS
##########################
add_boolean_option
(
PDCP_USE_NETLINK False
"For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO"
)
add_boolean_option
(
PDCP_USE_NETLINK_QUEUES False
"When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues"
)
add_boolean_option
(
LINK_ENB_PDCP_TO_IP_DRIVER False
"For eNB, PDCP communicate with a IP driver"
)
add_boolean_option
(
LINK_ENB_PDCP_TO_GTPV1U True
"For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)"
)
#
add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
#
add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
#
add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
#
add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
##########################
# RRC LAYER OPTIONS
...
...
@@ -1994,26 +1994,29 @@ add_executable(lte-softmodem-nos1
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/netlink_init.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/multicast_link.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/socket.c
${
OPENAIR_DIR
}
/common/utils/utils.c
${
OPENAIR_DIR
}
/common/utils/system.c
${
GTPU_need_ITTI
}
${
XFORMS_SOURCE
}
${
XFORMS_SOURCE_SOFTMODEM
}
${
T_SOURCE
}
${
CONFIG_SOURCES
}
${
SHLIB_LOADER_SOURCES
}
)
add_dependencies
(
lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag
)
target_link_libraries
(
lte-softmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
${
RAL_LIB
}
${
ITTI_LIB
}
${
MI
H
_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
LFDS7
RRC_LIB
S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U
SECU_CN SECU_OSA UTIL HASHTABLE
SCTP_CLIENT UDP
SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
${
M
SC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ITT
I_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl
)
-Wl,--end-group z dl
)
target_link_libraries
(
lte-softmodem-nos1
${
LIBXML2_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem-nos1 pthread m
${
CONFIG_LIBRARIES
}
rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
sctp
${
XFORMS_LIBRARIES
}
${
PROTOBUF_LIB
}
${
CMAKE_DL_LIBS
}
${
LIBYAML_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem-nos1
${
LIB_LMS_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem-nos1 pthread m
${
CONFIG_LIBRARIES
}
rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
sctp
${
XFORMS_LIBRARIES
}
${
PROTOBUF_LIB
}
${
CMAKE_DL_LIBS
}
${
LIBYAML_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem-nos1
${
LIB_LMS_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem-nos1
${
T_LIB
}
)
# lte-uesoftmodem is UE implementation
#######################################
...
...
@@ -2027,6 +2030,8 @@ add_executable(lte-uesoftmodem
${
OPENAIR1_DIR
}
/SIMULATION/TOOLS/taus.c
${
OPENAIR_TARGETS
}
/COMMON/create_tasks_ue.c
${
OPENAIR_TARGETS
}
/ARCH/COMMON/common_lib.c
${
OPENAIR2_DIR
}
/RRC/NAS/nas_config.c
${
OPENAIR2_DIR
}
/RRC/NAS/rb_config.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/netlink_init.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/multicast_link.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/socket.c
...
...
@@ -2070,6 +2075,7 @@ add_executable(lte-uesoftmodem-nos1
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/netlink_init.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/multicast_link.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/socket.c
${
OPENAIR3_DIR
}
/NAS/UE/nas_ue_task.c
${
OPENAIR_DIR
}
/common/utils/utils.c
${
OPENAIR_DIR
}
/common/utils/system.c
${
XFORMS_SOURCE
}
...
...
@@ -2080,18 +2086,18 @@ add_executable(lte-uesoftmodem-nos1
)
add_dependencies
(
lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag
)
target_link_libraries
(
lte-uesoftmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
${
RAL_LIB
}
${
ITTI_LIB
}
${
MI
H
_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
LFDS7
${
ATLAS_LIBRARIES
}
RRC_LIB
S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U
SECU_CN SECU_OSA UTIL HASHTABLE
SCTP_CLIENT UDP
SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
${
M
SC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ITT
I_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
LFDS7
${
ATLAS_LIBRARIES
}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl
)
-Wl,--end-group z dl
)
target_link_libraries
(
lte-uesoftmodem-nos1
${
LIBXML2_LIBRARIES
}
)
target_link_libraries
(
lte-uesoftmodem-nos1 pthread m
${
CONFIG_LIBRARIES
}
rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
sctp
${
XFORMS_LIBRARIES
}
${
PROTOBUF_LIB
}
${
CMAKE_DL_LIBS
}
${
LIBYAML_LIBRARIES
}
${
ATLAS_LIBRARIES
}
)
target_link_libraries
(
lte-uesoftmodem-nos1
${
LIB_LMS_LIBRARIES
}
)
target_link_libraries
(
lte-uesoftmodem-nos1 pthread m
${
CONFIG_LIBRARIES
}
rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
sctp
${
XFORMS_LIBRARIES
}
${
PROTOBUF_LIB
}
${
CMAKE_DL_LIBS
}
${
LIBYAML_LIBRARIES
}
${
ATLAS_LIBRARIES
}
)
target_link_libraries
(
lte-uesoftmodem-nos1
${
LIB_LMS_LIBRARIES
}
)
target_link_libraries
(
lte-uesoftmodem-nos1
${
T_LIB
}
)
# USIM process
#################
#add_executable(usim
...
...
cmake_targets/build_oai
View file @
38d772d8
...
...
@@ -547,9 +547,9 @@ function main() {
mkdir
-p
$DIR
/
$lte_build_dir
/build
cmake_file
=
$DIR
/
$lte_build_dir
/CMakeLists.txt
echo
"cmake_minimum_required(VERSION 2.8)"
>
$cmake_file
if
[
"
$NOS1
"
=
"1"
]
;
then
cat
$DIR
/
$lte_build_dir
/CMakeLists.template
>>
$cmake_file
fi
#
if [ "$NOS1" = "1" ] ; then
#
cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
#
fi
echo
"set ( CMAKE_BUILD_TYPE
$CMAKE_BUILD_TYPE
)"
>>
$cmake_file
echo
"set ( CFLAGS_PROCESSOR_USER
\"
$CFLAGS_PROCESSOR_USER
\"
)"
>>
$cmake_file
echo
"set ( XFORMS
$XFORMS
)"
>>
$cmake_file
...
...
openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
View file @
38d772d8
...
...
@@ -39,13 +39,14 @@
#include <fcntl.h>
#include <errno.h>
#include "platform_constants.h"
#ifdef UE_NAS_USE_TUN
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <linux/if_tun.h>
#include "openairinterface5g_limits.h"
#endif
#include "pdcp.h"
char
nl_rx_buf
[
NL_MAX_PAYLOAD
];
...
...
@@ -54,20 +55,16 @@ struct nlmsghdr *nas_nlh_tx = NULL;
struct
nlmsghdr
*
nas_nlh_rx
=
NULL
;
struct
iovec
nas_iov_tx
;
struct
iovec
nas_iov_rx
=
{
nl_rx_buf
,
sizeof
(
nl_rx_buf
)};
#ifdef UE_NAS_USE_TUN
int
nas_sock_fd
[
NUMBER_OF_UE_MAX
];
#else
int
nas_sock_fd
;
#endif
struct
msghdr
nas_msg_tx
;
struct
msghdr
nas_msg_rx
;
#define GRAAL_NETLINK_ID 31
#ifdef UE_NAS_USE_TUN
static
int
tun_alloc
(
char
*
dev
)
{
static
int
tun_alloc
(
char
*
dev
)
{
struct
ifreq
ifr
;
int
fd
,
err
;
...
...
@@ -77,136 +74,112 @@ static int tun_alloc(char *dev)
}
memset
(
&
ifr
,
0
,
sizeof
(
ifr
));
/* Flags: IFF_TUN - TUN device (no Ethernet headers)
* IFF_TAP - TAP device
*
* IFF_NO_PI - Do not provide packet information
*/
ifr
.
ifr_flags
=
IFF_TUN
|
IFF_NO_PI
;
if
(
*
dev
)
strncpy
(
ifr
.
ifr_name
,
dev
,
IFNAMSIZ
);
strncpy
(
ifr
.
ifr_name
,
dev
,
IFNAMSIZ
);
if
(
(
err
=
ioctl
(
fd
,
TUNSETIFF
,
(
void
*
)
&
ifr
))
<
0
){
close
(
fd
);
return
err
;
if
(
(
err
=
ioctl
(
fd
,
TUNSETIFF
,
(
void
*
)
&
ifr
))
<
0
)
{
close
(
fd
);
return
err
;
}
strcpy
(
dev
,
ifr
.
ifr_name
);
return
fd
;
}
int
netlink_init
(
void
)
{
int
i
;
int
netlink_init_tun
(
void
)
{
int
ret
;
char
ifname
[
64
];
for
(
i
=
0
;
i
<
NUMBER_OF_UE_MAX
;
i
++
)
{
sprintf
(
ifname
,
"oip%d"
,
i
+
1
);
nas_sock_fd
[
i
]
=
tun_alloc
(
ifname
);
sprintf
(
ifname
,
"oip1"
);
nas_sock_fd
=
tun_alloc
(
ifname
);
if
(
nas_sock_fd
[
i
]
==
-
1
)
{
printf
(
"[NETLINK] Error opening socket %d (%d:%s)
\n
"
,
nas_sock_fd
[
i
]
,
errno
,
strerror
(
errno
));
exit
(
1
);
}
if
(
nas_sock_fd
==
-
1
)
{
printf
(
"[NETLINK] Error opening socket %d (%d:%s)
\n
"
,
nas_sock_fd
,
errno
,
strerror
(
errno
));
exit
(
1
);
}
printf
(
"[NETLINK]Opened socket with fd %d
\n
"
,
nas_sock_fd
[
i
]);
printf
(
"[NETLINK]Opened socket with fd %d
\n
"
,
nas_sock_fd
);
ret
=
fcntl
(
nas_sock_fd
,
F_SETFL
,
O_NONBLOCK
);
#
if
!defined(PDCP_USE_NETLINK_QUEUES)
ret
=
fcntl
(
nas_sock_fd
[
i
],
F_SETFL
,
O_NONBLOCK
);
if
(
ret
==
-
1
)
{
printf
(
"[NETLINK] Error fcntl (%d:%s)
\n
"
,
errno
,
strerror
(
errno
)
);
if
(
ret
==
-
1
)
{
printf
(
"[NETLINK] Error fcntl (%d:%s)
\n
"
,
errno
,
strerror
(
errno
));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
if
(
LINK_ENB_PDCP_TO_IP_DRIVER
)
{
exit
(
1
);
#endif
}
#endif
memset
(
&
nas_src_addr
,
0
,
sizeof
(
nas_src_addr
));
nas_src_addr
.
nl_family
=
AF_NETLINK
;
nas_src_addr
.
nl_pid
=
1
;
//getpid(); /* self pid */
nas_src_addr
.
nl_groups
=
0
;
/* not in mcast groups */
ret
=
bind
(
nas_sock_fd
[
i
],
(
struct
sockaddr
*
)
&
nas_src_addr
,
sizeof
(
nas_src_addr
));
memset
(
&
nas_dest_addr
,
0
,
sizeof
(
nas_dest_addr
));
nas_dest_addr
.
nl_family
=
AF_NETLINK
;
nas_dest_addr
.
nl_pid
=
0
;
/* For Linux Kernel */
nas_dest_addr
.
nl_groups
=
0
;
/* unicast */
// TX PART
nas_nlh_tx
=
(
struct
nlmsghdr
*
)
malloc
(
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
memset
(
nas_nlh_tx
,
0
,
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
/* Fill the netlink message header */
nas_nlh_tx
->
nlmsg_len
=
NLMSG_SPACE
(
NL_MAX_PAYLOAD
);
nas_nlh_tx
->
nlmsg_pid
=
1
;
//getpid(); /* self pid */
nas_nlh_tx
->
nlmsg_flags
=
0
;
nas_iov_tx
.
iov_base
=
(
void
*
)
nas_nlh_tx
;
nas_iov_tx
.
iov_len
=
nas_nlh_tx
->
nlmsg_len
;
memset
(
&
nas_msg_tx
,
0
,
sizeof
(
nas_msg_tx
));
nas_msg_tx
.
msg_name
=
(
void
*
)
&
nas_dest_addr
;
nas_msg_tx
.
msg_namelen
=
sizeof
(
nas_dest_addr
);
nas_msg_tx
.
msg_iov
=
&
nas_iov_tx
;
nas_msg_tx
.
msg_iovlen
=
1
;
// RX PART
memset
(
&
nas_msg_rx
,
0
,
sizeof
(
nas_msg_rx
));
nas_msg_rx
.
msg_name
=
(
void
*
)
&
nas_src_addr
;
nas_msg_rx
.
msg_namelen
=
sizeof
(
nas_src_addr
);
nas_msg_rx
.
msg_iov
=
&
nas_iov_rx
;
nas_msg_rx
.
msg_iovlen
=
1
;
}
memset
(
&
nas_src_addr
,
0
,
sizeof
(
nas_src_addr
));
nas_src_addr
.
nl_family
=
AF_NETLINK
;
nas_src_addr
.
nl_pid
=
1
;
//getpid(); /* self pid */
nas_src_addr
.
nl_groups
=
0
;
/* not in mcast groups */
ret
=
bind
(
nas_sock_fd
,
(
struct
sockaddr
*
)
&
nas_src_addr
,
sizeof
(
nas_src_addr
));
memset
(
&
nas_dest_addr
,
0
,
sizeof
(
nas_dest_addr
));
nas_dest_addr
.
nl_family
=
AF_NETLINK
;
nas_dest_addr
.
nl_pid
=
0
;
/* For Linux Kernel */
nas_dest_addr
.
nl_groups
=
0
;
/* unicast */
// TX PART
nas_nlh_tx
=
(
struct
nlmsghdr
*
)
malloc
(
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
memset
(
nas_nlh_tx
,
0
,
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
/* Fill the netlink message header */
nas_nlh_tx
->
nlmsg_len
=
NLMSG_SPACE
(
NL_MAX_PAYLOAD
);
nas_nlh_tx
->
nlmsg_pid
=
1
;
//getpid(); /* self pid */
nas_nlh_tx
->
nlmsg_flags
=
0
;
nas_iov_tx
.
iov_base
=
(
void
*
)
nas_nlh_tx
;
nas_iov_tx
.
iov_len
=
nas_nlh_tx
->
nlmsg_len
;
memset
(
&
nas_msg_tx
,
0
,
sizeof
(
nas_msg_tx
));
nas_msg_tx
.
msg_name
=
(
void
*
)
&
nas_dest_addr
;
nas_msg_tx
.
msg_namelen
=
sizeof
(
nas_dest_addr
);
nas_msg_tx
.
msg_iov
=
&
nas_iov_tx
;
nas_msg_tx
.
msg_iovlen
=
1
;
// RX PART
memset
(
&
nas_msg_rx
,
0
,
sizeof
(
nas_msg_rx
));
nas_msg_rx
.
msg_name
=
(
void
*
)
&
nas_src_addr
;
nas_msg_rx
.
msg_namelen
=
sizeof
(
nas_src_addr
);
nas_msg_rx
.
msg_iov
=
&
nas_iov_rx
;
nas_msg_rx
.
msg_iovlen
=
1
;
return
1
;
}
#else
/* UE_NAS_USE_TUN */
int
netlink_init
(
void
)
{
int
netlink_init
(
void
)
{
int
ret
;
nas_sock_fd
=
socket
(
PF_NETLINK
,
SOCK_RAW
,
GRAAL_NETLINK_ID
);
if
(
nas_sock_fd
==
-
1
)
{
printf
(
"[NETLINK] Error opening socket %d (%d:%s)
\n
"
,
nas_sock_fd
,
errno
,
strerror
(
errno
));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit
(
1
);
#endif
if
(
LINK_ENB_PDCP_TO_IP_DRIVER
)
{
exit
(
1
);
}
}
printf
(
"[NETLINK]Opened socket with fd %d
\n
"
,
nas_sock_fd
);
#if !defined(PDCP_USE_NETLINK_QUEUES)
ret
=
fcntl
(
nas_sock_fd
,
F_SETFL
,
O_NONBLOCK
);
if
(
ret
==
-
1
)
{
printf
(
"[NETLINK] Error fcntl (%d:%s)
\n
"
,
errno
,
strerror
(
errno
));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit
(
1
);
#endif
}
#endif
if
(
LINK_ENB_PDCP_TO_IP_DRIVER
)
{
exit
(
1
);
}
}
memset
(
&
nas_src_addr
,
0
,
sizeof
(
nas_src_addr
));
nas_src_addr
.
nl_family
=
AF_NETLINK
;
nas_src_addr
.
nl_pid
=
1
;
//getpid(); /* self pid */
nas_src_addr
.
nl_groups
=
0
;
/* not in mcast groups */
ret
=
bind
(
nas_sock_fd
,
(
struct
sockaddr
*
)
&
nas_src_addr
,
sizeof
(
nas_src_addr
));
ret
=
bind
(
nas_sock_fd
,
(
struct
sockaddr
*
)
&
nas_src_addr
,
sizeof
(
nas_src_addr
));
memset
(
&
nas_dest_addr
,
0
,
sizeof
(
nas_dest_addr
));
nas_dest_addr
.
nl_family
=
AF_NETLINK
;
nas_dest_addr
.
nl_pid
=
0
;
/* For Linux Kernel */
nas_dest_addr
.
nl_groups
=
0
;
/* unicast */
// TX PART
nas_nlh_tx
=
(
struct
nlmsghdr
*
)
malloc
(
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
memset
(
nas_nlh_tx
,
0
,
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
...
...
@@ -214,7 +187,6 @@ int netlink_init(void)
nas_nlh_tx
->
nlmsg_len
=
NLMSG_SPACE
(
NL_MAX_PAYLOAD
);
nas_nlh_tx
->
nlmsg_pid
=
1
;
//getpid(); /* self pid */
nas_nlh_tx
->
nlmsg_flags
=
0
;
nas_iov_tx
.
iov_base
=
(
void
*
)
nas_nlh_tx
;
nas_iov_tx
.
iov_len
=
nas_nlh_tx
->
nlmsg_len
;
memset
(
&
nas_msg_tx
,
0
,
sizeof
(
nas_msg_tx
));
...
...
@@ -222,16 +194,12 @@ int netlink_init(void)
nas_msg_tx
.
msg_namelen
=
sizeof
(
nas_dest_addr
);
nas_msg_tx
.
msg_iov
=
&
nas_iov_tx
;
nas_msg_tx
.
msg_iovlen
=
1
;
// RX PART
memset
(
&
nas_msg_rx
,
0
,
sizeof
(
nas_msg_rx
));
nas_msg_rx
.
msg_name
=
(
void
*
)
&
nas_src_addr
;
nas_msg_rx
.
msg_namelen
=
sizeof
(
nas_src_addr
);
nas_msg_rx
.
msg_iov
=
&
nas_iov_rx
;
nas_msg_rx
.
msg_iovlen
=
1
;
return
(
nas_sock_fd
);
}
#endif
/* UE_NAS_USE_TUN */
openair1/SIMULATION/ETH_TRANSPORT/proto.h
View file @
38d772d8
...
...
@@ -62,5 +62,6 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag);
void
clear_eNB_transport_info
(
uint8_t
);
void
clear_UE_transport_info
(
uint8_t
);
int
netlink_init
(
void
);
int
netlink_init_tun
(
void
);
#endif
/* EMU_PROTO_H_ */
openair2/COMMON/nas_messages_def.h
View file @
38d772d8
...
...
@@ -26,7 +26,6 @@
* Author: winckel
*/
#if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
//-------------------------------------------------------------------------------------------//
// Messages for NAS logging
MESSAGE_DEF
(
NAS_DL_EMM_RAW_MSG
,
MESSAGE_PRIORITY_MED
,
nas_raw_msg_t
,
nas_dl_emm_raw_msg
)
...
...
@@ -46,4 +45,4 @@ MESSAGE_DEF(NAS_DL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_
MESSAGE_DEF
(
NAS_UL_ESM_PROTECTED_MSG
,
MESSAGE_PRIORITY_MED
,
nas_esm_protected_msg_t
,
nas_ul_esm_protected_msg
)
//-------------------------------------------------------------------------------------------//
#endif
/* ENABLE_USE_MME */
openair2/COMMON/nas_messages_types.h
View file @
38d772d8
...
...
@@ -29,7 +29,7 @@
#ifndef NAS_MESSAGES_TYPES_H_
#define NAS_MESSAGES_TYPES_H_
# if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
#include "nas_message.h"
...
...
@@ -142,5 +142,4 @@ typedef struct nas_esm_protected_msg_s {
ESM_msg
choice
;
}
nas_esm_protected_msg_t
;
# endif
/* ENABLE_USE_MME */
#endif
/* NAS_MESSAGES_TYPES_H_ */
openair2/ENB_APP/NB_IoT_config.c
View file @
38d772d8
...
...
@@ -33,13 +33,9 @@
#include "log.h"
#include "log_extern.h"
#include "assertions.h"
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#endif
#endif
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "SystemInformationBlockType2.h"
#include "PHY/phy_extern.h"
...
...
openair2/ENB_APP/RRC_config_tools.c
View file @
38d772d8
...
...
@@ -33,13 +33,9 @@
#include "common/utils/LOG/log.h"
#include "assertions.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif
#endif
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "LTE_SystemInformationBlockType2.h"
#include "common/config/config_userapi.h"
#include "RRC_config_tools.h"
...
...
openair2/ENB_APP/enb_app.c
View file @
38d772d8
...
...
@@ -37,36 +37,27 @@
#include "common/utils/LOG/log.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
/* temporary warning removale while implementing noS1 */
/* as config option */
# else
# ifdef EPC_MODE_ENABLED
# undef EPC_MODE_ENABLED
# endif
# define EPC_MODE_ENABLED 0
# endif
# include "x2ap_eNB.h"
# include "x2ap_messages_types.h"
# define X2AP_ENB_REGISTER_RETRY_DELAY 10
#include "openair1/PHY/INIT/phy_init.h"
extern
unsigned
char
NB_eNB_INST
;
#endif
extern
RAN_CONTEXT_t
RC
;
#if defined(ENABLE_ITTI)
/*------------------------------------------------------------------------------*/
# if defined(ENABLE_USE_MME)
# define ENB_REGISTER_RETRY_DELAY 10
# endif
#include "targets/RT/USER/lte-softmodem.h"
...
...
@@ -115,7 +106,7 @@ static void configure_rrc(uint32_t enb_id)
}
/*------------------------------------------------------------------------------*/
# if defined(ENABLE_USE_MME)
static
uint32_t
eNB_app_register
(
uint32_t
enb_id_start
,
uint32_t
enb_id_end
)
//, const Enb_properties_array_t *enb_properties)
{
uint32_t
enb_id
;
...
...
@@ -143,8 +134,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
return
register_enb_pending
;
}
# endif
#endif
/*------------------------------------------------------------------------------*/
static
uint32_t
eNB_app_register_x2
(
uint32_t
enb_id_start
,
uint32_t
enb_id_end
)
...
...
@@ -173,15 +163,12 @@ static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end)
/*------------------------------------------------------------------------------*/
void
*
eNB_app_task
(
void
*
args_p
)
{
#if defined(ENABLE_ITTI)
uint32_t
enb_nb
=
RC
.
nb_inst
;
uint32_t
enb_id_start
=
0
;
uint32_t
enb_id_end
=
enb_id_start
+
enb_nb
;
# if defined(ENABLE_USE_MME)
uint32_t
register_enb_pending
=
0
;
uint32_t
registered_enb
;
long
enb_register_retry_timer_id
;
# endif
uint32_t
x2_register_enb_pending
;
uint32_t
x2_registered_enb
;
long
x2_enb_register_retry_timer_id
;
...
...
@@ -220,15 +207,11 @@ void *eNB_app_task(void *args_p)
configure_rrc
(
enb_id
);
}
#
if
defined(ENABLE_USE_MME)
if
(
EPC_MODE_ENABLED
)
{
/* Try to register each eNB */
registered_enb
=
0
;
register_enb_pending
=
eNB_app_register
(
enb_id_start
,
enb_id_end
);
//, enb_properties_p);
#else
/* Start L2L1 task */
msg_p
=
itti_alloc_new_message
(
TASK_ENB_APP
,
INITIALIZE_MESSAGE
);
itti_send_msg_to_task
(
TASK_L2L1
,
INSTANCE_DEFAULT
,
msg_p
);
#endif
}
/* Try to register each eNB with each other */
x2_registered_enb
=
0
;
...
...
@@ -255,44 +238,45 @@ void *eNB_app_task(void *args_p)
break
;
case
S1AP_REGISTER_ENB_CNF
:
# if defined(ENABLE_USE_MME)
LOG_I
(
ENB_APP
,
"[eNB %d] Received %s: associated MME %d
\n
"
,
instance
,
ITTI_MSG_NAME
(
msg_p
),
S1AP_REGISTER_ENB_CNF
(
msg_p
).
nb_mme
);
if
(
EPC_MODE_ENABLED
)
{
LOG_I
(
ENB_APP
,
"[eNB %d] Received %s: associated MME %d
\n
"
,
instance
,
ITTI_MSG_NAME
(
msg_p
),
S1AP_REGISTER_ENB_CNF
(
msg_p
).
nb_mme
);
DevAssert
(
register_enb_pending
>
0
);
register_enb_pending
--
;
DevAssert
(
register_enb_pending
>
0
);
register_enb_pending
--
;
/* Check if at least eNB is registered with one MME */
if
(
S1AP_REGISTER_ENB_CNF
(
msg_p
).
nb_mme
>
0
)
{
registered_enb
++
;
}
if
(
S1AP_REGISTER_ENB_CNF
(
msg_p
).
nb_mme
>
0
)
{
registered_enb
++
;
}
/* Check if all register eNB requests have been processed */
if
(
register_enb_pending
==
0
)
{
if
(
registered_enb
==
enb_nb
)
{
if
(
register_enb_pending
==
0
)
{
if
(
registered_enb
==
enb_nb
)
{
/* If all eNB are registered, start L2L1 task */
MessageDef
*
msg_init_p
;
MessageDef
*
msg_init_p
;
msg_init_p
=
itti_alloc_new_message
(
TASK_ENB_APP
,
INITIALIZE_MESSAGE
);
itti_send_msg_to_task
(
TASK_L2L1
,
INSTANCE_DEFAULT
,
msg_init_p
);
msg_init_p
=
itti_alloc_new_message
(
TASK_ENB_APP
,
INITIALIZE_MESSAGE
);
itti_send_msg_to_task
(
TASK_L2L1
,
INSTANCE_DEFAULT
,
msg_init_p
);
}
else
{
LOG_W
(
ENB_APP
,
" %d eNB not associated with a MME, retrying registration in %d seconds ...
\n
"
,
enb_nb
-
registered_enb
,
ENB_REGISTER_RETRY_DELAY
);
}
else
{
LOG_W
(
ENB_APP
,
" %d eNB not associated with a MME, retrying registration in %d seconds ...
\n
"
,
enb_nb
-
registered_enb
,
ENB_REGISTER_RETRY_DELAY
);
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
if
(
timer_setup
(
ENB_REGISTER_RETRY_DELAY
,
0
,
TASK_ENB_APP
,
INSTANCE_DEFAULT
,
TIMER_ONE_SHOT
,
NULL
,
&
enb_register_retry_timer_id
)
<
0
)
{
LOG_E
(
ENB_APP
,
" Can not start eNB register retry timer, use
\"
sleep
\"
instead!
\n
"
);
if
(
timer_setup
(
ENB_REGISTER_RETRY_DELAY
,
0
,
TASK_ENB_APP
,
INSTANCE_DEFAULT
,
TIMER_ONE_SHOT
,
NULL
,
&
enb_register_retry_timer_id
)
<
0
)
{
LOG_E
(
ENB_APP
,
" Can not start eNB register retry timer, use
\"
sleep
\"
instead!
\n
"
);
sleep
(
ENB_REGISTER_RETRY_DELAY
);
sleep
(
ENB_REGISTER_RETRY_DELAY
);
/* Restart the registration process */
registered_enb
=
0
;
register_enb_pending
=
eNB_app_register
(
enb_id_start
,
enb_id_end
);
//, enb_properties_p);
registered_enb
=
0
;
register_enb_pending
=
eNB_app_register
(
enb_id_start
,
enb_id_end
);
//, enb_properties_p);
}
}
}
}
#endif
}
/* if (EPC_MODE_ENABLED) */
break
;
case
S1AP_DEREGISTERED_ENB_IND
:
...
...
@@ -305,21 +289,21 @@ void *eNB_app_task(void *args_p)
break
;
case
TIMER_HAS_EXPIRED
:
# if defined(ENABLE_USE_MME)
LOG_I
(
ENB_APP
,
" Received %s: timer_id %ld
\n
"
,
ITTI_MSG_NAME
(
msg_p
),
TIMER_HAS_EXPIRED
(
msg_p
).
timer_id
);
if
(
EPC_MODE_ENABLED
)
{