- all RAN code, CI code, configuration files, dockerfiles, in CSSL v1.0
- all deployment code (openshift, charts, ancillary files like shell
scripts), in MIT
- documentation in CC-BY-4.0
- exceptions might apply and are listed in NOTICE
- there is a new LICENSES folder with all licenses
- CONTRIBUTIONS.md has been updated accordingly
For automated changes based on OAI PL v1.1:
perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.{c,h,cpp}
perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.ts
perl -i~ -0pe 's/<!--.*Licensed to the OpenAirInterface.*openairinterface.org\n.*-->/<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->/s' **/*.xml
The rest (cmake, files with missing license, cmake) manually.
57 lines
1.3 KiB
C
57 lines
1.3 KiB
C
/*
|
|
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include "fs.h"
|
|
#include "user_api.h"
|
|
#include "utils.h"
|
|
|
|
bool file_exist_and_is_readable(const char *filename) {
|
|
FILE *file ;
|
|
file = fopen(filename, "r");
|
|
if ( file == NULL )
|
|
return false;
|
|
fclose(file);
|
|
return true;
|
|
}
|
|
|
|
char *get_ue_filename(const char *output_dir, int user_id) {
|
|
return make_filename(output_dir, USER_NVRAM_FILENAME, user_id);
|
|
}
|
|
|
|
char *get_emm_filename(const char *output_dir, int user_id) {
|
|
return make_filename(output_dir, EMM_NVRAM_FILENAME, user_id);
|
|
}
|
|
|
|
char *get_usim_filename(const char *output_dir, int user_id) {
|
|
return make_filename(output_dir, USIM_API_NVRAM_FILENAME, user_id);
|
|
}
|
|
|
|
char *make_filename(const char *output_dir, const char *filename, int ueid) {
|
|
size_t size;
|
|
char *str_ueid, *str;
|
|
|
|
str_ueid = itoa(ueid);
|
|
|
|
if (str_ueid == NULL) {
|
|
perror("ERROR\t: itoa() failed");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
size = strlen(output_dir)+strlen(filename) + sizeof(ueid) + 1 + 1; // for \0 and for '/'
|
|
str = malloc(size);
|
|
if (str == NULL) {
|
|
perror("ERROR\t: make_filename() failed");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
snprintf(str, size, "%s/%s%s",output_dir, filename, str_ueid);
|
|
free(str_ueid);
|
|
|
|
return str;
|
|
}
|