Commit 70ea902a authored by Vaibhav Shrivastava's avatar Vaibhav Shrivastava

Full openair3 Rebased changes

parent 72a04396
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "ip_forward_messages_types.h" #include "ip_forward_messages_types.h"
#include "s11_messages_types.h" #include "s11_messages_types.h"
#include "s1ap_messages_types.h" #include "s1ap_messages_types.h"
#include "f1ap_messages_types.h"
#include "nas_messages_types.h" #include "nas_messages_types.h"
#include "s6a_messages_types.h" #include "s6a_messages_types.h"
#include "sctp_messages_types.h" #include "sctp_messages_types.h"
...@@ -40,6 +39,6 @@ ...@@ -40,6 +39,6 @@
#include "mme_app_messages_types.h" #include "mme_app_messages_types.h"
#include "m2ap_messages_types.h" #include "m2ap_messages_types.h"
#include "ngap_messages_types.h" #include "ngap_messages_types.h"
#include "ss_messages_types.h"
#endif /* MESSAGES_TYPES_H_ */ #endif /* MESSAGES_TYPES_H_ */
...@@ -18,10 +18,8 @@ ...@@ -18,10 +18,8 @@
* For more information about the OpenAirInterface (OAI) Software Alliance: * For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#ifndef SECURITY_TYPES_H_
#if HAVE_CONFIG_H #define SECURITY_TYPES_H_
# include "config.h"
#endif
#if !defined(HAVE_UINT128_T) #if !defined(HAVE_UINT128_T)
# include <gmp.h> # include <gmp.h>
...@@ -31,8 +29,6 @@ ...@@ -31,8 +29,6 @@
#include <stdint.h> #include <stdint.h>
#include <inttypes.h> #include <inttypes.h>
#ifndef SECURITY_TYPES_H_
#define SECURITY_TYPES_H_
#define RAND_LENGTH_BITS (128) #define RAND_LENGTH_BITS (128)
#define RAND_LENGTH_OCTETS (RAND_LENGTH_BITS/8) #define RAND_LENGTH_OCTETS (RAND_LENGTH_BITS/8)
......
This diff is collapsed.
#/*
# * 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
# */
if HAVE_DOXYGEN
directory = $(top_srcdir)/DOCS/Documentation
if HAVE_PDFLATEX
doc_DATA = $(directory)oaisim_mme.pdf
else
doc_DATA = $(directory)
endif
$(directory): doxyfile.stamp
doxyfile.stamp:
$(DOXYGEN) Doxyfile
echo Timestamp > doxyfile.stamp
CLEANFILES = doxyfile.stamp
all-local: doxyfile.stamp
clean-local:
rm -f doxyfile.stamp
rm -rf $(top_srcdir)/DOCS/Documentation/html
rm -rf $(top_srcdir)/DOCS/Documentation/latex
endif
This diff is collapsed.
#/*
# * 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
# */
MYFILE=EPC
all:
pdflatex $(MYFILE).tex
pdflatex $(MYFILE).tex
makeindex $(MYFILE).nlo -s nomencl.ist -o $(MYFILE).nls
pdflatex $(MYFILE).tex
.PHONY: all
...@@ -683,7 +683,7 @@ int is_m3ap_MCE_enabled(void) ...@@ -683,7 +683,7 @@ int is_m3ap_MCE_enabled(void)
char *enable_m3 = NULL; char *enable_m3 = NULL;
paramdef_t p[] = { paramdef_t p[] = {
{ "enable_mce_m3", "yes/no", 0, strptr:&enable_m3, defstrval:"", TYPE_STRING, 0 } { "enable_mce_m3", "yes/no", 0, .strptr=&enable_m3, .defstrval="", TYPE_STRING, 0 }
}; };
/* TODO: do it per module - we check only first MCE */ /* TODO: do it per module - we check only first MCE */
......
...@@ -92,7 +92,7 @@ int m2ap_eNB_generate_m2_setup_request( ...@@ -92,7 +92,7 @@ int m2ap_eNB_generate_m2_setup_request(
//ie->id = M2AP_ProtocolIE_ID_id_gNB_eNB_ID; //ie->id = M2AP_ProtocolIE_ID_id_gNB_eNB_ID;
//ie->criticality = M2AP_Criticality_reject; //ie->criticality = M2AP_Criticality_reject;
//ie->value.present = M2AP_M2SetupRequestIEs__value_PR_GNB_eNB_ID; //ie->value.present = M2AP_M2SetupRequestIEs__value_PR_GNB_eNB_ID;
//asn_int642INTEGER(&ie->value.choice.GNB_eNB_ID, f1ap_du_data->gNB_eNB_id); //asn_int642INTEGER(&ie->value.choice.GNB_eNB_ID, 0);
//asn1cSeqAdd(&out->protocolIEs.list, ie); //asn1cSeqAdd(&out->protocolIEs.list, ie);
/* optional */ /* optional */
......
...@@ -128,7 +128,7 @@ int MCE_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m3ap_session_start ...@@ -128,7 +128,7 @@ int MCE_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m3ap_session_start
ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionStartResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionStartResponse_IEs__value_PR_MCE_MBMS_M3AP_ID;
//ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MCE_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
...@@ -137,7 +137,7 @@ int MCE_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m3ap_session_start ...@@ -137,7 +137,7 @@ int MCE_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m3ap_session_start
ie->id = M3AP_ProtocolIE_ID_id_MME_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MME_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionStartResponse_IEs__value_PR_MME_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionStartResponse_IEs__value_PR_MME_MBMS_M3AP_ID;
//ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MCE_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
...@@ -289,7 +289,7 @@ int MCE_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m3ap_session_start_ ...@@ -289,7 +289,7 @@ int MCE_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m3ap_session_start_
ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionStopResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionStopResponse_IEs__value_PR_MCE_MBMS_M3AP_ID;
//ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MCE_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
...@@ -298,7 +298,7 @@ int MCE_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m3ap_session_start_ ...@@ -298,7 +298,7 @@ int MCE_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m3ap_session_start_
ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionStopResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionStopResponse_IEs__value_PR_MCE_MBMS_M3AP_ID;
//ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MCE_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
...@@ -388,7 +388,7 @@ int MCE_send_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, m3ap_mbms_session ...@@ -388,7 +388,7 @@ int MCE_send_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, m3ap_mbms_session
ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionUpdateResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionUpdateResponse_IEs__value_PR_MCE_MBMS_M3AP_ID;
//ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MCE_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
...@@ -397,7 +397,7 @@ int MCE_send_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, m3ap_mbms_session ...@@ -397,7 +397,7 @@ int MCE_send_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, m3ap_mbms_session
ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionUpdateResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionUpdateResponse_IEs__value_PR_MCE_MBMS_M3AP_ID;
//ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MCE_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
...@@ -494,7 +494,7 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t * ...@@ -494,7 +494,7 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t *
// //ie->id = M3AP_ProtocolIE_ID_id_gNB_MCE_ID; // //ie->id = M3AP_ProtocolIE_ID_id_gNB_MCE_ID;
// //ie->criticality = M3AP_Criticality_reject; // //ie->criticality = M3AP_Criticality_reject;
// //ie->value.present = M3AP_M3SetupRequestIEs__value_PR_GNB_MCE_ID; // //ie->value.present = M3AP_M3SetupRequestIEs__value_PR_GNB_MCE_ID;
// //asn_int642INTEGER(&ie->value.choice.GNB_MCE_ID, f1ap_du_data->gNB_MCE_id); // //asn_int642INTEGER(&ie->value.choice.GNB_MCE_ID, 0);
// //asn1cSeqAdd(&out->protocolIEs.list, ie); // //asn1cSeqAdd(&out->protocolIEs.list, ie);
// //
// /* optional */ // /* optional */
......
...@@ -111,9 +111,7 @@ void m3ap_MME_handle_sctp_association_resp(instance_t instance, sctp_new_associa ...@@ -111,9 +111,7 @@ void m3ap_MME_handle_sctp_association_resp(instance_t instance, sctp_new_associa
sctp_new_association_resp->ulp_cnx_id); sctp_new_association_resp->ulp_cnx_id);
if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN) if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN)
//proto_agent_stop(instance); return;
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; // exit -1 for debugging
} }
// go to an init func // go to an init func
...@@ -710,7 +708,7 @@ int is_m3ap_MME_enabled(void) ...@@ -710,7 +708,7 @@ int is_m3ap_MME_enabled(void)
char *enable_m3 = NULL; char *enable_m3 = NULL;
paramdef_t p[] = { paramdef_t p[] = {
{ "enable_mme_m3", "yes/no", 0, strptr:&enable_m3, defstrval:"", TYPE_STRING, 0 } { "enable_mme_m3", "yes/no", 0, .strptr=&enable_m3, .defstrval="", TYPE_STRING, 0 }
}; };
/* TODO: do it per module - we check only first MME */ /* TODO: do it per module - we check only first MME */
......
...@@ -93,7 +93,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id ...@@ -93,7 +93,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id
ie->id = M3AP_ProtocolIE_ID_id_MME_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MME_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionStartRequest_IEs__value_PR_MME_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionStartRequest_IEs__value_PR_MME_MBMS_M3AP_ID;
//ie->value.choice.MME_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MME_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
...@@ -343,7 +343,7 @@ int MME_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m3ap_session_stop_re ...@@ -343,7 +343,7 @@ int MME_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m3ap_session_stop_re
ie->id = M3AP_ProtocolIE_ID_id_MME_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MME_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionStopRequest_IEs__value_PR_MME_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionStopRequest_IEs__value_PR_MME_MBMS_M3AP_ID;
//ie->value.choice.MME_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MME_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
...@@ -352,7 +352,7 @@ int MME_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m3ap_session_stop_re ...@@ -352,7 +352,7 @@ int MME_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m3ap_session_stop_re
ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionStopRequest_IEs__value_PR_MCE_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionStopRequest_IEs__value_PR_MCE_MBMS_M3AP_ID;
//ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MCE_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
...@@ -658,7 +658,7 @@ int MME_send_M3_SETUP_RESPONSE(instance_t instance, /*uint32_t assoc_id,*/ ...@@ -658,7 +658,7 @@ int MME_send_M3_SETUP_RESPONSE(instance_t instance, /*uint32_t assoc_id,*/
ie = (M3AP_M3SetupResponseIEs_t *)calloc(1, sizeof(M3AP_M3SetupResponseIEs_t)); ie = (M3AP_M3SetupResponseIEs_t *)calloc(1, sizeof(M3AP_M3SetupResponseIEs_t));
ie->id = M3AP_ProtocolIE_ID_id_CriticalityDiagnostics; ie->id = M3AP_ProtocolIE_ID_id_CriticalityDiagnostics;
ie->criticality = M3AP_Criticality_ignore; ie->criticality = M3AP_Criticality_ignore;
ie->value.present = M3AP_M3SetupFailureIEs__value_PR_CriticalityDiagnostics; ie->value.present = M3AP_M3SetupResponseIEs__value_PR_CriticalityDiagnostics;
ie->value.choice.CriticalityDiagnostics.procedureCode = (M3AP_ProcedureCode_t *)calloc(1, sizeof(M3AP_ProcedureCode_t)); ie->value.choice.CriticalityDiagnostics.procedureCode = (M3AP_ProcedureCode_t *)calloc(1, sizeof(M3AP_ProcedureCode_t));
*ie->value.choice.CriticalityDiagnostics.procedureCode = M3AP_ProcedureCode_id_m3Setup; *ie->value.choice.CriticalityDiagnostics.procedureCode = M3AP_ProcedureCode_id_m3Setup;
ie->value.choice.CriticalityDiagnostics.triggeringMessage = (M3AP_TriggeringMessage_t *)calloc(1, sizeof(M3AP_TriggeringMessage_t)); ie->value.choice.CriticalityDiagnostics.triggeringMessage = (M3AP_TriggeringMessage_t *)calloc(1, sizeof(M3AP_TriggeringMessage_t));
...@@ -857,7 +857,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ ...@@ -857,7 +857,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_
ie->id = M3AP_ProtocolIE_ID_id_MME_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MME_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionUpdateRequest_IEs__value_PR_MME_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionUpdateRequest_IEs__value_PR_MME_MBMS_M3AP_ID;
//ie->value.choice.MME_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MME_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
...@@ -866,7 +866,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ ...@@ -866,7 +866,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_
ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID; ie->id = M3AP_ProtocolIE_ID_id_MCE_MBMS_M3AP_ID;
ie->criticality = M3AP_Criticality_reject; ie->criticality = M3AP_Criticality_reject;
ie->value.present = M3AP_MBMSSessionUpdateRequest_IEs__value_PR_MCE_MBMS_M3AP_ID; ie->value.present = M3AP_MBMSSessionUpdateRequest_IEs__value_PR_MCE_MBMS_M3AP_ID;
//ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? //ie->value.choice.MCE_MBMS_M3AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&out->protocolIEs.list, ie);
......
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
# include "intertask_interface.h" # include "intertask_interface.h"
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
#include "sctp_eNB_task.h" # include "sctp_eNB_task.h"
# include "openair3/ocp-gtpu/gtp_itf.h"
# include "x2ap_eNB.h" # include "x2ap_eNB.h"
# include "x2ap_messages_types.h" # include "x2ap_messages_types.h"
...@@ -84,17 +85,7 @@ extern RAN_CONTEXT_t RC; ...@@ -84,17 +85,7 @@ extern RAN_CONTEXT_t RC;
// LOG_I(ENB_APP,"[MCE %d] MCE_app_register via M3AP for instance %d\n", mce_id, ENB_MODULE_ID_TO_INSTANCE(mce_id)); // LOG_I(ENB_APP,"[MCE %d] MCE_app_register via M3AP for instance %d\n", mce_id, ENB_MODULE_ID_TO_INSTANCE(mce_id));
// itti_send_msg_to_task (TASK_M3AP, ENB_MODULE_ID_TO_INSTANCE(mce_id), msg_p); // itti_send_msg_to_task (TASK_M3AP, ENB_MODULE_ID_TO_INSTANCE(mce_id), msg_p);
// //
// //if (NODE_IS_DU(node_type)) { // F1AP registration // //{ // S1AP registration
// // // configure F1AP here for F1C
// // LOG_I(ENB_APP,"ngran_eNB_DU: Allocating ITTI message for F1AP_SETUP_REQ\n");
// // msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, F1AP_SETUP_REQ);
// // RCconfig_DU_F1(msg_p, enb_id);
//
// // LOG_I(ENB_APP,"[eNB %d] eNB_app_register via F1AP for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
// // itti_send_msg_to_task (TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
// // // configure GTPu here for F1U
// //}
// //else { // S1AP registration
// // /* note: there is an implicit relationship between the data structure and the message name */ // // /* note: there is an implicit relationship between the data structure and the message name */
// // msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, S1AP_REGISTER_ENB_REQ); // // msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, S1AP_REGISTER_ENB_REQ);
// // RCconfig_S1(msg_p, enb_id); // // RCconfig_S1(msg_p, enb_id);
...@@ -312,12 +303,9 @@ void *MME_app_task(void *args_p) { ...@@ -312,12 +303,9 @@ void *MME_app_task(void *args_p) {
break; break;
// case M3AP_SETUP_RESP: // case M3AP_SETUP_RESP:
// //AssertFatal(NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received F1AP_REGISTER_ENB_CNF in CU/MCE\n");
// //LOG_I(MME_APP, "Received %s: associated ngran_MCE_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p), // //LOG_I(MME_APP, "Received %s: associated ngran_MCE_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
// //F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate);
// //
// //handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p));
// handle_m3ap_setup_resp(&M3AP_SETUP_RESP(msg_p)); // handle_m3ap_setup_resp(&M3AP_SETUP_RESP(msg_p));
// DevAssert(register_mce_pending > 0); // DevAssert(register_mce_pending > 0);
......
...@@ -36,11 +36,10 @@ ...@@ -36,11 +36,10 @@
#include "commonDef.h" #include "commonDef.h"
#include "platform_types.h" #include "platform_types.h"
#include "platform_constants.h" #include "common/platform_constants.h"
#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_top.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h" #include "s1ap_messages_types.h"
#include "f1ap_messages_types.h"
#include "LTE_SystemInformationBlockType2.h" #include "LTE_SystemInformationBlockType2.h"
#include "rrc_messages_types.h" #include "rrc_messages_types.h"
#include "RRC/LTE/rrc_defs.h" #include "RRC/LTE/rrc_defs.h"
......
...@@ -1052,7 +1052,7 @@ static int _nas_message_decrypt( ...@@ -1052,7 +1052,7 @@ static int _nas_message_decrypt(
stream_cipher.message = (unsigned char *)src; stream_cipher.message = (unsigned char *)src;
/* length in bits */ /* length in bits */
stream_cipher.blength = length << 3; stream_cipher.blength = length << 3;
nas_stream_encrypt_eea2(&stream_cipher, (unsigned char *)dest); nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest);
/* Decode the first octet (security header type or EPS bearer identity, /* Decode the first octet (security header type or EPS bearer identity,
* and protocol discriminator) */ * and protocol discriminator) */
DECODE_U8(dest, *(uint8_t*)(&header), size); DECODE_U8(dest, *(uint8_t*)(&header), size);
...@@ -1097,7 +1097,7 @@ static int _nas_message_decrypt( ...@@ -1097,7 +1097,7 @@ static int _nas_message_decrypt(
LOG_FUNC_RETURN (0); LOG_FUNC_RETURN (0);
}; };
LOG_FUNC_RETURN (0); LOG_FUNC_RETURN (0);
} }
/**************************************************************************** /****************************************************************************
......
...@@ -66,8 +66,8 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_ ...@@ -66,8 +66,8 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_
packet_filter_t pf; packet_filter_t pf;
if(qos_rule.oc == ROC_CREATE_NEW_QOS_RULE || if(qos_rule.oc == ROC_CREATE_NEW_QOS_RULE ||
ROC_MODIFY_QOS_RULE_ADD_PF || qos_rule.oc == ROC_MODIFY_QOS_RULE_ADD_PF ||
ROC_MODIFY_QOS_RULE_REPLACE_PF) { qos_rule.oc == ROC_MODIFY_QOS_RULE_REPLACE_PF) {
pf.pf_type.type_1.pf_dir = (*(buffer + offset) & 0x30) >> 4; pf.pf_type.type_1.pf_dir = (*(buffer + offset) & 0x30) >> 4;
pf.pf_type.type_1.pf_id = *(buffer + offset++) & 0x0F; pf.pf_type.type_1.pf_id = *(buffer + offset++) & 0x0F;
pf.pf_type.type_1.length = *(buffer + offset++); pf.pf_type.type_1.length = *(buffer + offset++);
......
...@@ -235,10 +235,23 @@ static int encode_suci_5gs_mobile_identity(Suci5GSMobileIdentity_t *suci, uint8_ ...@@ -235,10 +235,23 @@ static int encode_suci_5gs_mobile_identity(Suci5GSMobileIdentity_t *suci, uint8_
static int encode_imeisv_5gs_mobile_identity(Imeisv5GSMobileIdentity_t *imeisv, uint8_t *buffer) static int encode_imeisv_5gs_mobile_identity(Imeisv5GSMobileIdentity_t *imeisv, uint8_t *buffer)
{ {
uint32_t encoded = 0; uint32_t encoded = 0;
*(buffer + encoded) = 0x00 | (imeisv->digit1 << 4) | (imeisv->oddeven << 3) | (imeisv->typeofidentity); *(buffer + encoded) = 0x00 | (imeisv->digittac01 << 4) | (imeisv->oddeven << 3) | (imeisv->typeofidentity);
encoded++; encoded++;
*(buffer + encoded) = 0x00 | (imeisv->digittac03 << 4) | (imeisv->digittac02);
*(buffer + encoded) = 0x00 | (imeisv->digitp1 << 4) | (imeisv->digitp); encoded++;
*(buffer + encoded) = 0x00 | (imeisv->digittac05 << 4) | (imeisv->digittac04);
encoded++;
*(buffer + encoded) = 0x00 | (imeisv->digittac07 << 4) | (imeisv->digittac06);
encoded++;
*(buffer + encoded) = 0x00 | (imeisv->digit09 << 4) | (imeisv->digittac08);
encoded++;
*(buffer + encoded) = 0x00 | (imeisv->digit11 << 4) | (imeisv->digit10);
encoded++;
*(buffer + encoded) = 0x00 | (imeisv->digit13 << 4) | (imeisv->digit12);
encoded++;
*(buffer + encoded) = 0x00 | (imeisv->digitsv1 << 4) | (imeisv->digit14);
encoded++;
*(buffer + encoded) = 0x00 | (imeisv->spare << 4) | (imeisv->digitsv2);
encoded++; encoded++;
return encoded; return encoded;
......
...@@ -92,7 +92,27 @@ typedef struct { ...@@ -92,7 +92,27 @@ typedef struct {
uint8_t digitp:4; uint8_t digitp:4;
} Imei5GSMobileIdentity_t; } Imei5GSMobileIdentity_t;
typedef Imei5GSMobileIdentity_t Imeisv5GSMobileIdentity_t; typedef struct {
uint8_t digittac01:4;
uint8_t oddeven:1;
uint8_t typeofidentity:3;
uint8_t digittac02:4;
uint8_t digittac03:4;
uint8_t digittac04:4;
uint8_t digittac05:4;
uint8_t digittac06:4;
uint8_t digittac07:4;
uint8_t digittac08:4;
uint8_t digit09:4;
uint8_t digit10:4;
uint8_t digit11:4;
uint8_t digit12:4;
uint8_t digit13:4;
uint8_t digit14:4;
uint8_t digitsv1:4;
uint8_t digitsv2:4;
uint8_t spare:4;
} Imeisv5GSMobileIdentity_t;
typedef struct { typedef struct {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <openair3/NAS/COMMON/NR_NAS_defs.h> #include <openair3/NAS/COMMON/NR_NAS_defs.h>
#include <openair3/SECU/secu_defs.h> #include <openair3/SECU/secu_defs.h>
#include <openair3/SECU/kdf.h>
void servingNetworkName(uint8_t *msg, char * imsiStr, int nmc_size) { void servingNetworkName(uint8_t *msg, char * imsiStr, int nmc_size) {
//SNN-network-identifier in TS 24.501 //SNN-network-identifier in TS 24.501
...@@ -59,8 +60,12 @@ int resToresStar(uint8_t *msg, uicc_t* uicc) { ...@@ -59,8 +60,12 @@ int resToresStar(uint8_t *msg, uicc_t* uicc) {
uint8_t ckik[sizeof(uicc->ck) +sizeof(uicc->ik)]; uint8_t ckik[sizeof(uicc->ck) +sizeof(uicc->ik)];
memcpy(ckik, uicc->ck, sizeof(uicc->ck)); memcpy(ckik, uicc->ck, sizeof(uicc->ck));
memcpy(ckik+sizeof(uicc->ck),uicc->ik, sizeof(uicc->ik)); memcpy(ckik+sizeof(uicc->ck),uicc->ik, sizeof(uicc->ik));
uint8_t out[32]; uint8_t out[32] = {0};
kdf(S, ptr-S, ckik, 32, out, sizeof(out)); assert(ptr-S == 32);
//kdf(S, ptr-S, ckik, 32, out, sizeof(out));
byte_array_t data = {.buf = ckik, .len = 32};
kdf(S, data, 32, out);
memcpy(msg, out+16, 16); memcpy(msg, out+16, 16);
return 16; return 16;
} }
This diff is collapsed.
...@@ -1068,31 +1068,31 @@ static int _at_response_encode_cgpaddr(char* buffer, const at_response_t* data) ...@@ -1068,31 +1068,31 @@ static int _at_response_encode_cgpaddr(char* buffer, const at_response_t* data)
if (cgpaddr->PDP_addr_1[i] != NULL) { if (cgpaddr->PDP_addr_1[i] != NULL) {
/* IPv4 address */ /* IPv4 address */
offset += sprintf(buffer+offset, ",%hhu.%hhu.%hhu.%hhu", offset += sprintf(buffer+offset, ",%hhu.%hhu.%hhu.%hhu",
(unsigned int)cgpaddr->PDP_addr_1[i][0], (unsigned char)cgpaddr->PDP_addr_1[i][0],
(unsigned int)cgpaddr->PDP_addr_1[i][1], (unsigned char)cgpaddr->PDP_addr_1[i][1],
(unsigned int)cgpaddr->PDP_addr_1[i][2], (unsigned char)cgpaddr->PDP_addr_1[i][2],
(unsigned int)cgpaddr->PDP_addr_1[i][3]); (unsigned char)cgpaddr->PDP_addr_1[i][3]);
} }
if (cgpaddr->PDP_addr_2[i] != NULL) { if (cgpaddr->PDP_addr_2[i] != NULL) {
/* IPv6 Link-local address prefixe */ /* IPv6 Link-local address prefixe */
offset += sprintf(buffer+offset, offset += sprintf(buffer+offset,
",%hhu.%hhu.%hhu.%hhu.%hhu.%hhu.%hhu.%hhu", ",%hhu.%hhu.%hhu.%hhu.%hhu.%hhu.%hhu.%hhu",
(unsigned int)0xfe, (unsigned int)0x80, (unsigned char)0xfe, (unsigned char)0x80,
(unsigned int)0, (unsigned int)0, (unsigned char)0, (unsigned char)0,
(unsigned int)0, (unsigned int)0, (unsigned char)0, (unsigned char)0,
(unsigned int)0, (unsigned int)0); (unsigned char)0, (unsigned char)0);
/* IPv6 Link-local address */ /* IPv6 Link-local address */
offset += sprintf(buffer+offset, offset += sprintf(buffer+offset,
".%hhu.%hhu.%hhu.%hhu.%hhu.%hhu.%hhu.%hhu", ".%hhu.%hhu.%hhu.%hhu.%hhu.%hhu.%hhu.%hhu",
(unsigned int)cgpaddr->PDP_addr_2[i][0], (unsigned char)cgpaddr->PDP_addr_2[i][0],
(unsigned int)cgpaddr->PDP_addr_2[i][1], (unsigned char)cgpaddr->PDP_addr_2[i][1],
(unsigned int)cgpaddr->PDP_addr_2[i][2], (unsigned char)cgpaddr->PDP_addr_2[i][2],
(unsigned int)cgpaddr->PDP_addr_2[i][3], (unsigned char)cgpaddr->PDP_addr_2[i][3],
(unsigned int)cgpaddr->PDP_addr_2[i][4], (unsigned char)cgpaddr->PDP_addr_2[i][4],
(unsigned int)cgpaddr->PDP_addr_2[i][5], (unsigned char)cgpaddr->PDP_addr_2[i][5],
(unsigned int)cgpaddr->PDP_addr_2[i][6], (unsigned char)cgpaddr->PDP_addr_2[i][6],
(unsigned int)cgpaddr->PDP_addr_2[i][7]); (unsigned char)cgpaddr->PDP_addr_2[i][7]);
} }
offset += sprintf(buffer+offset, "\r\n"); offset += sprintf(buffer+offset, "\r\n");
......
...@@ -67,6 +67,7 @@ Description Defines the authentication EMM procedure executed by the ...@@ -67,6 +67,7 @@ Description Defines the authentication EMM procedure executed by the
#include "usim_api.h" #include "usim_api.h"
#include "secu_defs.h" #include "secu_defs.h"
#include "kdf.h"
#include "Authentication.h" #include "Authentication.h"
#include "executables/lte-softmodem.h" #include "executables/lte-softmodem.h"
...@@ -982,14 +983,10 @@ static int _authentication_kasme(const OctetString *autn, ...@@ -982,14 +983,10 @@ static int _authentication_kasme(const OctetString *autn,
input_s[4],input_s[5],input_s[6],input_s[7], input_s[4],input_s[5],input_s[6],input_s[7],
input_s[8],input_s[9],input_s[10],input_s[11], input_s[8],input_s[9],input_s[10],input_s[11],
input_s[12],input_s[13]); input_s[12],input_s[13]);
/* TODO !!! Compute the Kasme key */
// todo_hmac_256(key, input_s, kasme->value); assert(ck->length + ik->length == 32);
kdf(key, byte_array_t data = {.len = offset, .buf = input_s};
ck->length + ik->length , /*key_length*/ kdf(key, data, kasme->length, kasme->value);
input_s,
offset,
kasme->value,
kasme->length);
LOG_TRACE(INFO,"EMM-PROC KASME (l=%d)%s", LOG_TRACE(INFO,"EMM-PROC KASME (l=%d)%s",
kasme->length, kasme->length,
......
...@@ -63,6 +63,7 @@ Description Defines the security mode control EMM procedure executed by the ...@@ -63,6 +63,7 @@ Description Defines the security mode control EMM procedure executed by the
# include "assertions.h" # include "assertions.h"
#include "secu_defs.h" #include "secu_defs.h"
#include "kdf.h"
#include "SecurityModeControl.h" #include "SecurityModeControl.h"
#if defined(NAS_BUILT_IN_UE) #if defined(NAS_BUILT_IN_UE)
...@@ -484,7 +485,9 @@ static int _security_kenb(const OctetString *kasme, OctetString *kenb, ...@@ -484,7 +485,9 @@ static int _security_kenb(const OctetString *kasme, OctetString *kenb,
input[5] = 0; input[5] = 0;
input[6] = 4; input[6] = 4;
kdf(kasme->value, 32, input, 7, kenb->value, 32); byte_array_t data = {.len = 7, .buf = input};
kdf(kasme->value, data, 32, kenb->value);
kenb->length = 32; kenb->length = 32;
return (RETURNok); return (RETURNok);
} }
...@@ -536,8 +539,12 @@ static int _security_kdf(const OctetString *kasme, OctetString *key, ...@@ -536,8 +539,12 @@ static int _security_kdf(const OctetString *kasme, OctetString *key,
input[5] = 0x00; input[5] = 0x00;
input[6] = 0x01; input[6] = 0x01;
assert(kasme->length == 32);
byte_array_t data = {.len = 7, .buf=input};
/* Compute the derived key */ /* Compute the derived key */
kdf(kasme->value, kasme->length, input, 7, output, 32); kdf(kasme->value, data, 32, output);
memcpy(key->value, &output[31 - key->length + 1], key->length); memcpy(key->value, &output[31 - key->length + 1], key->length);
return (RETURNok); return (RETURNok);
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "intertask_interface.h" #include "intertask_interface.h"
#include "nas_itti_messaging.h" #include "nas_itti_messaging.h"
#include "common/ran_context.h"
# define TASK_ORIGIN TASK_NAS_UE # define TASK_ORIGIN TASK_NAS_UE
...@@ -95,10 +96,6 @@ int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const i ...@@ -95,10 +96,6 @@ int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const i
} }
#endif #endif
extern unsigned char NB_eNB_INST;
int nas_itti_kenb_refresh_req(const Byte_t kenb[32], int user_id) { int nas_itti_kenb_refresh_req(const Byte_t kenb[32], int user_id) {
MessageDef *message_p; MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_KENB_REFRESH_REQ); message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_KENB_REFRESH_REQ);
......
...@@ -32,11 +32,11 @@ ...@@ -32,11 +32,11 @@
# include "memory.h" # include "memory.h"
#include "nas_user.h" #include "nas_user.h"
#include "common/ran_context.h"
// FIXME make command line option for NAS_UE_AUTOSTART // FIXME make command line option for NAS_UE_AUTOSTART
# define NAS_UE_AUTOSTART 1 # define NAS_UE_AUTOSTART 1
// FIXME review these externs // FIXME review these externs
extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST; extern uint16_t NB_UE_INST;
uint16_t ue_idx_standalone = 0xFFFF; uint16_t ue_idx_standalone = 0xFFFF;
...@@ -308,7 +308,7 @@ void *nas_ue_task(void *args_p) ...@@ -308,7 +308,7 @@ void *nas_ue_task(void *args_p)
struct epoll_event events[20]; struct epoll_event events[20];
nb_events = itti_get_events(TASK_NAS_UE, events, 20); nb_events = itti_get_events(TASK_NAS_UE, events, 20);
if ((nb_events > 0) && (events != NULL)) { if (nb_events > 0) {
if (nas_ue_process_events(users, events, nb_events) == true) { if (nas_ue_process_events(users, events, nb_events) == true) {
LOG_E(NAS, "[UE] Received exit loop\n"); LOG_E(NAS, "[UE] Received exit loop\n");
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -373,7 +373,7 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa ...@@ -373,7 +373,7 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
timer_kind = timer_kind | SCTP_REQ_WAIT; timer_kind = timer_kind | SCTP_REQ_WAIT;
if( s1ap_timer_setup( instance_p->sctp_req_timer, 0, TASK_S1AP, instance_p->instance, if( s1ap_timer_setup( instance_p->sctp_req_timer, 0, TASK_S1AP, instance_p->instance,
timer_kind, S1AP_TIMER_ONE_SHOT, NULL, &s1ap_mme_data_p->timer_id) < 0 ) { timer_kind, TIMER_ONE_SHOT, NULL, &s1ap_mme_data_p->timer_id) < 0 ) {
S1AP_ERROR("Timer Start NG(SCTP retransmission wait timer) : MME=%d\n",s1ap_mme_data_p->cnx_id); S1AP_ERROR("Timer Start NG(SCTP retransmission wait timer) : MME=%d\n",s1ap_mme_data_p->cnx_id);
s1ap_sctp_req( instance_p, s1ap_mme_data_p ); s1ap_sctp_req( instance_p, s1ap_mme_data_p );
} }
...@@ -750,7 +750,7 @@ static int s1ap_eNB_generate_s1_setup_request( ...@@ -750,7 +750,7 @@ static int s1ap_eNB_generate_s1_setup_request(
timer_kind = timer_kind | S1AP_MMEIND; timer_kind = timer_kind | S1AP_MMEIND;
timer_kind = timer_kind | S1_SETRSP_WAIT; timer_kind = timer_kind | S1_SETRSP_WAIT;
if( s1ap_timer_setup(instance_p->s1_setuprsp_wait_timer, 0, TASK_S1AP, instance_p->instance, timer_kind, S1AP_TIMER_ONE_SHOT, if( s1ap_timer_setup(instance_p->s1_setuprsp_wait_timer, 0, TASK_S1AP, instance_p->instance, timer_kind, TIMER_ONE_SHOT,
NULL, &s1ap_mme_data_p->timer_id) < 0 ) NULL, &s1ap_mme_data_p->timer_id) < 0 )
{ {
S1AP_ERROR("Timer Start NG(S1 Setup Response) : MME=%d\n",s1ap_mme_data_p->cnx_id); S1AP_ERROR("Timer Start NG(S1 Setup Response) : MME=%d\n",s1ap_mme_data_p->cnx_id);
......
...@@ -349,7 +349,7 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id, ...@@ -349,7 +349,7 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
timer_kind = timer_kind | S1AP_MMEIND; timer_kind = timer_kind | S1AP_MMEIND;
timer_kind = timer_kind | S1_SETREQ_WAIT; timer_kind = timer_kind | S1_SETREQ_WAIT;
if( s1ap_timer_setup(interval_sec, 0, TASK_S1AP, instance_p->instance, timer_kind, S1AP_TIMER_ONE_SHOT, if( s1ap_timer_setup(interval_sec, 0, TASK_S1AP, instance_p->instance, timer_kind, TIMER_ONE_SHOT,
NULL, &mme_desc_p->timer_id) < 0 ) { NULL, &mme_desc_p->timer_id) < 0 ) {
S1AP_ERROR("Timer Start NG(S1 Setup Request) : MME=%d\n",mme_desc_p->cnx_id); S1AP_ERROR("Timer Start NG(S1 Setup Request) : MME=%d\n",mme_desc_p->cnx_id);
s1ap_eNB_snd_s1_setup_request( instance_p, mme_desc_p ); s1ap_eNB_snd_s1_setup_request( instance_p, mme_desc_p );
...@@ -1445,7 +1445,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id, ...@@ -1445,7 +1445,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
item_p = &(((S1AP_E_RABToBeModifiedItemBearerModReqIEs_t *) item_p = &(((S1AP_E_RABToBeModifiedItemBearerModReqIEs_t *)
ie->value.choice.E_RABToBeModifiedListBearerModReq.list.array[nb_of_e_rabs_failed])->value.choice.E_RABToBeModifiedItemBearerModReq); ie->value.choice.E_RABToBeModifiedListBearerModReq.list.array[nb_of_e_rabs_failed])->value.choice.E_RABToBeModifiedItemBearerModReq);
S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].e_rab_id = item_p->e_RAB_ID; S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].e_rab_id = item_p->e_RAB_ID;
S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].cause = S1AP_Cause_PR_radioNetwork; S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].cause = S1AP_CAUSE_RADIO_NETWORK;
S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].cause_value = S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id; S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].cause_value = S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id;
} }
} else { } else {
...@@ -1981,7 +1981,7 @@ static int s1ap_eNB_snd_s1_setup_request( ...@@ -1981,7 +1981,7 @@ static int s1ap_eNB_snd_s1_setup_request(
timer_kind = timer_kind | S1AP_MMEIND; timer_kind = timer_kind | S1AP_MMEIND;
timer_kind = timer_kind | S1_SETRSP_WAIT; timer_kind = timer_kind | S1_SETRSP_WAIT;
if( s1ap_timer_setup(instance_p->s1_setuprsp_wait_timer, 0, TASK_S1AP, instance_p->instance, timer_kind, S1AP_TIMER_ONE_SHOT, if( s1ap_timer_setup(instance_p->s1_setuprsp_wait_timer, 0, TASK_S1AP, instance_p->instance, timer_kind, TIMER_ONE_SHOT,
NULL, &s1ap_mme_data_p->timer_id) < 0 ) NULL, &s1ap_mme_data_p->timer_id) < 0 )
{ {
S1AP_ERROR("Timer Start NG(S1 Setup Response) : MME=%d\n",s1ap_mme_data_p->cnx_id); S1AP_ERROR("Timer Start NG(S1 Setup Response) : MME=%d\n",s1ap_mme_data_p->cnx_id);
......
This diff is collapsed.
...@@ -617,10 +617,7 @@ sctp_handle_new_association_req( ...@@ -617,10 +617,7 @@ sctp_handle_new_association_req(
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static void sctp_send_data( static void sctp_send_data(sctp_data_req_t *sctp_data_req_p)
instance_t instance,
task_id_t task_id,
sctp_data_req_t *sctp_data_req_p)
{ {
struct sctp_cnx_list_elm_s *sctp_cnx = NULL; struct sctp_cnx_list_elm_s *sctp_cnx = NULL;
...@@ -660,10 +657,7 @@ static void sctp_send_data( ...@@ -660,10 +657,7 @@ static void sctp_send_data(
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static int sctp_close_association( static int sctp_close_association(sctp_close_association_t *close_association_p)
const instance_t instance,
const task_id_t requestor,
sctp_close_association_t *close_association_p)
{ {
struct sctp_cnx_list_elm_s *sctp_cnx = NULL; struct sctp_cnx_list_elm_s *sctp_cnx = NULL;
...@@ -1152,10 +1146,8 @@ static void sctp_eNB_process_itti_msg() ...@@ -1152,10 +1146,8 @@ static void sctp_eNB_process_itti_msg()
break; break;
case SCTP_CLOSE_ASSOCIATION: case SCTP_CLOSE_ASSOCIATION:
sctp_close_association(ITTI_MSG_DESTINATION_INSTANCE(received_msg), sctp_close_association(&received_msg->ittiMsg.sctp_close_association);
ITTI_MSG_ORIGIN_ID(received_msg), break;
&received_msg->ittiMsg.sctp_close_association);
break;
case TERMINATE_MESSAGE: case TERMINATE_MESSAGE:
SCTP_WARN("*** Exiting SCTP thread\n"); SCTP_WARN("*** Exiting SCTP thread\n");
...@@ -1163,9 +1155,7 @@ static void sctp_eNB_process_itti_msg() ...@@ -1163,9 +1155,7 @@ static void sctp_eNB_process_itti_msg()
break; break;
case SCTP_DATA_REQ: { case SCTP_DATA_REQ: {
sctp_send_data(ITTI_MSG_DESTINATION_INSTANCE(received_msg), sctp_send_data(&received_msg->ittiMsg.sctp_data_req);
ITTI_MSG_ORIGIN_ID(received_msg),
&received_msg->ittiMsg.sctp_data_req);
} }
break; break;
......
...@@ -19,66 +19,70 @@ ...@@ -19,66 +19,70 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include <stdio.h> #ifndef AES_128_OAI_H
#include <stdlib.h> #define AES_128_OAI_H
#include <endian.h>
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <stdlib.h>
#include "test_util.h" // see 33.401 B.2.3 for the input to 128-EIA2
// (which is identical to 128-NIA2, see 33.501 D.3.1.3)
#include "secu_defs.h" typedef struct {
uint32_t count;
uint8_t padding: 2;
uint8_t direction: 1;
uint8_t bearer: 5;
uint8_t pad_8;
uint16_t pad_16;
uint64_t pad_64;
} data_iv16_t;
#include <nettle/nettle-meta.h> typedef struct{
#include <nettle/aes.h> union{
#include <nettle/ctr.h> data_iv16_t d;
uint8_t iv[16];
};
} iv16_t;
static void test_cipher_ctr(const struct nettle_cipher *cipher, const uint8_t *key, typedef struct {
unsigned key_length, const uint8_t *cleartext, unsigned length, uint32_t count;
const uint8_t *ciphertext, const uint8_t *ictr) uint8_t padding: 2;
{ uint8_t direction: 1;
void *ctx = malloc(cipher->context_size); uint8_t bearer: 5;
uint8_t *data = malloc(length); uint8_t pad_8;
uint8_t *ctr = malloc(cipher->block_size); uint16_t pad_16;
} data_iv8_t;
#if NETTLE_VERSION_MAJOR < 3 typedef struct{
cipher->set_encrypt_key(ctx, key_length, key); union{
#else data_iv8_t d;
cipher->set_encrypt_key(ctx, key); uint8_t iv[8];
#endif };
} iv8_t;
memcpy(ctr, ictr, cipher->block_size); typedef enum{
AES_INITIALIZATION_VECTOR_8,
AES_INITIALIZATION_VECTOR_16,
ctr_crypt(ctx, cipher->encrypt, AES_INITIALIZATION_VECTOR_END,
cipher->block_size, ctr, } iv_e;
length, data, cleartext);
if (compare_buffer(data, length, ciphertext, length) != 0) { #if __BYTE_ORDER == __BIG_ENDIAN
fail("Fail: test_cipher_ctr"); static_assert(0 != 0, "The struct iv_t needs little endianness");
} #endif
// static_assert((16 == sizeof(iv_t)) , "Initialization Vector needs to have an AES_BLOCK_SIZE" );
free(ctx); typedef struct {
free(data); uint8_t key[16];
free(ctr); iv_e type;
} union{
iv8_t iv8;
iv16_t iv16;
};
} aes_128_t;
#endif
void doit (void)
{
/* From NIST spec 800-38a on AES modes,
*
* http://csrc.nist.gov/CryptoToolkit/modes/800-38_Series_Publications/SP800-38A.pdf
*
* F.5 CTR Example Vectors
*/
/* F.5.1 CTR-AES128.Encrypt */
test_cipher_ctr(&nettle_aes128,
HL("2b7e151628aed2a6abf7158809cf4f3c"),
HL("6bc1bee22e409f96e93d7e117393172a"
"ae2d8a571e03ac9c9eb76fac45af8e51"
"30c81c46a35ce411e5fbc1191a0a52ef"
"f69f2445df4f9b17ad2b417be66c3710"),
H("874d6191b620e3261bef6864990db6ce"
"9806f66b7970fdff8617187bb9fffdff"
"5ae4df3edbd5d35e5b4f09020db03eab"
"1e031dda2fbe03d1792170a0f3009cee"),
H("f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"));
}
This diff is collapsed.
...@@ -19,67 +19,30 @@ ...@@ -19,67 +19,30 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include "test_util.h" #ifndef AES_128_CBC_CMAC_H
#define AES_128_CBC_CMAC_H
#include "secu_defs.h" #include "aes_128.h"
#include "common/utils/ds/byte_array.h"
#include <nettle/nettle-meta.h>
#include <nettle/aes.h>
#include <nettle/ctr.h>
static #include <stdint.h>
void test_uncipher_ctr(const struct nettle_cipher *cipher, const uint8_t *key, #include <stdlib.h>
unsigned key_length, const uint8_t *cipheredtext,
unsigned length, const uint8_t *cleartext, const uint8_t *ictr)
{
void *ctx = malloc(cipher->context_size);
uint8_t *data = malloc(length);
uint8_t *ctr = malloc(cipher->block_size);
#if NETTLE_VERSION_MAJOR < 3 typedef struct {
cipher->set_encrypt_key(ctx, key_length, key); void* lib_ctx;
#else void* mac;
cipher->set_encrypt_key(ctx, key); uint8_t key[16];
#endif } cbc_cmac_ctx_t ;
void aes_128_cbc_cmac(const aes_128_t* k_iv, byte_array_t msg, size_t len_out, uint8_t out[len_out]);
memcpy(ctr, ictr, cipher->block_size); cbc_cmac_ctx_t init_aes_128_cbc_cmac(uint8_t key[16]);
ctr_crypt(ctx, cipher->encrypt, void cipher_aes_128_cbc_cmac(cbc_cmac_ctx_t const* ctx, const aes_128_t* k_iv, byte_array_t msg, size_t len_out, uint8_t out[len_out]);
cipher->block_size, ctr,
length, data, cipheredtext);
if (compare_buffer(data, length, cleartext, length) != 0) { void free_aes_128_cbc_cmac(cbc_cmac_ctx_t const* ctx);
fail("Fail: test_uncipher_ctr\n");
}
free(ctx); #endif
free(data);
free(ctr);
}
void doit (void)
{
/* From NIST spec 800-38a on AES modes,
*
* http://csrc.nist.gov/CryptoToolkit/modes/800-38_Series_Publications/SP800-38A.pdf
*
* F.5 CTR Example Vectors
*/
/* F.5.1 CTR-AES128.Encrypt */
test_uncipher_ctr(&nettle_aes128,
HL("2b7e151628aed2a6abf7158809cf4f3c"),
HL("6bc1bee22e409f96e93d7e117393172a"
"ae2d8a571e03ac9c9eb76fac45af8e51"
"30c81c46a35ce411e5fbc1191a0a52ef"
"f69f2445df4f9b17ad2b417be66c3710"),
H("874d6191b620e3261bef6864990db6ce"
"9806f66b7970fdff8617187bb9fffdff"
"5ae4df3edbd5d35e5b4f09020db03eab"
"1e031dda2fbe03d1792170a0f3009cee"),
H("f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"));
}
/*
* 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
*/
// TS 133 401 pag. 88
#include "aes_128_ctr.h"
#include "common/utils/assertions.h"
#include <openssl/aes.h>
#include <openssl/err.h>
#include <openssl/evp.h>
void aes_128_ctr(const aes_128_t* k_iv, byte_array_t msg, size_t len_out, uint8_t out[len_out])
{
DevAssert(k_iv != NULL);
DevAssert(sizeof(iv16_t) == AES_BLOCK_SIZE);
DevAssert(k_iv->type == AES_INITIALIZATION_VECTOR_16);
// Create and initialise the context
EVP_CIPHER_CTX* ctx = EVP_CIPHER_CTX_new();
DevAssert(ctx != NULL);
// Set IV length if default 12 bytes (96 bits) is not appropriate
// int rc = EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CTR_SET_IVLEN, 16, NULL))
// Initialise the encryption operation.
int rc = EVP_EncryptInit_ex(ctx, EVP_aes_128_ctr(), NULL, k_iv->key, k_iv->iv16.iv);
DevAssert(rc == 1);
OPENSSL_assert(EVP_CIPHER_CTX_iv_length(ctx) == AES_BLOCK_SIZE);
int len_ev = 0;
rc = EVP_EncryptUpdate(ctx, out, &len_ev, msg.buf, msg.len);
DevAssert(!(len_ev > len_out) && "Buffer overflow");
// Finalise the encryption. Normally ciphertext bytes may be written at
// this stage, but this does not occur in GCM mode
rc = EVP_EncryptFinal_ex(ctx, out + len_ev, &len_ev);
DevAssert(rc == 1);
// Get the tag
// rc == EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, 16, tag))
EVP_CIPHER_CTX_free(ctx);
}
/*
* 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 AES_128_CTR_OAI_H
#define AES_128_CTR_OAI_H
#include "aes_128.h"
#include "common/utils/ds/byte_array.h"
#include <endian.h>
#include <stdint.h>
#include <stdlib.h>
void aes_128_ctr(const aes_128_t* k_iv, byte_array_t msg, size_t len_out, uint8_t out[len_out]);
#endif
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.
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