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
alex037yang
OpenXG-RAN
Commits
610e07a9
Commit
610e07a9
authored
Dec 01, 2015
by
gauthier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For backup only, dont compile, TODO missing patch for asn1c compiler
parent
717cd8a1
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
570 additions
and
9 deletions
+570
-9
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+2
-0
openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py
openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py
+145
-1
openair3/TEST/EPC_TEST/play_scenario.c
openair3/TEST/EPC_TEST/play_scenario.c
+4
-0
openair3/TEST/EPC_TEST/play_scenario.h
openair3/TEST/EPC_TEST/play_scenario.h
+11
-0
openair3/TEST/EPC_TEST/play_scenario_fsm.c
openair3/TEST/EPC_TEST/play_scenario_fsm.c
+9
-2
openair3/TEST/EPC_TEST/play_scenario_parse.c
openair3/TEST/EPC_TEST/play_scenario_parse.c
+2
-2
openair3/TEST/EPC_TEST/play_scenario_s1ap.c
openair3/TEST/EPC_TEST/play_scenario_s1ap.c
+79
-4
openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
+273
-0
openair3/TEST/EPC_TEST/play_scenario_sctp.c
openair3/TEST/EPC_TEST/play_scenario_sctp.c
+45
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
610e07a9
...
...
@@ -337,6 +337,7 @@ set(S1AP_OAI_generated
${
S1AP_C_DIR
}
/s1ap_decoder.c
${
S1AP_C_DIR
}
/s1ap_encoder.c
${
S1AP_C_DIR
}
/s1ap_xer_print.c
${
S1AP_C_DIR
}
/s1ap_compare.c
${
S1AP_C_DIR
}
/s1ap_ies_defs.h
)
file
(
GLOB s1ap_h
${
S1AP_C_DIR
}
/*.h
)
...
...
@@ -1667,6 +1668,7 @@ add_executable(test_epc_play_scenario
${
OPENAIR3_DIR
}
/TEST/EPC_TEST/play_scenario_fsm.c
${
OPENAIR3_DIR
}
/TEST/EPC_TEST/play_scenario_parse.c
${
OPENAIR3_DIR
}
/TEST/EPC_TEST/play_scenario_s1ap.c
${
OPENAIR3_DIR
}
/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
${
OPENAIR3_DIR
}
/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h
${
OPENAIR3_DIR
}
/TEST/EPC_TEST/play_scenario_sctp.c
${
OPENAIR3_DIR
}
/TEST/EPC_TEST/play_scenario.h
...
...
openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py
View file @
610e07a9
This diff is collapsed.
Click to expand it.
openair3/TEST/EPC_TEST/play_scenario.c
View file @
610e07a9
...
...
@@ -318,15 +318,19 @@ int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_ad
S1AP_DEBUG
(
"%s(%s,%s)=%d
\n
"
,
__FUNCTION__
,
ip
->
str
,
net_ip
->
ipv4_address
,
strcmp
(
ip
->
str
,
net_ip
->
ipv4_address
));
return
strcmp
(
ip
->
str
,
net_ip
->
ipv4_address
);
}
S1AP_DEBUG
(
"%s(%s,%s)=-1 (IP version (4) not matching)
\n
"
,
__FUNCTION__
,
ip
->
str
,
net_ip
->
ipv4_address
);
return
-
1
;
break
;
case
AF_INET6
:
if
(
net_ip
->
ipv6
)
{
S1AP_DEBUG
(
"%s(%s,%s)=%d
\n
"
,
__FUNCTION__
,
ip
->
str
,
net_ip
->
ipv4_address
,
strcmp
(
ip
->
str
,
net_ip
->
ipv6_address
));
return
strcmp
(
ip
->
str
,
net_ip
->
ipv6_address
);
}
S1AP_DEBUG
(
"%s(%s,%s)=-1 (IP version (6) not matching)
\n
"
,
__FUNCTION__
,
ip
->
str
,
net_ip
->
ipv6_address
);
return
-
1
;
break
;
default:
S1AP_DEBUG
(
"%s(%s,...)=-1 (unknown IP version)
\n
"
,
__FUNCTION__
,
ip
->
str
);
return
-
1
;
}
}
...
...
openair3/TEST/EPC_TEST/play_scenario.h
View file @
610e07a9
...
...
@@ -47,6 +47,10 @@
#include "play_scenario_s1ap_eNB_defs.h"
#include "hashtable.h"
// powers of 2
#define ET_BIT_MASK_MATCH_SCTP_STREAM 1
#define ET_BIT_MASK_MATCH_SCTP_SSN 2
//#define ET_BIT_MASK_MATCH_S1AP_ 2
#define MAX_ENB 16
...
...
@@ -396,6 +400,8 @@ void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p);
struct
s1ap_eNB_mme_data_s
*
et_s1ap_eNB_get_MME
(
s1ap_eNB_instance_t
*
instance_p
,
int32_t
assoc_id
,
uint16_t
cnx_id
);
s1ap_eNB_instance_t
*
et_s1ap_eNB_get_instance
(
instance_t
instance
);
void
et_s1ap_eNB_itti_send_sctp_data_req
(
instance_t
instance
,
int32_t
assoc_id
,
uint8_t
*
buffer
,
uint32_t
buffer_length
,
uint16_t
stream
);
int
et_s1ap_is_matching
(
et_s1ap_t
*
const
s1ap1
,
et_s1ap_t
*
const
s1ap2
,
const
uint32_t
constraints
);
et_packet_t
*
et_build_packet_from_s1ap_data_ind
(
et_event_s1ap_data_ind_t
*
const
s1ap_data_ind
);
void
et_s1ap_process_rx_packet
(
et_event_s1ap_data_ind_t
*
const
sctp_data_ind
);
void
et_s1ap_eNB_handle_sctp_data_ind
(
sctp_data_ind_t
*
const
sctp_data_ind
);
void
et_s1ap_eNB_register_mme
(
s1ap_eNB_instance_t
*
instance_p
,
...
...
@@ -428,6 +434,11 @@ void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t
et_packet_t
*
et_parse_xml_packet
(
xmlDocPtr
doc
,
xmlNodePtr
node
);
et_scenario_t
*
et_generate_scenario
(
const
char
*
const
et_scenario_filename
);
//-------------------------
int
et_s1ap_ies_is_matching
(
const
S1AP_PDU_PR
present
,
s1ap_message
*
const
m1
,
s1ap_message
*
const
m2
,
const
uint32_t
constraints
);
//-------------------------
int
et_sctp_data_is_matching
(
sctp_datahdr_t
*
const
sctp1
,
sctp_datahdr_t
*
const
sctp2
,
const
uint32_t
constraints
);
int
et_sctp_is_matching
(
et_sctp_hdr_t
*
const
sctp1
,
et_sctp_hdr_t
*
const
sctp2
,
const
uint32_t
constraints
);
//------------------------------------------------------------------------------
void
et_print_hex_octets
(
const
unsigned
char
*
const
byte_stream
,
const
unsigned
long
int
num
);
int
et_is_file_exists
(
const
char
const
*
file_nameP
,
const
char
const
*
file_roleP
);
int
et_strip_extension
(
char
*
in_filename
);
...
...
openair3/TEST/EPC_TEST/play_scenario_fsm.c
View file @
610e07a9
...
...
@@ -50,6 +50,7 @@
et_scenario_t
*
g_scenario
=
NULL
;
pthread_mutex_t
g_fsm_lock
=
PTHREAD_MUTEX_INITIALIZER
;
et_fsm_state_t
g_fsm_state
=
ET_FSM_STATE_NULL
;
uint32_t
g_constraints
=
ET_BIT_MASK_MATCH_SCTP_STREAM
|
ET_BIT_MASK_MATCH_SCTP_SSN
;
//------------------------------------------------------------------------------
int
timeval_subtract
(
struct
timeval
*
const
result
,
struct
timeval
*
const
a
,
struct
timeval
*
const
b
)
{
...
...
@@ -123,6 +124,9 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet)
}
if
(
we_are_too_early
>
0
)
{
// set timer
LOG_D
(
ENB_APP
,
"Send packet num %u original frame number %u in %ld.%d sec
\n
"
,
packet
->
packet_number
,
packet
->
original_frame_number
,
offset
.
tv_sec
,
offset
.
tv_usec
);
packet
->
status
=
ET_PACKET_STATUS_SCHEDULED_FOR_SENDING
;
if
(
timer_setup
(
offset
.
tv_sec
,
offset
.
tv_usec
,
TASK_S1AP
,
INSTANCE_DEFAULT
,
TIMER_ONE_SHOT
,
NULL
,
&
packet
->
timer_id
)
<
0
)
{
...
...
@@ -130,7 +134,9 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet)
}
// Done g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT;
}
else
{
LOG_D
(
ENB_APP
,
"Send packet num %u original frame number %u immediately
\n
"
,
packet
->
packet_number
,
packet
->
original_frame_number
);
// send immediately
AssertFatal
(
0
==
gettimeofday
(
&
packet
->
timestamp_packet
,
NULL
),
"gettimeofday() Failed"
);
et_s1ap_eNB_itti_send_sctp_data_req
(
packet
->
enb_instance
,
packet
->
sctp_hdr
.
u
.
data_hdr
.
assoc_id
,
...
...
@@ -161,7 +167,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event)
AssertFatal
(
0
,
"Event ET_EVENT_TX_TIMED_PACKET not handled in FSM state ET_FSM_STATE_RUNNING"
);
break
;
case
ET_EVENT_RX_S1AP
:
AssertFatal
(
0
,
"TODO"
);
et_s1ap_process_rx_packet
(
&
event
.
u
.
s1ap_data_ind
);
break
;
default:
AssertFatal
(
0
,
"Case event %d not handled in ET_FSM_STATE_RUNNING"
,
event
.
code
);
...
...
@@ -185,6 +191,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting(et_event_t event)
break
;
case
ET_EVENT_TX_TIMED_PACKET
:
// send immediately
AssertFatal
(
0
==
gettimeofday
(
&
event
.
u
.
tx_timed_packet
->
timestamp_packet
,
NULL
),
"gettimeofday() Failed"
);
et_s1ap_eNB_itti_send_sctp_data_req
(
event
.
u
.
tx_timed_packet
->
enb_instance
,
event
.
u
.
tx_timed_packet
->
sctp_hdr
.
u
.
data_hdr
.
assoc_id
,
...
...
@@ -290,7 +297,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event)
switch
(
g_scenario
->
next_packet
->
sctp_hdr
.
chunk_type
)
{
case
SCTP_CID_DATA
:
// no init in this scenario, may be sub-scenario
// no init in this scenario, may be sub-scenario
, ...
if
(
g_scenario
->
next_packet
->
action
==
ET_PACKET_ACTION_S1C_SEND
)
{
et_scenario_schedule_tx_packet
(
g_scenario
->
next_packet
);
pthread_mutex_unlock
(
&
g_fsm_lock
);
...
...
openair3/TEST/EPC_TEST/play_scenario_parse.c
View file @
610e07a9
...
...
@@ -518,7 +518,7 @@ int et_generate_xml_scenario(
for
(
i
=
0
;
i
<
g_enb_properties
.
number
;
i
++
)
{
// eNB S1-C IPv4 address
sprintf
(
astring
,
"enb
_s1c%d
"
,
i
);
sprintf
(
astring
,
"enb
%d_s1c
"
,
i
);
params
[
nb_params
++
]
=
strdup
(
astring
);
addr
.
s_addr
=
g_enb_properties
.
properties
[
i
]
->
enb_ipv4_address_for_S1_MME
;
sprintf
(
astring
,
"
\"
%s
\"
"
,
inet_ntoa
(
addr
));
...
...
@@ -526,7 +526,7 @@ int et_generate_xml_scenario(
// MME S1-C IPv4 address
for
(
j
=
0
;
j
<
g_enb_properties
.
properties
[
i
]
->
nb_mme
;
j
++
)
{
sprintf
(
astring
,
"mme
_s1c%d
_%d"
,
i
,
j
);
sprintf
(
astring
,
"mme
%d_s1c
_%d"
,
i
,
j
);
params
[
nb_params
++
]
=
strdup
(
astring
);
AssertFatal
(
g_enb_properties
.
properties
[
i
]
->
mme_ip_address
[
j
].
ipv4_address
,
"Only support MME IPv4 address
\n
"
);
...
...
openair3/TEST/EPC_TEST/play_scenario_s1ap.c
View file @
610e07a9
...
...
@@ -40,6 +40,7 @@
#include <stdint.h>
#include <unistd.h>
#include <crypt.h>
#include <sys/time.h>
#include "tree.h"
#include "queue.h"
...
...
@@ -58,6 +59,7 @@ s1ap_eNB_internal_data_t s1ap_eNB_internal_data;
RB_GENERATE
(
s1ap_mme_map
,
s1ap_eNB_mme_data_s
,
entry
,
et_s1ap_eNB_compare_assoc_id
);
//------------------------------------------------------------------------------
extern
et_scenario_t
*
g_scenario
;
extern
uint32_t
g_constraints
;
//------------------------------------------------------------------------------
int
et_s1ap_eNB_compare_assoc_id
(
struct
s1ap_eNB_mme_data_s
*
p1
,
struct
s1ap_eNB_mme_data_s
*
p2
)
...
...
@@ -187,20 +189,86 @@ void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id,
itti_send_msg_to_task
(
TASK_SCTP
,
instance
,
message_p
);
}
//------------------------------------------------------------------------------
void
et_s1ap_process_rx_packet
(
et_event_s1ap_data_ind_t
*
const
sctp_data_ind
)
int
et_s1ap_is_matching
(
et_s1ap_t
*
const
s1ap1
,
et_s1ap_t
*
const
s1ap2
,
const
uint32_t
constraints
)
{
if
(
s1ap1
->
pdu
.
present
!=
s1ap2
->
pdu
.
present
)
return
-
6
;
switch
(
s1ap1
->
pdu
.
present
)
{
case
S1AP_PDU_PR_NOTHING
:
break
;
case
S1AP_PDU_PR_initiatingMessage
:
if
(
s1ap1
->
pdu
.
choice
.
initiatingMessage
.
procedureCode
!=
s1ap2
->
pdu
.
choice
.
initiatingMessage
.
procedureCode
)
return
-
7
;
if
(
s1ap1
->
pdu
.
choice
.
initiatingMessage
.
criticality
!=
s1ap2
->
pdu
.
choice
.
initiatingMessage
.
criticality
)
return
-
8
;
break
;
case
S1AP_PDU_PR_successfulOutcome
:
if
(
s1ap1
->
pdu
.
choice
.
successfulOutcome
.
procedureCode
!=
s1ap2
->
pdu
.
choice
.
successfulOutcome
.
procedureCode
)
return
-
7
;
if
(
s1ap1
->
pdu
.
choice
.
successfulOutcome
.
criticality
!=
s1ap2
->
pdu
.
choice
.
successfulOutcome
.
criticality
)
return
-
8
;
break
;
case
S1AP_PDU_PR_unsuccessfulOutcome
:
if
(
s1ap1
->
pdu
.
choice
.
unsuccessfulOutcome
.
procedureCode
!=
s1ap2
->
pdu
.
choice
.
unsuccessfulOutcome
.
procedureCode
)
return
-
7
;
if
(
s1ap1
->
pdu
.
choice
.
unsuccessfulOutcome
.
criticality
!=
s1ap2
->
pdu
.
choice
.
unsuccessfulOutcome
.
criticality
)
return
-
8
;
break
;
default:
AssertFatal
(
0
,
"Unknown pdu.present %d"
,
s1ap1
->
pdu
.
present
);
}
if
(
s1ap1
->
binary_stream_allocated_size
==
s1ap2
->
binary_stream_allocated_size
)
{
if
(
memcmp
((
void
*
)
s1ap1
->
binary_stream
,
(
void
*
)
s1ap2
->
binary_stream
,
s1ap1
->
binary_stream_allocated_size
)
==
0
)
return
0
;
}
// if no matching, may be the scenario need minor corrections (same enb_ue_s1ap_id but need to update mme_ue_s1ap_id)
return
et_s1ap_ies_is_matching
(
s1ap1
->
pdu
.
present
,
&
s1ap1
->
message
,
&
s1ap2
->
message
,
constraints
);
}
//------------------------------------------------------------------------------
et_packet_t
*
et_build_packet_from_s1ap_data_ind
(
et_event_s1ap_data_ind_t
*
const
s1ap_data_ind
)
{
et_packet_t
*
packet
=
NULL
;
AssertFatal
(
NULL
!=
s1ap_data_ind
,
"Bad parameter sctp_data_ind
\n
"
);
packet
=
calloc
(
1
,
sizeof
(
*
packet
));
packet
->
action
=
ET_PACKET_ACTION_S1C_NULL
;
//packet->time_relative_to_first_packet.tv_sec = 0;
//packet->time_relative_to_first_packet.tv_usec = 0;
//packet->time_relative_to_last_sent_packet.tv_sec = 0;
//packet->time_relative_to_last_sent_packet.tv_usec = 0;
//packet->time_relative_to_last_received_packet.tv_sec = 0;
//packet->time_relative_to_last_received_packet.tv_usec = 0;
//packet->original_frame_number = 0;
//packet->packet_number = 0;
packet
->
enb_instance
=
0
;
//TODO
//packet->ip_hdr;
// keep in mind: allocated buffer: sctp_datahdr.payload.binary_stream
memcpy
((
void
*
)
&
packet
->
sctp_hdr
,
(
void
*
)
&
s1ap_data_ind
->
sctp_datahdr
,
sizeof
(
packet
->
sctp_hdr
));
//packet->next = NULL;
packet
->
status
=
ET_PACKET_STATUS_RECEIVED
;
//packet->timer_id = 0;
AssertFatal
(
0
==
gettimeofday
(
&
packet
->
timestamp_packet
,
NULL
),
"gettimeofday() Failed"
);
return
packet
;
}
//------------------------------------------------------------------------------
void
et_s1ap_process_rx_packet
(
et_event_s1ap_data_ind_t
*
const
s1ap_data_ind
)
{
et_packet_t
*
packet
=
NULL
;
et_packet_t
*
rx_packet
=
NULL
;
unsigned
long
int
not_found
=
1
;
AssertFatal
(
NULL
!=
s1ap_data_ind
,
"Bad parameter sctp_data_ind
\n
"
);
rx_packet
=
et_build_packet_from_s1ap_data_ind
(
s1ap_data_ind
);
packet
=
g_scenario
->
next_packet
;
// not_found threshold may sure depend on number of mme, may be not sure on number of UE
while
((
NULL
!=
packet
)
&&
(
not_found
<
5
))
{
if
(
packet
->
action
==
ET_PACKET_ACTION_S1C_RECEIVE
)
{
//TODO
if
(
et_sctp_is_matching
(
&
packet
->
sctp_hdr
,
&
rx_packet
->
sctp_hdr
,
g_constraints
)
==
0
)
{
et_scenario_set_packet_received
(
packet
);
}
}
not_found
+=
1
;
packet
=
packet
->
next
;
}
S1AP_DEBUG
(
"Rx packet not found in scenario:
\n
"
);
et_display_packet_sctp
(
&
rx_packet
->
sctp_hdr
);
}
//------------------------------------------------------------------------------
...
...
@@ -234,7 +302,7 @@ void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind)
&
event
.
u
.
s1ap_data_ind
.
sctp_datahdr
.
payload
.
message
,
event
.
u
.
s1ap_data_ind
.
sctp_datahdr
.
payload
.
binary_stream
,
event
.
u
.
s1ap_data_ind
.
sctp_datahdr
.
payload
.
binary_stream_allocated_size
)
<
0
)
{
AssertFatal
(
0
,
"ERROR
%s() Cannot decode RX S1AP message!
\n
"
,
__FUNCTION__
);
AssertFatal
(
0
,
"ERROR
Cannot decode RX S1AP message!
\n
"
);
}
}
...
...
@@ -319,6 +387,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id,
switch
(
packet
->
sctp_hdr
.
chunk_type
)
{
case
SCTP_CID_DATA
:
S1AP_DEBUG
(
"%s for SCTP association (%u) SCTP_CID_DATA
\n
"
,
__FUNCTION__
,
assoc_id
);
if
(
ET_PACKET_STATUS_NONE
==
packet
->
status
)
{
if
(
0
<
old_mme_port
)
{
if
(
g_scenario
->
next_packet
->
action
==
ET_PACKET_ACTION_S1C_SEND
)
{
...
...
@@ -355,6 +424,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id,
// Strong assumption
// in replayed scenario, the order of SCTP INIT packets is supposed to be the same as in the catched scenario
case
SCTP_CID_INIT
:
S1AP_DEBUG
(
"%s for SCTP association (%u) SCTP_CID_INIT
\n
"
,
__FUNCTION__
,
assoc_id
);
ret
=
et_compare_et_ip_to_net_ip_address
(
&
packet
->
ip_hdr
.
dst
,
&
mme_desc_p
->
mme_net_ip_address
);
if
(
0
==
ret
)
{
ret
=
et_compare_et_ip_to_net_ip_address
(
&
packet
->
ip_hdr
.
src
,
&
s1ap_eNB_instance
->
s1c_net_ip_address
);
...
...
@@ -363,6 +433,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id,
if
(
ET_PACKET_STATUS_NONE
==
packet
->
status
)
{
packet
->
status
=
ET_PACKET_STATUS_SENT
;
old_enb_port
=
packet
->
sctp_hdr
.
src_port
;
S1AP_DEBUG
(
"%s for SCTP association (%u) SCTP_CID_INIT SUCCESS
\n
"
,
__FUNCTION__
,
assoc_id
);
}
}
}
...
...
@@ -370,14 +441,16 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id,
break
;
case
SCTP_CID_INIT_ACK
:
ret
=
et_compare_et_ip_to_net_ip_address
(
&
packet
->
ip_hdr
.
dst
,
&
mme_desc_p
->
mme_net_ip_address
);
S1AP_DEBUG
(
"%s for SCTP association (%u) SCTP_CID_INIT_ACK
\n
"
,
__FUNCTION__
,
assoc_id
);
ret
=
et_compare_et_ip_to_net_ip_address
(
&
packet
->
ip_hdr
.
src
,
&
mme_desc_p
->
mme_net_ip_address
);
if
(
0
==
ret
)
{
ret
=
et_compare_et_ip_to_net_ip_address
(
&
packet
->
ip_hdr
.
src
,
&
s1ap_eNB_instance
->
s1c_net_ip_address
);
ret
=
et_compare_et_ip_to_net_ip_address
(
&
packet
->
ip_hdr
.
dst
,
&
s1ap_eNB_instance
->
s1c_net_ip_address
);
if
(
0
==
ret
)
{
if
(
old_enb_port
==
packet
->
sctp_hdr
.
dst_port
)
{
if
(
ET_PACKET_STATUS_NONE
==
packet
->
status
)
{
packet
->
status
=
ET_PACKET_STATUS_RECEIVED
;
old_mme_port
=
packet
->
sctp_hdr
.
dst_port
;
S1AP_DEBUG
(
"%s for SCTP association (%u) SCTP_CID_INIT_ACK SUCCESS
\n
"
,
__FUNCTION__
,
assoc_id
);
}
}
}
...
...
@@ -475,6 +548,7 @@ void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_
DevCheck
(
new_instance
->
mcc
==
s1ap_register_eNB
->
mcc
,
new_instance
->
mcc
,
s1ap_register_eNB
->
mcc
,
0
);
DevCheck
(
new_instance
->
mnc
==
s1ap_register_eNB
->
mnc
,
new_instance
->
mnc
,
s1ap_register_eNB
->
mnc
,
0
);
DevCheck
(
new_instance
->
mnc_digit_length
==
s1ap_register_eNB
->
mnc_digit_length
,
new_instance
->
mnc_digit_length
,
s1ap_register_eNB
->
mnc_digit_length
,
0
);
DevCheck
(
memcmp
((
void
*
)
&
new_instance
->
s1c_net_ip_address
,
(
void
*
)
&
s1ap_register_eNB
->
enb_ip_address
,
sizeof
(
new_instance
->
s1c_net_ip_address
))
==
0
,
0
,
0
,
0
);
}
else
{
new_instance
=
calloc
(
1
,
sizeof
(
s1ap_eNB_instance_t
));
DevAssert
(
new_instance
!=
NULL
);
...
...
@@ -491,6 +565,7 @@ void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_
new_instance
->
mcc
=
s1ap_register_eNB
->
mcc
;
new_instance
->
mnc
=
s1ap_register_eNB
->
mnc
;
new_instance
->
mnc_digit_length
=
s1ap_register_eNB
->
mnc_digit_length
;
memcpy
((
void
*
)
&
new_instance
->
s1c_net_ip_address
,
(
void
*
)
&
s1ap_register_eNB
->
enb_ip_address
,
sizeof
(
new_instance
->
s1c_net_ip_address
));
/* Add the new instance to the list of eNB (meaningfull in virtual mode) */
et_s1ap_eNB_insert_new_instance
(
new_instance
);
...
...
openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
0 → 100644
View file @
610e07a9
This diff is collapsed.
Click to expand it.
openair3/TEST/EPC_TEST/play_scenario_sctp.c
View file @
610e07a9
...
...
@@ -43,3 +43,48 @@
#include "assertions.h"
#include "play_scenario.h"
//------------------------------------------------------------------------------
int
et_sctp_data_is_matching
(
sctp_datahdr_t
*
const
sctp1
,
sctp_datahdr_t
*
const
sctp2
,
const
uint32_t
constraints
)
{
// no comparison for ports
if
(
sctp1
->
ppid
!=
sctp2
->
ppid
)
return
-
4
;
if
(
sctp1
->
assoc_id
!=
sctp2
->
assoc_id
)
return
-
5
;
if
(
sctp1
->
stream
!=
sctp2
->
stream
)
{
if
(
constraints
&
ET_BIT_MASK_MATCH_SCTP_STREAM
)
{
return
-
2
;
}
else
{
S1AP_WARN
(
"No Matching SCTP stream %u %u
\n
"
,
sctp1
->
stream
,
sctp2
->
stream
);
}
}
if
(
sctp1
->
ssn
!=
sctp2
->
ssn
)
{
if
(
constraints
&
ET_BIT_MASK_MATCH_SCTP_SSN
)
{
return
-
3
;
}
else
{
S1AP_WARN
(
"No Matching SCTP ssn %u %u
\n
"
,
sctp1
->
ssn
,
sctp2
->
ssn
);
}
}
return
et_s1ap_is_matching
(
&
sctp1
->
payload
,
&
sctp2
->
payload
,
constraints
);
}
//------------------------------------------------------------------------------
int
et_sctp_is_matching
(
et_sctp_hdr_t
*
const
sctp1
,
et_sctp_hdr_t
*
const
sctp2
,
const
uint32_t
constraints
)
{
// no comparison for ports
if
(
sctp1
->
chunk_type
!=
sctp2
->
chunk_type
)
return
-
1
;
switch
(
sctp1
->
chunk_type
)
{
case
SCTP_CID_DATA
:
return
et_sctp_data_is_matching
(
&
sctp1
->
u
.
data_hdr
,
&
sctp2
->
u
.
data_hdr
,
constraints
);
break
;
case
SCTP_CID_INIT
:
AssertFatal
(
0
,
"Not needed now"
);
break
;
case
SCTP_CID_INIT_ACK
:
AssertFatal
(
0
,
"Not needed now"
);
break
;
default:
AssertFatal
(
0
,
"Not needed now cid %d"
,
sctp1
->
chunk_type
);
}
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