Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-AMF
Commits
b2a7610d
Commit
b2a7610d
authored
Aug 11, 2021
by
Niuhaiwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add amf_id_region
parent
823e1158
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
7 deletions
+21
-7
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+7
-3
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+7
-0
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+1
-0
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+4
-2
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+1
-1
src/common/amf.hpp
src/common/amf.hpp
+1
-1
No files found.
src/amf-app/amf_app.cpp
View file @
b2a7610d
...
...
@@ -173,10 +173,13 @@ void amf_app_task(void*) {
//------------------------------------------------------------------------------
long
amf_app
::
generate_amf_ue_ngap_id
()
{
long
tmp
=
0
;
//tmp = __sync_fetch_and_add(&amf_app_ue_ngap_id_generator, 1);
//time_t now_time = time(NULL);
//tm* t_tm = localtime(&now_time);
//long current = t_tm->tm_mday*24*60*60 + t_tm->tm_hour*60*60 + t_tm->tm_min*60 + t_tm->tm_sec;
//long tmp = (rand()+current)%100000 + 1;
long
tmp
=
__sync_fetch_and_add
(
&
amf_cfg
.
amf_id_region
,
1
);
//srand(time(NULL));
tmp
=
rand
()
%
1000
+
1
;
//
tmp = rand()%1000 + 1;
//return tmp & 0xffffffffff;
return
tmp
;
}
...
...
@@ -309,6 +312,7 @@ void amf_app::handle_itti_message(
long
amf_ue_ngap_id
=
0
;
if
((
amf_ue_ngap_id
=
itti_msg
.
amf_ue_ngap_id
)
==
-
1
)
{
amf_ue_ngap_id
=
generate_amf_ue_ngap_id
();
Logger
::
amf_app
().
debug
(
"Generated amf_ue_ngap_id(%d) for UE (ran_ue_ngap_id = %d)"
,
amf_ue_ngap_id
,
itti_msg
.
ran_ue_ngap_id
);
}
else
{
amf_ue_ngap_id
=
itti_msg
.
amf_ue_ngap_id
;
}
...
...
src/amf-app/amf_config.cpp
View file @
b2a7610d
...
...
@@ -109,6 +109,13 @@ int amf_config::load(const std::string& config_file) {
Logger
::
amf_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
}
try
{
amf_cfg
.
lookupValue
(
"AMF_ID_REGION"
,
amf_id_region
);
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
}
try
{
amf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_PID_DIRECTORY
,
pid_dir
);
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
...
...
src/amf-app/amf_config.hpp
View file @
b2a7610d
...
...
@@ -181,6 +181,7 @@ class amf_config {
util
::
thread_sched_params
&
cfg
);
void
display
();
unsigned
int
instance
;
int
amf_id_region
;
std
::
string
pid_dir
;
interface_cfg_t
n2
;
interface_cfg_t
n11
;
...
...
src/amf-app/amf_n1.cpp
View file @
b2a7610d
...
...
@@ -1241,6 +1241,7 @@ void amf_n1::registration_request_handle(bool isNasSig,
}
nc
.
get
()
->
is_imsi_present
=
true
;
nc
.
get
()
->
imsi
=
imsi
.
mcc
+
imsi
.
mnc
+
imsi
.
msin
;
Logger
::
amf_n1
().
debug
(
"Receiving Registration Request message from UE (imsi-%s)"
,
nc
.
get
()
->
imsi
.
c_str
());
Logger
::
amf_n1
().
debug
(
"Received IMSI %s"
,
nc
.
get
()
->
imsi
.
c_str
());
supi2amfId
[(
"imsi-"
+
nc
.
get
()
->
imsi
)]
=
amf_ue_ngap_id
;
supi2ranId
[(
"imsi-"
+
nc
.
get
()
->
imsi
)]
=
ran_ue_ngap_id
;
...
...
@@ -1892,7 +1893,7 @@ void amf_n1::response_registration_reject_msg(uint8_t cause_value,
//------------------------------------------------------------------------------
// specific procedures running logic
void
amf_n1
::
run_registration_procedure
(
std
::
shared_ptr
<
nas_context
>
&
nc
)
{
Logger
::
amf_n1
().
debug
(
"Start to run registration procedure
"
);
Logger
::
amf_n1
().
debug
(
"Start to run registration procedure
with UE (%s)"
,
nc
.
get
()
->
imsi
.
c_str
()
);
#if 0
nlohmann::json udsf_nas_context;
nlohmann::json udsf_response;
...
...
@@ -2023,7 +2024,7 @@ bool amf_n1::auth_vectors_generator(std::shared_ptr<nas_context> &nc) {
return
true
;
}
//------------------------------------------------------------------------------
#define CURL_TIMEOUT_MS 300L
#define CURL_TIMEOUT_MS 300
0
L
std
::
size_t
callback_ausf
(
const
char
*
in
,
std
::
size_t
size
,
std
::
size_t
num
,
std
::
string
*
out
)
{
...
...
@@ -2767,6 +2768,7 @@ bool amf_n1::start_authentication_procedure(std::shared_ptr<nas_context> nc,
is_common_procedure_for_authentication_running["content"] = to_string(nc.get()->is_common_procedure_for_authentication_running);
udsf_nas_context["blocks"].push_back(is_common_procedure_for_authentication_running);
#endif
Logger
::
amf_n1
().
debug
(
"Sending Authentication Request to UE (%s)"
,
nc
.
get
()
->
imsi
.
c_str
());
AuthenticationRequest
*
authReq
=
new
AuthenticationRequest
();
authReq
->
setHeader
(
PLAIN_5GS_MSG
);
authReq
->
setngKSI
(
NAS_KEY_SET_IDENTIFIER_NATIVE
,
ngksi
);
...
...
src/amf-app/amf_n2.cpp
View file @
b2a7610d
...
...
@@ -617,7 +617,7 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
}
else
if
(
gc
.
get
()
->
ng_state
!=
NGAP_READY
)
{
Logger
::
amf_n2
().
debug
(
"gNB with assoc_id (%d) is illegal"
,
init_ue_msg
.
assoc_id
);
return
;
//
return;
}
...
...
src/common/amf.hpp
View file @
b2a7610d
...
...
@@ -81,7 +81,7 @@ enum class http_response_codes_e {
};
// for CURL
#define SMF_CURL_TIMEOUT_MS
1
00L
#define SMF_CURL_TIMEOUT_MS
500
00L
#define SMF_NUMBER_RETRIES 3
constexpr
auto
CURL_MIME_BOUNDARY
=
"----Boundary"
;
#define NRF_CURL_TIMEOUT_MS 100L
...
...
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