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
canghaiwuhen
OpenXG-RAN
Commits
9b143e9a
Commit
9b143e9a
authored
Feb 15, 2019
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: astyle to help merge
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
ee3b6509
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
75 deletions
+49
-75
openair3/S1AP/s1ap_eNB_handlers.c
openair3/S1AP/s1ap_eNB_handlers.c
+49
-75
No files found.
openair3/S1AP/s1ap_eNB_handlers.c
View file @
9b143e9a
...
...
@@ -781,9 +781,7 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
S1AP_INITIAL_CONTEXT_SETUP_REQ
(
message_p
).
ue_initial_id
=
ue_desc_p
->
ue_initial_id
;
ue_desc_p
->
ue_initial_id
=
0
;
S1AP_INITIAL_CONTEXT_SETUP_REQ
(
message_p
).
eNB_ue_s1ap_id
=
ue_desc_p
->
eNB_ue_s1ap_id
;
S1AP_INITIAL_CONTEXT_SETUP_REQ
(
message_p
).
mme_ue_s1ap_id
=
ue_desc_p
->
mme_ue_s1ap_id
;
/* id-uEaggregateMaximumBitrate */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_InitialContextSetupRequestIEs_t
,
ie
,
container
,
S1AP_ProtocolIE_ID_id_uEaggregateMaximumBitrate
,
true
);
...
...
@@ -1388,25 +1386,19 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
static
int
s1ap_eNB_handle_s1_path_switch_request_ack
(
uint32_t
assoc_id
,
uint32_t
stream
,
S1AP_S1AP_PDU_t
*
pdu
)
{
S1AP_S1AP_PDU_t
*
pdu
)
{
s1ap_eNB_mme_data_t
*
mme_desc_p
=
NULL
;
s1ap_eNB_ue_context_t
*
ue_desc_p
=
NULL
;
MessageDef
*
message_p
=
NULL
;
S1AP_PathSwitchRequestAcknowledge_t
*
pathSwitchRequestAcknowledge
;
S1AP_PathSwitchRequestAcknowledgeIEs_t
*
ie
;
S1AP_E_RABToBeSwitchedULItemIEs_t
*
s1ap_E_RABToBeSwitchedULItemIEs
;
S1AP_E_RABToBeSwitchedULItem_t
*
s1ap_E_RABToBeSwitchedULItem
;
S1AP_E_RABItemIEs_t
*
e_RABItemIEs
;
S1AP_E_RABItem_t
*
e_RABItem
;
DevAssert
(
pdu
!=
NULL
);
pathSwitchRequestAcknowledge
=
&
pdu
->
choice
.
successfulOutcome
.
value
.
choice
.
PathSwitchRequestAcknowledge
;
/* Path Switch request == UE-related procedure -> stream !=0 */
if
(
stream
==
0
)
{
S1AP_ERROR
(
"[SCTP %d] Received s1 path switch request ack on stream (%d)
\n
"
,
...
...
@@ -1422,11 +1414,9 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
// send a message to RRC
message_p
=
itti_alloc_new_message
(
TASK_S1AP
,
S1AP_PATH_SWITCH_REQ_ACK
);
/* mandatory */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PathSwitchRequestAcknowledgeIEs_t
,
ie
,
pathSwitchRequestAcknowledge
,
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID
,
true
);
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
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
,
...
...
@@ -1438,36 +1428,29 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
}
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
ue_initial_id
=
ue_desc_p
->
ue_initial_id
;
/* mandatory */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PathSwitchRequestAcknowledgeIEs_t
,
ie
,
pathSwitchRequestAcknowledge
,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID
,
true
);
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
mme_ue_s1ap_id
=
ie
->
value
.
choice
.
MME_UE_S1AP_ID
;
if
(
ue_desc_p
->
mme_ue_s1ap_id
!=
ie
->
value
.
choice
.
MME_UE_S1AP_ID
){
if
(
ue_desc_p
->
mme_ue_s1ap_id
!=
ie
->
value
.
choice
.
MME_UE_S1AP_ID
)
{
S1AP_WARN
(
"UE context mme_ue_s1ap_id is different form that of the message (%d != %ld)"
,
ue_desc_p
->
mme_ue_s1ap_id
,
ie
->
value
.
choice
.
MME_UE_S1AP_ID
);
}
/* mandatory */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PathSwitchRequestAcknowledgeIEs_t
,
ie
,
pathSwitchRequestAcknowledge
,
S1AP_ProtocolIE_ID_id_SecurityContext
,
true
);
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
next_hop_chain_count
=
ie
->
value
.
choice
.
SecurityContext
.
nextHopChainingCount
;
memcpy
(
&
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
next_security_key
,
ie
->
value
.
choice
.
SecurityContext
.
nextHopParameter
.
buf
,
ie
->
value
.
choice
.
SecurityContext
.
nextHopParameter
.
size
);
/* optional */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PathSwitchRequestAcknowledgeIEs_t
,
ie
,
pathSwitchRequestAcknowledge
,
S1AP_ProtocolIE_ID_id_uEaggregateMaximumBitrate
,
false
);
if
(
ie
)
{
OCTET_STRING_TO_INT32
(
&
ie
->
value
.
choice
.
UEAggregateMaximumBitrate
.
uEaggregateMaximumBitRateUL
,
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
ue_ambr
.
br_ul
...
...
@@ -1478,7 +1461,6 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
);
}
else
{
S1AP_WARN
(
"UEAggregateMaximumBitrate not supported
\n
"
);
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
ue_ambr
.
br_ul
=
0
;
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
ue_ambr
.
br_dl
=
0
;
}
...
...
@@ -1488,24 +1470,20 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
S1AP_ProtocolIE_ID_id_E_RABToBeSwitchedULList
,
false
);
if
(
ie
)
{
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
nb_e_rabs_tobeswitched
=
ie
->
value
.
choice
.
E_RABToBeSwitchedULList
.
list
.
count
;
for
(
int
i
=
0
;
i
<
ie
->
value
.
choice
.
E_RABToBeSwitchedULList
.
list
.
count
;
i
++
)
{
s1ap_E_RABToBeSwitchedULItemIEs
=
(
S1AP_E_RABToBeSwitchedULItemIEs_t
*
)
ie
->
value
.
choice
.
E_RABToBeSwitchedULList
.
list
.
array
[
i
];
s1ap_E_RABToBeSwitchedULItem
=
&
s1ap_E_RABToBeSwitchedULItemIEs
->
value
.
choice
.
E_RABToBeSwitchedULItem
;
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
e_rabs_tobeswitched
[
i
].
e_rab_id
=
s1ap_E_RABToBeSwitchedULItem
->
e_RAB_ID
;
memcpy
(
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
e_rabs_tobeswitched
[
i
].
sgw_addr
.
buffer
,
s1ap_E_RABToBeSwitchedULItem
->
transportLayerAddress
.
buf
,
s1ap_E_RABToBeSwitchedULItem
->
transportLayerAddress
.
size
);
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
e_rabs_tobeswitched
[
i
].
sgw_addr
.
length
=
s1ap_E_RABToBeSwitchedULItem
->
transportLayerAddress
.
size
*
8
-
s1ap_E_RABToBeSwitchedULItem
->
transportLayerAddress
.
bits_unused
;
OCTET_STRING_TO_INT32
(
&
s1ap_E_RABToBeSwitchedULItem
->
gTP_TEID
,
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
e_rabs_tobeswitched
[
i
].
gtp_teid
);
}
}
else
{
}
else
{
S1AP_WARN
(
"E_RABToBeSwitchedULList not supported
\n
"
);
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
nb_e_rabs_tobeswitched
=
0
;
}
...
...
@@ -1515,17 +1493,14 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
S1AP_ProtocolIE_ID_id_E_RABToBeReleasedList
,
false
);
if
(
ie
)
{
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
nb_e_rabs_tobereleased
=
ie
->
value
.
choice
.
E_RABList
.
list
.
count
;
for
(
int
i
=
0
;
i
<
ie
->
value
.
choice
.
E_RABList
.
list
.
count
;
i
++
)
{
e_RABItemIEs
=
(
S1AP_E_RABItemIEs_t
*
)
ie
->
value
.
choice
.
E_RABList
.
list
.
array
[
i
];
e_RABItem
=
&
e_RABItemIEs
->
value
.
choice
.
E_RABItem
;
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
e_rabs_tobereleased
[
i
].
e_rab_id
=
e_RABItem
->
e_RAB_ID
;
}
}
else
{
}
else
{
S1AP_WARN
(
"E_RABToBeReleasedList not supported
\n
"
);
S1AP_PATH_SWITCH_REQ_ACK
(
message_p
).
nb_e_rabs_tobereleased
=
0
;
}
...
...
@@ -1533,6 +1508,7 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
/* optional */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PathSwitchRequestAcknowledgeIEs_t
,
ie
,
pathSwitchRequestAcknowledge
,
S1AP_ProtocolIE_ID_id_CriticalityDiagnostics
,
false
);
if
(
!
ie
)
{
S1AP_WARN
(
"Critical Diagnostic not supported
\n
"
);
}
...
...
@@ -1540,30 +1516,24 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
/* optional */
S1AP_FIND_PROTOCOLIE_BY_ID
(
S1AP_PathSwitchRequestAcknowledgeIEs_t
,
ie
,
pathSwitchRequestAcknowledge
,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID_2
,
false
);
if
(
!
ie
)
{
S1AP_WARN
(
"MME_UE_S1AP_ID_2 flag not supported
\n
"
);
}
// TODO continue
itti_send_msg_to_task
(
TASK_RRC_ENB
,
ue_desc_p
->
eNB_instance
->
instance
,
message_p
);
return
0
;
}
static
int
s1ap_eNB_handle_s1_path_switch_request_failure
(
uint32_t
assoc_id
,
uint32_t
stream
,
S1AP_S1AP_PDU_t
*
pdu
)
{
S1AP_S1AP_PDU_t
*
pdu
)
{
s1ap_eNB_mme_data_t
*
mme_desc_p
=
NULL
;
S1AP_PathSwitchRequestFailure_t
*
pathSwitchRequestFailure
;
S1AP_PathSwitchRequestFailureIEs_t
*
ie
;
DevAssert
(
pdu
!=
NULL
);
pathSwitchRequestFailure
=
&
pdu
->
choice
.
unsuccessfulOutcome
.
value
.
choice
.
PathSwitchRequestFailure
;
if
(
stream
!=
0
)
{
...
...
@@ -1585,18 +1555,23 @@ int s1ap_eNB_handle_s1_path_switch_request_failure(uint32_t assoc_
case
S1AP_Cause_PR_NOTHING
:
S1AP_WARN
(
"Received S1 Error indication cause NOTHING
\n
"
);
break
;
case
S1AP_Cause_PR_radioNetwork
:
S1AP_WARN
(
"Radio Network Layer Cause Failure
\n
"
);
break
;
case
S1AP_Cause_PR_transport
:
S1AP_WARN
(
"Transport Layer Cause Failure
\n
"
);
break
;
case
S1AP_Cause_PR_nas
:
S1AP_WARN
(
"NAS Cause Failure
\n
"
);
break
;
case
S1AP_Cause_PR_misc
:
S1AP_WARN
(
"Miscelaneous Cause Failure
\n
"
);
break
;
default:
S1AP_WARN
(
"Received an unknown S1 Error indication cause
\n
"
);
break
;
...
...
@@ -1608,8 +1583,7 @@ int s1ap_eNB_handle_s1_path_switch_request_failure(uint32_t assoc_
if
(
!
ie
)
{
S1AP_WARN
(
"Critical Diagnostic not supported
\n
"
);
}
// TODO continue
// TODO continue
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