Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Shweta Shrivastava
openairinterface5G
Commits
3d0fbc00
Commit
3d0fbc00
authored
8 years ago
by
FredericLeroy
Browse files
Options
Downloads
Patches
Plain Diff
feat(conf2uedata): reintroduce nvram binary
parent
30fde6bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmake_targets/nas_sim_tools/CMakeLists.txt
+11
-0
11 additions, 0 deletions
cmake_targets/nas_sim_tools/CMakeLists.txt
openair3/NAS/TOOLS/display.c
+2
-0
2 additions, 0 deletions
openair3/NAS/TOOLS/display.c
openair3/NAS/TOOLS/nvram.c
+169
-0
169 additions, 0 deletions
openair3/NAS/TOOLS/nvram.c
with
182 additions
and
0 deletions
cmake_targets/nas_sim_tools/CMakeLists.txt
+
11
−
0
View file @
3d0fbc00
...
...
@@ -77,3 +77,14 @@ set(usim_SRC
add_executable
(
usim
${
usim_SRC
}
${
conf2uedata_HDR
}
)
target_link_libraries
(
usim
${
CONFIG_LIBRARIES
}
)
# nvram binary
set
(
nvram_SRC
${
OPENAIR_DIR
}
/openair3/NAS/TOOLS/nvram.c
${
CONF2UEDATA_LIB_SRC
}
)
add_executable
(
nvram
${
nvram_SRC
}
${
conf2uedata_HDR
}
)
target_link_libraries
(
nvram
${
CONFIG_LIBRARIES
}
)
This diff is collapsed.
Click to expand it.
openair3/NAS/TOOLS/display.c
+
2
−
0
View file @
3d0fbc00
...
...
@@ -44,6 +44,7 @@ int display_data_from_directory(const char *directory, int flags) {
display_ue_data
(
filename
);
displayed_count
+=
1
;
found
=
true
;
printf
(
"UE identity data file: %s
\n
"
,
filename
);
}
free
(
filename
);
}
...
...
@@ -54,6 +55,7 @@ int display_data_from_directory(const char *directory, int flags) {
display_emm_data
(
filename
);
displayed_count
+=
1
;
found
=
true
;
printf
(
"EPS Mobility Management data file: %s
\n
"
,
filename
);
}
free
(
filename
);
}
...
...
This diff is collapsed.
Click to expand it.
openair3/NAS/TOOLS/nvram.c
0 → 100644
+
169
−
0
View file @
3d0fbc00
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source usim_data.c
Version 0.1
Date 2012/10/31
Product NVRAM data generator
Subsystem NVRAM data generator main process
Author Frederic Maurel
Description Implements the utility used to generate data stored in the
NVRAM application
*****************************************************************************/
#include
<stdlib.h>
#include
<string.h>
#include
<stdbool.h>
#include
<getopt.h>
#include
"conf_parser.h"
#include
"display.h"
#define DEFAULT_NAS_PATH "PWD"
#define OUTPUT_DIR_ENV "NVRAM_DIR"
void
_display_usage
(
const
char
*
command
);
int
main
(
int
argc
,
char
*
const
argv
[])
{
enum
usim_command
{
NVRAM_COMMAND_NONE
,
NVRAM_COMMAND_PRINT
,
NVRAM_COMMAND_GEN
,
}
command
=
NVRAM_COMMAND_NONE
;
char
*
output_dir
=
NULL
;
char
*
conf_file
=
NULL
;
const
char
options
[]
=
"gpc:o:h"
;
const
struct
option
options_long_option
[]
=
{
{
"gen"
,
no_argument
,
NULL
,
'g'
},
{
"print"
,
no_argument
,
NULL
,
'p'
},
{
"conf"
,
required_argument
,
NULL
,
'c'
},
{
"output"
,
required_argument
,
NULL
,
'o'
},
{
"help"
,
no_argument
,
NULL
,
'h'
},
{
NULL
,
0
,
NULL
,
0
}
};
int
option_index
;
char
option_short
;
/*
* Read command line parameters
*/
while
(
true
)
{
option_short
=
getopt_long
(
argc
,
argv
,
options
,
options_long_option
,
&
option_index
);
if
(
option_short
==
-
1
)
break
;
switch
(
option_short
)
{
case
'c'
:
conf_file
=
optarg
;
break
;
case
'g'
:
command
=
NVRAM_COMMAND_GEN
;
break
;
case
'p'
:
command
=
NVRAM_COMMAND_PRINT
;
break
;
case
'o'
:
output_dir
=
optarg
;
break
;
default:
break
;
}
}
if
(
command
==
NVRAM_COMMAND_NONE
)
{
_display_usage
(
argv
[
0
]);
exit
(
EXIT_SUCCESS
);
}
/* compute default data directory if no output_dir is given */
if
(
output_dir
==
NULL
)
{
output_dir
=
getenv
(
OUTPUT_DIR_ENV
);
if
(
output_dir
==
NULL
)
{
output_dir
=
getenv
(
DEFAULT_NAS_PATH
);
}
if
(
output_dir
==
NULL
)
{
fprintf
(
stderr
,
"%s and %s environment variables are not defined trying local directory"
,
OUTPUT_DIR_ENV
,
DEFAULT_NAS_PATH
);
output_dir
=
"."
;
}
}
if
(
command
==
NVRAM_COMMAND_GEN
)
{
if
(
conf_file
==
NULL
)
{
printf
(
"No Configuration file is given
\n
"
);
_display_usage
(
argv
[
0
]);
exit
(
EXIT_FAILURE
);
}
if
(
parse_config_file
(
output_dir
,
conf_file
,
OUTPUT_UEDATA
|
OUTPUT_EMM
)
==
false
)
{
exit
(
EXIT_FAILURE
);
}
}
if
(
display_data_from_directory
(
output_dir
,
DISPLAY_UEDATA
|
DISPLAY_EMM
)
==
0
)
{
fprintf
(
stderr
,
"No NVRAM files found in %s
\n
"
,
output_dir
);
}
exit
(
EXIT_SUCCESS
);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
/*
* Displays command line usage
*/
void
_display_usage
(
const
char
*
command
)
{
fprintf
(
stderr
,
"usage: %s [OPTION]
\n
"
,
command
);
fprintf
(
stderr
,
"
\t
[--gen|-g]
\t
Generate the NVRAM data file
\n
"
);
fprintf
(
stderr
,
"
\t
[--print|-p]
\t
Display the content of the NVRAM data file
\n
"
);
fprintf
(
stderr
,
"
\t
[-c]
\t
Config file to use
\n
"
);
fprintf
(
stderr
,
"
\t
[-o]
\t
output file directory
\n
"
);
fprintf
(
stderr
,
"
\t
[--help|-h]
\t
Display this usage
\n
"
);
const
char
*
path
=
getenv
(
"NVRAM_DIR"
);
if
(
path
!=
NULL
)
{
fprintf
(
stderr
,
"NVRAM_DIR = %s
\n
"
,
path
);
}
else
{
fprintf
(
stderr
,
"NVRAM_DIR environment variable is not defined
\n
"
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment