Commit 7321aab6 authored by Bi-Ruei, Chiu's avatar Bi-Ruei, Chiu

Add S1AP R14 based on new asn1c

This feature requires an un-official version of asn1c :

https://github.com/velichkov/asn1c/tree/s1ap
parent 1272cabb
...@@ -280,6 +280,7 @@ set(protobuf_generated_dir ${OPENAIR_BIN_DIR}) ...@@ -280,6 +280,7 @@ set(protobuf_generated_dir ${OPENAIR_BIN_DIR})
# RRC # RRC
###### ######
add_list2_option(RRC_ASN1_VERSION "Rel14" "ASN.1 version of RRC interface" "Rel8" "Rel10" "Rel14" "CBA") add_list2_option(RRC_ASN1_VERSION "Rel14" "ASN.1 version of RRC interface" "Rel8" "Rel10" "Rel14" "CBA")
if (${RRC_ASN1_VERSION} STREQUAL "Rel8") if (${RRC_ASN1_VERSION} STREQUAL "Rel8")
...@@ -292,7 +293,7 @@ else() ...@@ -292,7 +293,7 @@ else()
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/RRC-e30.asn) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/RRC-e30.asn)
endif (${RRC_ASN1_VERSION} STREQUAL "Rel8") endif (${RRC_ASN1_VERSION} STREQUAL "Rel8")
set (RRC_FULL_DIR ${asn1_generated_dir}/${RRC_ASN1_VERSION}) set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION})
if(NOT EXISTS ${asn1c_call}) if(NOT EXISTS ${asn1c_call})
message( FATAL_ERROR "The script ${asn1c_call} must be present" ) message( FATAL_ERROR "The script ${asn1c_call} must be present" )
endif(NOT EXISTS ${asn1c_call}) endif(NOT EXISTS ${asn1c_call})
...@@ -331,10 +332,14 @@ add_custom_command ( ...@@ -331,10 +332,14 @@ add_custom_command (
# Same limitation as described in RRC: unknown generated file list # Same limitation as described in RRC: unknown generated file list
# so we generate it at cmake time # so we generate it at cmake time
############## ##############
add_list1_option(S1AP_VERSION R10 "S1AP Asn.1 grammar version" R8 R9 R10) add_list1_option(S1AP_VERSION R14 "S1AP Asn.1 grammar version" R8 R9 R10 R14)
set(S1AP_DIR ${OPENAIR3_DIR}/S1AP) set(S1AP_DIR ${OPENAIR3_DIR}/S1AP)
if (${S1AP_VERSION} STREQUAL "R10") if (${S1AP_VERSION} STREQUAL "R14")
set (ASN1RELDIR R14.4)
add_definitions("-DUPDATE_RELEASE_9 -DUPDATE_RELEASE_10 -DUPDATE_RELEASE_14")
set(S1AP_ASN_FILES s1ap-14.4.0.asn1)
elseif (${S1AP_VERSION} STREQUAL "R10")
set (ASN1RELDIR R10.5) set (ASN1RELDIR R10.5)
add_definitions("-DUPDATE_RELEASE_9 -DUPDATE_RELEASE_10") add_definitions("-DUPDATE_RELEASE_9 -DUPDATE_RELEASE_10")
elseif (${S1AP_VERSION} STREQUAL "R9") elseif (${S1AP_VERSION} STREQUAL "R9")
...@@ -342,52 +347,28 @@ elseif (${S1AP_VERSION} STREQUAL "R9") ...@@ -342,52 +347,28 @@ elseif (${S1AP_VERSION} STREQUAL "R9")
add_definitions("-DUPDATE_RELEASE_9") add_definitions("-DUPDATE_RELEASE_9")
else(${S1AP_VERSION} STREQUAL "R8") else(${S1AP_VERSION} STREQUAL "R8")
set (ASN1RELDIR R8.10) set (ASN1RELDIR R8.10)
endif(${S1AP_VERSION} STREQUAL "R10") endif(${S1AP_VERSION} STREQUAL "R14")
set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR}) set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR})
set(S1AP_ASN_FILES set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${ASN1RELDIR})
${S1AP_ASN_DIR}/S1AP-CommonDataTypes.asn message("calling ASN1C_PREFIX=S1AP_ asn1c -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}")
${S1AP_ASN_DIR}/S1AP-Constants.asn execute_process(COMMAND mkdir -p ${S1AP_C_DIR}
${S1AP_ASN_DIR}/S1AP-IEs.asn COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
${S1AP_ASN_DIR}/S1AP-PDU.asn
)
set(S1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR})
#message("calling ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}")
execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}
RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0)
execute_process(COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR}
RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "asn1tostruct.py: error")
endif (NOT ${ret} STREQUAL 0)
execute_process(COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION}
RESULT_VARIABLE ret) RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${fix_asn1c_call}: error") message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
file(GLOB S1AP_source ${S1AP_C_DIR}/*.c) file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
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) file(GLOB s1ap_h ${S1AP_C_DIR}/*.h)
set(s1ap_h ${s1ap_h} ) set(s1ap_h ${s1ap_h} )
add_custom_command ( add_custom_command (
OUTPUT ${S1AP_OAI_generated} OUTPUT ${S1AP_C_DIR}/S1AP_asn_constant.h
COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES} COMMAND mkdir -p ${S1AP_C_DIR}
COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR} COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION} DEPENDS ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
DEPENDS ${S1AP_ASN_FILES} )
)
add_library(S1AP_LIB add_library(S1AP_LIB
${S1AP_OAI_generated}
${S1AP_source} ${S1AP_source}
${S1AP_DIR}/s1ap_common.c ${S1AP_DIR}/s1ap_common.c
) )
...@@ -396,10 +377,9 @@ include_directories ("${S1AP_C_DIR}") ...@@ -396,10 +377,9 @@ include_directories ("${S1AP_C_DIR}")
include_directories ("${S1AP_DIR}") include_directories ("${S1AP_DIR}")
add_library(S1AP_ENB add_library(S1AP_ENB
${S1AP_C_DIR}/s1ap_ies_defs.h # ${S1AP_C_DIR}/s1ap_ies_defs.h
${S1AP_DIR}/s1ap_eNB.c ${S1AP_DIR}/s1ap_eNB.c
${S1AP_DIR}/s1ap_eNB_context_management_procedures.c ${S1AP_DIR}/s1ap_eNB_context_management_procedures.c
${S1AP_DIR}/s1ap_eNB_decoder.c
${S1AP_DIR}/s1ap_eNB_encoder.c ${S1AP_DIR}/s1ap_eNB_encoder.c
${S1AP_DIR}/s1ap_eNB_handlers.c ${S1AP_DIR}/s1ap_eNB_handlers.c
${S1AP_DIR}/s1ap_eNB_itti_messaging.c ${S1AP_DIR}/s1ap_eNB_itti_messaging.c
...@@ -409,6 +389,7 @@ add_library(S1AP_ENB ...@@ -409,6 +389,7 @@ add_library(S1AP_ENB
${S1AP_DIR}/s1ap_eNB_overload.c ${S1AP_DIR}/s1ap_eNB_overload.c
${S1AP_DIR}/s1ap_eNB_trace.c ${S1AP_DIR}/s1ap_eNB_trace.c
${S1AP_DIR}/s1ap_eNB_ue_context.c ${S1AP_DIR}/s1ap_eNB_ue_context.c
${S1AP_DIR}/s1ap_eNB_decoder.c
) )
...@@ -417,61 +398,39 @@ add_library(S1AP_ENB ...@@ -417,61 +398,39 @@ add_library(S1AP_ENB
# Same limitation as described in RRC/S1AP: unknown generated file list # Same limitation as described in RRC/S1AP: unknown generated file list
# so we generate it at cmake time # so we generate it at cmake time
############## ##############
add_list1_option(X2AP_VERSION R11 "X2AP Asn.1 grammar version" R10 R11) add_list1_option(X2AP_VERSION R14 "X2AP Asn.1 grammar version" R10 R11 R14)
set(X2AP_DIR ${OPENAIR2_DIR}/X2AP) set(X2AP_DIR ${OPENAIR2_DIR}/X2AP)
if (${X2AP_VERSION} STREQUAL "R11") if (${X2AP_VERSION} STREQUAL "R14")
set (ASN1RELDIR R14.5)
set (X2AP_ASN_FILES x2ap-14.5.0.asn1)
elseif (${X2AP_VERSION} STREQUAL "R11")
set (ASN1RELDIR R11.2) set (ASN1RELDIR R11.2)
elseif (${X2AP_VERSION} STREQUAL "R10") elseif (${X2AP_VERSION} STREQUAL "R10")
set (ASN1RELDIR R.UNKNOWN) set (ASN1RELDIR R.UNKNOWN)
endif(${X2AP_VERSION} STREQUAL "R11") endif(${X2AP_VERSION} STREQUAL "R14")
set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR}) set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR})
set(X2AP_ASN_FILES
${X2AP_ASN_DIR}/X2AP-CommonDataTypes.asn
${X2AP_ASN_DIR}/X2AP-Constants.asn
${X2AP_ASN_DIR}/X2AP-IEs.asn
${X2AP_ASN_DIR}/X2AP-PDU.asn
${X2AP_ASN_DIR}/X2AP-Containers.asn
)
set(X2AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR}) set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${ASN1RELDIR})
#message("calling ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}") message("calling asn1c -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}")
execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES} execute_process(COMMAND mkdir -p ${X2AP_C_DIR}
COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
RESULT_VARIABLE ret) RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${asn1c_call}: error") message(FATAL_ERROR "${asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
execute_process(COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}
RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "asn1tostruct.py: error")
endif (NOT ${ret} STREQUAL 0)
execute_process(COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION}
RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${fix_asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0)
file(GLOB X2AP_source ${X2AP_C_DIR}/*.c) file(GLOB X2AP_source ${X2AP_C_DIR}/*.c)
set(X2AP_OAI_generated
${X2AP_C_DIR}/x2ap_decoder.c
${X2AP_C_DIR}/x2ap_encoder.c
${X2AP_C_DIR}/x2ap_xer_print.c
${X2AP_C_DIR}/x2ap_ies_defs.h
)
file(GLOB x2ap_h ${X2AP_C_DIR}/*.h) file(GLOB x2ap_h ${X2AP_C_DIR}/*.h)
set(x2ap_h ${x2ap_h} ) set(x2ap_h ${x2ap_h} )
#message("calling ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}")
add_custom_command ( add_custom_command (
OUTPUT ${X2AP_OAI_generated} OUTPUT ${X2AP_C_DIR}/X2AP_asn_constant.h
COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES} COMMAND mkdir -p ${X2AP_C_DIR}
COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR} COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION} DEPENDS ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
DEPENDS ${X2AP_ASN_FILES}
) )
add_library(X2AP_LIB add_library(X2AP_LIB
${X2AP_OAI_generated}
${X2AP_source} ${X2AP_source}
${X2AP_DIR}/x2ap_common.c ${X2AP_DIR}/x2ap_common.c
) )
......
...@@ -659,8 +659,10 @@ install_asn1c_from_source(){ ...@@ -659,8 +659,10 @@ install_asn1c_from_source(){
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log " echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
( (
$SUDO rm -rf /tmp/asn1c $SUDO rm -rf /tmp/asn1c
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c # GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
git clone git checkout https://github.com/velichkov/asn1c /tmp/asn1c
cd /tmp/asn1c cd /tmp/asn1c
git checkout s1ap
./configure ./configure
make -j`nproc` make -j`nproc`
$SUDO make install $SUDO make install
......
...@@ -94,7 +94,7 @@ function patch_rrc() ...@@ -94,7 +94,7 @@ function patch_rrc()
case "$version" in case "$version" in
Rel14 ) Rel14 )
echo "patching RRC files release 14" echo "patching RRC files release 14"
apply_patches "$directory" RRC_Rel14 ${#RRC_Rel14[*]} # apply_patches "$directory" RRC_Rel14 ${#RRC_Rel14[*]}
;; ;;
Rel10 ) Rel10 )
echo "patching RRC files release 10" echo "patching RRC files release 10"
...@@ -115,6 +115,8 @@ function patch_x2ap() ...@@ -115,6 +115,8 @@ function patch_x2ap()
local version="$2" local version="$2"
case "$version" in case "$version" in
R14 )
;;
R11 ) R11 )
echo "patching X2AP files release 11.2" echo "patching X2AP files release 11.2"
apply_patches "$directory" X2AP_Rel11_2 ${#X2AP_Rel11_2[*]} apply_patches "$directory" X2AP_Rel11_2 ${#X2AP_Rel11_2[*]}
...@@ -131,6 +133,8 @@ function patch_s1ap() ...@@ -131,6 +133,8 @@ function patch_s1ap()
local version="$2" local version="$2"
case "$version" in case "$version" in
R14 )
;;
R10 ) R10 )
#nothing to do anymore (fixes went to asn1c) #nothing to do anymore (fixes went to asn1c)
;; ;;
......
...@@ -99,7 +99,7 @@ echo done with asnfix ...@@ -99,7 +99,7 @@ echo done with asnfix
echo running asn1c echo running asn1c
asn1c -gen-PER -fcompound-names fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample asn1c -gen-PER -fcompound-names -no-gen-example fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
rm -f fixed_grammar.asn rm -f fixed_grammar.asn
...@@ -107,7 +107,7 @@ echo asn1c done ...@@ -107,7 +107,7 @@ echo asn1c done
else else
asn1c -gen-PER -fcompound-names $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample asn1c -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
fi fi
......
...@@ -69,7 +69,7 @@ mac_rrc_data_req( ...@@ -69,7 +69,7 @@ mac_rrc_data_req(
const frame_t frameP, const frame_t frameP,
const rb_id_t Srb_id, const rb_id_t Srb_id,
const uint8_t Nb_tb, const uint8_t Nb_tb,
uint8_t* const buffer_pP, uint8_t *const buffer_pP,
const uint8_t mbsfn_sync_area const uint8_t mbsfn_sync_area
) )
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
...@@ -78,18 +78,13 @@ mac_rrc_data_req( ...@@ -78,18 +78,13 @@ mac_rrc_data_req(
SRB_INFO *Srb_info; SRB_INFO *Srb_info;
uint8_t Sdu_size = 0; uint8_t Sdu_size = 0;
uint8_t sfn = (uint8_t)((frameP>>2)&0xff); uint8_t sfn = (uint8_t)((frameP>>2)&0xff);
#ifdef DEBUG_RRC #ifdef DEBUG_RRC
int i; int i;
LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id); LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id);
#endif #endif
eNB_RRC_INST *rrc; eNB_RRC_INST *rrc;
rrc_eNB_carrier_data_t *carrier; rrc_eNB_carrier_data_t *carrier;
BCCH_BCH_Message_t *mib; BCCH_BCH_Message_t *mib;
rrc = RC.rrc[Mod_idP]; rrc = RC.rrc[Mod_idP];
carrier = &rrc->carrier[0]; carrier = &rrc->carrier[0];
mib = &carrier->mib; mib = &carrier->mib;
...@@ -107,7 +102,6 @@ mac_rrc_data_req( ...@@ -107,7 +102,6 @@ mac_rrc_data_req(
memcpy(&buffer_pP[0], memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB1, RC.rrc[Mod_idP]->carrier[CC_id].SIB1,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1); RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
#if 0 //defined(ENABLE_ITTI) #if 0 //defined(ENABLE_ITTI)
{ {
MessageDef *message_p; MessageDef *message_p;
...@@ -127,11 +121,9 @@ mac_rrc_data_req( ...@@ -127,11 +121,9 @@ mac_rrc_data_req(
RC.rrc[Mod_idP]->carrier[CC_id].SIB1, RC.rrc[Mod_idP]->carrier[CC_id].SIB1,
sib1_size); sib1_size);
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index; RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
} }
#endif #endif
#ifdef DEBUG_RRC #ifdef DEBUG_RRC
LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 1\n",Mod_idP,frameP); LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 1\n",Mod_idP,frameP);
...@@ -141,14 +133,12 @@ mac_rrc_data_req( ...@@ -141,14 +133,12 @@ mac_rrc_data_req(
LOG_T(RRC,"\n"); LOG_T(RRC,"\n");
#endif #endif
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1); return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
} // All RFN mod 8 transmit SIB2-3 in SF 5 } // All RFN mod 8 transmit SIB2-3 in SF 5
else if ((frameP%8) == 1) { else if ((frameP%8) == 1) {
memcpy(&buffer_pP[0], memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB23, RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23); RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
#if 0 //defined(ENABLE_ITTI) #if 0 //defined(ENABLE_ITTI)
{ {
MessageDef *message_p; MessageDef *message_p;
...@@ -168,11 +158,9 @@ mac_rrc_data_req( ...@@ -168,11 +158,9 @@ mac_rrc_data_req(
RC.rrc[Mod_idP]->carrier[CC_id].SIB23, RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
sib23_size); sib23_size);
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index; RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
} }
#endif #endif
#ifdef DEBUG_RRC #ifdef DEBUG_RRC
LOG_T(RRC,"[eNB %d] Frame %d BCCH request => SIB 2-3\n",Mod_idP,frameP); LOG_T(RRC,"[eNB %d] Frame %d BCCH request => SIB 2-3\n",Mod_idP,frameP);
...@@ -187,11 +175,12 @@ mac_rrc_data_req( ...@@ -187,11 +175,12 @@ mac_rrc_data_req(
return(0); return(0);
} }
} }
if( (Srb_id & RAB_OFFSET ) == MIBCH) {
if( (Srb_id & RAB_OFFSET ) == MIBCH) {
mib->message.systemFrameNumber.buf = &sfn; mib->message.systemFrameNumber.buf = &sfn;
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message, enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message,
(void*)mib, NULL,
(void *)mib,
carrier->MIB, carrier->MIB,
24); 24);
LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded); LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded);
...@@ -216,7 +205,6 @@ mac_rrc_data_req( ...@@ -216,7 +205,6 @@ mac_rrc_data_req(
// check if data is there for MAC // check if data is there for MAC
if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer
LOG_D(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload); LOG_D(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload);
#if 0 // defined(ENABLE_ITTI) #if 0 // defined(ENABLE_ITTI)
{ {
MessageDef *message_p; MessageDef *message_p;
...@@ -234,11 +222,9 @@ mac_rrc_data_req( ...@@ -234,11 +222,9 @@ mac_rrc_data_req(
memset (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, 0, CCCH_SDU_SIZE); memset (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, 0, CCCH_SDU_SIZE);
memcpy (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, Srb_info->Tx_buffer.Payload, ccch_size); memcpy (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, Srb_info->Tx_buffer.Payload, ccch_size);
RRC_MAC_CCCH_DATA_REQ (message_p).enb_index = eNB_index; RRC_MAC_CCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
} }
#endif #endif
memcpy(buffer_pP,Srb_info->Tx_buffer.Payload,Srb_info->Tx_buffer.payload_size); memcpy(buffer_pP,Srb_info->Tx_buffer.Payload,Srb_info->Tx_buffer.payload_size);
Sdu_size = Srb_info->Tx_buffer.payload_size; Sdu_size = Srb_info->Tx_buffer.payload_size;
Srb_info->Tx_buffer.payload_size=0; Srb_info->Tx_buffer.payload_size=0;
...@@ -254,7 +240,6 @@ mac_rrc_data_req( ...@@ -254,7 +240,6 @@ mac_rrc_data_req(
if(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] > 0) { //Fill buffer if(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] > 0) { //Fill buffer
LOG_D(RRC,"[eNB %d] PCCH (%p) has %d bytes\n",Mod_idP,&RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], LOG_D(RRC,"[eNB %d] PCCH (%p) has %d bytes\n",Mod_idP,&RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area],
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]); RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]);
#if 0 //defined(ENABLE_ITTI) #if 0 //defined(ENABLE_ITTI)
{ {
MessageDef *message_p; MessageDef *message_p;
...@@ -272,11 +257,9 @@ mac_rrc_data_req( ...@@ -272,11 +257,9 @@ mac_rrc_data_req(
memset (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, 0, PCCH_SDU_SIZE); memset (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, 0, PCCH_SDU_SIZE);
memcpy (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], pcch_size); memcpy (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], pcch_size);
RRC_MAC_PCCH_DATA_REQ (message_p).enb_index = eNB_index; RRC_MAC_PCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
} }
#endif #endif
memcpy(buffer_pP, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]); memcpy(buffer_pP, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]);
Sdu_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]; Sdu_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area];
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] = 0; RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] = 0;
...@@ -292,7 +275,6 @@ mac_rrc_data_req( ...@@ -292,7 +275,6 @@ mac_rrc_data_req(
return 0; // this parameter is set in function init_mcch in rrc_eNB.c return 0; // this parameter is set in function init_mcch in rrc_eNB.c
} }
#if 0 // defined(ENABLE_ITTI) #if 0 // defined(ENABLE_ITTI)
{ {
MessageDef *message_p; MessageDef *message_p;
...@@ -313,15 +295,12 @@ mac_rrc_data_req( ...@@ -313,15 +295,12 @@ mac_rrc_data_req(
mcch_size); mcch_size);
RRC_MAC_MCCH_DATA_REQ (message_p).enb_index = eNB_index; RRC_MAC_MCCH_DATA_REQ (message_p).enb_index = eNB_index;
RRC_MAC_MCCH_DATA_REQ (message_p).mbsfn_sync_area = mbsfn_sync_area; RRC_MAC_MCCH_DATA_REQ (message_p).mbsfn_sync_area = mbsfn_sync_area;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
} }
#endif #endif
memcpy(&buffer_pP[0], memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area], RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]); RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
#ifdef DEBUG_RRC #ifdef DEBUG_RRC
LOG_D(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_idP,frameP); LOG_D(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_idP,frameP);
...@@ -331,7 +310,6 @@ mac_rrc_data_req( ...@@ -331,7 +310,6 @@ mac_rrc_data_req(
LOG_T(RRC,"\n"); LOG_T(RRC,"\n");
#endif #endif
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]); return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
// } // }
//else //else
...@@ -339,16 +317,16 @@ mac_rrc_data_req( ...@@ -339,16 +317,16 @@ mac_rrc_data_req(
} }
#endif //Rel10 || Rel14 #endif //Rel10 || Rel14
#ifdef Rel14 #ifdef Rel14
if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR){
if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR) {
memcpy(&buffer_pP[0], memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR, RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR); RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR); return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
} }
if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR){ // First SI message with SIB2/3 if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR) { // First SI message with SIB2/3
memcpy(&buffer_pP[0], memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR, RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR); RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR);
...@@ -356,8 +334,6 @@ mac_rrc_data_req( ...@@ -356,8 +334,6 @@ mac_rrc_data_req(
} }
#endif #endif
return(0); return(0);
} }
...@@ -370,7 +346,7 @@ mac_rrc_data_ind( ...@@ -370,7 +346,7 @@ mac_rrc_data_ind(
const sub_frame_t sub_frameP, const sub_frame_t sub_frameP,
const rnti_t rntiP, const rnti_t rntiP,
const rb_id_t srb_idP, const rb_id_t srb_idP,
const uint8_t* sduP, const uint8_t *sduP,
const sdu_size_t sdu_lenP, const sdu_size_t sdu_lenP,
const uint8_t mbsfn_sync_areaP const uint8_t mbsfn_sync_areaP
) )
...@@ -379,18 +355,14 @@ mac_rrc_data_ind( ...@@ -379,18 +355,14 @@ mac_rrc_data_ind(
SRB_INFO *Srb_info; SRB_INFO *Srb_info;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
sdu_size_t sdu_size = 0; sdu_size_t sdu_size = 0;
/* for no gcc warnings */ /* for no gcc warnings */
(void)sdu_size; (void)sdu_size;
/* /*
int si_window; int si_window;
*/ */
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, rntiP, frameP, sub_frameP,0); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, rntiP, frameP, sub_frameP,0);
Srb_info = &RC.rrc[module_idP]->carrier[CC_id].Srb0; Srb_info = &RC.rrc[module_idP]->carrier[CC_id].Srb0;
LOG_D(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id); LOG_D(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id);
#if 0 //defined(ENABLE_ITTI) #if 0 //defined(ENABLE_ITTI)
{ {
MessageDef *message_p; MessageDef *message_p;
...@@ -424,9 +396,7 @@ mac_rrc_data_ind( ...@@ -424,9 +396,7 @@ mac_rrc_data_ind(
} }
#endif #endif
return(0); return(0);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -437,7 +407,7 @@ mac_eNB_get_rrc_status( ...@@ -437,7 +407,7 @@ mac_eNB_get_rrc_status(
) )
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
struct rrc_eNB_ue_context_s* ue_context_p = NULL; struct rrc_eNB_ue_context_s *ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context( ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[Mod_idP], RC.rrc[Mod_idP],
rntiP); rntiP);
...@@ -455,25 +425,28 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, ...@@ -455,25 +425,28 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
const sub_frame_t subframeP, const sub_frame_t subframeP,
const rnti_t rntiP) const rnti_t rntiP)
{ {
struct rrc_eNB_ue_context_s* ue_context_p = NULL; struct rrc_eNB_ue_context_s *ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context( ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[Mod_instP], RC.rrc[Mod_instP],
rntiP); rntiP);
if (ue_context_p != NULL) { if (ue_context_p != NULL) {
LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP); LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP);
if(ue_context_p->ue_context.ul_failure_timer == 0) if(ue_context_p->ue_context.ul_failure_timer == 0)
ue_context_p->ue_context.ul_failure_timer=1; ue_context_p->ue_context.ul_failure_timer=1;
} }
else { else {
LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP); LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
} }
if (rrc_agent_registered[Mod_instP]) { if (rrc_agent_registered[Mod_instP]) {
agent_rrc_xface[Mod_instP]->flexran_agent_notify_ue_state_change(Mod_instP, agent_rrc_xface[Mod_instP]->flexran_agent_notify_ue_state_change(Mod_instP,
rntiP, rntiP,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED); PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
} }
// rrc_mac_remove_ue(Mod_instP,rntiP);
// rrc_mac_remove_ue(Mod_instP,rntiP);
} }
void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP, void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP,
...@@ -482,10 +455,11 @@ void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP, ...@@ -482,10 +455,11 @@ void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP,
const sub_frame_t subframeP, const sub_frame_t subframeP,
const rnti_t rntiP) const rnti_t rntiP)
{ {
struct rrc_eNB_ue_context_s* ue_context_p = NULL; struct rrc_eNB_ue_context_s *ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context( ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[Mod_instP], RC.rrc[Mod_instP],
rntiP); rntiP);
if (ue_context_p != NULL) { if (ue_context_p != NULL) {
LOG_I(RRC,"Frame %d, Subframe %d: UE %x U-Plane failure, activating timer\n",frameP,subframeP,rntiP); LOG_I(RRC,"Frame %d, Subframe %d: UE %x U-Plane failure, activating timer\n",frameP,subframeP,rntiP);
...@@ -503,7 +477,7 @@ void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, ...@@ -503,7 +477,7 @@ void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
const sub_frame_t subframeP, const sub_frame_t subframeP,
const rnti_t rntiP) const rnti_t rntiP)
{ {
struct rrc_eNB_ue_context_s* ue_context_p = NULL; struct rrc_eNB_ue_context_s *ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context( ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[Mod_instP], RC.rrc[Mod_instP],
rntiP); rntiP);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <stdint.h> #include <stdint.h>
#include "x2ap_common.h" #include "x2ap_common.h"
#include "X2AP-PDU.h" #include "X2AP_X2AP-PDU.h"
int asn_debug = 0; int asn_debug = 0;
int asn1_xer_print = 0; int asn1_xer_print = 0;
...@@ -55,29 +55,27 @@ inline void ASN_DEBUG(const char *fmt, ...) ...@@ -55,29 +55,27 @@ inline void ASN_DEBUG(const char *fmt, ...)
ssize_t x2ap_generate_initiating_message( ssize_t x2ap_generate_initiating_message(
uint8_t **buffer, uint8_t **buffer,
uint32_t *length, uint32_t *length,
X2ap_ProcedureCode_t procedureCode, X2AP_ProcedureCode_t procedureCode,
X2ap_Criticality_t criticality, X2AP_Criticality_t criticality,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
void *sptr) void *sptr)
{ {
X2AP_PDU_t pdu; X2AP_X2AP_PDU_t pdu;
ssize_t encoded; ssize_t encoded;
memset(&pdu, 0, sizeof(X2AP_X2AP_PDU_t));
memset(&pdu, 0, sizeof(X2AP_PDU_t)); pdu.present = X2AP_X2AP_PDU_PR_initiatingMessage;
pdu.present = X2AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = procedureCode; pdu.choice.initiatingMessage.procedureCode = procedureCode;
pdu.choice.initiatingMessage.criticality = criticality; pdu.choice.initiatingMessage.criticality = criticality;
ANY_fromType_aper(&pdu.choice.initiatingMessage.value, td, sptr); ANY_fromType_aper(&pdu.choice.initiatingMessage.value, td, sptr);
if (asn1_xer_print) { if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_X2AP_PDU, (void *)&pdu); xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)&pdu);
} }
/* We can safely free list of IE from sptr */ /* We can safely free list of IE from sptr */
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr); ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_PDU, 0, &pdu, if ((encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_X2AP_PDU, 0, &pdu,
(void **)buffer)) < 0) { (void **)buffer)) < 0) {
return -1; return -1;
} }
...@@ -89,107 +87,67 @@ ssize_t x2ap_generate_initiating_message( ...@@ -89,107 +87,67 @@ ssize_t x2ap_generate_initiating_message(
ssize_t x2ap_generate_successfull_outcome( ssize_t x2ap_generate_successfull_outcome(
uint8_t **buffer, uint8_t **buffer,
uint32_t *length, uint32_t *length,
X2ap_ProcedureCode_t procedureCode, X2AP_ProcedureCode_t procedureCode,
X2ap_Criticality_t criticality, X2AP_Criticality_t criticality,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
void *sptr) void *sptr)
{ {
X2AP_PDU_t pdu; X2AP_X2AP_PDU_t pdu;
ssize_t encoded; ssize_t encoded;
memset(&pdu, 0, sizeof(X2AP_X2AP_PDU_t));
memset(&pdu, 0, sizeof(X2AP_PDU_t)); pdu.present = X2AP_X2AP_PDU_PR_successfulOutcome;
pdu.present = X2AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = procedureCode; pdu.choice.successfulOutcome.procedureCode = procedureCode;
pdu.choice.successfulOutcome.criticality = criticality; pdu.choice.successfulOutcome.criticality = criticality;
ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr); ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr);
if (asn1_xer_print) { if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_X2AP_PDU, (void *)&pdu); xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)&pdu);
} }
/* We can safely free list of IE from sptr */ /* We can safely free list of IE from sptr */
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr); ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_PDU, 0, &pdu, if ((encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_X2AP_PDU, 0, &pdu,
(void **)buffer)) < 0) { (void **)buffer)) < 0) {
return -1; return -1;
} }
*length = encoded; *length = encoded;
return encoded; return encoded;
} }
ssize_t x2ap_generate_unsuccessfull_outcome( ssize_t x2ap_generate_unsuccessfull_outcome(
uint8_t **buffer, uint8_t **buffer,
uint32_t *length, uint32_t *length,
X2ap_ProcedureCode_t procedureCode, X2AP_ProcedureCode_t procedureCode,
X2ap_Criticality_t criticality, X2AP_Criticality_t criticality,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
void *sptr) void *sptr)
{ {
X2AP_PDU_t pdu; X2AP_X2AP_PDU_t pdu;
ssize_t encoded; ssize_t encoded;
memset(&pdu, 0, sizeof(X2AP_X2AP_PDU_t));
memset(&pdu, 0, sizeof(X2AP_PDU_t)); pdu.present = X2AP_X2AP_PDU_PR_unsuccessfulOutcome;
pdu.present = X2AP_PDU_PR_unsuccessfulOutcome;
pdu.choice.successfulOutcome.procedureCode = procedureCode; pdu.choice.successfulOutcome.procedureCode = procedureCode;
pdu.choice.successfulOutcome.criticality = criticality; pdu.choice.successfulOutcome.criticality = criticality;
ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr); ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr);
if (asn1_xer_print) { if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_X2AP_PDU, (void *)&pdu); xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)&pdu);
} }
/* We can safely free list of IE from sptr */ /* We can safely free list of IE from sptr */
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr); ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_PDU, 0, &pdu, if ((encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_X2AP_PDU, 0, &pdu,
(void **)buffer)) < 0) { (void **)buffer)) < 0) {
return -1; return -1;
} }
*length = encoded; *length = encoded;
return encoded; return encoded;
} }
X2ap_IE_t *x2ap_new_ie( void x2ap_handle_criticality(X2AP_Criticality_t criticality)
X2ap_ProtocolIE_ID_t id,
X2ap_Criticality_t criticality,
asn_TYPE_descriptor_t *type,
void *sptr)
{
X2ap_IE_t *buff;
if ((buff = malloc(sizeof(X2ap_IE_t))) == NULL) {
// Possible error on malloc
return NULL;
}
memset((void *)buff, 0, sizeof(X2ap_IE_t));
buff->id = id;
buff->criticality = criticality;
if (ANY_fromType_aper(&buff->value, type, sptr) < 0) {
fprintf(stderr, "Encoding of %s failed\n", type->name);
free(buff);
return NULL;
}
if (asn1_xer_print)
if (xer_fprint(stdout, &asn_DEF_X2ap_IE, buff) < 0) {
free(buff);
return NULL;
}
return buff;
}
void x2ap_handle_criticality(X2ap_Criticality_t criticality)
{ {
} }
This diff is collapsed.
This diff is collapsed.
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <stdint.h> #include <stdint.h>
#include "s1ap_common.h" #include "s1ap_common.h"
#include "S1AP-PDU.h" #include "S1AP_S1AP-PDU.h"
int asn_debug = 0; int asn_debug = 0;
int asn1_xer_print = 0; int asn1_xer_print = 0;
...@@ -53,144 +53,6 @@ inline void ASN_DEBUG(const char *fmt, ...) ...@@ -53,144 +53,6 @@ inline void ASN_DEBUG(const char *fmt, ...)
} }
#endif #endif
ssize_t s1ap_generate_initiating_message( void s1ap_handle_criticality(S1AP_Criticality_t criticality)
uint8_t **buffer,
uint32_t *length,
e_S1ap_ProcedureCode procedureCode,
S1ap_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr)
{ {
S1AP_PDU_t pdu;
ssize_t encoded;
memset(&pdu, 0, sizeof(S1AP_PDU_t));
pdu.present = S1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = procedureCode;
pdu.choice.initiatingMessage.criticality = criticality;
ANY_fromType_aper(&pdu.choice.initiatingMessage.value, td, sptr);
if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_S1AP_PDU, (void *)&pdu);
}
/* We can safely free list of IE from sptr */
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &pdu,
(void **)buffer)) < 0) {
return -1;
}
*length = encoded;
return encoded;
}
ssize_t s1ap_generate_successfull_outcome(
uint8_t **buffer,
uint32_t *length,
e_S1ap_ProcedureCode procedureCode,
S1ap_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr)
{
S1AP_PDU_t pdu;
ssize_t encoded;
memset(&pdu, 0, sizeof(S1AP_PDU_t));
pdu.present = S1AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = procedureCode;
pdu.choice.successfulOutcome.criticality = criticality;
ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr);
if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_S1AP_PDU, (void *)&pdu);
}
/* We can safely free list of IE from sptr */
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &pdu,
(void **)buffer)) < 0) {
return -1;
}
*length = encoded;
return encoded;
}
ssize_t s1ap_generate_unsuccessfull_outcome(
uint8_t **buffer,
uint32_t *length,
e_S1ap_ProcedureCode procedureCode,
S1ap_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr)
{
S1AP_PDU_t pdu;
ssize_t encoded;
memset(&pdu, 0, sizeof(S1AP_PDU_t));
pdu.present = S1AP_PDU_PR_unsuccessfulOutcome;
pdu.choice.successfulOutcome.procedureCode = procedureCode;
pdu.choice.successfulOutcome.criticality = criticality;
ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr);
if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_S1AP_PDU, (void *)&pdu);
}
/* We can safely free list of IE from sptr */
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &pdu,
(void **)buffer)) < 0) {
return -1;
}
*length = encoded;
return encoded;
}
S1ap_IE_t *s1ap_new_ie(
S1ap_ProtocolIE_ID_t id,
S1ap_Criticality_t criticality,
asn_TYPE_descriptor_t *type,
void *sptr)
{
S1ap_IE_t *buff;
if ((buff = malloc(sizeof(S1ap_IE_t))) == NULL) {
// Possible error on malloc
return NULL;
}
memset((void *)buff, 0, sizeof(S1ap_IE_t));
buff->id = id;
buff->criticality = criticality;
if (ANY_fromType_aper(&buff->value, type, sptr) < 0) {
fprintf(stderr, "Encoding of %s failed\n", type->name);
free(buff);
return NULL;
}
if (asn1_xer_print)
if (xer_fprint(stdout, &asn_DEF_S1ap_IE, buff) < 0) {
free(buff);
return NULL;
}
return buff;
}
void s1ap_handle_criticality(S1ap_Criticality_t criticality)
{
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
*/ */
#include <stdint.h> #include <stdint.h>
#include "s1ap_ies_defs.h"
#ifndef S1AP_ENB_DECODER_H_ #ifndef S1AP_ENB_DECODER_H_
#define S1AP_ENB_DECODER_H_ #define S1AP_ENB_DECODER_H_
int s1ap_eNB_decode_pdu(s1ap_message *message, const uint8_t * const buffer, int s1ap_eNB_decode_pdu(S1AP_S1AP_PDU_t *pdu, const uint8_t *const buffer,
const uint32_t length) __attribute__ ((warn_unused_result)); const uint32_t length) __attribute__ ((warn_unused_result));
#endif /* S1AP_ENB_DECODER_H_ */ #endif /* S1AP_ENB_DECODER_H_ */
This diff is collapsed.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#ifndef S1AP_ENB_ENCODER_H_ #ifndef S1AP_ENB_ENCODER_H_
#define S1AP_ENB_ENCODER_H_ #define S1AP_ENB_ENCODER_H_
int s1ap_eNB_encode_pdu(s1ap_message *message, uint8_t **buffer, uint32_t *len) int s1ap_eNB_encode_pdu(S1AP_S1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
__attribute__ ((warn_unused_result)); __attribute__ ((warn_unused_result));
#endif /* S1AP_ENB_ENCODER_H_ */ #endif /* S1AP_ENB_ENCODER_H_ */
This diff is collapsed.
This diff is collapsed.
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
#define S1AP_ENB_NAS_PROCEDURES_H_ #define S1AP_ENB_NAS_PROCEDURES_H_
int s1ap_eNB_handle_nas_downlink( int s1ap_eNB_handle_nas_downlink(
const uint32_t assoc_id, uint32_t assoc_id,
const uint32_t stream, uint32_t stream,
struct s1ap_message_s* message_p); S1AP_S1AP_PDU_t *pdu);
int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_p); int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_p);
void s1ap_eNB_nas_non_delivery_ind(instance_t instance, int s1ap_eNB_nas_non_delivery_ind(instance_t instance,
s1ap_nas_non_delivery_ind_t *s1ap_nas_non_delivery_ind); s1ap_nas_non_delivery_ind_t *s1ap_nas_non_delivery_ind);
int s1ap_eNB_handle_nas_first_req( int s1ap_eNB_handle_nas_first_req(
......
This diff is collapsed.
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
// struct s1ap_message_s *message_p); // struct s1ap_message_s *message_p);
int s1ap_eNB_handle_overload_start(uint32_t assoc_id, int s1ap_eNB_handle_overload_start(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p); S1AP_S1AP_PDU_t *pdu);
/** /**
* \brief Handle an overload stop message * \brief Handle an overload stop message
...@@ -40,6 +40,6 @@ int s1ap_eNB_handle_overload_start(uint32_t assoc_id, ...@@ -40,6 +40,6 @@ int s1ap_eNB_handle_overload_start(uint32_t assoc_id,
// struct s1ap_message_s *message_p); // struct s1ap_message_s *message_p);
int s1ap_eNB_handle_overload_stop(uint32_t assoc_id, int s1ap_eNB_handle_overload_stop(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p); S1AP_S1AP_PDU_t *pdu);
#endif /* S1AP_ENB_OVERLOAD_H_ */ #endif /* S1AP_ENB_OVERLOAD_H_ */
This diff is collapsed.
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
// struct s1ap_message_s *message_p); // struct s1ap_message_s *message_p);
int s1ap_eNB_handle_trace_start(uint32_t assoc_id, int s1ap_eNB_handle_trace_start(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p); S1AP_S1AP_PDU_t *pdu);
// int s1ap_eNB_handle_deactivate_trace(eNB_mme_desc_t *eNB_desc_p, // int s1ap_eNB_handle_deactivate_trace(eNB_mme_desc_t *eNB_desc_p,
// sctp_queue_item_t *packet_p, // sctp_queue_item_t *packet_p,
// struct s1ap_message_s *message_p); // struct s1ap_message_s *message_p);
int s1ap_eNB_handle_deactivate_trace(uint32_t assoc_id, int s1ap_eNB_handle_deactivate_trace(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
struct s1ap_message_s *message_p); S1AP_S1AP_PDU_t *pdu);
#endif /* S1AP_ENB_TRACE_H_ */ #endif /* S1AP_ENB_TRACE_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment