Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
2d6270a7
Commit
2d6270a7
authored
Jun 25, 2015
by
gauthier
Browse files
Better behaviour for NAS MME (NAS NON DELIVERY INDICATION)
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@7660
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
f777e5c7
Changes
54
Hide whitespace changes
Inline
Side-by-side
openair-cn/GTPV1-U/gtpv1u_eNB.c
View file @
2d6270a7
...
...
@@ -1082,14 +1082,14 @@ void *gtpv1u_eNB_task(void *args)
if
(
rc
!=
NW_GTPV1U_OK
)
{
LOG_E
(
GTPU
,
"nwGtpv1uGpduMsgNew failed: 0x%x
\n
"
,
rc
);
MSC_LOG_EVENT
(
MSC_GTPU_ENB
,
"Failed send G-PDU ltid %u rtid %u size %u"
,
MSC_LOG_EVENT
(
MSC_GTPU_ENB
,
"
0
Failed send G-PDU ltid %u rtid %u size %u"
,
enb_s1u_teid
,
sgw_s1u_teid
,
data_req_p
->
length
);
}
else
{
rc
=
nwGtpv1uProcessUlpReq
(
gtpv1u_data_g
.
gtpv1u_stack
,
&
stack_req
);
if
(
rc
!=
NW_GTPV1U_OK
)
{
LOG_E
(
GTPU
,
"nwGtpv1uProcessUlpReq failed: 0x%x
\n
"
,
rc
);
MSC_LOG_EVENT
(
MSC_GTPU_ENB
,
"Failed send G-PDU ltid %u rtid %u size %u"
,
MSC_LOG_EVENT
(
MSC_GTPU_ENB
,
"
0
Failed send G-PDU ltid %u rtid %u size %u"
,
enb_s1u_teid
,
sgw_s1u_teid
,
data_req_p
->
length
);
}
else
{
MSC_LOG_TX_MESSAGE
(
...
...
openair-cn/MME_APP/mme_app_authentication.c
View file @
2d6270a7
...
...
@@ -170,8 +170,8 @@ int
mme_app_handle_authentication_info_answer
(
const
s6a_auth_info_ans_t
*
const
s6a_auth_info_ans_pP
)
{
struct
ue_context_s
*
ue_context
;
uint64_t
imsi
;
struct
ue_context_s
*
ue_context
=
NULL
;
uint64_t
imsi
=
0
;
DevAssert
(
s6a_auth_info_ans_pP
!=
NULL
);
...
...
openair-cn/MME_APP/mme_app_context.c
View file @
2d6270a7
...
...
@@ -275,6 +275,29 @@ int mme_insert_ue_context(mme_ue_context_t *mme_ue_context, struct ue_context_s
return
0
;
}
//------------------------------------------------------------------------------
void
mme_remove_ue_context
(
mme_ue_context_t
*
mme_ue_context
,
struct
ue_context_s
*
ue_context_p
)
//------------------------------------------------------------------------------
{
struct
ue_context_s
*
collision_p
=
NULL
;
DevAssert
(
mme_ue_context
!=
NULL
);
DevAssert
(
ue_context_p
!=
NULL
);
/* Updating statistics */
mme_ue_context
->
nb_ue_managed
++
;
mme_ue_context
->
nb_ue_since_last_stat
++
;
collision_p
=
RB_REMOVE
(
ue_context_map
,
&
mme_ue_context
->
ue_context_tree
,
ue_context_p
);
#warning "TODO mme_ue_context_free_content"
//TODO mme_ue_context_free_content(ue_context_p);
free
(
ue_context_p
);
return
0
;
}
//------------------------------------------------------------------------------
void
mme_app_dump_ue_contexts
(
mme_ue_context_t
*
mme_ue_context
)
//------------------------------------------------------------------------------
...
...
@@ -451,13 +474,12 @@ void mme_app_dump_ue_contexts(mme_ue_context_t *mme_ue_context)
void
mme_app_handle_s1ap_ue_context_release_req
(
const
s1ap_ue_context_release_req_t
const
*
s1ap_ue_context_release_req
)
//------------------------------------------------------------------------------
{
struct
ue_context_s
*
ue_context_p
=
NULL
;
struct
ue_context_s
*
ue_context_p
=
NULL
;
MessageDef
*
message_p
=
NULL
;
MME_APP_DEBUG
(
"Received S1AP_UE_CONTEXT_RELEASE_REQ from S1AP
\n
"
);
ue_context_p
=
mme_ue_context_exists_nas_ue_id
(
&
mme_app_desc
.
mme_ue_contexts
,
s1ap_ue_context_release_req
->
mme_ue_s1ap_id
);
if
(
ue_context_p
==
NULL
)
{
MSC_LOG_EVENT
(
MSC_MMEAPP_MME
,
...
...
@@ -467,7 +489,29 @@ void mme_app_handle_s1ap_ue_context_release_req(const s1ap_ue_context_release_re
s1ap_ue_context_release_req
->
mme_ue_s1ap_id
);
return
;
}
mme_app_send_s11_release_access_bearers_req
(
ue_context_p
);
if
((
ue_context_p
->
mme_s11_teid
==
0
)
&&
(
ue_context_p
->
sgw_s11_teid
==
0
))
{
// no session was created, no need for releasing bearers in SGW
message_p
=
itti_alloc_new_message
(
TASK_MME_APP
,
S1AP_UE_CONTEXT_RELEASE_COMMAND
);
AssertFatal
(
message_p
!=
NULL
,
"itti_alloc_new_message Failed"
);
memset
((
void
*
)
&
message_p
->
ittiMsg
.
s1ap_ue_context_release_command
,
0
,
sizeof
(
s1ap_ue_context_release_command_t
));
S1AP_UE_CONTEXT_RELEASE_COMMAND
(
message_p
).
mme_ue_s1ap_id
=
ue_context_p
->
mme_ue_s1ap_id
;
MSC_LOG_TX_MESSAGE
(
MSC_MMEAPP_MME
,
MSC_S1AP_MME
,
NULL
,
0
,
"0 S1AP_UE_CONTEXT_RELEASE_COMMAND mme_ue_s1ap_id %06"
PRIX32
" "
,
S1AP_UE_CONTEXT_RELEASE_COMMAND
(
message_p
).
mme_ue_s1ap_id
);
itti_send_msg_to_task
(
TASK_S1AP
,
INSTANCE_DEFAULT
,
message_p
);
}
else
{
mme_app_send_s11_release_access_bearers_req
(
ue_context_p
);
}
}
...
...
@@ -506,4 +550,6 @@ void mme_app_handle_s1ap_ue_context_release_complete(const s1ap_ue_context_relea
"0 S1AP_DEREGISTER_UE_REQ"
);
itti_send_msg_to_task
(
TASK_NAS_MME
,
INSTANCE_DEFAULT
,
message_p
);
mme_remove_ue_context
(
&
mme_app_desc
.
mme_ue_contexts
,
ue_context_p
);
}
openair-cn/MME_APP/mme_app_ue_context.h
View file @
2d6270a7
...
...
@@ -241,6 +241,13 @@ ue_context_t *mme_ue_context_exists_guti(mme_ue_context_t *mme_ue_context,
int
mme_insert_ue_context
(
mme_ue_context_t
*
mme_ue_context
,
struct
ue_context_s
*
ue_context_p
);
/** \brief Remove a UE context of the tree of known UEs.
* \param ue_context_p The UE context to remove
**/
void
mme_remove_ue_context
(
mme_ue_context_t
*
mme_ue_context
,
struct
ue_context_s
*
ue_context_p
);
/** \brief Allocate memory for a new UE context
* @returns Pointer to the new structure, NULL if allocation failed
**/
...
...
openair-cn/NAS/COMMON/API/NETWORK/as_message.c
View file @
2d6270a7
...
...
@@ -91,8 +91,8 @@ int as_message_decode(const char* buffer, as_message_t* msg, int length)
Byte_t
**
data
=
NULL
;
/* Get the message type */
msg
->
msgID
=
*
(
UI
nt16_t
*
)(
buffer
);
bytes
=
sizeof
(
UI
nt16_t
);
msg
->
msgID
=
*
(
ui
nt16_t
*
)(
buffer
);
bytes
=
sizeof
(
ui
nt16_t
);
switch
(
msg
->
msgID
)
{
case
AS_NAS_ESTABLISH_REQ
:
...
...
openair-cn/NAS/COMMON/API/NETWORK/l2_message.h
View file @
2d6270a7
...
...
@@ -204,13 +204,13 @@ typedef struct {} paging_ind_t;
/* Structure of the SAE Temporary Mobile Subscriber Identity */
typedef
struct
{
UI
nt8_t
MMEcode
;
/* MME code that allocated the GUTI */
UI
nt32_t
m_tmsi
;
/* M-Temporary Mobile Subscriber Identity */
ui
nt8_t
MMEcode
;
/* MME code that allocated the GUTI */
ui
nt32_t
m_tmsi
;
/* M-Temporary Mobile Subscriber Identity */
}
as_stmsi_t
;
/* Structure of the dedicated NAS information */
typedef
struct
{
UI
nt32_t
length
;
/* Length of the NAS information data */
ui
nt32_t
length
;
/* Length of the NAS information data */
Byte_t
*
data
;
/* Dedicated NAS information data container */
}
as_nas_info_t
;
...
...
@@ -220,8 +220,8 @@ typedef struct {
* to transfer initial NAS message to the network while UE is in IDLE mode.
*/
typedef
struct
{
UI
nt8_t
cause
;
/* Connection establishment cause */
UI
nt8_t
type
;
/* Associated call type */
ui
nt8_t
cause
;
/* Connection establishment cause */
ui
nt8_t
type
;
/* Associated call type */
plmn_t
plmnID
;
/* Identifier of the selected PLMN */
as_stmsi_t
s_tmsi
;
/* SAE Temporary Mobile Subscriber Identity */
as_nas_info_t
initialNasMsg
;
/* Initial NAS message to transfer */
...
...
@@ -274,7 +274,7 @@ typedef as_nas_info_t ul_info_transfer_t;
* --------------------------------------------------------------------------
*/
typedef
struct
{
UI
nt16_t
msgID
;
ui
nt16_t
msgID
;
union
{
cell_info_req_t
cell_info_req
;
cell_info_rsp_t
cell_info_rsp
;
...
...
openair-cn/NAS/COMMON/API/NETWORK/nas_message.c
View file @
2d6270a7
...
...
@@ -97,9 +97,9 @@ static int _nas_message_protected_encode(
static
int
_nas_message_decrypt
(
char
*
dest
,
const
char
*
src
,
UI
nt8_t
type
,
UI
nt32_t
code
,
UI
nt8_t
seq
,
ui
nt8_t
type
,
ui
nt32_t
code
,
ui
nt8_t
seq
,
int
length
,
const
emm_security_context_t
*
const
emm_security_context
);
...
...
@@ -108,15 +108,15 @@ static int
_nas_message_encrypt
(
char
*
dest
,
const
char
*
src
,
UI
nt8_t
type
,
UI
nt32_t
code
,
UI
nt8_t
seq
,
ui
nt8_t
type
,
ui
nt32_t
code
,
ui
nt8_t
seq
,
int
const
direction
,
int
length
,
const
emm_security_context_t
*
const
emm_security_context
);
/* Functions used for integrity protection of layer 3 NAS messages */
static
UI
nt32_t
_nas_message_get_mac
(
static
ui
nt32_t
_nas_message_get_mac
(
const
char
*
const
buffer
,
int
const
length
,
int
const
direction
,
...
...
@@ -180,9 +180,9 @@ nas_message_encrypt(
/* Integrity protected the NAS message */
if
(
bytes
>
0
)
{
/* Compute offset of the sequence number field */
int
offset
=
size
-
sizeof
(
UI
nt8_t
);
int
offset
=
size
-
sizeof
(
ui
nt8_t
);
/* Compute the NAS message authentication code */
UI
nt32_t
mac
=
_nas_message_get_mac
(
ui
nt32_t
mac
=
_nas_message_get_mac
(
outbuf
+
offset
,
bytes
+
size
-
offset
,
#ifdef NAS_MME
...
...
@@ -192,7 +192,7 @@ nas_message_encrypt(
#endif
emm_security_context
);
/* Set the message authentication code of the NAS message */
*
(
UI
nt32_t
*
)(
outbuf
+
sizeof
(
UI
nt8_t
))
=
htonl
(
mac
);
*
(
ui
nt32_t
*
)(
outbuf
+
sizeof
(
ui
nt8_t
))
=
htonl
(
mac
);
}
}
else
{
/* The input buffer does not need to be encrypted */
...
...
@@ -301,9 +301,9 @@ int nas_message_decrypt(
}
/* Compute offset of the sequence number field */
int
offset
=
size
-
sizeof
(
UI
nt8_t
);
int
offset
=
size
-
sizeof
(
ui
nt8_t
);
/* Compute the NAS message authentication code */
UI
nt32_t
mac
=
_nas_message_get_mac
(
ui
nt32_t
mac
=
_nas_message_get_mac
(
inbuf
+
offset
,
length
-
offset
,
#ifdef NAS_MME
...
...
@@ -410,9 +410,9 @@ int nas_message_decode(
}
/* Compute offset of the sequence number field */
int
offset
=
size
-
sizeof
(
UI
nt8_t
);
int
offset
=
size
-
sizeof
(
ui
nt8_t
);
/* Compute the NAS message authentication code */
UI
nt32_t
mac
=
_nas_message_get_mac
(
ui
nt32_t
mac
=
_nas_message_get_mac
(
buffer
+
offset
,
length
-
offset
,
#ifdef NAS_MME
...
...
@@ -524,13 +524,13 @@ int nas_message_encode(
/* Integrity protect the NAS message */
if
(
bytes
>
0
)
{
/* Compute offset of the sequence number field */
int
offset
=
size
-
sizeof
(
UI
nt8_t
);
int
offset
=
size
-
sizeof
(
ui
nt8_t
);
/* Compute the NAS message authentication code */
LOG_TRACE
(
DEBUG
,
"offset %d = %d - %d, hdr encode = %d, length = %d bytes = %d"
,
offset
,
size
,
sizeof
(
UI
nt8_t
),
offset
,
size
,
sizeof
(
ui
nt8_t
),
size
,
length
,
bytes
);
UI
nt32_t
mac
=
_nas_message_get_mac
(
ui
nt32_t
mac
=
_nas_message_get_mac
(
buffer
+
offset
,
bytes
+
size
-
offset
,
#ifdef NAS_MME
...
...
@@ -540,7 +540,7 @@ int nas_message_encode(
#endif
emm_security_context
);
/* Set the message authentication code of the NAS message */
*
(
UI
nt32_t
*
)(
buffer
+
sizeof
(
UI
nt8_t
))
=
htonl
(
mac
);
*
(
ui
nt32_t
*
)(
buffer
+
sizeof
(
ui
nt8_t
))
=
htonl
(
mac
);
if
(
emm_security_context
)
{
#ifdef NAS_MME
...
...
@@ -644,7 +644,7 @@ _nas_message_header_decode(
/* Decode the first octet of the header (security header type or EPS bearer
* identity, and protocol discriminator) */
DECODE_U8
(
buffer
,
*
(
UI
nt8_t
*
)(
header
),
size
);
DECODE_U8
(
buffer
,
*
(
ui
nt8_t
*
)(
header
),
size
);
if
(
header
->
protocol_discriminator
==
EPS_MOBILITY_MANAGEMENT_MESSAGE
)
{
if
(
header
->
security_header_type
!=
SECURITY_HEADER_TYPE_NOT_PROTECTED
)
{
...
...
@@ -798,7 +798,7 @@ static int _nas_message_header_encode(
/* Encode the first octet of the header (security header type or EPS bearer
* identity, and protocol discriminator) */
ENCODE_U8
(
buffer
,
*
(
UI
nt8_t
*
)(
header
),
size
);
ENCODE_U8
(
buffer
,
*
(
ui
nt8_t
*
)(
header
),
size
);
if
(
header
->
protocol_discriminator
==
EPS_MOBILITY_MANAGEMENT_MESSAGE
)
{
if
(
header
->
security_header_type
!=
SECURITY_HEADER_TYPE_NOT_PROTECTED
)
{
...
...
@@ -956,9 +956,9 @@ static int _nas_message_protected_encode(
static
int
_nas_message_decrypt
(
char
*
dest
,
const
char
*
src
,
UI
nt8_t
security_header_type
,
UI
nt32_t
code
,
UI
nt8_t
seq
,
ui
nt8_t
security_header_type
,
ui
nt32_t
code
,
ui
nt8_t
seq
,
int
length
,
const
emm_security_context_t
*
const
emm_security_context
)
{
...
...
@@ -986,7 +986,7 @@ static int _nas_message_decrypt(
"No decryption of message length %u according to security header type 0x%02x"
,
length
,
security_header_type
);
memcpy
(
dest
,
src
,
length
);
DECODE_U8
(
dest
,
*
(
UI
nt8_t
*
)(
&
header
),
size
);
DECODE_U8
(
dest
,
*
(
ui
nt8_t
*
)(
&
header
),
size
);
LOG_FUNC_RETURN
(
header
.
protocol_discriminator
);
//LOG_FUNC_RETURN (length);
break
;
...
...
@@ -1022,7 +1022,7 @@ static int _nas_message_decrypt(
nas_stream_encrypt_eea1
(
&
stream_cipher
,
dest
);
/* Decode the first octet (security header type or EPS bearer identity,
* and protocol discriminator) */
DECODE_U8
(
dest
,
*
(
UI
nt8_t
*
)(
&
header
),
size
);
DECODE_U8
(
dest
,
*
(
ui
nt8_t
*
)(
&
header
),
size
);
LOG_FUNC_RETURN
(
header
.
protocol_discriminator
);
...
...
@@ -1056,7 +1056,7 @@ static int _nas_message_decrypt(
nas_stream_encrypt_eea1
(
&
stream_cipher
,
dest
);
/* Decode the first octet (security header type or EPS bearer identity,
* and protocol discriminator) */
DECODE_U8
(
dest
,
*
(
UI
nt8_t
*
)(
&
header
),
size
);
DECODE_U8
(
dest
,
*
(
ui
nt8_t
*
)(
&
header
),
size
);
LOG_FUNC_RETURN
(
header
.
protocol_discriminator
);
}
...
...
@@ -1071,7 +1071,7 @@ static int _nas_message_decrypt(
memcpy
(
dest
,
src
,
length
);
/* Decode the first octet (security header type or EPS bearer identity,
* and protocol discriminator) */
DECODE_U8
(
dest
,
*
(
UI
nt8_t
*
)(
&
header
),
size
);
DECODE_U8
(
dest
,
*
(
ui
nt8_t
*
)(
&
header
),
size
);
LOG_FUNC_RETURN
(
header
.
protocol_discriminator
);
...
...
@@ -1084,7 +1084,7 @@ static int _nas_message_decrypt(
memcpy
(
dest
,
src
,
length
);
/* Decode the first octet (security header type or EPS bearer identity,
* and protocol discriminator) */
DECODE_U8
(
dest
,
*
(
UI
nt8_t
*
)(
&
header
),
size
);
DECODE_U8
(
dest
,
*
(
ui
nt8_t
*
)(
&
header
),
size
);
LOG_FUNC_RETURN
(
header
.
protocol_discriminator
);
break
;
...
...
@@ -1124,9 +1124,9 @@ static int _nas_message_decrypt(
static
int
_nas_message_encrypt
(
char
*
dest
,
const
char
*
src
,
UI
nt8_t
security_header_type
,
UI
nt32_t
code
,
UI
nt8_t
seq
,
ui
nt8_t
security_header_type
,
ui
nt32_t
code
,
ui
nt8_t
seq
,
int
const
direction
,
int
length
,
const
emm_security_context_t
*
const
emm_security_context
)
...
...
@@ -1274,7 +1274,7 @@ static int _nas_message_encrypt(
** Others: None **
** **
***************************************************************************/
static
UI
nt32_t
_nas_message_get_mac
(
static
ui
nt32_t
_nas_message_get_mac
(
const
char
*
const
buffer
,
int
const
length
,
int
const
direction
,
...
...
@@ -1296,10 +1296,10 @@ static UInt32_t _nas_message_get_mac(
switch
(
emm_security_context
->
selected_algorithms
.
integrity
)
{
case
NAS_SECURITY_ALGORITHMS_EIA1
:
{
UI
nt8_t
mac
[
4
];
ui
nt8_t
mac
[
4
];
nas_stream_cipher_t
stream_cipher
;
UI
nt32_t
count
;
UI
nt32_t
*
mac32
;
ui
nt32_t
count
;
ui
nt32_t
*
mac32
;
int
i
,
bytes
=
0
;
...
...
@@ -1354,20 +1354,20 @@ static UInt32_t _nas_message_get_mac(
LOG_TRACE
(
DEBUG
,
"NAS_SECURITY_ALGORITHMS_EIA1 returned MAC %x.%x.%x.%x(%u) for length %d direction %d, count %d"
,
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
*
((
UI
nt32_t
*
)
&
mac
),
*
((
ui
nt32_t
*
)
&
mac
),
length
,
direction
,
count
);
mac32
=
(
UI
nt32_t
*
)
&
mac
;
mac32
=
(
ui
nt32_t
*
)
&
mac
;
LOG_FUNC_RETURN
(
ntohl
(
*
mac32
));
}
break
;
case
NAS_SECURITY_ALGORITHMS_EIA2
:
{
UI
nt8_t
mac
[
4
];
ui
nt8_t
mac
[
4
];
nas_stream_cipher_t
stream_cipher
;
UI
nt32_t
count
;
UI
nt32_t
*
mac32
;
ui
nt32_t
count
;
ui
nt32_t
*
mac32
;
if
(
direction
==
SECU_DIRECTION_UPLINK
)
{
count
=
0x00000000
||
...
...
@@ -1400,11 +1400,11 @@ static UInt32_t _nas_message_get_mac(
LOG_TRACE
(
DEBUG
,
"NAS_SECURITY_ALGORITHMS_EIA2 returned MAC %x.%x.%x.%x(%u) for length %d direction %d, count %d"
,
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
*
((
UI
nt32_t
*
)
&
mac
),
*
((
ui
nt32_t
*
)
&
mac
),
length
,
direction
,
count
);
mac32
=
(
UI
nt32_t
*
)
&
mac
;
mac32
=
(
ui
nt32_t
*
)
&
mac
;
LOG_FUNC_RETURN
(
ntohl
(
*
mac32
));
}
break
;
...
...
openair-cn/NAS/COMMON/API/NETWORK/nas_message.h
View file @
2d6270a7
...
...
@@ -68,14 +68,14 @@ Description Defines the layer 3 messages supported by the NAS sublayer
typedef
struct
{
#ifdef __LITTLE_ENDIAN_BITFIELD
eps_protocol_discriminator_t
protocol_discriminator
:
4
;
UI
nt8_t
security_header_type
:
4
;
ui
nt8_t
security_header_type
:
4
;
#endif
#ifdef __BIG_ENDIAN_BITFIELD
UI
nt8_t
security_header_type
:
4
;
UI
nt8_t
protocol_discriminator
:
4
;
ui
nt8_t
security_header_type
:
4
;
ui
nt8_t
protocol_discriminator
:
4
;
#endif
UI
nt32_t
message_authentication_code
;
UI
nt8_t
sequence_number
;
ui
nt32_t
message_authentication_code
;
ui
nt8_t
sequence_number
;
}
nas_message_security_header_t
;
/* Structure of plain NAS message */
...
...
openair-cn/NAS/MME/API/MME/mme_api.c
View file @
2d6270a7
...
...
@@ -98,19 +98,19 @@ static const plmn_t mme_api_plmn = {0, 2, 0xf, 8, 0, 1}; // 20810
/* Authentication parameter RAND */
static
const
UI
nt8_t
_mme_api_rand
[
AUTH_RAND_SIZE
]
=
{
static
const
ui
nt8_t
_mme_api_rand
[
AUTH_RAND_SIZE
]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x02
,
0x03
,
0x04
};
/* Authentication parameter AUTN */
static
const
UI
nt8_t
_mme_api_autn
[
AUTH_AUTN_SIZE
]
=
{
static
const
ui
nt8_t
_mme_api_autn
[
AUTH_AUTN_SIZE
]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x80
,
0x05
,
0x04
,
0x03
,
0x02
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
/* Authentication response parameter */
static
const
UI
nt8_t
_mme_api_xres
[
AUTH_XRES_SIZE
]
=
{
static
const
ui
nt8_t
_mme_api_xres
[
AUTH_XRES_SIZE
]
=
{
0x67
,
0x70
,
0x3a
,
0x31
,
0xf2
,
0x2a
,
0x2d
,
0x51
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
...
...
openair-cn/NAS/MME/API/MME/mme_api.h
View file @
2d6270a7
...
...
@@ -58,7 +58,7 @@ Description Implements the API used by the NAS layer running in the MME
/****************************************************************************/
/* Maximum number of UEs the MME may simultaneously support */
#define MME_API_NB_UE_MAX
1
#define MME_API_NB_UE_MAX
256
/* Features supported by the MME */
...
...
openair-cn/NAS/MME/EMM/Attach.c
View file @
2d6270a7
...
...
@@ -207,7 +207,7 @@ int emm_proc_attach_request(
int
rc
;
emm_data_context_t
ue_ctx
;
LOG_TRACE
(
INFO
,
"EMM-PROC - EPS attach type = %s (%d) requested (ueid=
0x%08x
)"
,
LOG_TRACE
(
INFO
,
"EMM-PROC - EPS attach type = %s (%d) requested (ueid=
"
NAS_UE_ID_FMT
"
)"
,
_emm_attach_type_str
[
type
],
type
,
ueid
);
LOG_TRACE
(
INFO
,
"EMM-PROC - umts_present = %u umts_present = %u"
,
umts_present
,
gprs_present
);
...
...
@@ -314,6 +314,15 @@ int emm_proc_attach_request(
(
*
emm_ctx
)
->
emm_cause
=
EMM_CAUSE_SUCCESS
;
(
*
emm_ctx
)
->
_emm_fsm_status
=
EMM_INVALID
;
(
*
emm_ctx
)
->
ueid
=
ueid
;
/*
* Initialize EMM timers
*/
(
*
emm_ctx
)
->
T3450
.
id
=
NAS_TIMER_INACTIVE_ID
;
(
*
emm_ctx
)
->
T3450
.
sec
=
T3450_DEFAULT_VALUE
;
(
*
emm_ctx
)
->
T3460
.
id
=
NAS_TIMER_INACTIVE_ID
;
(
*
emm_ctx
)
->
T3460
.
sec
=
T3460_DEFAULT_VALUE
;
(
*
emm_ctx
)
->
T3470
.
id
=
NAS_TIMER_INACTIVE_ID
;
(
*
emm_ctx
)
->
T3470
.
sec
=
T3470_DEFAULT_VALUE
;
emm_fsm_set_status
(
ueid
,
*
emm_ctx
,
EMM_DEREGISTERED
);
#if defined(NAS_BUILT_IN_EPC)
...
...
@@ -324,7 +333,7 @@ int emm_proc_attach_request(
if
(
tai
)
{
LOG_TRACE
(
WARNING
,
"EMM-PROC - Set tac %u in context
%u
"
,
"EMM-PROC - Set tac %u in context"
,
tai
->
tac
);
(
*
emm_ctx
)
->
tac
=
tai
->
tac
;
}
else
{
...
...
@@ -433,11 +442,7 @@ int emm_proc_attach_complete(unsigned int ueid, const OctetString *esm_msg_pP)
LOG_FUNC_IN
;
LOG_TRACE
(
INFO
,
"EMM-PROC - EPS attach complete (ueid=%u)"
,
ueid
);
/* Stop timer T3450 */
LOG_TRACE
(
INFO
,
"EMM-PROC - Stop timer T3450 (%d)"
,
T3450
.
id
);
T3450
.
id
=
nas_timer_stop
(
T3450
.
id
);
LOG_TRACE
(
INFO
,
"EMM-PROC - EPS attach complete (ueid="
NAS_UE_ID_FMT
")"
,
ueid
);
/* Release retransmission timer parameters */
attach_data_t
*
data
=
(
attach_data_t
*
)(
emm_proc_common_get_args
(
ueid
));
...
...
@@ -446,28 +451,27 @@ int emm_proc_attach_complete(unsigned int ueid, const OctetString *esm_msg_pP)
if
(
data
->
esm_msg
.
length
>
0
)
{
free
(
data
->
esm_msg
.
value
);
}
free
(
data
);
}
/* Get the UE context */
#if defined(NAS_BUILT_IN_EPC)
if
(
ueid
>
0
)
{
emm_ctx
=
emm_data_context_get
(
&
_emm_data
,
ueid
);
}
#else
if
(
ueid
<
EMM_DATA_NB_UE_MAX
)
{
emm_ctx
=
_emm_data
.
ctx
[
ueid
];
}
#endif
if
(
emm_ctx
)
{
/* Delete the old GUTI and consider the GUTI sent in the Attach
/* Stop timer T3450 */
LOG_TRACE
(
INFO
,
"EMM-PROC - Stop timer T3450 (%d)"
,
emm_ctx
->
T3450
.
id
);
emm_ctx
->
T3450
.
id
=
nas_timer_stop
(
emm_ctx
->
T3450
.
id
);
MSC_LOG_EVENT
(
MSC_NAS_EMM_MME
,
"0 T3450 stopped UE "
NAS_UE_ID_FMT
" "
,
ueid
);
/* Delete the old GUTI and consider the GUTI sent in the Attach
* Accept message as valid */
emm_ctx
->
guti_is_new
=
FALSE
;
emm_ctx
->
old_guti
=
NULL
;
...
...
@@ -612,7 +616,7 @@ static int _emm_attach_release(void *args)
emm_data_context_t
*
emm_ctx
=
(
emm_data_context_t
*
)(
args
);
if
(
emm_ctx
)
{
LOG_TRACE
(
WARNING
,
"EMM-PROC - Release UE context data (ueid=
%u
)"
,
LOG_TRACE
(
WARNING
,
"EMM-PROC - Release UE context data (ueid=
"
NAS_UE_ID_FMT
"
)"
,
emm_ctx
->
ueid
);
unsigned
int
ueid
=
emm_ctx
->
ueid
;
...
...
@@ -663,6 +667,25 @@ static int _emm_attach_release(void *args)
emm_ctx
->
security
=
NULL
;
}
/* Stop timer T3450 */
if
(
emm_ctx
->
T3450
.
id
!=
NAS_TIMER_INACTIVE_ID
)
{
LOG_TRACE
(
INFO
,
"EMM-PROC - Stop timer T3450 (%d)"
,
emm_ctx
->
T3450
.
id
);
emm_ctx
->
T3450
.
id
=
nas_timer_stop
(
emm_ctx
->
T3450
.
id
);
MSC_LOG_EVENT
(
MSC_NAS_EMM_MME
,
"0 T3450 stopped UE "
NAS_UE_ID_FMT
" "
,
emm_ctx
->
ueid
);
}
/* Stop timer T3460 */
if
(
emm_ctx
->
T3460
.
id
!=
NAS_TIMER_INACTIVE_ID
)
{
LOG_TRACE
(
INFO
,
"EMM-PROC - Stop timer T3460 (%d)"
,
emm_ctx
->
T3460
.
id
);
emm_ctx
->
T3460
.
id
=
nas_timer_stop
(
emm_ctx
->
T3460
.
id
);
MSC_LOG_EVENT
(
MSC_NAS_EMM_MME
,
"0 T3460 stopped UE "
NAS_UE_ID_FMT
" "
,
emm_ctx
->
ueid
);
}
/* Stop timer T3470 */
if
(
emm_ctx
->
T3470
.
id
!=
NAS_TIMER_INACTIVE_ID
)
{
LOG_TRACE
(
INFO
,
"EMM-PROC - Stop timer T3470 (%d)"
,
emm_ctx
->
T3460
.
id
);
emm_ctx
->
T3470
.
id
=
nas_timer_stop
(
emm_ctx
->
T3470
.
id
);
MSC_LOG_EVENT
(
MSC_NAS_EMM_MME
,
"0 T3470 stopped UE "
NAS_UE_ID_FMT
" "
,
emm_ctx
->
ueid
);
}
/* Release the EMM context */
#if defined(NAS_BUILT_IN_EPC)
emm_data_context_remove
(
&
_emm_data
,
emm_ctx
);
...
...
@@ -713,7 +736,7 @@ static int _emm_attach_reject(void *args)
if
(
emm_ctx
)
{
emm_sap_t
emm_sap
;
LOG_TRACE
(
WARNING
,
"EMM-PROC - EMM attach procedure not accepted "
"by the network (ueid=
%08x
, cause=%d)"
,
"by the network (ueid=
"
NAS_UE_ID_FMT
"
, cause=%d)"
,
emm_ctx
->
ueid
,
emm_ctx
->
emm_cause
);
/*
* Notify EMM-AS SAP that Attach Reject message has to be sent
...
...
@@ -783,13 +806,20 @@ static int _emm_attach_abort(void *args)
unsigned
int
ueid
=
data
->
ueid
;
esm_sap_t
esm_sap
;
LOG_TRACE
(
WARNING
,
"EMM-PROC - Abort the attach procedure (ueid=
%u
)"
,
LOG_TRACE
(
WARNING
,
"EMM-PROC - Abort the attach procedure (ueid=
"
NAS_UE_ID_FMT
"
)"
,
ueid
);