Merge remote-tracking branch 'origin/remove-unused-memblock' into integration_2023_w51
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#define M3AP_TIMERS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform_types.h"
|
||||
#include "common/platform_types.h"
|
||||
|
||||
typedef struct {
|
||||
/* incremented every TTI (every millisecond when in realtime).
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
#define MME_APP_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform_types.h"
|
||||
|
||||
#include "common/platform_types.h"
|
||||
|
||||
void *MME_app_task(void *args_p);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <libconfig.h>
|
||||
|
||||
#include "commonDef.h"
|
||||
#include "platform_types.h"
|
||||
#include "common/platform_types.h"
|
||||
#include "common/platform_constants.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
|
||||
@@ -1,208 +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
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
Source memory.c
|
||||
|
||||
Version 0.1
|
||||
|
||||
Date 2012/10/09
|
||||
|
||||
Product NAS stack
|
||||
|
||||
Subsystem Utilities
|
||||
|
||||
Author Frederic Maurel
|
||||
|
||||
Description Memory access utilities
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include "memory.h"
|
||||
#include "commonDef.h"
|
||||
#include "nas_log.h"
|
||||
|
||||
#include <stdio.h> // fopen, fread, fclose
|
||||
#include <stdlib.h> // getenv, malloc, free
|
||||
#include <string.h> // strlen
|
||||
|
||||
/****************************************************************************/
|
||||
/**************** E X T E R N A L D E F I N I T I O N S ****************/
|
||||
/****************************************************************************/
|
||||
|
||||
/****************************************************************************/
|
||||
/******************* L O C A L D E F I N I T I O N S *******************/
|
||||
/****************************************************************************/
|
||||
|
||||
/****************************************************************************/
|
||||
/****************** E X P O R T E D F U N C T I O N S ******************/
|
||||
/****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
** **
|
||||
** Name: memory_get_path() **
|
||||
** **
|
||||
** Description: Gets the absolute path of the file where non-volatile **
|
||||
** data are located **
|
||||
** **
|
||||
** Inputs: dirname: The directory where data file is located **
|
||||
** filename: The name of the data file **
|
||||
** Others: None **
|
||||
** **
|
||||
** Outputs: None **
|
||||
** Return: The absolute path of the non-volatile data **
|
||||
** file. The returned value is a dynamically **
|
||||
** allocated octet string that needs to be **
|
||||
** freed after usage. **
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
char* memory_get_path(const char* dirname, const char* filename)
|
||||
{
|
||||
/* Get non-volatile data directory */
|
||||
const char* path = getenv(dirname);
|
||||
|
||||
if (path == NULL) {
|
||||
path = getenv(DEFAULT_NAS_PATH);
|
||||
}
|
||||
|
||||
if (path == NULL) {
|
||||
LOG_TRACE(WARNING, "MEMORY - %s and %s environment variables are not defined trying local directory", dirname, DEFAULT_NAS_PATH);
|
||||
path = ".";
|
||||
}
|
||||
|
||||
/* Append non-volatile data file name */
|
||||
size_t size = strlen(path) + strlen(filename) + 1;
|
||||
char* data_filename = (char*)malloc(size+1);
|
||||
|
||||
if (data_filename != NULL) {
|
||||
if (size != sprintf(data_filename, "%s/%s", path, filename)) {
|
||||
free(data_filename);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return data_filename;
|
||||
}
|
||||
|
||||
char* memory_get_path_from_ueid(const char* dirname, const char* filename, int ueid)
|
||||
{
|
||||
/* Get non-volatile data directory */
|
||||
const char* path = getenv(dirname);
|
||||
char buffer[2048];
|
||||
|
||||
if (path == NULL) {
|
||||
path = getenv(DEFAULT_NAS_PATH);
|
||||
}
|
||||
|
||||
if (path == NULL) {
|
||||
LOG_TRACE(WARNING, "MEMORY - %s and %s environment variables are not defined trying local directory", dirname, DEFAULT_NAS_PATH);
|
||||
path = ".";
|
||||
}
|
||||
|
||||
/* Append non-volatile data file name */
|
||||
if ( snprintf(buffer, sizeof(buffer), "%s/%s%d", path, filename, ueid) < 0 ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return strdup(buffer);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
** **
|
||||
** Name: memory_read() **
|
||||
** **
|
||||
** Description: Reads data from a non-volatile data file **
|
||||
** **
|
||||
** Inputs: datafile: The absolute path to the data file **
|
||||
** size: The size of the data to read **
|
||||
** Others: None **
|
||||
** **
|
||||
** Outputs: data: Pointer to the data read **
|
||||
** Return: RETURNerror, RETURNok **
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int memory_read(const char* datafile, void* data, size_t size)
|
||||
{
|
||||
int rc = RETURNerror;
|
||||
|
||||
/* Open the data file for reading operation */
|
||||
FILE* fp = fopen(datafile, "rb");
|
||||
|
||||
if (fp != NULL) {
|
||||
/* Read data */
|
||||
size_t n = fread(data, size, 1, fp);
|
||||
|
||||
if (n == 1) {
|
||||
rc = RETURNok;
|
||||
}
|
||||
|
||||
/* Close the data file */
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
** **
|
||||
** Name: memory_write() **
|
||||
** **
|
||||
** Description: Writes data to a non-volatile data file **
|
||||
** **
|
||||
** Inputs: datafile: The absolute path to the data file **
|
||||
** data: Pointer to the data to write **
|
||||
** size: The size of the data to write **
|
||||
** Others: None **
|
||||
** **
|
||||
** Outputs: None **
|
||||
** Return: RETURNerror, RETURNok **
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int memory_write(const char* datafile, const void* data, size_t size)
|
||||
{
|
||||
int rc = RETURNerror;
|
||||
|
||||
/* Open the data file for writing operation */
|
||||
FILE* fp = fopen(datafile, "wb");
|
||||
|
||||
if (fp != NULL) {
|
||||
/* Write data */
|
||||
size_t n = fwrite(data, size, 1, fp);
|
||||
|
||||
if (n == 1) {
|
||||
rc = RETURNok;
|
||||
}
|
||||
|
||||
/* Close the data file */
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/********************* L O C A L F U N C T I O N S *********************/
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -1,67 +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
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
Source memory.h
|
||||
|
||||
Version 0.1
|
||||
|
||||
Date 2012/10/09
|
||||
|
||||
Product NAS stack
|
||||
|
||||
Subsystem Utilities
|
||||
|
||||
Author Frederic Maurel
|
||||
|
||||
Description Memory access utilities
|
||||
|
||||
*****************************************************************************/
|
||||
#ifndef __MEMORY_H__
|
||||
#define __MEMORY_H__
|
||||
|
||||
#include <stddef.h> // size_t
|
||||
|
||||
/****************************************************************************/
|
||||
/********************* G L O B A L C O N S T A N T S *******************/
|
||||
/****************************************************************************/
|
||||
|
||||
/****************************************************************************/
|
||||
/************************ G L O B A L T Y P E S ************************/
|
||||
/****************************************************************************/
|
||||
|
||||
/****************************************************************************/
|
||||
/******************** G L O B A L V A R I A B L E S ********************/
|
||||
/****************************************************************************/
|
||||
|
||||
/****************************************************************************/
|
||||
/****************** E X P O R T E D F U N C T I O N S ******************/
|
||||
/****************************************************************************/
|
||||
|
||||
char* memory_get_path(const char* dirname, const char* filename);
|
||||
|
||||
char* memory_get_path_from_ueid(const char* dirname, const char* filename, int ueid);
|
||||
|
||||
int memory_read(const char* datafile, void* data, size_t size);
|
||||
|
||||
int memory_write(const char* datafile, const void* data, size_t size);
|
||||
|
||||
#endif /* __MEMORY_H__*/
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "memory.h"
|
||||
#include "common/utils/mem/oai_memory.h"
|
||||
#include "conf_emm.h"
|
||||
#include "fs.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "commonDef.h"
|
||||
#include "memory.h"
|
||||
#include "common/utils/mem/oai_memory.h"
|
||||
#include "fs.h"
|
||||
#include "conf_user_data.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "usim_api.h"
|
||||
#include "emmData.h"
|
||||
#include "display.h"
|
||||
#include "memory.h"
|
||||
#include "common/utils/mem/oai_memory.h"
|
||||
#include "fs.h"
|
||||
|
||||
#define PRINT_PLMN_DIGIT(d) if ((d) != 0xf) printf("%u", (d))
|
||||
|
||||
@@ -38,16 +38,14 @@ Description Implements the API used by the NAS layer to read/write
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h> // memcpy, memset
|
||||
#include <stdlib.h> // malloc, free
|
||||
#include "usim_api.h"
|
||||
#include "nas_log.h"
|
||||
#include "utils.h"
|
||||
#include "memory.h"
|
||||
#include <stdio.h>
|
||||
#include "common/utils/mem/oai_memory.h"
|
||||
#include "aka_functions.h"
|
||||
#include <string.h> // memcpy, memset
|
||||
#include <stdlib.h> // malloc, free
|
||||
#include <stdio.h>
|
||||
|
||||
/****************************************************************************/
|
||||
/**************** E X T E R N A L D E F I N I T I O N S ****************/
|
||||
|
||||
@@ -37,6 +37,9 @@ Description Defines the EPS Mobility Management procedure call manager,
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include <string.h> // memset, memcpy, strlen
|
||||
#include <stdio.h> // sprintf
|
||||
#include <stdlib.h> // malloc, free
|
||||
#include "emm_main.h"
|
||||
#include "nas_log.h"
|
||||
#include "utils.h"
|
||||
@@ -44,13 +47,9 @@ Description Defines the EPS Mobility Management procedure call manager,
|
||||
#include "MobileIdentity.h"
|
||||
#include "emm_proc_defs.h"
|
||||
|
||||
#include "memory.h"
|
||||
#include "usim_api.h"
|
||||
#include "IdleMode.h"
|
||||
|
||||
#include <string.h> // memset, memcpy, strlen
|
||||
#include <stdio.h> // sprintf
|
||||
#include <stdlib.h> // malloc, free
|
||||
#include "common/utils/mem/oai_memory.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/**************** E X T E R N A L D E F I N I T I O N S ****************/
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
# include "user_api.h"
|
||||
# include "nas_parser.h"
|
||||
# include "nas_proc.h"
|
||||
# include "memory.h"
|
||||
#include "common/utils/mem/oai_memory.h"
|
||||
|
||||
#include "nas_user.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
@@ -39,7 +39,7 @@ Description NAS procedure functions triggered by the user
|
||||
|
||||
#include "user_defs.h"
|
||||
#include "nas_log.h"
|
||||
#include "memory.h"
|
||||
#include "common/utils/mem/oai_memory.h"
|
||||
|
||||
#include "at_command.h"
|
||||
#include "at_response.h"
|
||||
|
||||
@@ -10,7 +10,7 @@ extern "C" {
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include <openair2/COMMON/platform_types.h>
|
||||
#include "common/platform_types.h"
|
||||
#include <openair3/UTILS/conversions.h>
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include <common/utils/ocp_itti/intertask_interface.h>
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#define GTPNOK -1
|
||||
|
||||
# define GTPU_HEADER_OVERHEAD_MAX 64
|
||||
|
||||
#include "common/utils/hashtable/hashtable.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user