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
Michael Black
OpenXG UE
Commits
c74ff9e3
Commit
c74ff9e3
authored
Nov 19, 2015
by
Navid Nikaein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protocol implementation for dedicated E-RABSetup.
Test of dedicated bearer setup in both control and data plane.
parent
2033357e
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
339 additions
and
151 deletions
+339
-151
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+3
-1
openair2/COMMON/s1ap_messages_def.h
openair2/COMMON/s1ap_messages_def.h
+2
-0
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+4
-4
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+1
-1
openair2/RRC/LITE/rrc_eNB.c
openair2/RRC/LITE/rrc_eNB.c
+24
-14
openair2/RRC/LITE/rrc_eNB_GTPV1U.c
openair2/RRC/LITE/rrc_eNB_GTPV1U.c
+11
-6
openair2/RRC/LITE/rrc_eNB_S1AP.c
openair2/RRC/LITE/rrc_eNB_S1AP.c
+128
-101
openair3/S1AP/s1ap_common.c
openair3/S1AP/s1ap_common.c
+3
-2
openair3/S1AP/s1ap_eNB.c
openair3/S1AP/s1ap_eNB.c
+9
-0
openair3/S1AP/s1ap_eNB_context_management_procedures.c
openair3/S1AP/s1ap_eNB_context_management_procedures.c
+8
-1
openair3/S1AP/s1ap_eNB_decoder.c
openair3/S1AP/s1ap_eNB_decoder.c
+20
-5
openair3/S1AP/s1ap_eNB_encoder.c
openair3/S1AP/s1ap_eNB_encoder.c
+46
-3
openair3/S1AP/s1ap_eNB_handlers.c
openair3/S1AP/s1ap_eNB_handlers.c
+8
-2
openair3/S1AP/s1ap_eNB_nas_procedures.c
openair3/S1AP/s1ap_eNB_nas_procedures.c
+72
-11
No files found.
cmake_targets/CMakeLists.txt
View file @
c74ff9e3
...
...
@@ -42,6 +42,8 @@ set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
project
(
OpenAirInterface
)
#add_definitions("-DEMIT_ASN_DEBUG=1")
###########################################
# macros to define options as there is numerous options in oai
################################################
...
...
@@ -196,7 +198,7 @@ add_definitions("-DPACKAGE_BUGREPORT=\"OpenAirInterface web site\"")
add_boolean_option
(
MSG_PRINT False
"print debug messages"
)
add_boolean_option
(
DISABLE_XER_PRINT False
"print XER Format"
)
add_boolean_option
(
XER_PRINT False
"print XER Format"
)
add_boolean_option
(
RRC_MSG_PRINT F
al
se
"print RRC messages"
)
add_boolean_option
(
RRC_MSG_PRINT F
la
se
"print RRC messages"
)
add_boolean_option
(
PDCP_MSG_PRINT False
"print PDCP messages to /tmp/pdcp.log"
)
add_boolean_option
(
DEBUG_PDCP_PAYLOAD False
"print PDCP PDU to stdout"
)
# if true, make sure that global and PDCP log levels are trace
add_boolean_option
(
DEBUG_MAC_INTERFACE False
"print MAC-RLC PDU exchange to stdout"
)
# if true, make sure that global and PDCP log levels are trace
...
...
openair2/COMMON/s1ap_messages_def.h
View file @
c74ff9e3
...
...
@@ -39,6 +39,8 @@ MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_REQ_LOG, MESSAGE_PRIORITY_MED, IttiMsgText
MESSAGE_DEF
(
S1AP_UE_CONTEXT_RELEASE_COMMAND_LOG
,
MESSAGE_PRIORITY_MED
,
IttiMsgText
,
s1ap_ue_context_release_command_log
)
MESSAGE_DEF
(
S1AP_UE_CONTEXT_RELEASE_COMPLETE_LOG
,
MESSAGE_PRIORITY_MED
,
IttiMsgText
,
s1ap_ue_context_release_complete_log
)
MESSAGE_DEF
(
S1AP_UE_CONTEXT_RELEASE_LOG
,
MESSAGE_PRIORITY_MED
,
IttiMsgText
,
s1ap_ue_context_release_log
)
MESSAGE_DEF
(
S1AP_E_RAB_SETUP_REQUEST_LOG
,
MESSAGE_PRIORITY_MED
,
IttiMsgText
,
s1ap_e_rab_setup_request_log
)
MESSAGE_DEF
(
S1AP_E_RAB_SETUP_RESPONSE_LOG
,
MESSAGE_PRIORITY_MED
,
IttiMsgText
,
s1ap_e_rab_setup_response_log
)
/* eNB application layer -> S1AP messages */
MESSAGE_DEF
(
S1AP_REGISTER_ENB_REQ
,
MESSAGE_PRIORITY_MED
,
s1ap_register_enb_req_t
,
s1ap_register_enb_req
)
...
...
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
View file @
c74ff9e3
...
...
@@ -1104,12 +1104,12 @@ schedule_ue_spec(
post_padding
);
//#ifdef DEBUG_eNB_SCHEDULER
if
(
ta_update
)
{
//
if (ta_update) {
LOG_I
(
MAC
,
"[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d
\n
"
,
module_idP
,
frameP
,
UE_id
,
CC_id
,
sdu_length_total
,
num_sdus
,
sdu_lengths
[
0
],
sdu_lcids
[
0
],
offset
,
"[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d
LCID %d
: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d
\n
"
,
module_idP
,
frameP
,
UE_id
,
CC_id
,
sdu_l
cids
[
0
],
sdu_l
ength_total
,
num_sdus
,
sdu_lengths
[
0
],
sdu_lcids
[
0
],
offset
,
ta_update
,
padding
,
post_padding
,
mcs
,
TBS
,
nb_rb
,
header_len_dcch
,
header_len_dtch
);
}
//
}
//#endif
#ifdef DEBUG_eNB_SCHEDULER
...
...
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
View file @
c74ff9e3
...
...
@@ -309,7 +309,7 @@ void rx_sdu(const module_id_t enb_mod_idP,
}
/* UE_id != -1 */
}
else
if
((
rx_lcids
[
i
]
<
NB_RB_MAX
)
&&
(
rx_lcids
[
i
]
>
DCCH1
))
{
LOG_
D
(
MAC
,
"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH%d, received %d bytes form UE %d
\n
"
,
LOG_
I
(
MAC
,
"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH%d, received %d bytes form UE %d
\n
"
,
enb_mod_idP
,
CC_idP
,
frameP
,
rx_lcids
[
i
],
rx_lengths
[
i
],
UE_id
);
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
...
...
openair2/RRC/LITE/rrc_eNB.c
View file @
c74ff9e3
...
...
@@ -1085,30 +1085,33 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
DedicatedInfoNAS_t
*
dedicatedInfoNas
=
NULL
;
long
*
logicalchannelgroup
,
*
logicalchannelgroup_drb
;
int
drb_
Identity_index
;
int
drb_
identity_index
=
0
;
// Configure DRB
//*DRB_configList = CALLOC(1, sizeof(*DRB_configList));
*
DRB_configList
=
CALLOC
(
1
,
sizeof
(
**
DRB_configList
));
dedicatedInfoNASList
=
CALLOC
(
1
,
sizeof
(
struct
RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList
));
for
(
i
=
0
;
i
<
ue_context_pP
->
ue_context
.
nb_of_e_rabs
;
i
<
ue_context_pP
->
ue_context
.
setup_e_rabs
;
i
++
){
// bypass the already configured erabs
if
(
ue_context_pP
->
ue_context
.
e_rab
[
i
].
status
==
E_RAB_STATUS_
DONE
)
{
//drb_identi
y_index++;
if
(
ue_context_pP
->
ue_context
.
e_rab
[
i
].
status
==
E_RAB_STATUS_
ESTABLISHED
)
{
drb_identit
y_index
++
;
continue
;
}
DRB_config
=
CALLOC
(
1
,
sizeof
(
*
DRB_config
));
DRB_config
->
eps_BearerIdentity
=
CALLOC
(
1
,
sizeof
(
long
));
*
(
DRB_config
->
eps_BearerIdentity
)
=
5L
;
*
(
DRB_config
->
eps_BearerIdentity
)
=
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
e_rab_id
;
DRB_config
->
drb_Identity
=
(
DRB_Identity_t
)
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
e_rab_id
;
DRB_config
->
drb_Identity
=
1
+
drb_identity_index
;
//
(DRB_Identity_t) ue_context_pP->ue_context.e_rab[i].param.e_rab_id;
// 1 + drb_identiy_index;
DRB_config
->
logicalChannelIdentity
=
CALLOC
(
1
,
sizeof
(
long
));
*
(
DRB_config
->
logicalChannelIdentity
)
=
(
long
)
(
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
e_rab_id
+
2
);
// value : x+2
*
(
DRB_config
->
logicalChannelIdentity
)
=
DRB_config
->
drb_Identity
+
2
;
//
(long) (ue_context_pP->ue_context.e_rab[i].param.e_rab_id + 2); // value : x+2
DRB_rlc_config
=
CALLOC
(
1
,
sizeof
(
*
DRB_rlc_config
));
DRB_config
->
rlc_Config
=
DRB_rlc_config
;
...
...
@@ -1174,13 +1177,20 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50
;
logicalchannelgroup_drb
=
CALLOC
(
1
,
sizeof
(
long
));
*
logicalchannelgroup_drb
=
(
i
+
1
)
%
3
;
*
logicalchannelgroup_drb
=
1
;
//
(i+1) % 3;
DRB_ul_SpecificParameters
->
logicalChannelGroup
=
logicalchannelgroup_drb
;
ASN_SEQUENCE_ADD
(
&
(
*
DRB_configList
)
->
list
,
DRB_config
);
#if defined(ENABLE_ITTI)
LOG_I
(
RRC
,
"EPS ID %d, DRB ID %d (index %d), QCI %d, priority %d, LCID %d LCGID %d
\n
"
,
*
DRB_config
->
eps_BearerIdentity
,
DRB_config
->
drb_Identity
,
i
,
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
qos
.
qci
,
DRB_ul_SpecificParameters
->
priority
,
*
(
DRB_config
->
logicalChannelIdentity
),
DRB_ul_SpecificParameters
->
logicalChannelGroup
);
if
(
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
nas_pdu
.
buffer
!=
NULL
)
{
dedicatedInfoNas
=
CALLOC
(
1
,
sizeof
(
DedicatedInfoNAS_t
));
memset
(
dedicatedInfoNas
,
0
,
sizeof
(
OCTET_STRING_t
));
...
...
@@ -1188,7 +1198,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
(
char
*
)
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
nas_pdu
.
buffer
,
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
nas_pdu
.
length
);
ASN_SEQUENCE_ADD
(
&
dedicatedInfoNASList
->
list
,
dedicatedInfoNas
);
}
}
/* TODO parameters yet to process ... */
{
// ue_context_pP->ue_context.e_rab[i].param.qos;
...
...
@@ -1201,7 +1211,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
free
(
dedicatedInfoNASList
);
dedicatedInfoNASList
=
NULL
;
}
#endif
ue_context_pP
->
ue_context
.
e_rab
[
i
].
status
=
E_RAB_STATUS_DONE
;
...
...
@@ -1788,7 +1797,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
if
(
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
nas_pdu
.
buffer
!=
NULL
)
{
dedicatedInfoNas
=
CALLOC
(
1
,
sizeof
(
DedicatedInfoNAS_t
));
memset
(
dedicatedInfoNas
,
0
,
sizeof
(
OCTET_STRING_t
));
OCTET_STRING_fromBuf
(
dedicatedInfoNas
,
(
char
*
)
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
nas_pdu
.
buffer
,
OCTET_STRING_fromBuf
(
dedicatedInfoNas
,
(
char
*
)
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
nas_pdu
.
buffer
,
ue_context_pP
->
ue_context
.
e_rab
[
i
].
param
.
nas_pdu
.
length
);
ASN_SEQUENCE_ADD
(
&
dedicatedInfoNASList
->
list
,
dedicatedInfoNas
);
}
...
...
openair2/RRC/LITE/rrc_eNB_GTPV1U.c
View file @
c74ff9e3
...
...
@@ -68,14 +68,19 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
ctxt_pP
->
rnti
);
for
(
i
=
0
;
i
<
create_tunnel_resp_pP
->
num_tunnels
;
i
++
)
{
LOG_D
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP tunnel %u bearer index %u id %u
\n
"
,
ue_context_p
->
ue_context
.
enb_gtp_teid
[
i
+
ue_context_p
->
ue_context
.
setup_e_rabs
]
=
create_tunnel_resp_pP
->
enb_S1u_teid
[
i
];
ue_context_p
->
ue_context
.
enb_gtp_addrs
[
i
+
ue_context_p
->
ue_context
.
setup_e_rabs
]
=
create_tunnel_resp_pP
->
enb_addr
;
ue_context_p
->
ue_context
.
enb_gtp_ebi
[
i
+
ue_context_p
->
ue_context
.
setup_e_rabs
]
=
create_tunnel_resp_pP
->
eps_bearer_id
[
i
];
LOG_I
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP tunnel (%u, %u) bearer UE context index %u, msg index %u, id %u, gtp addr len %d
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
create_tunnel_resp_pP
->
enb_S1u_teid
[
i
],
i
,
create_tunnel_resp_pP
->
eps_bearer_id
[
i
]);
ue_context_p
->
ue_context
.
enb_gtp_teid
[
i
]
=
create_tunnel_resp_pP
->
enb_S1u_teid
[
i
];
ue_context_p
->
ue_context
.
enb_gtp_addrs
[
i
]
=
create_tunnel_resp_pP
->
enb_addr
;
ue_context_p
->
ue_context
.
enb_gtp_ebi
[
i
]
=
create_tunnel_resp_pP
->
eps_bearer_id
[
i
]
;
ue_context_p
->
ue_context
.
enb_gtp_teid
[
i
+
ue_context_p
->
ue_context
.
setup_e_rabs
]
,
i
+
ue_context_p
->
ue_context
.
setup_e_rabs
,
i
,
create_tunnel_resp_pP
->
eps_bearer_id
[
i
],
create_tunnel_resp_pP
->
enb_addr
.
length
)
;
}
MSC_LOG_RX_MESSAGE
(
MSC_RRC_ENB
,
...
...
openair2/RRC/LITE/rrc_eNB_S1AP.c
View file @
c74ff9e3
...
...
@@ -844,93 +844,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
return
(
0
);
}
}
int
rrc_eNB_process_S1AP_E_RAB_SETUP_REQ
(
MessageDef
*
msg_p
,
const
char
*
msg_name
,
instance_t
instance
)
{
uint16_t
ue_initial_id
;
uint32_t
eNB_ue_s1ap_id
;
MessageDef
*
message_gtpv1u_p
=
NULL
;
gtpv1u_enb_create_tunnel_req_t
create_tunnel_req
;
gtpv1u_enb_create_tunnel_resp_t
create_tunnel_resp
;
struct
rrc_eNB_ue_context_s
*
ue_context_p
=
NULL
;
protocol_ctxt_t
ctxt
;
ue_initial_id
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
ue_initial_id
;
eNB_ue_s1ap_id
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
eNB_ue_s1ap_id
;
ue_context_p
=
rrc_eNB_get_ue_context_from_s1ap_ids
(
instance
,
ue_initial_id
,
eNB_ue_s1ap_id
);
LOG_I
(
RRC
,
"[eNB %d] Received %s: ue_initial_id %d, eNB_ue_s1ap_id %d, nb_of_e_rabs %d
\n
"
,
instance
,
msg_name
,
ue_initial_id
,
eNB_ue_s1ap_id
,
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
nb_e_rabs_tosetup
);
if
(
ue_context_p
==
NULL
)
{
/* Can not associate this message to an UE index, send a failure to S1AP and discard it! */
MessageDef
*
msg_fail_p
=
NULL
;
LOG_W
(
RRC
,
"[eNB %d] In S1AP_E_RAB_SETUP_REQ: unknown UE from S1AP ids (%d, %d)
\n
"
,
instance
,
ue_initial_id
,
eNB_ue_s1ap_id
);
msg_fail_p
=
itti_alloc_new_message
(
TASK_RRC_ENB
,
S1AP_E_RAB_SETUP_REQUEST_FAIL
);
S1AP_E_RAB_SETUP_REQ
(
msg_fail_p
).
eNB_ue_s1ap_id
=
eNB_ue_s1ap_id
;
// TODO add failure cause when defined!
itti_send_msg_to_task
(
TASK_S1AP
,
instance
,
msg_fail_p
);
return
(
-
1
);
}
else
{
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
instance
,
ENB_FLAG_YES
,
ue_context_p
->
ue_context
.
rnti
,
0
,
0
);
ue_context_p
->
ue_context
.
eNB_ue_s1ap_id
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
eNB_ue_s1ap_id
;
/* Save e RAB information for later */
{
int
i
;
memset
(
&
create_tunnel_req
,
0
,
sizeof
(
create_tunnel_req
));
uint8_t
nb_e_rabs_tosetup
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
nb_e_rabs_tosetup
;
// keep the previous bearer
for
(
i
=
ue_context_p
->
ue_context
.
setup_e_rabs
;
i
<
ue_context_p
->
ue_context
.
setup_e_rabs
+
nb_e_rabs_tosetup
;
i
++
)
{
if
(
ue_context_p
->
ue_context
.
e_rab
[
i
].
status
==
E_RAB_STATUS_DONE
)
LOG_W
(
RRC
,
"E-RAB already configured, reconfiguring
\n
"
);
ue_context_p
->
ue_context
.
e_rab
[
i
].
status
=
E_RAB_STATUS_NEW
;
ue_context_p
->
ue_context
.
e_rab
[
i
].
param
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
e_rab_setup_params
[
i
];
create_tunnel_req
.
eps_bearer_id
[
i
]
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
e_rab_setup_params
[
i
].
e_rab_id
;
create_tunnel_req
.
sgw_S1u_teid
[
i
]
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
e_rab_setup_params
[
i
].
gtp_teid
;
memcpy
(
&
create_tunnel_req
.
sgw_addr
[
i
],
&
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
e_rab_setup_params
[
i
].
sgw_addr
,
sizeof
(
transport_layer_addr_t
));
}
ue_context_p
->
ue_context
.
nb_of_e_rabs
=
nb_e_rabs_tosetup
;
ue_context_p
->
ue_context
.
setup_e_rabs
+=
nb_e_rabs_tosetup
;
create_tunnel_req
.
rnti
=
ue_context_p
->
ue_context
.
rnti
;
// warning put zero above
create_tunnel_req
.
num_tunnels
=
i
;
// NN: not sure if we should create a new tunnel: need to check teid, etc.
gtpv1u_create_s1u_tunnel
(
instance
,
&
create_tunnel_req
,
&
create_tunnel_resp
);
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP
(
&
ctxt
,
&
create_tunnel_resp
);
}
/* TODO parameters yet to process ... */
{
// S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p).ue_ambr;
}
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration
(
&
ctxt
,
ue_context_p
,
0
);
return
(
0
);
}
}
/*------------------------------------------------------------------------------*/
int
rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ
(
MessageDef
*
msg_p
,
const
char
*
msg_name
,
instance_t
instance
)
...
...
@@ -986,9 +899,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
&
S1AP_INITIAL_CONTEXT_SETUP_REQ
(
msg_p
).
e_rab_param
[
i
].
sgw_addr
,
sizeof
(
transport_layer_addr_t
));
}
ue_context_p
->
ue_context
.
setup_e_rabs
=
ue_context_p
->
ue_context
.
nb_of_e_rabs
;
create_tunnel_req
.
rnti
=
ue_context_p
->
ue_context
.
rnti
;
// warning put zero above
create_tunnel_req
.
num_tunnels
=
i
;
...
...
@@ -999,7 +910,8 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP
(
&
ctxt
,
&
create_tunnel_resp
);
&
create_tunnel_resp
);
ue_context_p
->
ue_context
.
setup_e_rabs
=
ue_context_p
->
ue_context
.
nb_of_e_rabs
;
}
/* TODO parameters yet to process ... */
...
...
@@ -1308,6 +1220,101 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
}
}
int
rrc_eNB_process_S1AP_E_RAB_SETUP_REQ
(
MessageDef
*
msg_p
,
const
char
*
msg_name
,
instance_t
instance
)
{
uint16_t
ue_initial_id
;
uint32_t
eNB_ue_s1ap_id
;
MessageDef
*
message_gtpv1u_p
=
NULL
;
gtpv1u_enb_create_tunnel_req_t
create_tunnel_req
;
gtpv1u_enb_create_tunnel_resp_t
create_tunnel_resp
;
struct
rrc_eNB_ue_context_s
*
ue_context_p
=
NULL
;
protocol_ctxt_t
ctxt
;
ue_initial_id
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
ue_initial_id
;
eNB_ue_s1ap_id
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
eNB_ue_s1ap_id
;
ue_context_p
=
rrc_eNB_get_ue_context_from_s1ap_ids
(
instance
,
ue_initial_id
,
eNB_ue_s1ap_id
);
LOG_I
(
RRC
,
"[eNB %d] Received %s: ue_initial_id %d, eNB_ue_s1ap_id %d, nb_of_e_rabs %d
\n
"
,
instance
,
msg_name
,
ue_initial_id
,
eNB_ue_s1ap_id
,
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
nb_e_rabs_tosetup
);
if
(
ue_context_p
==
NULL
)
{
/* Can not associate this message to an UE index, send a failure to S1AP and discard it! */
MessageDef
*
msg_fail_p
=
NULL
;
LOG_W
(
RRC
,
"[eNB %d] In S1AP_E_RAB_SETUP_REQ: unknown UE from S1AP ids (%d, %d)
\n
"
,
instance
,
ue_initial_id
,
eNB_ue_s1ap_id
);
msg_fail_p
=
itti_alloc_new_message
(
TASK_RRC_ENB
,
S1AP_E_RAB_SETUP_REQUEST_FAIL
);
S1AP_E_RAB_SETUP_REQ
(
msg_fail_p
).
eNB_ue_s1ap_id
=
eNB_ue_s1ap_id
;
// TODO add failure cause when defined!
itti_send_msg_to_task
(
TASK_S1AP
,
instance
,
msg_fail_p
);
return
(
-
1
);
}
else
{
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
instance
,
ENB_FLAG_YES
,
ue_context_p
->
ue_context
.
rnti
,
0
,
0
);
ue_context_p
->
ue_context
.
eNB_ue_s1ap_id
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
eNB_ue_s1ap_id
;
/* Save e RAB information for later */
{
int
i
;
memset
(
&
create_tunnel_req
,
0
,
sizeof
(
create_tunnel_req
));
uint8_t
nb_e_rabs_tosetup
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
nb_e_rabs_tosetup
;
// keep the previous bearer
// the index for the rec
for
(
i
=
0
;
i
<
nb_e_rabs_tosetup
;
i
++
)
{
if
(
ue_context_p
->
ue_context
.
e_rab
[
i
+
ue_context_p
->
ue_context
.
setup_e_rabs
].
status
==
E_RAB_STATUS_DONE
)
LOG_W
(
RRC
,
"E-RAB already configured, reconfiguring
\n
"
);
ue_context_p
->
ue_context
.
e_rab
[
i
+
ue_context_p
->
ue_context
.
setup_e_rabs
].
status
=
E_RAB_STATUS_NEW
;
ue_context_p
->
ue_context
.
e_rab
[
i
+
ue_context_p
->
ue_context
.
setup_e_rabs
].
param
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
e_rab_setup_params
[
i
];
create_tunnel_req
.
eps_bearer_id
[
i
]
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
e_rab_setup_params
[
i
].
e_rab_id
;
create_tunnel_req
.
sgw_S1u_teid
[
i
]
=
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
e_rab_setup_params
[
i
].
gtp_teid
;
memcpy
(
&
create_tunnel_req
.
sgw_addr
[
i
],
&
S1AP_E_RAB_SETUP_REQ
(
msg_p
).
e_rab_setup_params
[
i
].
sgw_addr
,
sizeof
(
transport_layer_addr_t
));
LOG_I
(
RRC
,
"E_RAB setup REQ: local index %d teid %u, eps id %d
\n
"
,
i
+
ue_context_p
->
ue_context
.
setup_e_rabs
,
create_tunnel_req
.
sgw_S1u_teid
[
i
],
create_tunnel_req
.
eps_bearer_id
[
i
]
);
}
ue_context_p
->
ue_context
.
nb_of_e_rabs
=
nb_e_rabs_tosetup
;
create_tunnel_req
.
rnti
=
ue_context_p
->
ue_context
.
rnti
;
// warning put zero above
create_tunnel_req
.
num_tunnels
=
i
;
// NN: not sure if we should create a new tunnel: need to check teid, etc.
gtpv1u_create_s1u_tunnel
(
instance
,
&
create_tunnel_req
,
&
create_tunnel_resp
);
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP
(
&
ctxt
,
&
create_tunnel_resp
);
ue_context_p
->
ue_context
.
setup_e_rabs
+=
nb_e_rabs_tosetup
;
}
/* TODO parameters yet to process ... */
{
// S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p).ue_ambr;
}
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration
(
&
ctxt
,
ue_context_p
,
0
);
return
(
0
);
}
}
rrc_eNB_send_S1AP_E_RAB_SETUP_RESP
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_eNB_ue_context_t
*
const
ue_context_pP
){
...
...
@@ -1315,28 +1322,48 @@ rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP,
int
e_rab
;
int
e_rabs_done
=
0
;
int
e_rabs_failed
=
0
;
int
established_e_rab_index
=
0
;
msg_p
=
itti_alloc_new_message
(
TASK_RRC_ENB
,
S1AP_E_RAB_SETUP_RESP
);
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
eNB_ue_s1ap_id
=
ue_context_pP
->
ue_context
.
eNB_ue_s1ap_id
;
for
(
e_rab
=
ue_context_pP
->
ue_context
.
setup_e_rabs
-
ue_context_pP
->
ue_context
.
nb_of_e_rabs
;
e_rab
<
ue_context_pP
->
ue_context
.
setup_e_rabs
;
e_rab
++
)
{
if
(
ue_context_pP
->
ue_context
.
e_rab
[
e_rab
].
status
==
E_RAB_STATUS_DONE
)
{
established_e_rab_index
=
ue_context_pP
->
ue_context
.
setup_e_rabs
-
ue_context_pP
->
ue_context
.
nb_of_e_rabs
;
for
(
e_rab
=
0
;
e_rab
<
ue_context_pP
->
ue_context
.
nb_of_e_rabs
;
e_rab
++
)
{
/* if (ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_ESTABLISHED)
continue;
else
*/
if
(
ue_context_pP
->
ue_context
.
e_rab
[
e_rab
+
established_e_rab_index
].
status
==
E_RAB_STATUS_DONE
)
{
e_rabs_done
++
;
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
e_rab_id
=
ue_context_pP
->
ue_context
.
e_rab
[
e_rab
].
param
.
e_rab_id
;
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
e_rab_id
=
ue_context_pP
->
ue_context
.
e_rab
[
e_rab
+
established_e_rab_index
].
param
.
e_rab_id
;
// TODO add other information from S1-U when it will be integrated
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
gtp_teid
=
ue_context_pP
->
ue_context
.
enb_gtp_teid
[
e_rab
];
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
eNB_addr
=
ue_context_pP
->
ue_context
.
enb_gtp_addrs
[
e_rab
];
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
eNB_addr
.
length
=
4
;
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
gtp_teid
=
ue_context_pP
->
ue_context
.
enb_gtp_teid
[
e_rab
+
established_e_rab_index
];
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
eNB_addr
=
ue_context_pP
->
ue_context
.
enb_gtp_addrs
[
e_rab
+
established_e_rab_index
];
//S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr.length +
= 4;
ue_context_pP
->
ue_context
.
e_rab
[
e_rab
].
status
=
E_RAB_STATUS_ESTABLISHED
;
LOG_I
(
RRC
,
"enb_gtp_addr (msg index %d, local index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d
\n
"
,
e_rab
,
established_e_rab_index
,
ue_context_pP
->
ue_context
.
e_rab
[
e_rab
+
established_e_rab_index
].
status
,
ue_context_pP
->
ue_context
.
nb_of_e_rabs
,
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
e_rab_id
,
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
gtp_teid
,
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
eNB_addr
.
buffer
[
0
],
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
eNB_addr
.
buffer
[
1
],
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
eNB_addr
.
buffer
[
2
],
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs
[
e_rab
].
eNB_addr
.
buffer
[
3
]);
}
else
{
e_rabs_failed
++
;
ue_context_pP
->
ue_context
.
e_rab
[
e_rab
].
status
=
E_RAB_STATUS_FAILED
;
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs_failed
[
e_rab
].
e_rab_id
=
ue_context_pP
->
ue_context
.
e_rab
[
e_rab
].
param
.
e_rab_id
;
S1AP_E_RAB_SETUP_RESP
(
msg_p
).
e_rabs_failed
[
e_rab
].
e_rab_id
=
ue_context_pP
->
ue_context
.
e_rab
[
e_rab
+
established_e_rab_index
].
param
.
e_rab_id
;
// TODO add cause when it will be integrated
}
}
LOG_I
(
RRC
,
"S1AP_E_RAB_SETUP_RESP: nb_of_erabs %d, total e_rabs %d, index %d,
\n
"
,
ue_context_pP
->
ue_context
.
nb_of_e_rabs
,
ue_context_pP
->
ue_context
.
setup_e_rabs
,
established_e_rab_index
);
MSC_LOG_TX_MESSAGE
(
MSC_RRC_ENB
,
MSC_S1AP_ENB
,
...
...
openair3/S1AP/s1ap_common.c
View file @
c74ff9e3
...
...
@@ -29,8 +29,9 @@
/*! \file s1ap_common.c
* \brief s1ap procedures for both eNB and MME
* \author Sebastien ROUX <sebastien.roux@eurecom.fr>
* \date 2012
* \author Sebastien ROUX and Navid Nikaein
* \email navid.nikaein@eurecom.fr
* \date 2012-2015
* \version 0.1
*/
...
...
openair3/S1AP/s1ap_eNB.c
View file @
c74ff9e3
...
...
@@ -26,6 +26,15 @@
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file s1ap_eNB.c
* \brief S1AP eNB task
* \author S. Roux and Navid Nikaein
* \date 2010 - 2015
* \email: navid.nikaein@eurecom.fr
* \version 1.0
* @ingroup _s1ap
*/
#include <pthread.h>
#include <stdio.h>
...
...
openair3/S1AP/s1ap_eNB_context_management_procedures.c
View file @
c74ff9e3
...
...
@@ -26,7 +26,14 @@
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file s1ap_eNB_context_management_procedures.c
* \brief S1AP context management procedures
* \author S. Roux and Navid Nikaein
* \date 2010 - 2015
* \email: navid.nikaein@eurecom.fr
* \version 1.0
* @ingroup _s1ap
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
...
...
openair3/S1AP/s1ap_eNB_decoder.c
View file @
c74ff9e3
...
...
@@ -29,8 +29,9 @@
/*! \file s1ap_eNB_decoder.c
* \brief s1ap pdu decode procedures for eNB
* \author Sebastien ROUX <sebastien.roux@eurecom.fr>
* \date 2013
* \author Sebastien ROUX and Navid Nikaein
* \email navid.nikaein@eurecom.fr
* \date 2013 - 2015
* \version 0.1
*/
...
...
@@ -123,11 +124,25 @@ static int s1ap_eNB_decode_initiating_message(s1ap_message *message,
case
S1ap_ProcedureCode_id_E_RABSetup
:
ret
=
s1ap_decode_s1ap_e_rabsetuprequesties
(
&
message
->
msg
.
s1ap_E_RABSetupRequestIEs
,
&
initiating_p
->
value
);
s1ap_xer_print_s1ap_paging
(
s1ap_xer__print2sp
,
message_string
,
message
);
//message_id = S1AP_E_RABSETUP_REQ_LOG;
S1AP_ERROR
(
"TODO E_RABSetup initiating message
\n
"
);
s1ap_xer_print_s1ap_e_rabsetuprequest
(
s1ap_xer__print2sp
,
message_string
,
message
);
message_id
=
S1AP_E_RAB_SETUP_REQUEST_LOG
;
message_string_size
=
strlen
(
message_string
);
message_p
=
itti_alloc_new_message_sized
(
TASK_S1AP
,
message_id
,
message_string_size
+
sizeof
(
IttiMsgText
));
message_p
->
ittiMsg
.
s1ap_e_rab_setup_request_log
.
size
=
message_string_size
;
memcpy
(
&
message_p
->
ittiMsg
.
s1ap_e_rab_setup_request_log
.
text
,
message_string
,
message_string_size
);
itti_send_msg_to_task
(
TASK_UNKNOWN
,
INSTANCE_DEFAULT
,
message_p
);
free
(
message_string
);
S1AP_INFO
(
"E_RABSetup initiating message
\n
"
);
break
;
case
S1ap_ProcedureCode_id_E_RABRelease
:
ret
=
s1ap_decode_s1ap_e_rabreleasecommandies
(
&
message
->
msg
.
s1ap_E_RABReleaseCommandIEs
,
&
initiating_p
->
value
);
s1ap_xer_print_s1ap_e_rabsetuprequest
(
s1ap_xer__print2sp
,
message_string
,
message
);
S1AP_ERROR
(
"TODO E_RABReleas initiating message
\n
"
);
free
(
message_string
);
default:
S1AP_ERROR
(
"Unknown procedure ID (%d) for initiating message
\n
"
,
(
int
)
initiating_p
->
procedureCode
);
...
...
openair3/S1AP/s1ap_eNB_encoder.c
View file @
c74ff9e3
...
...
@@ -29,8 +29,9 @@
/*! \file s1ap_eNB_encoder.c
* \brief s1ap pdu encode procedures for eNB
* \author Sebastien ROUX <sebastien.roux@eurecom.fr>
* \date 2013
* \author Sebastien ROUX and Navid Nikaein
* \email navid.nikaein@eurecom.fr
* \date 2013 - 2015
* \version 0.1
*/
...
...
@@ -38,6 +39,8 @@
#include <string.h>
#include <stdint.h>
#include "assertions.h"
#include "conversions.h"
#include "intertask_interface.h"
...
...
@@ -100,6 +103,11 @@ int s1ap_eNB_encode_ue_context_release_request(
uint8_t
**
buffer
,
uint32_t
*
length
);
static
inline
int
s1ap_eNB_encode_e_rab_setup_response
(
S1ap_E_RABSetupResponseIEs_t
*
E_RABSetupResponseIEs
,
uint8_t
**
buffer
,
uint32_t
*
length
);
int
s1ap_eNB_encode_pdu
(
s1ap_message
*
message
,
uint8_t
**
buffer
,
uint32_t
*
len
)
{
DevAssert
(
message
!=
NULL
);
...
...
@@ -251,8 +259,21 @@ int s1ap_eNB_encode_successfull_outcome(s1ap_message *s1ap_message_p,
free
(
message_string
);
break
;
case
S1ap_ProcedureCode_id_E_RABSetup
:
ret
=
s1ap_eNB_encode_e_rab_setup_response
(
&
s1ap_message_p
->
msg
.
s1ap_E_RABSetupResponseIEs
,
buffer
,
len
);
//s1ap_xer_print_s1ap_e_rabsetupresponse (s1ap_xer__print2sp, message_string, s1ap_message_p);
message_id
=
S1AP_E_RAB_SETUP_RESPONSE_LOG
;
message_p
=
itti_alloc_new_message_sized
(
TASK_S1AP
,
message_id
,
message_string_size
+
sizeof
(
IttiMsgText
));
message_p
->
ittiMsg
.
s1ap_e_rab_setup_response_log
.
size
=
message_string_size
;
memcpy
(
&
message_p
->
ittiMsg
.
s1ap_e_rab_setup_response_log
.
text
,
message_string
,
message_string_size
);
itti_send_msg_to_task
(
TASK_UNKNOWN
,
INSTANCE_DEFAULT
,
message_p
);
free
(
message_string
);
S1AP_INFO
(
"E_RABSetup successful message
\n
"
);
break
;
default:
S1AP_
DEBUG
(
"Unknown procedure ID (%d) for successfull outcome message
\n
"
,
S1AP_
WARN
(
"Unknown procedure ID (%d) for successfull outcome message
\n
"
,
(
int
)
s1ap_message_p
->
procedureCode
);
return
ret
;
break
;
...
...
@@ -528,3 +549,25 @@ int s1ap_eNB_encode_ue_context_release_request(
ue_context_release_request_p
);
}
static
inline
int
s1ap_eNB_encode_e_rab_setup_response
(
S1ap_E_RABSetupResponseIEs_t
*
s1ap_E_RABSetupResponseIEs
,
uint8_t
**
buffer
,
uint32_t
*
length
)
{
S1ap_E_RABSetupResponse_t
e_rab_setup_response
;
S1ap_E_RABSetupResponse_t
*
e_rab_setup_response_p
=
&
e_rab_setup_response
;
memset
((
void
*
)
e_rab_setup_response_p
,
0
,
sizeof
(
e_rab_setup_response
));
if
(
s1ap_encode_s1ap_e_rabsetupresponseies
(
e_rab_setup_response_p
,
s1ap_E_RABSetupResponseIEs
)
<
0
)
{
return
-
1
;
}
return
s1ap_generate_successfull_outcome
(
buffer
,
length
,
S1ap_ProcedureCode_id_E_RABSetup
,
S1ap_Criticality_reject
,
&
asn_DEF_S1ap_E_RABSetupResponse
,
e_rab_setup_response_p
);
}
openair3/S1AP/s1ap_eNB_handlers.c
View file @
c74ff9e3
...
...
@@ -29,8 +29,9 @@
/*! \file s1ap_eNB_handlers.c
* \brief s1ap messages handlers for eNB part
* \author Sebastien ROUX <sebastien.roux@eurecom.fr>
* \date 2013
* \author Sebastien ROUX and Navid Nikaein
* \email navid.nikaein@eurecom.fr
* \date 2013 - 2015
* \version 0.1
*/
...
...
@@ -963,6 +964,11 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
S1AP_E_RAB_SETUP_REQ
(
message_p
).
e_rab_setup_params
[
i
].
sgw_addr
.
length
=
item_p
->
transportLayerAddress
.
size
*
8
-
item_p
->
transportLayerAddress
.
bits_unused
;
/* S1AP_INFO("sgw addr %s len: %d (size %d, index %d)\n",
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.buffer,
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.length,
item_p->transportLayerAddress.size, i);
*/
/* GTP tunnel endpoint ID */
OCTET_STRING_TO_INT32
(
&
item_p
->
gTP_TEID
,
S1AP_E_RAB_SETUP_REQ
(
message_p
).
e_rab_setup_params
[
i
].
gtp_teid
);
...
...
openair3/S1AP/s1ap_eNB_nas_procedures.c
View file @
c74ff9e3
...
...
@@ -26,7 +26,14 @@
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file s1ap_eNB_nas_procedures.c
* \brief S1AP eNb NAS procedure handler
* \author S. Roux and Navid Nikaein
* \date 2010 - 2015
* \email: navid.nikaein@eurecom.fr
* \version 1.0
* @ingroup _s1ap
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
...
...
@@ -579,6 +586,14 @@ int s1ap_eNB_initial_ctxt_resp(
new_item
->
transportLayerAddress
.
size
=
initial_ctxt_resp_p
->
e_rabs
[
i
].
eNB_addr
.
length
;
new_item
->
transportLayerAddress
.
bits_unused
=
0
;
S1AP_DEBUG
(
"initial_ctxt_resp_p: e_rab ID %d, enb_addr %d.%d.%d.%d, SIZE %d
\n
"
,
new_item
->
e_RAB_ID
,
new_item
->
transportLayerAddress
.
buf
[
0
],
new_item
->
transportLayerAddress
.
buf
[
1
],
new_item
->
transportLayerAddress
.
buf
[
2
],
new_item
->
transportLayerAddress
.
buf
[
3
],
new_item
->
transportLayerAddress
.
size
);
ASN_SEQUENCE_ADD
(
&
initial_ies_p
->
e_RABSetupListCtxtSURes
.
s1ap_E_RABSetupItemCtxtSURes
,
new_item
);
}
...
...
@@ -695,7 +710,7 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
struct
s1ap_eNB_ue_context_s
*
ue_context_p
=
NULL
;
S1ap_E_RABSetupResponseIEs_t
*
initial_ies_p
=
NULL
;
s1ap_message
message
;
uint8_t
*
buffer
=
NULL
;
...
...
@@ -727,39 +742,85 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
e_rab_setup_resp_p
->
eNB_ue_s1ap_id
,
ue_context_p
->
ue_state
);
return
-
1
;
}
/* Prepare the S1AP message to encode */
memset
(
&
message
,
0
,
sizeof
(
s1ap_message
));
message
.
direction
=
S1AP_PDU_PR_successfulOutcome
;
message
.
procedureCode
=
S1ap_ProcedureCode_id_E_RABSetup
;
message
.
criticality
=
S1ap_Criticality_reject
;
initial_ies_p
=
&
message
.
msg
.
s1ap_E_RABSetupResponseIEs
;
initial_ies_p
->
eNB_UE_S1AP_ID
=
e_rab_setup_resp_p
->
eNB_ue_s1ap_id
;
initial_ies_p
->
mme_ue_s1ap_id
=
ue_context_p
->
mme_ue_s1ap_id
;
for
(
i
=
0
;
i
<
e_rab_setup_resp_p
->
nb_of_e_rabs
;
i
++
)
{
if
(
e_rab_setup_resp_p
->
nb_of_e_rabs
>=
1
)
initial_ies_p
->
presenceMask
|=
S1AP_E_RABSETUPRESPONSEIES_E_RABSETUPLISTBEARERSURES_PRESENT
;
for
(
i
=
0
;
i
<
e_rab_setup_resp_p
->
nb_of_e_rabs
;
i
++
)
{
S1ap_E_RABSetupItemBearerSURes_t
*
new_item
;
new_item
=
calloc
(
1
,
sizeof
(
S1ap_E_RABSetupItemBearerSURes_t
));
new_item
->
e_RAB_ID
=
e_rab_setup_resp_p
->
e_rabs
[
i
].
e_rab_id
;
GTP_TEID_TO_ASN1
(
e_rab_setup_resp_p
->
e_rabs
[
i
].
gtp_teid
,
&
new_item
->
gTP_TEID
);
new_item
->
transportLayerAddress
.
buf
=
e_rab_setup_resp_p
->
e_rabs
[
i
].
eNB_addr
.
buffer
;
/*
new_item->transportLayerAddress.buf = MALLOC(e_rab_setup_resp_p->e_rabs[i].eNB_addr.length);
memcpy (new_item->transportLayerAddress.buf,
e_rab_setup_resp_p->e_rabs[i].eNB_addr.buffer,
e_rab_setup_resp_p->e_rabs[i].eNB_addr.length);
*/
/*
new_item->transportLayerAddress.buf[0] = e_rab_setup_resp_p->e_rabs[i].eNB_addr.buffer[0];
new_item->transportLayerAddress.buf[1] = e_rab_setup_resp_p->e_rabs[i].eNB_addr.buffer[1];
new_item->transportLayerAddress.buf[2] = e_rab_setup_resp_p->e_rabs[i].eNB_addr.buffer[2];
new_item->transportLayerAddress.buf[3] = e_rab_setup_resp_p->e_rabs[i].eNB_addr.buffer[3];
*/
new_item
->
transportLayerAddress
.
buf
=
e_rab_setup_resp_p
->
e_rabs
[
i
].
eNB_addr
.
buffer
;
new_item
->
transportLayerAddress
.
size
=
e_rab_setup_resp_p
->
e_rabs
[
i
].
eNB_addr
.
length
;
new_item
->
transportLayerAddress
.
bits_unused
=
0
;
S1AP_DEBUG
(
"e_rab_setup_resp: e_rab ID %d, teid %u, enb_addr %d.%d.%d.%d, SIZE %d
\n
"
,
new_item
->
e_RAB_ID
,
e_rab_setup_resp_p
->
e_rabs
[
i
].
gtp_teid
,
new_item
->
transportLayerAddress
.
buf
[
0
],
new_item
->
transportLayerAddress
.
buf
[
1
],
new_item
->
transportLayerAddress
.
buf
[
2
],
new_item
->
transportLayerAddress
.
buf
[
3
],
new_item
->
transportLayerAddress
.
size
);
S1ap_IE_t
*
ie
=
s1ap_new_ie
(
S1ap_ProtocolIE_ID_id_E_RABSetupItemBearerSURes
,
S1ap_Criticality_ignore
,
&
asn_DEF_S1ap_E_RABSetupItemBearerSURes
,
new_item
);
/*
S1ap_IE_t *ie = s1ap_new_ie(S1ap_ProtocolIE_ID_id_E_RABSetupListBearerSURes,
S1ap_Criticality_ignore,
&asn_DEF_S1ap_E_RABSetupListBearerSURes,
new_item);
*/
ASN_SEQUENCE_ADD
(
&
initial_ies_p
->
e_RABSetupListBearerSURes
.
s1ap_E_RABSetupItemBearerSURes
,
new_item
);
ie
);
}
/* S1ap_E_RABSetupListBearerSURes_t e_RABSetupListBearerSURes;
memset(&e_RABSetupListBearerSURes, 0, sizeof(S1ap_E_RABSetupListBearerSURes_t));
if (s1ap_encode_s1ap_e_rabsetuplistbearersures(&e_RABSetupListBearerSURes, &initial_ies_p->e_RABSetupListBearerSURes.s1ap_E_RABSetupItemBearerSURes) < 0 )
return -1;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1ap_E_RABSetupListBearerSURes, &e_RABSetupListBearerSURes);
*/
fprintf
(
stderr
,
"start encode
\n
"
);
if
(
s1ap_eNB_encode_pdu
(
&
message
,
&
buffer
,
&
length
)
<
0
)
{
S1AP_ERROR
(
"Failed to encode uplink
NAS
transport
\n
"
);
S1AP_ERROR
(
"Failed to encode uplink transport
\n
"
);
/* Encode procedure has failed... */
return
-
1
;
}
MSC_LOG_TX_MESSAGE
(
MSC_S1AP_ENB
,
MSC_S1AP_MME
,
...
...
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