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
c8356911
Commit
c8356911
authored
Jun 17, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First version for Update AMF conf API
parent
50653056
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
35 deletions
+129
-35
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+2
-1
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+96
-29
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+22
-3
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+2
-2
src/nas/common/3gpp_ts24501.hpp
src/nas/common/3gpp_ts24501.hpp
+7
-0
No files found.
src/amf-app/amf_app.cpp
View file @
c8356911
...
...
@@ -749,7 +749,8 @@ void amf_app::handle_itti_message(itti_sbi_update_amf_configuration& itti_msg) {
// Process the request and trigger the response from AMF API Server
nlohmann
::
json
response_data
=
{};
response_data
[
"content"
]
=
{};
response_data
[
"content"
]
=
itti_msg
.
configuration
;
if
(
update_amf_configuration
(
response_data
[
"content"
]))
{
Logger
::
amf_app
().
debug
(
"AMF configuration:
\n
%s"
,
response_data
[
"content"
].
dump
().
c_str
());
...
...
src/amf-app/amf_config.cpp
View file @
c8356911
This diff is collapsed.
Click to expand it.
src/amf-app/amf_config.hpp
View file @
c8356911
...
...
@@ -288,7 +288,6 @@ typedef struct plmn_support_item_s {
this
->
mnc
=
json_data
[
"mnc"
].
get
<
std
::
string
>
();
this
->
tac
=
json_data
[
"tac"
].
get
<
int
>
();
json_data
[
"slice_list"
]
=
nlohmann
::
json
::
array
();
for
(
auto
s
:
json_data
[
"slice_list"
])
{
slice_t
sl
=
{};
sl
.
from_json
(
s
);
...
...
@@ -314,6 +313,21 @@ typedef struct {
}
return
json_data
;
}
/*
void from_json(nlohmann::json& json_data) {
uint8_t i = 0;
for (auto s : json_data["prefered_integrity_algorithm"]) {
uint8_t integ_alg = s.get<int>();
prefered_integrity_algorithm[i] = integ_alg;
++i;
}
i = 0;
for (auto s : json_data["prefered_ciphering_algorithm"]) {
uint8_t cipher_alg = s.get<int>();
prefered_ciphering_algorithm[i] = cipher_alg;
++i;
}
}*/
}
nas_conf_t
;
typedef
struct
{
...
...
@@ -354,12 +368,14 @@ typedef struct nf_addr_s {
struct
in_addr
ipv4_addr
;
unsigned
int
port
;
std
::
string
api_version
;
std
::
string
fqdn
;
nlohmann
::
json
to_json
()
const
{
nlohmann
::
json
json_data
=
{};
json_data
[
"ipv4_addr"
]
=
inet_ntoa
(
this
->
ipv4_addr
);
json_data
[
"port"
]
=
this
->
port
;
json_data
[
"api_version"
]
=
this
->
api_version
;
json_data
[
"fqdn"
]
=
this
->
fqdn
;
return
json_data
;
}
...
...
@@ -370,6 +386,7 @@ typedef struct nf_addr_s {
"BAD IPv4 ADDRESS FORMAT FOR INTERFACE !"
);
this
->
port
=
json_data
[
"port"
].
get
<
int
>
();
this
->
api_version
=
json_data
[
"api_version"
].
get
<
std
::
string
>
();
this
->
fqdn
=
json_data
[
"fqdn"
].
get
<
std
::
string
>
();
}
}
nf_addr_t
;
...
...
@@ -394,6 +411,8 @@ class amf_config {
*/
int
load_interface
(
const
Setting
&
if_cfg
,
interface_cfg_t
&
cfg
);
bool
resolve_fqdn
(
const
std
::
string
&
fqdn
,
struct
in_addr
&
ipv4_addr
);
/*
* Get the URI of AMF N1N2MessageSubscribe
* @param [const std::string&] ue_cxt_id: UE Context Id
...
...
@@ -467,10 +486,10 @@ class amf_config {
unsigned
int
sbi_http2_port
;
unsigned
int
statistics_interval
;
std
::
string
AMF_N
ame
;
std
::
string
amf_n
ame
;
guami_t
guami
;
std
::
vector
<
guami_t
>
guami_list
;
unsigned
int
relative
AMFC
apacity
;
unsigned
int
relative
_amf_c
apacity
;
std
::
vector
<
plmn_item_t
>
plmn_list
;
std
::
string
is_emergency_support
;
auth_conf
auth_para
;
...
...
src/amf-app/amf_n2.cpp
View file @
c8356911
...
...
@@ -420,7 +420,7 @@ void amf_n2::handle_itti_message(itti_ng_setup_request& itti_msg) {
// file and send_msg
uint8_t
*
buffer
=
(
uint8_t
*
)
calloc
(
1
,
BUFFER_SIZE_1024
);
NGSetupResponseMsg
ngSetupResp
;
ngSetupResp
.
setAMFName
(
amf_cfg
.
AMF_N
ame
);
ngSetupResp
.
setAMFName
(
amf_cfg
.
amf_n
ame
);
std
::
vector
<
struct
GuamiItem_s
>
guami_list
;
for
(
int
i
=
0
;
i
<
amf_cfg
.
guami_list
.
size
();
i
++
)
{
struct
GuamiItem_s
tmp
;
...
...
@@ -433,7 +433,7 @@ void amf_n2::handle_itti_message(itti_ng_setup_request& itti_msg) {
}
ngSetupResp
.
setGUAMIList
(
guami_list
);
ngSetupResp
.
setRelativeAmfCapacity
(
amf_cfg
.
relative
AMFC
apacity
);
ngSetupResp
.
setRelativeAmfCapacity
(
amf_cfg
.
relative
_amf_c
apacity
);
std
::
vector
<
PlmnSliceSupport_t
>
plmn_list
;
for
(
int
i
=
0
;
i
<
amf_cfg
.
plmn_list
.
size
();
i
++
)
{
PlmnSliceSupport_t
tmp
;
...
...
src/nas/common/3gpp_ts24501.hpp
View file @
c8356911
...
...
@@ -29,6 +29,9 @@
#ifndef _3GPP_TS_24501_H_
#define _3GPP_TS_24501_H_
#include <string>
#include <vector>
/********** epd type **************/
#define EPD_5GS_MM_MSG 0b01111110
...
...
@@ -129,6 +132,10 @@
#define EA1_128_5G 0b001
#define EA2_128_5G 0b010
static
const
std
::
vector
<
std
::
string
>
nas_itegrity_algorithm_list_e2str
=
{
"NIA0"
,
"NIA1"
,
"NIA2"
};
static
const
std
::
vector
<
std
::
string
>
nas_ciphering_algorithm_list_e2str
=
{
"NEA0"
,
"NEA1"
,
"NEA2"
};
/************************** cause value for 5g mobility management(Annex A)
* ********************************/
#define _5GMM_CAUSE_ILLEGAL_UE 3
...
...
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