Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
OpenXG UE
Commits
be2fbc20
Commit
be2fbc20
authored
Feb 15, 2019
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: astyle trying to help merge
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
b7ef2a53
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1231 additions
and
1182 deletions
+1231
-1182
openair3/S1AP/s1ap_eNB_handlers.c
openair3/S1AP/s1ap_eNB_handlers.c
+1231
-1182
No files found.
openair3/S1AP/s1ap_eNB_handlers.c
View file @
be2fbc20
...
...
@@ -261,6 +261,7 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_S1SetupFailureIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_Cause
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
if
((
ie
->
value
.
choice
.
Cause
.
present
==
S1AP_Cause_PR_misc
)
&&
(
ie
->
value
.
choice
.
Cause
.
choice
.
misc
==
S1AP_CauseMisc_unspecified
))
{
...
...
@@ -271,6 +272,7 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
}
else
{
return
-
1
;
}
mme_desc_p
->
state
=
S1AP_ENB_STATE_WAITING
;
s1ap_handle_s1_setup_message
(
mme_desc_p
,
0
);
return
0
;
...
...
@@ -302,6 +304,7 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_S1SetupResponseIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_ServedGUMMEIs
,
true
);
/* The list of served gummei can contain at most 8 elements.
* LTE related gummei is the first element in the list, i.e with an id of 0.
*/
...
...
@@ -357,14 +360,17 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
}
else
{
return
-
1
;
}
/* Set the capacity of this MME */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_S1SetupResponseIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_RelativeMMECapacity
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
mme_desc_p
->
relative_mme_capacity
=
ie
->
value
.
choice
.
RelativeMMECapacity
;
}
else
{
return
-
1
;
}
/* Optionaly set the mme name */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_S1SetupResponseIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_MMEname
,
false
);
...
...
@@ -408,6 +414,7 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
"MME context
\n
"
,
assoc_id
);
return
-
1
;
}
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_ErrorIndicationIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID
,
false
);
...
...
@@ -752,16 +759,20 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
/* id-MME-UE-S1AP-ID */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_InitialContextSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
mme_ue_s1ap_id
=
ie
->
value
.
choice
.
MME_UE_S1AP_ID
;
}
else
{
return
-
1
;
}
/* id-eNB-UE-S1AP-ID */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_InitialContextSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
enb_ue_s1ap_id
=
ie
->
value
.
choice
.
ENB_UE_S1AP_ID
;
if
((
ue_desc_p
=
s1ap_eNB_get_ue_context
(
mme_desc_p
->
s1ap_eNB_instance
,
enb_ue_s1ap_id
))
==
NULL
)
{
S1AP_ERROR
(
"[SCTP %d] Received initial context setup request for non "
...
...
@@ -789,6 +800,7 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
/* id-uEaggregateMaximumBitrate */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_InitialContextSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_uEaggregateMaximumBitrate
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
asn_INTEGER2ulong
(
&
(
ie
->
value
.
choice
.
UEAggregateMaximumBitrate
.
uEaggregateMaximumBitRateUL
),
&
(
S1AP_INITIAL_CONTEXT_SETUP_REQ
(
message_p
).
ue_ambr
.
br_ul
));
...
...
@@ -798,8 +810,10 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
}
else
{
return
-
1
;
}
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_InitialContextSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_E_RABToBeSetupListCtxtSUReq
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
S1AP_INITIAL_CONTEXT_SETUP_REQ
(
message_p
).
nb_of_e_rabs
=
ie
->
value
.
choice
.
E_RABToBeSetupListCtxtSUReq
.
list
.
count
;
...
...
@@ -841,9 +855,11 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
}
else
{
/* ie != NULL */
return
-
1
;
}
/* id-UESecurityCapabilities */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_InitialContextSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_UESecurityCapabilities
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
S1AP_INITIAL_CONTEXT_SETUP_REQ
(
message_p
).
security_capabilities
.
encryption_algorithms
=
BIT_STRING_to_uint16
(
&
ie
->
value
.
choice
.
UESecurityCapabilities
.
encryptionAlgorithms
);
...
...
@@ -853,8 +869,10 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
}
else
{
/* ie != NULL */
return
-
1
;
}
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_InitialContextSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_SecurityKey
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
memcpy
(
&
S1AP_INITIAL_CONTEXT_SETUP_REQ
(
message_p
).
security_key
,
ie
->
value
.
choice
.
SecurityKey
.
buf
,
ie
->
value
.
choice
.
SecurityKey
.
size
);
...
...
@@ -862,6 +880,7 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
}
else
{
/* ie != NULL */
return
-
1
;
}
return
0
;
}
...
...
@@ -888,6 +907,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_UEContextReleaseCommand_IEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_UE_S1AP_IDs
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
switch
(
ie
->
value
.
choice
.
UE_S1AP_IDs
.
present
)
{
case
S1AP_UE_S1AP_IDs_PR_uE_S1AP_ID_pair
:
...
...
@@ -944,6 +964,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
}
else
{
return
-
1
;
}
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_UEContextReleaseCommand_IEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_Cause
,
true
);
/* TBD */
...
...
@@ -973,19 +994,23 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
/* id-MME-UE-S1AP-ID */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
mme_ue_s1ap_id
=
ie
->
value
.
choice
.
MME_UE_S1AP_ID
;
}
else
{
return
-
1
;
}
/* id-eNB-UE-S1AP-ID */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
enb_ue_s1ap_id
=
ie
->
value
.
choice
.
ENB_UE_S1AP_ID
;
}
else
{
return
-
1
;
}
if
((
ue_desc_p
=
s1ap_eNB_get_ue_context
(
mme_desc_p
->
s1ap_eNB_instance
,
enb_ue_s1ap_id
))
==
NULL
)
{
S1AP_ERROR
(
"[SCTP %d] Received initial context setup request for non "
...
...
@@ -1014,6 +1039,7 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
S1AP_E_RAB_SETUP_REQ
(
message_p
).
eNB_ue_s1ap_id
=
enb_ue_s1ap_id
;
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_E_RABToBeSetupListBearerSUReq
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
S1AP_E_RAB_SETUP_REQ
(
message_p
).
nb_e_rabs_tosetup
=
ie
->
value
.
choice
.
E_RABToBeSetupListBearerSUReq
.
list
.
count
;
...
...
@@ -1057,10 +1083,12 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
S1AP_E_RAB_SETUP_REQ
(
message_p
).
e_rab_setup_params
[
i
].
qos
.
allocation_retention_priority
.
pre_emp_vulnerability
=
item_p
->
e_RABlevelQoSParameters
.
allocationRetentionPriority
.
pre_emptionVulnerability
;
}
/* for i... */
itti_send_msg_to_task
(
TASK_RRC_ENB
,
ue_desc_p
->
eNB_instance
->
instance
,
message_p
);
}
else
{
return
-
1
;
}
return
0
;
}
...
...
@@ -1104,6 +1132,7 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
/* id-UEIdentityIndexValue : convert UE Identity Index value */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PagingIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_UEIdentityIndexValue
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
S1AP_PAGING_IND
(
message_p
).
ue_index_value
=
BIT_STRING_to_uint32
(
&
ie
->
value
.
choice
.
UEIdentityIndexValue
);
S1AP_DEBUG
(
"[SCTP %d] Received Paging ue_index_value (%d)
\n
"
,
...
...
@@ -1113,9 +1142,11 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
}
else
{
return
-
1
;
}
/* id-UEPagingID */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PagingIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_UEPagingID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
/* convert UE Paging Identity */
if
(
ie
->
value
.
choice
.
UEPagingID
.
present
==
S1AP_UEPagingID_PR_s_TMSI
)
{
...
...
@@ -1172,6 +1203,7 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
/* */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PagingIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_CNDomain
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
/* id-CNDomain : convert cnDomain */
if
(
ie
->
value
.
choice
.
CNDomain
==
S1AP_CNDomain_ps
)
{
...
...
@@ -1186,14 +1218,17 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
}
else
{
return
-
1
;
}
memset
(
&
S1AP_PAGING_IND
(
message_p
).
plmn_identity
[
0
],
0
,
sizeof
(
plmn_identity_t
)
*
256
);
memset
(
&
S1AP_PAGING_IND
(
message_p
).
tac
[
0
],
0
,
sizeof
(
int16_t
)
*
256
);
S1AP_PAGING_IND
(
message_p
).
tai_size
=
0
;
/* id-TAIList */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PagingIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_TAIList
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
S1AP_INFO
(
"[SCTP %d] Received Paging taiList: count %d
\n
"
,
assoc_id
,
ie
->
value
.
choice
.
TAIList
.
list
.
count
);
for
(
int
i
=
0
;
i
<
ie
->
value
.
choice
.
TAIList
.
list
.
count
;
i
++
)
{
S1AP_TAIItem_t
*
item_p
;
item_p
=
&
(((
S1AP_TAIItemIEs_t
*
)
ie
->
value
.
choice
.
TAIList
.
list
.
array
[
i
])
->
value
.
choice
.
TAIItem
);
...
...
@@ -1250,19 +1285,23 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
/* id-MME-UE-S1AP-ID */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABModifyRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
mme_ue_s1ap_id
=
ie
->
value
.
choice
.
MME_UE_S1AP_ID
;
}
else
{
return
-
1
;
}
/* id-eNB-UE-S1AP-ID */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABModifyRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
enb_ue_s1ap_id
=
ie
->
value
.
choice
.
ENB_UE_S1AP_ID
;
}
else
{
return
-
1
;
}
if
((
ue_desc_p
=
s1ap_eNB_get_ue_context
(
mme_desc_p
->
s1ap_eNB_instance
,
enb_ue_s1ap_id
))
==
NULL
)
{
S1AP_ERROR
(
"[SCTP %d] Received E-RAB modify request for non "
...
...
@@ -1287,6 +1326,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
S1AP_E_RAB_MODIFY_RESP
(
message_p
).
eNB_ue_s1ap_id
=
enb_ue_s1ap_id
;
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABModifyRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_E_RABToBeModifiedListBearerModReq
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
for
(
nb_of_e_rabs_failed
=
0
;
nb_of_e_rabs_failed
<
ie
->
value
.
choice
.
E_RABToBeModifiedListBearerModReq
.
list
.
count
;
nb_of_e_rabs_failed
++
)
{
S1AP_E_RABToBeModifiedItemBearerModReq_t
*
item_p
;
...
...
@@ -1299,6 +1339,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
}
else
{
return
-
1
;
}
S1AP_E_RAB_MODIFY_RESP
(
message_p
).
nb_of_e_rabs_failed
=
nb_of_e_rabs_failed
;
s1ap_eNB_e_rab_modify_resp
(
mme_desc_p
->
s1ap_eNB_instance
->
instance
,
&
S1AP_E_RAB_MODIFY_RESP
(
message_p
));
...
...
@@ -1313,6 +1354,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
/* id-E-RABToBeModifiedListBearerModReq */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABModifyRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_E_RABToBeModifiedListBearerModReq
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
S1AP_E_RAB_MODIFY_REQ
(
message_p
).
nb_e_rabs_tomodify
=
ie
->
value
.
choice
.
E_RABToBeModifiedListBearerModReq
.
list
.
count
;
...
...
@@ -1348,6 +1390,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
}
else
{
/* of if (ie != NULL)*/
return
-
1
;
}
return
0
;
}
// handle e-rab release command and send it to rrc_end
...
...
@@ -1374,19 +1417,23 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
/* id-MME-UE-S1AP-ID */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABReleaseCommandIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
mme_ue_s1ap_id
=
ie
->
value
.
choice
.
MME_UE_S1AP_ID
;
}
else
{
return
-
1
;
}
/* id-eNB-UE-S1AP-ID */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABReleaseCommandIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
enb_ue_s1ap_id
=
ie
->
value
.
choice
.
ENB_UE_S1AP_ID
;
}
else
{
return
-
1
;
}
if
((
ue_desc_p
=
s1ap_eNB_get_ue_context
(
mme_desc_p
->
s1ap_eNB_instance
,
enb_ue_s1ap_id
))
==
NULL
)
{
S1AP_ERROR
(
"[SCTP %d] Received E-RAB release command for non existing UE context 0x%06lx
\n
"
,
assoc_id
,
...
...
@@ -1432,6 +1479,7 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
/* id-E-RABToBeReleasedList */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_E_RABReleaseCommandIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_E_RABToBeReleasedList
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
S1AP_E_RAB_RELEASE_COMMAND
(
message_p
).
nb_e_rabs_torelease
=
ie
->
value
.
choice
.
E_RABList
.
list
.
count
;
...
...
@@ -1444,6 +1492,7 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
}
else
{
return
-
1
;
}
itti_send_msg_to_task
(
TASK_RRC_ENB
,
ue_desc_p
->
eNB_instance
->
instance
,
message_p
);
return
0
;
}
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