From 8f549a54338ae3b67197a4958e5c5ddec9927a8e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 22 Jul 2024 11:17:31 +0200 Subject: [PATCH] Remove rb_config: it's not used by any code currently in use --- CMakeLists.txt | 4 - doc/Doxyfile | 2 - openair2/RRC/LTE/rrc_UE.c | 9 +- openair2/RRC/LTE/rrc_eNB.c | 11 +- openair2/RRC/NAS/rb_config.c | 241 ----------------------------------- openair2/RRC/NAS/rb_config.h | 38 ------ openair2/RRC/NR/rrc_gNB.c | 1 - openair2/RRC/NR_UE/rrc_UE.c | 1 - 8 files changed, 2 insertions(+), 305 deletions(-) delete mode 100644 openair2/RRC/NAS/rb_config.c delete mode 100644 openair2/RRC/NAS/rb_config.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ed31207d2..78c1408ca9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1935,7 +1935,6 @@ add_executable(lte-softmodem ${OPENAIR_DIR}/radio/COMMON/common_lib.c ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${PHY_INTERFACE_DIR}/queue_t.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c @@ -1993,7 +1992,6 @@ add_executable(lte-uesoftmodem ${OPENAIR_DIR}/radio/COMMON/common_lib.c ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c @@ -2030,7 +2028,6 @@ add_executable(nr-softmodem ${OPENAIR_DIR}/radio/COMMON/common_lib.c ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${PHY_INTERFACE_DIR}/queue_t.c @@ -2102,7 +2099,6 @@ add_executable(nr-uesoftmodem ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c ) diff --git a/doc/Doxyfile b/doc/Doxyfile index 4777455bfc..6e1c7828e1 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -1874,8 +1874,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR_UE/rrc_defs.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR_UE/L2_interface_ue.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NAS/rb_config.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NAS/rb_config.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NAS/nas_config.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NAS/nas_config.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_internode.c \ diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index 6aa452ed99..a7a8bb8fb3 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -68,7 +68,6 @@ #include "NR_UE-CapabilityRAT-Container.h" #include "RRC/NAS/nas_config.h" -#include "RRC/NAS/rb_config.h" #if ENABLE_RAL #include "rrc_UE_ral.h" #endif @@ -776,13 +775,7 @@ rrc_ue_establish_drb( ue_mod_idP, ip_addr_offset3+ue_mod_idP, (long int)((eNB_index * LTE_maxDRB) + DRB_config->drb_Identity)); - rb_conf_ipv4(0,//add - ue_mod_idP,//cx align with the UE index - ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index - (eNB_index * LTE_maxDRB) + DRB_config->drb_Identity,//rb - 0,//dscp - ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr - ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr + AssertFatal(false, "not implemented\n"); LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index); } } // !EPC_MODE_ENABLED diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index a5ad82b61e..8b086b1387 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -79,7 +79,6 @@ #include "LTE_MeasResults.h" #include "RRC/NAS/nas_config.h" -#include "RRC/NAS/rb_config.h" #include "rrc_eNB_S1AP.h" #include "rrc_eNB_GTPV1U.h" @@ -5144,7 +5143,6 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( { int drb_id; int oip_ifup = 0; - int dest_ip_offset = 0; uint8_t kRRCenc[32] = {0}; uint8_t kRRCint[32] = {0}; uint8_t kUPenc[32] = {0}; @@ -5264,19 +5262,12 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( if (oip_ifup == 0) { // interface is up --> send a config the DRB module_id_t ue_module_id; - dest_ip_offset = 8; LOG_I(OIP, "[eNB %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n", ctxt_pP->module_id, ctxt_pP->module_id, (long int)((ue_context_pP->local_uid * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity)); ue_module_id = 0; // Was oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[ctxt_pP->module_id][ue_context_pP->local_uid]; - rb_conf_ipv4(0, //add - ue_module_id, //cx - ctxt_pP->module_id, //inst - (ue_module_id * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity, // RB - 0, //dscp - ipv4_address(ctxt_pP->module_id + 1, ctxt_pP->module_id + 1), //saddr - ipv4_address(ctxt_pP->module_id + 1, dest_ip_offset + ue_module_id + 1)); //daddr + AssertFatal(false, "not implemented\n"); LOG_D(RRC, "[eNB %d] State = Attached (UE rnti %x module id %u)\n", ctxt_pP->module_id, ue_context_pP->ue_context.rnti, ue_module_id); } /* oip_ifup */ diff --git a/openair2/RRC/NAS/rb_config.c b/openair2/RRC/NAS/rb_config.c deleted file mode 100644 index 17b180131f..0000000000 --- a/openair2/RRC/NAS/rb_config.c +++ /dev/null @@ -1,241 +0,0 @@ -/* - * 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 - */ - -/*! \file rb_config.c -* \brief User-space utility for configuring NASMESH IOCTL interface -* \author Raymond Knopp and Navid Nikaein -* \date 2009 -* \version 1.1 -* \warning -* @ingroup driver - -*/ - -#include -#include - -#include "nas_config.h" -#include "common/utils/LOG/log.h" - -#include "NETWORK_DRIVER/MESH/rrc_nas_primitives.h" -#include "NETWORK_DRIVER/MESH/ioctl.h" -#include "NETWORK_DRIVER/MESH/constant.h" - - -#define BUF_SIZE 800 - -// Global variables -//int sd_graal; -//int fd; // moved to the struct rb_config -//char myIPAddr[16]; // local IP Address -//int meas_counter; -//struct ralu_priv ru_priv; -//struct ralu_priv *ralupriv; - -//ioctl -char dummy_buffer[BUF_SIZE]; // moved to stats req -struct nas_ioctl gifr; -//int wait_start_nas; - -static int fd; -static int socket_enabled; - -static void init_socket(void) -{ - - if ((fd=socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - LOG_E(OIP,"ERROR opening socket\n"); - socket_enabled=0; - } - - socket_enabled=1; -} - -static void rb_ioctl_init(int inst) -{ - - /* init the gifr struct for the given inst */ - sprintf(gifr.name, "oai%d",inst); - memset ((void *)dummy_buffer,0,BUF_SIZE); - gifr.msg= &(dummy_buffer[0]); -} - - -static int rb_validate_config_ipv4(int cx, int inst, int rb) -{ - - if (inst == -1) { - LOG_E(OIP,"Specify an interface\n"); - return(1); - } - - if (rb == -1) { - LOG_E(OIP,"Specify an RAB identifier \n"); - return (1); - } - - if (cx == -1) { - LOG_E(OIP,"Specify an LCR \n"); - return(1); - } - - /* - if ( inet_aton(src,&saddr_ipv4)<= 0) { - LOG_E(OIP,"Specify a source IP address\n"); - return(1); - } - if (inet_aton(src,&saddr_ipv4)<= 0 0) { - LOG_E(OIP,"Specify a destination IP address\n"); - return(1); - } - */ - return (0); - -} - -int rb_conf_ipv4(int action,int cx, int inst, int rb, int dscp, in_addr_t saddr_ipv4, in_addr_t daddr_ipv4) -{ - //int rb_conf_ipv6(int action,int cx, int inst, int qos, in6_addr src, in6_addr dst) { - //int rb_conf(rb_config *rb_cfg) { - - int err; - - struct nas_msg_rb_establishment_request *msgreq; - struct nas_msg_class_add_request *msgreq_class; - - struct nas_msg_rb_release_request *msgrel; - struct nas_msg_class_del_request *msgdel_class; - - if (socket_enabled ==0) { - init_socket(); - } - - rb_ioctl_init(inst); - - if (rb_validate_config_ipv4(cx,inst,rb) > 0) { - LOG_E(OIP, "OIP configuration failed, inputs parameters incorrect\n"); - return (1); - } - - // add an OIP - if (action == 0 ) { - - msgreq = (struct nas_msg_rb_establishment_request *)(gifr.msg); - msgreq->rab_id = (nasRadioBearerId_t) rb; - msgreq->lcr = (nasRadioBearerId_t) cx; - msgreq->qos = 0; - - gifr.type = NAS_MSG_RB_ESTABLISHMENT_REQUEST; - - if ((err=ioctl(fd, NAS_IOCTL_RRM, &gifr)) < 0) { - perror("IOCTL error: OIP ESTAB REQ\n"); - LOG_E(OIP,"IOCTL error: OIP ESTAB REQ"); - } - - msgreq_class = (struct nas_msg_class_add_request *)(gifr.msg); - msgreq_class->rab_id = (nasRadioBearerId_t) rb; - msgreq_class->lcr = (nasRadioBearerId_t) cx; - msgreq_class->version = 4;//ipv4 - - msgreq_class->classref = 0 + (msgreq_class->lcr<<3); - msgreq_class->dir = NAS_DIRECTION_SEND; - msgreq_class->fct = NAS_FCT_QOS_SEND; - msgreq_class->saddr.ipv4 = saddr_ipv4; - msgreq_class->daddr.ipv4 = daddr_ipv4; - - // TO BE FIXED WHEN WE CAN SPECIFY A PROTOCOL-based rule - msgreq_class->protocol = NAS_PROTOCOL_DEFAULT; - msgreq_class->dscp=dscp; - gifr.type = NAS_MSG_CLASS_ADD_REQUEST; - - if ((err=ioctl(fd, NAS_IOCTL_RRM, &gifr)) < 0 ) { - perror("IOCTL error: DIR SEND: ADD REQ"); - LOG_E(OIP,"IOCTL error: DIR SEND: ADD REQ\n"); - } - - msgreq_class->rab_id = (nasRadioBearerId_t)rb; - msgreq_class->lcr = (nasRadioBearerId_t)cx; - msgreq_class->classref = 1+(msgreq_class->lcr<<3); - msgreq_class->dir = NAS_DIRECTION_RECEIVE; - msgreq_class->daddr.ipv4 = saddr_ipv4; - msgreq_class->saddr.ipv4 = daddr_ipv4; - gifr.type = NAS_MSG_CLASS_ADD_REQUEST; - - if ((err=ioctl(fd, NAS_IOCTL_RRM, &gifr)) < 0 ) { - perror("IOCTL error: DIR RECEIVE: ADD REQ"); - LOG_E(OIP,"IOCTL error: DIR RECEIVE: ADD REQ\n"); - } - - } - // OIP DEL - else if (action == 1) { - - msgrel = (struct nas_msg_rb_release_request *)(gifr.msg); - msgrel->rab_id = rb; - msgrel->lcr = cx; - - gifr.type = NAS_MSG_RB_RELEASE_REQUEST; - - if ((err=ioctl(fd, NAS_IOCTL_RRM, &gifr)) < 0) { - perror("IOCTL error: OIP RELEASE REQ"); - LOG_E(OIP,"IOCTL error: OIP RELEASE REQ\n"); - } - - msgdel_class = (struct nas_msg_class_del_request *)(gifr.msg); - msgdel_class->lcr = cx; - msgdel_class->dir = NAS_DIRECTION_SEND; - msgdel_class->classref = 0 + (msgdel_class->lcr<<3); - msgdel_class->dscp=dscp; - - gifr.type = NAS_MSG_CLASS_DEL_REQUEST; - - if ((err=ioctl(fd, NAS_IOCTL_RRM, &gifr)) < 0 ) { - perror("IOCTL error: DIR SEND : CLASS DEL REQ"); - LOG_E(OIP,"IOCTL error: DIR SEND : CLASS DEL REQ\n"); - } - - msgdel_class->lcr = cx; - msgdel_class->classref = 1+(msgdel_class->lcr<<3); - msgdel_class->dir = NAS_DIRECTION_RECEIVE; - - gifr.type = NAS_MSG_CLASS_DEL_REQUEST; - - if ((err=ioctl(fd, NAS_IOCTL_RRM, &gifr)) < 0 ) { - perror("IOCTL error: DIR RECEIVE : CLASS DEL REQ"); - LOG_E(OIP,"IOCTL erro: DIR RECEIVE : CLASS DEL REQ\n"); - } - - } - - return(0); - -} - -in_addr_t ipv4_address (int thirdOctet, int fourthOctet) -{ - - struct in_addr saddr_ipv4; - char ipAddress[20]; - sprintf(ipAddress, "10.0.%d.%d",thirdOctet,fourthOctet); - inet_aton(ipAddress,&saddr_ipv4); - return saddr_ipv4.s_addr; - -} diff --git a/openair2/RRC/NAS/rb_config.h b/openair2/RRC/NAS/rb_config.h deleted file mode 100644 index f00a9573a5..0000000000 --- a/openair2/RRC/NAS/rb_config.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 - */ - -/** \file rb_config.h - * \brief Openair radio bearer configuration header file - * \author Raymond Knopp and Navid Nikaein - */ - -#ifndef __RB_CONFIG_H__ -#define __RB_CONFIG_H__ - -#include - -int rb_conf_ipv4(int action,int cx, int inst, int rb, int dscp, in_addr_t saddr_ipv4, in_addr_t daddr_ipv4); -void rb_ioctl_init(int inst); -in_addr_t ipv4_address (int thirdOctet, int fourthOctet); - - - -#endif diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index db737823fe..08b6b334af 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -74,7 +74,6 @@ #include "T.h" #include "RRC/NAS/nas_config.h" -#include "RRC/NAS/rb_config.h" #include "openair3/SECU/secu_defs.h" diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index cab08077ce..f214c70351 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -66,7 +66,6 @@ #endif #include "RRC/NAS/nas_config.h" -#include "RRC/NAS/rb_config.h" #include "SIMULATION/TOOLS/sim.h" // for taus #include "nr_nas_msg_sim.h"