Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangjie
OpenXG-RAN
Commits
747cea24
Commit
747cea24
authored
Aug 26, 2016
by
Frédéric Leroy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(conf2uedata): add a selector for displaying files
parent
af402766
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
23 deletions
+50
-23
openair3/NAS/TOOLS/conf2uedata.c
openair3/NAS/TOOLS/conf2uedata.c
+2
-2
openair3/NAS/TOOLS/display.c
openair3/NAS/TOOLS/display.c
+40
-20
openair3/NAS/TOOLS/display.h
openair3/NAS/TOOLS/display.h
+8
-1
No files found.
openair3/NAS/TOOLS/conf2uedata.c
View file @
747cea24
...
@@ -46,7 +46,7 @@ int main(int argc, char**argv) {
...
@@ -46,7 +46,7 @@ int main(int argc, char**argv) {
exit
(
1
);
exit
(
1
);
}
}
display_data_from_directory
(
output_dir
);
display_data_from_directory
(
output_dir
,
DISPLAY_ALL
);
exit
(
0
);
exit
(
0
);
}
}
...
@@ -55,7 +55,7 @@ int main(int argc, char**argv) {
...
@@ -55,7 +55,7 @@ int main(int argc, char**argv) {
* Displays command line usage
* Displays command line usage
*/
*/
void
_display_usage
(
void
)
{
void
_display_usage
(
void
)
{
fprintf
(
stderr
,
"usage: conf2uedata [OPTION]
[directory]
...
\n
"
);
fprintf
(
stderr
,
"usage: conf2uedata [OPTION]...
\n
"
);
fprintf
(
stderr
,
"
\t
[-c]
\t
Config file to use
\n
"
);
fprintf
(
stderr
,
"
\t
[-c]
\t
Config file to use
\n
"
);
fprintf
(
stderr
,
"
\t
[-o]
\t
output file directory
\n
"
);
fprintf
(
stderr
,
"
\t
[-o]
\t
output file directory
\n
"
);
fprintf
(
stderr
,
"
\t
[-h]
\t
Display this usage
\n
"
);
fprintf
(
stderr
,
"
\t
[-h]
\t
Display this usage
\n
"
);
...
...
openair3/NAS/TOOLS/display.c
View file @
747cea24
...
@@ -28,29 +28,49 @@
...
@@ -28,29 +28,49 @@
PRINT_PLMN_DIGIT((plmn).MNCdigit2); \
PRINT_PLMN_DIGIT((plmn).MNCdigit2); \
PRINT_PLMN_DIGIT((plmn).MNCdigit3)
PRINT_PLMN_DIGIT((plmn).MNCdigit3)
void
display_data_from_directory
(
const
char
*
directory
)
{
// return number of files displayed
int
user_id
=
0
;
int
display_data_from_directory
(
const
char
*
directory
,
int
flags
)
{
char
*
filename
;
int
user_id
=
0
;
char
*
filename
;
filename
=
get_ue_filename
(
directory
,
user_id
);
bool
found
=
true
;
while
(
file_exist_and_is_readable
(
filename
)
)
{
int
displayed_count
=
0
;
display_ue_data
(
filename
);
while
(
found
)
{
free
(
filename
);
found
=
false
;
filename
=
get_emm_filename
(
directory
,
user_id
);
if
(
flags
&
DISPLAY_UEDATA
)
{
display_emm_data
(
filename
);
filename
=
get_ue_filename
(
directory
,
user_id
);
free
(
filename
);
if
(
file_exist_and_is_readable
(
filename
)
)
{
display_ue_data
(
filename
);
displayed_count
+=
1
;
found
=
true
;
}
free
(
filename
);
}
filename
=
get_usim_filename
(
directory
,
user_id
);
if
(
flags
&
DISPLAY_EMM
)
{
display_usim_data
(
filename
);
filename
=
get_emm_filename
(
directory
,
user_id
);
free
(
filename
);
if
(
file_exist_and_is_readable
(
filename
)
)
{
display_emm_data
(
filename
);
displayed_count
+=
1
;
found
=
true
;
}
free
(
filename
);
}
if
(
flags
&
DISPLAY_USIM
)
{
filename
=
get_usim_filename
(
directory
,
user_id
);
if
(
file_exist_and_is_readable
(
filename
)
)
{
display_usim_data
(
filename
);
displayed_count
+=
1
;
found
=
true
;
}
free
(
filename
);
}
user_id
+=
1
;
user_id
+=
1
;
filename
=
get_ue_filename
(
directory
,
user_id
);
}
}
return
displayed_count
;
free
(
filename
);
}
}
void
display_ue_data
(
const
char
*
filename
)
{
void
display_ue_data
(
const
char
*
filename
)
{
...
...
openair3/NAS/TOOLS/display.h
View file @
747cea24
#ifndef _DISPLAY_H
#ifndef _DISPLAY_H
#define _DISPLAY_H
#define _DISPLAY_H
void
display_data_from_directory
(
const
char
*
directory
);
#define DISPLAY_EMM 1
#define DISPLAY_USIM 2
#define DISPLAY_UEDATA 4
#define DISPLAY_ALL 7
// return number of files displayed
int
display_data_from_directory
(
const
char
*
directory
,
int
flags
);
void
display_ue_data
(
const
char
*
filename
);
void
display_ue_data
(
const
char
*
filename
);
void
display_emm_data
(
const
char
*
filename
);
void
display_emm_data
(
const
char
*
filename
);
void
display_usim_data
(
const
char
*
filename
);
void
display_usim_data
(
const
char
*
filename
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment