Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
0083673e
Commit
0083673e
authored
Aug 23, 2016
by
Frédéric Leroy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(conf2uedata): make plmns_list struct for managing plmns
parent
47d4cf65
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
47 deletions
+42
-47
openair3/NAS/TOOLS/conf2uedata.c
openair3/NAS/TOOLS/conf2uedata.c
+13
-18
openair3/NAS/TOOLS/conf2uedata.h
openair3/NAS/TOOLS/conf2uedata.h
+11
-11
openair3/NAS/TOOLS/conf_emm.c
openair3/NAS/TOOLS/conf_emm.c
+1
-1
openair3/NAS/TOOLS/conf_usim.c
openair3/NAS/TOOLS/conf_usim.c
+17
-17
No files found.
openair3/NAS/TOOLS/conf2uedata.c
View file @
0083673e
...
...
@@ -12,18 +12,13 @@
#include "conf_user_data.h"
#include "conf_usim.h"
int
*
ucplmn
=
NULL
;
int
*
oplmn
=
NULL
;
int
*
ocplmn
=
NULL
;
int
*
fplmn
=
NULL
;
int
*
ehplmn
=
NULL
;
plmns_list
ucplmns
;
plmns_list
oplmns
;
plmns_list
ocplmns
;
plmns_list
fplmns
;
plmns_list
ehplmns
;
int
plmn_nb
=
0
;
int
ucplmn_nb
=
0
;
int
oplmn_nb
=
0
;
int
ocplmn_nb
=
0
;
int
fplmn_nb
=
0
;
int
ehplmn_nb
=
0
;
plmn_conf_param_t
*
user_plmn_list
=
NULL
;
network_record_t
*
user_network_record_list
=
NULL
;
...
...
@@ -241,15 +236,15 @@ int parse_ue_plmn_param(config_setting_t *ue_setting, int user_id, const char **
return
EXIT_FAILURE
;
}
if
(
parse_Xplmn
(
ue_setting
,
UCPLMN
,
user_id
,
&
ucplmn
_nb
,
&
ucplmn
)
==
EXIT_FAILURE
)
if
(
parse_Xplmn
(
ue_setting
,
UCPLMN
,
user_id
,
&
ucplmn
s
)
==
EXIT_FAILURE
)
nb_errors
++
;
if
(
parse_Xplmn
(
ue_setting
,
OPLMN
,
user_id
,
&
oplmn
_nb
,
&
oplmn
)
==
EXIT_FAILURE
)
if
(
parse_Xplmn
(
ue_setting
,
OPLMN
,
user_id
,
&
oplmn
s
)
==
EXIT_FAILURE
)
nb_errors
++
;
if
(
parse_Xplmn
(
ue_setting
,
OCPLMN
,
user_id
,
&
ocplmn
_nb
,
&
ocplmn
)
==
EXIT_FAILURE
)
if
(
parse_Xplmn
(
ue_setting
,
OCPLMN
,
user_id
,
&
ocplmn
s
)
==
EXIT_FAILURE
)
nb_errors
++
;
if
(
parse_Xplmn
(
ue_setting
,
FPLMN
,
user_id
,
&
fplmn
_nb
,
&
fplmn
)
==
EXIT_FAILURE
)
if
(
parse_Xplmn
(
ue_setting
,
FPLMN
,
user_id
,
&
fplmn
s
)
==
EXIT_FAILURE
)
nb_errors
++
;
if
(
parse_Xplmn
(
ue_setting
,
EHPLMN
,
user_id
,
&
ehplmn
_nb
,
&
ehplmn
)
==
EXIT_FAILURE
)
if
(
parse_Xplmn
(
ue_setting
,
EHPLMN
,
user_id
,
&
ehplmn
s
)
==
EXIT_FAILURE
)
nb_errors
++
;
if
(
nb_errors
>
0
)
...
...
@@ -258,7 +253,7 @@ int parse_ue_plmn_param(config_setting_t *ue_setting, int user_id, const char **
}
int
parse_Xplmn
(
config_setting_t
*
ue_setting
,
const
char
*
section
,
int
user_id
,
int
*
plmns_count
,
int
**
plmns
)
{
int
user_id
,
plmns_list
*
plmns
)
{
int
rc
;
int
item_count
;
config_setting_t
*
setting
;
...
...
@@ -286,8 +281,8 @@ int parse_Xplmn(config_setting_t *ue_setting, const char *section,
datas
[
i
]
=
rc
;
}
*
plmns_count
=
item_count
;
*
plmn
s
=
datas
;
plmns
->
size
=
item_count
;
plmns
->
item
s
=
datas
;
return
EXIT_SUCCESS
;
}
...
...
openair3/NAS/TOOLS/conf2uedata.h
View file @
0083673e
...
...
@@ -43,18 +43,18 @@ typedef struct {
const
char
*
mcc
;
}
plmn_conf_param_t
;
extern
int
*
ucplmn
;
extern
int
*
oplmn
;
extern
int
*
ocplmn
;
extern
int
*
fplmn
;
extern
int
*
ehplmn
;
typedef
struct
{
int
size
;
int
*
items
;
}
plmns_list
;
extern
plmns_list
ucplmns
;
extern
plmns_list
oplmns
;
extern
plmns_list
ocplmns
;
extern
plmns_list
fplmns
;
extern
plmns_list
ehplmns
;
extern
int
plmn_nb
;
extern
int
ucplmn_nb
;
extern
int
oplmn_nb
;
extern
int
ocplmn_nb
;
extern
int
fplmn_nb
;
extern
int
ehplmn_nb
;
extern
plmn_conf_param_t
*
user_plmn_list
;
extern
network_record_t
*
user_network_record_list
;
...
...
@@ -70,7 +70,7 @@ int parse_plmns(config_setting_t *all_plmn_setting);
int
get_plmn_index
(
const
char
*
mccmnc
);
int
parse_ue_plmn_param
(
config_setting_t
*
ue_setting
,
int
user_id
,
const
char
**
hplmn
);
int
parse_Xplmn
(
config_setting_t
*
ue_setting
,
const
char
*
section
,
int
user_id
,
int
*
plmns_count
,
int
**
plmns
);
int
user_id
,
plmns_list
*
plmns
);
#endif // _CONF2UEDATA_H
openair3/NAS/TOOLS/conf_emm.c
View file @
0083673e
...
...
@@ -53,7 +53,7 @@ void gen_emm_data(emm_nvdata_t *emm_data, const char *hplmn, const char *msin) {
emm_data
->
rplmn
.
MNCdigit1
=
user_plmn_list
[
hplmn_index
].
mnc
[
0
];
emm_data
->
rplmn
.
MNCdigit2
=
user_plmn_list
[
hplmn_index
].
mnc
[
1
];
emm_data
->
eplmn
.
n_plmns
=
ehplmn
_nb
;
emm_data
->
eplmn
.
n_plmns
=
ehplmn
s
.
size
;
}
int
write_emm_data
(
const
char
*
directory
,
int
user_id
,
emm_nvdata_t
*
emm_data
)
{
...
...
openair3/NAS/TOOLS/conf_usim.c
View file @
0083673e
...
...
@@ -96,9 +96,9 @@ void gen_usim_data(usim_data_conf_t *u, usim_data_t *usim_data) {
for
(
int
i
=
0
;
i
<
USIM_FPLMN_MAX
;
i
++
)
{
memset
(
&
usim_data
->
fplmn
[
i
],
0xff
,
sizeof
(
plmn_t
));
}
if
(
fplmn
_nb
>
0
)
{
for
(
int
i
=
0
;
i
<
fplmn
_nb
;
i
++
)
{
usim_data
->
fplmn
[
i
]
=
user_network_record_list
[
fplmn
[
i
]].
plmn
;
if
(
fplmn
s
.
size
>
0
)
{
for
(
int
i
=
0
;
i
<
fplmn
s
.
size
;
i
++
)
{
usim_data
->
fplmn
[
i
]
=
user_network_record_list
[
fplmn
s
.
items
[
i
]].
plmn
;
}
}
...
...
@@ -183,8 +183,8 @@ void gen_usim_data(usim_data_conf_t *u, usim_data_t *usim_data) {
/*
* PLMN Network Name and Operator PLMN List
*/
for
(
int
i
=
0
;
i
<
oplmn
_nb
;
i
++
)
{
network_record_t
record
=
user_network_record_list
[
oplmn
[
i
]];
for
(
int
i
=
0
;
i
<
oplmn
s
.
size
;
i
++
)
{
network_record_t
record
=
user_network_record_list
[
oplmn
s
.
items
[
i
]];
usim_data
->
pnn
[
i
].
fullname
.
type
=
USIM_PNN_FULLNAME_TAG
;
usim_data
->
pnn
[
i
].
fullname
.
length
=
strlen
(
record
.
fullname
);
strncpy
((
char
*
)
usim_data
->
pnn
[
i
].
fullname
.
value
,
record
.
fullname
,
...
...
@@ -198,8 +198,8 @@ void gen_usim_data(usim_data_conf_t *u, usim_data_t *usim_data) {
usim_data
->
opl
[
i
].
end
=
record
.
tac_end
;
usim_data
->
opl
[
i
].
record_id
=
i
;
}
if
(
oplmn
_nb
<
USIM_OPL_MAX
)
{
for
(
int
i
=
oplmn
_nb
;
i
<
USIM_OPL_MAX
;
i
++
)
{
if
(
oplmn
s
.
size
<
USIM_OPL_MAX
)
{
for
(
int
i
=
oplmn
s
.
size
;
i
<
USIM_OPL_MAX
;
i
++
)
{
memset
(
&
usim_data
->
opl
[
i
].
plmn
,
0xff
,
sizeof
(
plmn_t
));
}
}
...
...
@@ -207,11 +207,11 @@ void gen_usim_data(usim_data_conf_t *u, usim_data_t *usim_data) {
/*
* List of Equivalent HPLMNs
*/
for
(
int
i
=
0
;
i
<
ehplmn
_nb
;
i
++
)
{
usim_data
->
ehplmn
[
i
]
=
user_network_record_list
[
ehplmn
[
i
]].
plmn
;
for
(
int
i
=
0
;
i
<
ehplmn
s
.
size
;
i
++
)
{
usim_data
->
ehplmn
[
i
]
=
user_network_record_list
[
ehplmn
s
.
items
[
i
]].
plmn
;
}
if
(
ehplmn
_nb
<
USIM_EHPLMN_MAX
)
{
for
(
int
i
=
ehplmn
_nb
;
i
<
USIM_EHPLMN_MAX
;
i
++
)
{
if
(
ehplmn
s
.
size
<
USIM_EHPLMN_MAX
)
{
for
(
int
i
=
ehplmn
s
.
size
;
i
<
USIM_EHPLMN_MAX
;
i
++
)
{
memset
(
&
usim_data
->
ehplmn
[
i
],
0xff
,
sizeof
(
plmn_t
));
}
}
...
...
@@ -227,9 +227,9 @@ void gen_usim_data(usim_data_conf_t *u, usim_data_t *usim_data) {
for
(
int
i
=
0
;
i
<
USIM_PLMN_MAX
;
i
++
)
{
memset
(
&
usim_data
->
plmn
[
i
],
0xff
,
sizeof
(
plmn_t
));
}
if
(
ucplmn
_nb
>
0
)
{
for
(
int
i
=
0
;
i
<
ucplmn
_nb
;
i
++
)
{
usim_data
->
plmn
[
i
].
plmn
=
user_network_record_list
[
ucplmn
[
i
]].
plmn
;
if
(
ucplmn
s
.
size
>
0
)
{
for
(
int
i
=
0
;
i
<
ucplmn
s
.
size
;
i
++
)
{
usim_data
->
plmn
[
i
].
plmn
=
user_network_record_list
[
ucplmn
s
.
items
[
i
]].
plmn
;
}
}
...
...
@@ -238,9 +238,9 @@ void gen_usim_data(usim_data_conf_t *u, usim_data_t *usim_data) {
for
(
int
i
=
0
;
i
<
USIM_OPLMN_MAX
;
i
++
)
{
memset
(
&
usim_data
->
oplmn
[
i
],
0xff
,
sizeof
(
plmn_t
));
}
if
(
ocplmn
_nb
>
0
)
{
for
(
int
i
=
0
;
i
<
ocplmn
_nb
;
i
++
)
{
usim_data
->
oplmn
[
i
].
plmn
=
user_network_record_list
[
ocplmn
[
i
]].
plmn
;
if
(
ocplmn
s
.
size
>
0
)
{
for
(
int
i
=
0
;
i
<
ocplmn
s
.
size
;
i
++
)
{
usim_data
->
oplmn
[
i
].
plmn
=
user_network_record_list
[
ocplmn
s
.
items
[
i
]].
plmn
;
usim_data
->
oplmn
[
i
].
AcT
=
(
USIM_ACT_GSM
|
USIM_ACT_UTRAN
|
USIM_ACT_EUTRAN
);
}
...
...
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