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
wangjie
OpenXG-RAN
Commits
2c27a38d
Commit
2c27a38d
authored
Sep 21, 2018
by
Konstantinos Alexandris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x2ap: implement x2setuprequest, x2setupresponse, x2setupfailure
parent
938e0242
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1379 additions
and
36 deletions
+1379
-36
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+4
-4
common/utils/msc/msc.h
common/utils/msc/msc.h
+2
-0
openair2/COMMON/x2ap_messages_types.h
openair2/COMMON/x2ap_messages_types.h
+14
-10
openair2/ENB_APP/enb_config.c
openair2/ENB_APP/enb_config.c
+138
-3
openair2/LAYER2/MAC/config.c
openair2/LAYER2/MAC/config.c
+52
-0
openair2/X2AP/x2ap_common.h
openair2/X2AP/x2ap_common.h
+3
-5
openair2/X2AP/x2ap_eNB.c
openair2/X2AP/x2ap_eNB.c
+24
-11
openair2/X2AP/x2ap_eNB_decoder.c
openair2/X2AP/x2ap_eNB_decoder.c
+127
-0
openair2/X2AP/x2ap_eNB_decoder.h
openair2/X2AP/x2ap_eNB_decoder.h
+29
-0
openair2/X2AP/x2ap_eNB_defs.h
openair2/X2AP/x2ap_eNB_defs.h
+11
-0
openair2/X2AP/x2ap_eNB_encoder.c
openair2/X2AP/x2ap_eNB_encoder.c
+54
-0
openair2/X2AP/x2ap_eNB_encoder.h
openair2/X2AP/x2ap_eNB_encoder.h
+28
-0
openair2/X2AP/x2ap_eNB_generate_messages.c
openair2/X2AP/x2ap_eNB_generate_messages.c
+405
-0
openair2/X2AP/x2ap_eNB_generate_messages.h
openair2/X2AP/x2ap_eNB_generate_messages.h
+44
-0
openair2/X2AP/x2ap_eNB_handler.c
openair2/X2AP/x2ap_eNB_handler.c
+353
-0
openair2/X2AP/x2ap_eNB_handler.h
openair2/X2AP/x2ap_eNB_handler.h
+3
-3
openair2/X2AP/x2ap_eNB_itti_messaging.c
openair2/X2AP/x2ap_eNB_itti_messaging.c
+56
-0
openair2/X2AP/x2ap_eNB_itti_messaging.h
openair2/X2AP/x2ap_eNB_itti_messaging.h
+32
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
2c27a38d
...
...
@@ -476,12 +476,12 @@ include_directories ("${X2AP_DIR}")
add_library
(
X2AP_ENB
${
X2AP_DIR
}
/x2ap_eNB.c
#
${X2AP_DIR}/x2ap_eNB_decoder.c
#
${X2AP_DIR}/x2ap_eNB_encoder.c
${
X2AP_DIR
}
/x2ap_eNB_decoder.c
${
X2AP_DIR
}
/x2ap_eNB_encoder.c
${
X2AP_DIR
}
/x2ap_eNB_handler.c
#
${X2AP_DIR}/x2ap_eNB_itti_messaging.c
${
X2AP_DIR
}
/x2ap_eNB_itti_messaging.c
${
X2AP_DIR
}
/x2ap_eNB_management_procedures.c
#
${X2AP_DIR}/x2ap_eNB_generate_messages.c
${
X2AP_DIR
}
/x2ap_eNB_generate_messages.c
)
# Hardware dependant options
...
...
common/utils/msc/msc.h
View file @
2c27a38d
...
...
@@ -63,6 +63,8 @@ typedef enum {
MSC_S6A_MME
,
MSC_HSS
,
MAX_MSC_PROTOS
,
MSC_X2AP_SRC_ENB
,
MSC_X2AP_TARGET_ENB
,
}
msc_proto_t
;
...
...
openair2/COMMON/x2ap_messages_types.h
View file @
2c27a38d
...
...
@@ -63,17 +63,21 @@ typedef struct x2ap_register_enb_req_s {
uint8_t
mnc_digit_length
;
/*
*
EARFCN
*
CC Params
*/
uint16_t
fdd_uL_EARFCN
;
uint16_t
fdd_dL_EARFCN
;
uint16_t
tdd_EARFCN
;
uint16_t
fdd_uL_Transmission_Bandwidth
;
uint16_t
fdd_dL_Transmission_Bandwidth
;
uint16_t
tdd_Transmission_Bandwidth
;
int16_t
eutra_band
[
MAX_NUM_CCs
];
uint32_t
downlink_frequency
[
MAX_NUM_CCs
];
int32_t
uplink_frequency_offset
[
MAX_NUM_CCs
];
uint32_t
Nid_cell
[
MAX_NUM_CCs
];
int16_t
N_RB_DL
[
MAX_NUM_CCs
];
lte_frame_type_t
frame_type
[
MAX_NUM_CCs
];
uint32_t
fdd_earfcn_DL
[
MAX_NUM_CCs
];
uint32_t
fdd_earfcn_UL
[
MAX_NUM_CCs
];
int
num_cc
;
/* To be considered for TDD */
//uint16_t tdd_EARFCN;
//uint16_t tdd_Transmission_Bandwidth;
/* The local eNB IP address to bind */
net_ip_address_t
enb_x2_ip_address
;
...
...
openair2/ENB_APP/enb_config.c
View file @
2c27a38d
...
...
@@ -61,6 +61,9 @@
#include "enb_paramdef.h"
extern
uint16_t
sf_ahead
;
extern
uint32_t
to_earfcn_DL
(
int
eutra_bandP
,
uint32_t
dl_CarrierFreq
,
uint32_t
bw
);
extern
uint32_t
to_earfcn_UL
(
int
eutra_bandP
,
uint32_t
ul_CarrierFreq
,
uint32_t
bw
);
void
RCconfig_flexran
()
{
...
...
@@ -2337,8 +2340,7 @@ return 0;
int
RCconfig_X2
(
MessageDef
*
msg_p
,
uint32_t
i
)
{
int
j
,
k
,
l
;
int
I
,
J
,
j
,
k
,
l
;
int
enb_id
;
char
*
address
=
NULL
;
...
...
@@ -2350,6 +2352,88 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i)
/* get global parameters, defined outside any section in the config file */
config_get
(
ENBSParams
,
sizeof
(
ENBSParams
)
/
sizeof
(
paramdef_t
),
NULL
);
/* define CC params */
int32_t
Nid_cell
=
0
;
char
*
frame_type
,
*
prefix_type
,
*
pbch_repetition
,
*
prach_high_speed
,
*
pusch_hoppingMode
,
*
pusch_enable64QAM
,
*
pusch_groupHoppingEnabled
,
*
pusch_sequenceHoppingEnabled
,
*
phich_duration
,
*
phich_resource
,
*
srs_enable
,
*
srs_ackNackST
,
*
srs_MaxUpPts
,
*
pusch_alpha
,
*
pucch_deltaF_Format1
,
*
pucch_deltaF_Format1b
,
*
pucch_deltaF_Format2
,
*
pucch_deltaF_Format2a
,
*
pucch_deltaF_Format2b
,
*
rach_preamblesGroupAConfig
,
*
rach_messagePowerOffsetGroupB
,
*
pcch_nB
;
long
long
int
downlink_frequency
;
int32_t
tdd_config
,
tdd_config_s
,
eutra_band
,
uplink_frequency_offset
,
Nid_cell_mbsfn
,
N_RB_DL
,
nb_antenna_ports
,
prach_root
,
prach_config_index
,
prach_zero_correlation
,
prach_freq_offset
,
pucch_delta_shift
,
pucch_nRB_CQI
,
pucch_nCS_AN
,
pucch_n1_AN
,
pdsch_referenceSignalPower
,
pdsch_p_b
,
pusch_n_SB
,
pusch_hoppingOffset
,
pusch_groupAssignment
,
pusch_nDMRS1
,
srs_BandwidthConfig
,
srs_SubframeConfig
,
pusch_p0_Nominal
,
pucch_p0_Nominal
,
msg3_delta_Preamble
,
rach_numberOfRA_Preambles
,
rach_sizeOfRA_PreamblesGroupA
,
rach_messageSizeGroupA
,
rach_powerRampingStep
,
rach_preambleInitialReceivedTargetPower
,
rach_preambleTransMax
,
rach_raResponseWindowSize
,
rach_macContentionResolutionTimer
,
rach_maxHARQ_Msg3Tx
,
pcch_defaultPagingCycle
,
bcch_modificationPeriodCoeff
,
ue_TimersAndConstants_t300
,
ue_TimersAndConstants_t301
,
ue_TimersAndConstants_t310
,
ue_TimersAndConstants_t311
,
ue_TimersAndConstants_n310
,
ue_TimersAndConstants_n311
,
ue_TransmissionMode
,
ue_multiple_max
;
const
char
*
rxPool_sc_CP_Len
;
const
char
*
rxPool_sc_Period
;
const
char
*
rxPool_data_CP_Len
;
libconfig_int
rxPool_ResourceConfig_prb_Num
;
libconfig_int
rxPool_ResourceConfig_prb_Start
;
libconfig_int
rxPool_ResourceConfig_prb_End
;
const
char
*
rxPool_ResourceConfig_offsetIndicator_present
;
libconfig_int
rxPool_ResourceConfig_offsetIndicator_choice
;
const
char
*
rxPool_ResourceConfig_subframeBitmap_present
;
char
*
rxPool_ResourceConfig_subframeBitmap_choice_bs_buf
;
libconfig_int
rxPool_ResourceConfig_subframeBitmap_choice_bs_size
;
libconfig_int
rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused
;
//SIB19
//for discRxPool
const
char
*
discRxPool_cp_Len
;
const
char
*
discRxPool_discPeriod
;
libconfig_int
discRxPool_numRetx
;
libconfig_int
discRxPool_numRepetition
;
libconfig_int
discRxPool_ResourceConfig_prb_Num
;
libconfig_int
discRxPool_ResourceConfig_prb_Start
;
libconfig_int
discRxPool_ResourceConfig_prb_End
;
const
char
*
discRxPool_ResourceConfig_offsetIndicator_present
;
libconfig_int
discRxPool_ResourceConfig_offsetIndicator_choice
;
const
char
*
discRxPool_ResourceConfig_subframeBitmap_present
;
char
*
discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf
;
libconfig_int
discRxPool_ResourceConfig_subframeBitmap_choice_bs_size
;
libconfig_int
discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused
;
//for discRxPoolPS
const
char
*
discRxPoolPS_cp_Len
;
const
char
*
discRxPoolPS_discPeriod
;
libconfig_int
discRxPoolPS_numRetx
;
libconfig_int
discRxPoolPS_numRepetition
;
libconfig_int
discRxPoolPS_ResourceConfig_prb_Num
;
libconfig_int
discRxPoolPS_ResourceConfig_prb_Start
;
libconfig_int
discRxPoolPS_ResourceConfig_prb_End
;
const
char
*
discRxPoolPS_ResourceConfig_offsetIndicator_present
;
libconfig_int
discRxPoolPS_ResourceConfig_offsetIndicator_choice
;
const
char
*
discRxPoolPS_ResourceConfig_subframeBitmap_present
;
char
*
discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf
;
libconfig_int
discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size
;
libconfig_int
discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused
;
checkedparam_t
config_check_CCparams
[]
=
CCPARAMS_CHECK
;
paramdef_t
CCsParams
[]
=
CCPARAMS_DESC
;
paramlist_def_t
CCsParamList
=
{
ENB_CONFIG_STRING_COMPONENT_CARRIERS
,
NULL
,
0
};
/* map parameter checking array instances to parameter definition array instances */
for
(
I
=
0
;
I
<
(
sizeof
(
CCsParams
)
/
sizeof
(
paramdef_t
));
I
++
)
{
CCsParams
[
I
].
chkPptr
=
&
(
config_check_CCparams
[
I
]);
}
/*#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
if (strcasecmp( *(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr), ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0;
...
...
@@ -2398,7 +2482,9 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i)
paramdef_t
SCTPParams
[]
=
SCTPPARAMS_DESC
;
paramdef_t
NETParams
[]
=
NETPARAMS_DESC
;
char
aprefix
[
MAX_OPTNAME_SIZE
*
2
+
8
];
/* TODO: fix the size - if set lower we have a crash (MAX_OPTNAME_SIZE was 64 when this code was written) */
/* this is most probably a problem with the config module */
char
aprefix
[
MAX_OPTNAME_SIZE
*
80
+
8
];
/* Some default/random parameters */
...
...
@@ -2425,6 +2511,55 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i)
"BAD MNC DIGIT LENGTH %d"
,
X2AP_REGISTER_ENB_REQ
(
msg_p
).
mnc_digit_length
);
/* CC params */
sprintf
(
aprefix
,
"%s.[%i]"
,
ENB_CONFIG_STRING_ENB_LIST
,
k
);
config_getlist
(
&
CCsParamList
,
NULL
,
0
,
aprefix
);
X2AP_REGISTER_ENB_REQ
(
msg_p
).
num_cc
=
CCsParamList
.
numelt
;
if
(
CCsParamList
.
numelt
>
0
)
{
//char ccspath[MAX_OPTNAME_SIZE*2 + 16];
for
(
J
=
0
;
J
<
CCsParamList
.
numelt
;
J
++
)
{
sprintf
(
aprefix
,
"%s.[%i].%s.[%i]"
,
ENB_CONFIG_STRING_ENB_LIST
,
k
,
ENB_CONFIG_STRING_COMPONENT_CARRIERS
,
J
);
config_get
(
CCsParams
,
sizeof
(
CCsParams
)
/
sizeof
(
paramdef_t
),
aprefix
);
X2AP_REGISTER_ENB_REQ
(
msg_p
).
eutra_band
[
J
]
=
eutra_band
;
X2AP_REGISTER_ENB_REQ
(
msg_p
).
downlink_frequency
[
J
]
=
(
uint32_t
)
downlink_frequency
;
X2AP_REGISTER_ENB_REQ
(
msg_p
).
uplink_frequency_offset
[
J
]
=
(
unsigned
int
)
uplink_frequency_offset
;
X2AP_REGISTER_ENB_REQ
(
msg_p
).
Nid_cell
[
J
]
=
Nid_cell
;
if
(
Nid_cell
>
503
)
{
AssertFatal
(
0
,
"Failed to parse eNB configuration file %s, enb %d unknown value
\"
%d
\"
for Nid_cell choice: 0...503 !
\n
"
,
RC
.
config_file_name
,
k
,
Nid_cell
);
}
X2AP_REGISTER_ENB_REQ
(
msg_p
).
N_RB_DL
[
J
]
=
N_RB_DL
;
if
((
N_RB_DL
!=
6
)
&&
(
N_RB_DL
!=
15
)
&&
(
N_RB_DL
!=
25
)
&&
(
N_RB_DL
!=
50
)
&&
(
N_RB_DL
!=
75
)
&&
(
N_RB_DL
!=
100
))
{
AssertFatal
(
0
,
"Failed to parse eNB configuration file %s, enb %d unknown value
\"
%d
\"
for N_RB_DL choice: 6,15,25,50,75,100 !
\n
"
,
RC
.
config_file_name
,
k
,
N_RB_DL
);
}
if
(
strcmp
(
frame_type
,
"FDD"
)
==
0
)
{
X2AP_REGISTER_ENB_REQ
(
msg_p
).
frame_type
[
J
]
=
FDD
;
}
else
if
(
strcmp
(
frame_type
,
"TDD"
)
==
0
)
{
X2AP_REGISTER_ENB_REQ
(
msg_p
).
frame_type
[
J
]
=
TDD
;
}
else
{
AssertFatal
(
0
,
"Failed to parse eNB configuration file %s, enb %d unknown value
\"
%s
\"
for frame_type choice: FDD or TDD !
\n
"
,
RC
.
config_file_name
,
k
,
frame_type
);
}
X2AP_REGISTER_ENB_REQ
(
msg_p
).
fdd_earfcn_DL
[
J
]
=
to_earfcn_DL
(
eutra_band
,
downlink_frequency
,
N_RB_DL
);
X2AP_REGISTER_ENB_REQ
(
msg_p
).
fdd_earfcn_UL
[
J
]
=
to_earfcn_UL
(
eutra_band
,
downlink_frequency
+
uplink_frequency_offset
,
N_RB_DL
);
}
}
sprintf
(
aprefix
,
"%s.[%i]"
,
ENB_CONFIG_STRING_ENB_LIST
,
k
);
config_getlist
(
&
X2ParamList
,
X2Params
,
sizeof
(
X2Params
)
/
sizeof
(
paramdef_t
),
aprefix
);
...
...
openair2/LAYER2/MAC/config.c
View file @
2c27a38d
...
...
@@ -160,6 +160,58 @@ uint32_t to_earfcn(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw)
(
eutra_bandtable
[
i
].
N_OFFs_DL
/
10
));
}
uint32_t
to_earfcn_DL
(
int
eutra_bandP
,
long
long
int
dl_CarrierFreq
,
uint32_t
bw
)
{
uint32_t
dl_CarrierFreq_by_100k
=
dl_CarrierFreq
/
100000
;
int
bw_by_100
=
bw
/
100
;
int
i
;
AssertFatal
(
eutra_bandP
<
69
,
"eutra_band %d > 68
\n
"
,
eutra_bandP
);
for
(
i
=
0
;
i
<
69
&&
eutra_bandtable
[
i
].
band
!=
eutra_bandP
;
i
++
);
AssertFatal
(
dl_CarrierFreq_by_100k
>=
eutra_bandtable
[
i
].
dl_min
,
"Band %d, bw %u : DL carrier frequency %lld Hz < %u
\n
"
,
eutra_bandP
,
bw
,
dl_CarrierFreq
,
eutra_bandtable
[
i
].
dl_min
);
AssertFatal
(
dl_CarrierFreq_by_100k
<=
(
eutra_bandtable
[
i
].
dl_max
-
bw_by_100
),
"Band %d, bw %u : DL carrier frequency %lld Hz > %d
\n
"
,
eutra_bandP
,
bw
,
dl_CarrierFreq
,
eutra_bandtable
[
i
].
dl_max
-
bw_by_100
);
return
(
dl_CarrierFreq_by_100k
-
eutra_bandtable
[
i
].
dl_min
+
(
eutra_bandtable
[
i
].
N_OFFs_DL
/
10
));
}
uint32_t
to_earfcn_UL
(
int
eutra_bandP
,
long
long
int
ul_CarrierFreq
,
uint32_t
bw
)
{
uint32_t
ul_CarrierFreq_by_100k
=
ul_CarrierFreq
/
100000
;
int
bw_by_100
=
bw
/
100
;
int
i
;
AssertFatal
(
eutra_bandP
<
69
,
"eutra_band %d > 68
\n
"
,
eutra_bandP
);
for
(
i
=
0
;
i
<
69
&&
eutra_bandtable
[
i
].
band
!=
eutra_bandP
;
i
++
);
AssertFatal
(
ul_CarrierFreq_by_100k
>=
eutra_bandtable
[
i
].
ul_min
,
"Band %d, bw %u : UL carrier frequency %lld Hz < %u
\n
"
,
eutra_bandP
,
bw
,
ul_CarrierFreq
,
eutra_bandtable
[
i
].
ul_min
);
AssertFatal
(
ul_CarrierFreq_by_100k
<=
(
eutra_bandtable
[
i
].
ul_max
-
bw_by_100
),
"Band %d, bw %u : UL carrier frequency %lld Hz > %d
\n
"
,
eutra_bandP
,
bw
,
ul_CarrierFreq
,
eutra_bandtable
[
i
].
ul_max
-
bw_by_100
);
return
(
ul_CarrierFreq_by_100k
-
eutra_bandtable
[
i
].
ul_min
+
((
eutra_bandtable
[
i
].
N_OFFs_DL
+
180000
)
/
10
));
}
uint32_t
from_earfcn
(
int
eutra_bandP
,
uint32_t
dl_earfcn
)
{
...
...
openair2/X2AP/x2ap_common.h
View file @
2c27a38d
...
...
@@ -28,12 +28,12 @@
#include "X2AP_InitiatingMessage.h"
#include "X2AP_SuccessfulOutcome.h"
#include "X2AP_UnsuccessfulOutcome.h"
#include "X2AP_ProtocolIE-Field.h"
#include "X2AP_ProtocolIE-FieldPair.h"
#include "X2AP_ProtocolIE-ContainerPair.h"
#include "X2AP_ProtocolExtensionField.h"
#include "X2AP_ProtocolExtensionContainer.h"
#include "X2AP_asn_constant.h"
#include "intertask_interface.h"
#ifndef X2AP_COMMON_H_
#define X2AP_COMMON_H_
...
...
@@ -87,15 +87,13 @@ extern int asn1_xer_print;
if (mandatory) DevAssert(ie != NULL); \
} while(0)
//Forward declaration
struct
x2ap_message_s
;
/** \brief Function callback prototype.
**/
typedef
int
(
*
x2ap_message_decoded_callback
)(
instance_t
instance
,
uint32_t
assocId
,
uint32_t
stream
,
struct
x2ap_message_s
*
message
);
X2AP_X2AP_PDU_t
*
pdu
);
/** \brief Encode a successfull outcome message
\param buffer pointer to buffer in which data will be encoded
...
...
openair2/X2AP/x2ap_eNB.c
View file @
2c27a38d
...
...
@@ -31,6 +31,7 @@
#include "x2ap_eNB_defs.h"
#include "x2ap_eNB_management_procedures.h"
#include "x2ap_eNB_handler.h"
#include "x2ap_eNB_generate_messages.h"
#include "x2ap_common.h"
#include "queue.h"
...
...
@@ -42,9 +43,9 @@ struct x2ap_eNB_data_s;
RB_PROTOTYPE
(
x2ap_enb_map
,
x2ap_eNB_data_s
,
entry
,
x2ap_eNB_compare_assoc_id
);
//
static
//void x2ap_eNB_handle_sctp_data_ind(instance_t instance,
// sctp_data_ind_t *sctp_data_ind);
static
void
x2ap_eNB_handle_sctp_data_ind
(
instance_t
instance
,
sctp_data_ind_t
*
sctp_data_ind
);
static
void
x2ap_eNB_handle_sctp_association_resp
(
instance_t
instance
,
sctp_new_association_resp_t
*
sctp_new_association_resp
);
...
...
@@ -63,22 +64,21 @@ void x2ap_eNB_register_eNB(x2ap_eNB_instance_t *instance_p,
uint32_t
enb_port_for_X2C
,
int
multi_sd
);
/*
static
void x2ap_eNB_handle_sctp_data_ind(instance_t instance,
sctp_data_ind_t *sctp_data_ind) {
void
x2ap_eNB_handle_sctp_data_ind
(
instance_t
instance
,
sctp_data_ind_t
*
sctp_data_ind
)
{
int
result
;
DevAssert
(
sctp_data_ind
!=
NULL
);
x2ap_eNB_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
x2ap_eNB_handle_message
(
instance
,
sctp_data_ind
->
assoc_id
,
sctp_data_ind
->
stream
,
sctp_data_ind
->
buffer
,
sctp_data_ind
->
buffer_length
);
result
=
itti_free
(
TASK_UNKNOWN
,
sctp_data_ind
->
buffer
);
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
}
*/
}
static
void
x2ap_eNB_handle_sctp_association_resp
(
instance_t
instance
,
sctp_new_association_resp_t
*
sctp_new_association_resp
)
...
...
@@ -143,7 +143,7 @@ printf("x2ap_eNB_handle_sctp_association_resp at 4\n");
dump_trees
();
/* Prepare new x2 Setup Request */
//
x2ap_eNB_generate_x2_setup_request(instance_p, x2ap_enb_data_p);
x2ap_eNB_generate_x2_setup_request
(
instance_p
,
x2ap_enb_data_p
);
}
static
...
...
@@ -325,6 +325,19 @@ void x2ap_eNB_handle_register_eNB(instance_t instance,
new_instance
->
mnc
=
x2ap_register_eNB
->
mnc
;
new_instance
->
mnc_digit_length
=
x2ap_register_eNB
->
mnc_digit_length
;
new_instance
->
num_cc
=
x2ap_register_eNB
->
num_cc
;
for
(
int
i
=
0
;
i
<
x2ap_register_eNB
->
num_cc
;
i
++
){
new_instance
->
eutra_band
[
i
]
=
x2ap_register_eNB
->
eutra_band
[
i
];
new_instance
->
downlink_frequency
[
i
]
=
x2ap_register_eNB
->
downlink_frequency
[
i
];
new_instance
->
uplink_frequency_offset
[
i
]
=
x2ap_register_eNB
->
uplink_frequency_offset
[
i
];
new_instance
->
Nid_cell
[
i
]
=
x2ap_register_eNB
->
Nid_cell
[
i
];
new_instance
->
N_RB_DL
[
i
]
=
x2ap_register_eNB
->
N_RB_DL
[
i
];
new_instance
->
frame_type
[
i
]
=
x2ap_register_eNB
->
frame_type
[
i
];
new_instance
->
fdd_earfcn_DL
[
i
]
=
x2ap_register_eNB
->
fdd_earfcn_DL
[
i
];
new_instance
->
fdd_earfcn_UL
[
i
]
=
x2ap_register_eNB
->
fdd_earfcn_UL
[
i
];
}
DevCheck
(
x2ap_register_eNB
->
nb_x2
<=
X2AP_MAX_NB_ENB_IP_ADDRESS
,
X2AP_MAX_NB_ENB_IP_ADDRESS
,
x2ap_register_eNB
->
nb_x2
,
0
);
memcpy
(
new_instance
->
target_enb_x2_ip_address
,
...
...
@@ -429,8 +442,8 @@ void *x2ap_task(void *arg)
break
;
case
SCTP_DATA_IND
:
//
x2ap_eNB_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
//
&received_msg->ittiMsg.sctp_data_ind);
x2ap_eNB_handle_sctp_data_ind
(
ITTI_MESSAGE_GET_INSTANCE
(
received_msg
),
&
received_msg
->
ittiMsg
.
sctp_data_ind
);
break
;
default:
...
...
openair2/X2AP/x2ap_eNB_decoder.c
0 → 100644
View file @
2c27a38d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include "assertions.h"
#include "intertask_interface.h"
#include "x2ap_common.h"
#include "x2ap_eNB_decoder.h"
static
int
x2ap_eNB_decode_initiating_message
(
X2AP_X2AP_PDU_t
*
pdu
)
{
DevAssert
(
pdu
!=
NULL
);
switch
(
pdu
->
choice
.
initiatingMessage
.
procedureCode
)
{
case
X2AP_ProcedureCode_id_x2Setup
:
asn_encode_to_new_buffer
(
NULL
,
ATS_CANONICAL_XER
,
&
asn_DEF_X2AP_X2AP_PDU
,
pdu
);
X2AP_INFO
(
"x2ap_eNB_decode_initiating_message!
\n
"
);
break
;
default:
X2AP_ERROR
(
"Unknown procedure ID (%d) for initiating message
\n
"
,
(
int
)
pdu
->
choice
.
initiatingMessage
.
procedureCode
);
AssertFatal
(
0
,
"Unknown procedure ID (%d) for initiating message
\n
"
,
(
int
)
pdu
->
choice
.
initiatingMessage
.
procedureCode
);
return
-
1
;
}
return
0
;
}
static
int
x2ap_eNB_decode_successful_outcome
(
X2AP_X2AP_PDU_t
*
pdu
)
{
DevAssert
(
pdu
!=
NULL
);
switch
(
pdu
->
choice
.
successfulOutcome
.
procedureCode
)
{
case
X2AP_ProcedureCode_id_x2Setup
:
asn_encode_to_new_buffer
(
NULL
,
ATS_CANONICAL_XER
,
&
asn_DEF_X2AP_X2AP_PDU
,
pdu
);
X2AP_INFO
(
"x2ap_eNB_decode_successfuloutcome_message!
\n
"
);
break
;
default:
X2AP_ERROR
(
"Unknown procedure ID (%d) for successfull outcome message
\n
"
,
(
int
)
pdu
->
choice
.
successfulOutcome
.
procedureCode
);
return
-
1
;
}
return
0
;
}
static
int
x2ap_eNB_decode_unsuccessful_outcome
(
X2AP_X2AP_PDU_t
*
pdu
)
{
DevAssert
(
pdu
!=
NULL
);
switch
(
pdu
->
choice
.
unsuccessfulOutcome
.
procedureCode
)
{
case
X2AP_ProcedureCode_id_x2Setup
:
asn_encode_to_new_buffer
(
NULL
,
ATS_CANONICAL_XER
,
&
asn_DEF_X2AP_X2AP_PDU
,
pdu
);
X2AP_INFO
(
"x2ap_eNB_decode_unsuccessfuloutcome_message!
\n
"
);
break
;
default:
X2AP_ERROR
(
"Unknown procedure ID (%d) for unsuccessfull outcome message
\n
"
,
(
int
)
pdu
->
choice
.
unsuccessfulOutcome
.
procedureCode
);
return
-
1
;
}
return
0
;
}
int
x2ap_eNB_decode_pdu
(
X2AP_X2AP_PDU_t
*
pdu
,
const
uint8_t
*
const
buffer
,
uint32_t
length
)
{
asn_dec_rval_t
dec_ret
;
DevAssert
(
buffer
!=
NULL
);
dec_ret
=
aper_decode
(
NULL
,
&
asn_DEF_X2AP_X2AP_PDU
,
(
void
**
)
&
pdu
,
buffer
,
length
,
0
,
0
);
xer_fprint
(
stdout
,
&
asn_DEF_X2AP_X2AP_PDU
,
pdu
);
if
(
dec_ret
.
code
!=
RC_OK
)
{
X2AP_ERROR
(
"Failed to decode pdu
\n
"
);
return
-
1
;
}
switch
(
pdu
->
present
)
{
case
X2AP_X2AP_PDU_PR_initiatingMessage
:
return
x2ap_eNB_decode_initiating_message
(
pdu
);
case
X2AP_X2AP_PDU_PR_successfulOutcome
:
return
x2ap_eNB_decode_successful_outcome
(
pdu
);
case
X2AP_X2AP_PDU_PR_unsuccessfulOutcome
:
return
x2ap_eNB_decode_unsuccessful_outcome
(
pdu
);
default:
X2AP_DEBUG
(
"Unknown presence (%d) or not implemented
\n
"
,
(
int
)
pdu
->
present
);
break
;
}
return
-
1
;
}
openair2/X2AP/x2ap_eNB_decoder.h
0 → 100644
View file @
2c27a38d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef X2AP_ENB_DECODER_H_
#define X2AP_ENB_DECODER_H_
int
x2ap_eNB_decode_pdu
(
X2AP_X2AP_PDU_t
*
pdu
,
const
uint8_t
*
const
buffer
,
uint32_t
length
)
__attribute__
((
warn_unused_result
));
#endif
/* X2AP_ENB_DECODER_H_ */
openair2/X2AP/x2ap_eNB_defs.h
View file @
2c27a38d
...
...
@@ -151,6 +151,17 @@ typedef struct x2ap_eNB_instance_s {
uint16_t
mnc
;
uint8_t
mnc_digit_length
;
/* CC params */
int16_t
eutra_band
[
MAX_NUM_CCs
];
uint32_t
downlink_frequency
[
MAX_NUM_CCs
];
int32_t
uplink_frequency_offset
[
MAX_NUM_CCs
];
uint32_t
Nid_cell
[
MAX_NUM_CCs
];
int16_t
N_RB_DL
[
MAX_NUM_CCs
];
lte_frame_type_t
frame_type
[
MAX_NUM_CCs
];
uint32_t
fdd_earfcn_DL
[
MAX_NUM_CCs
];
uint32_t
fdd_earfcn_UL
[
MAX_NUM_CCs
];
int
num_cc
;
net_ip_address_t
target_enb_x2_ip_address
[
X2AP_MAX_NB_ENB_IP_ADDRESS
];
uint8_t
nb_x2
;
net_ip_address_t
enb_x2_ip_address
;
...
...
openair2/X2AP/x2ap_eNB_encoder.c
0 → 100644
View file @
2c27a38d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include "assertions.h"
#include "conversions.h"
#include "intertask_interface.h"
#include "x2ap_common.h"
#include "x2ap_eNB_encoder.h"
int
x2ap_eNB_encode_pdu
(
X2AP_X2AP_PDU_t
*
pdu
,
uint8_t
**
buffer
,
uint32_t
*
len
)
{
ssize_t
encoded
;
DevAssert
(
pdu
!=
NULL
);
DevAssert
(
buffer
!=
NULL
);
DevAssert
(
len
!=
NULL
);
if
(
asn1_xer_print
)
{
xer_fprint
(
stdout
,
&
asn_DEF_X2AP_X2AP_PDU
,
(
void
*
)
pdu
);
}
encoded
=
aper_encode_to_new_buffer
(
&
asn_DEF_X2AP_X2AP_PDU
,
0
,
pdu
,
(
void
**
)
buffer
);
if
(
encoded
<
0
)
{
return
-
1
;
}
*
len
=
encoded
;
ASN_STRUCT_FREE_CONTENTS_ONLY
(
asn_DEF_X2AP_X2AP_PDU
,
pdu
);
return
encoded
;
}
openair2/X2AP/x2ap_eNB_encoder.h
0 → 100644
View file @
2c27a38d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef X2AP_ENB_ENCODER_H_
#define X2AP_ENB_ENCODER_H_
int
x2ap_eNB_encode_pdu
(
X2AP_X2AP_PDU_t
*
pdu
,
uint8_t
**
buffer
,
uint32_t
*
len
)
__attribute__
((
warn_unused_result
));
#endif
/* X2AP_ENB_ENCODER_H_ */
openair2/X2AP/x2ap_eNB_generate_messages.c
0 → 100644
View file @
2c27a38d
This diff is collapsed.
Click to expand it.
openair2/X2AP/x2ap_eNB_generate_messages.h
0 → 100644
View file @
2c27a38d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef X2AP_ENB_GENERATE_MESSAGES_H_
#define X2AP_ENB_GENERATE_MESSAGES_H_
#include "x2ap_eNB_defs.h"
#include "x2ap_common.h"
int
x2ap_eNB_generate_x2_setup_request
(
x2ap_eNB_instance_t
*
instance_p
,
x2ap_eNB_data_t
*
x2ap_enb_data_p
);
int
x2ap_eNB_generate_x2_setup_response
(
x2ap_eNB_data_t
*
x2ap_enb_data_p
);
int
x2ap_eNB_generate_x2_setup_failure
(
instance_t
instance
,
uint32_t
assoc_id
,
X2AP_Cause_PR
cause_type
,
long
cause_value
,
long
time_to_wait
);
int
x2ap_eNB_set_cause
(
X2AP_Cause_t
*
cause_p
,
X2AP_Cause_PR
cause_type
,
long
cause_value
);
#endif
/* X2AP_ENB_GENERATE_MESSAGES_H_ */
openair2/X2AP/x2ap_eNB_handler.c
View file @
2c27a38d
This diff is collapsed.
Click to expand it.
openair2/X2AP/x2ap_eNB_handler.h
View file @
2c27a38d
...
...
@@ -24,10 +24,10 @@
#include "x2ap_eNB_defs.h"
void
x2ap_handle_x2_setup_message
(
x2ap_eNB_data_t
*
mme
_desc_p
,
int
sctp_shutdown
);
void
x2ap_handle_x2_setup_message
(
x2ap_eNB_data_t
*
eNB
_desc_p
,
int
sctp_shutdown
);
//int x2ap_eNB_handle_message(
uint32_t assoc_id, int32_t stream,
//
const uint8_t * const data, const uint32_t data_length);
int
x2ap_eNB_handle_message
(
instance_t
instance
,
uint32_t
assoc_id
,
int32_t
stream
,
const
uint8_t
*
const
data
,
const
uint32_t
data_length
);
#endif
/* X2AP_ENB_HANDLERS_H_ */
openair2/X2AP/x2ap_eNB_itti_messaging.c
0 → 100644
View file @
2c27a38d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "intertask_interface.h"
#include "x2ap_eNB_itti_messaging.h"
void
x2ap_eNB_itti_send_sctp_data_req
(
instance_t
instance
,
int32_t
assoc_id
,
uint8_t
*
buffer
,
uint32_t
buffer_length
,
uint16_t
stream
)
{
MessageDef
*
message_p
;
sctp_data_req_t
*
sctp_data_req
;
message_p
=
itti_alloc_new_message
(
TASK_X2AP
,
SCTP_DATA_REQ
);
sctp_data_req
=
&
message_p
->
ittiMsg
.
sctp_data_req
;
sctp_data_req
->
assoc_id
=
assoc_id
;
sctp_data_req
->
buffer
=
buffer
;
sctp_data_req
->
buffer_length
=
buffer_length
;
sctp_data_req
->
stream
=
stream
;
itti_send_msg_to_task
(
TASK_SCTP
,
instance
,
message_p
);
}
void
x2ap_eNB_itti_send_sctp_close_association
(
instance_t
instance
,
int32_t
assoc_id
)
{
MessageDef
*
message_p
=
NULL
;
sctp_close_association_t
*
sctp_close_association_p
=
NULL
;
message_p
=
itti_alloc_new_message
(
TASK_X2AP
,
SCTP_CLOSE_ASSOCIATION
);
sctp_close_association_p
=
&
message_p
->
ittiMsg
.
sctp_close_association
;
sctp_close_association_p
->
assoc_id
=
assoc_id
;
itti_send_msg_to_task
(
TASK_SCTP
,
instance
,
message_p
);
}
openair2/X2AP/x2ap_eNB_itti_messaging.h
0 → 100644
View file @
2c27a38d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef X2AP_ENB_ITTI_MESSAGING_H_
#define X2AP_ENB_ITTI_MESSAGING_H_
void
x2ap_eNB_itti_send_sctp_data_req
(
instance_t
instance
,
int32_t
assoc_id
,
uint8_t
*
buffer
,
uint32_t
buffer_length
,
uint16_t
stream
);
void
x2ap_eNB_itti_send_sctp_close_association
(
instance_t
instance
,
int32_t
assoc_id
);
#endif
/* X2AP_ENB_ITTI_MESSAGING_H_ */
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