Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-Spgwu-Tiny-Simple
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
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
CommunityXG
OpenXG-Spgwu-Tiny-Simple
Commits
bd5d312b
Commit
bd5d312b
authored
Jan 14, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
560b64e8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
146 deletions
+17
-146
src/common/msg/itti_msg_nrf.hpp
src/common/msg/itti_msg_nrf.hpp
+0
-128
src/spgwu/spgwu_nrf.cpp
src/spgwu/spgwu_nrf.cpp
+2
-2
src/spgwu/spgwu_nrf.hpp
src/spgwu/spgwu_nrf.hpp
+0
-1
src/spgwu/spgwu_profile.cpp
src/spgwu/spgwu_profile.cpp
+11
-11
src/spgwu/spgwu_profile.hpp
src/spgwu/spgwu_profile.hpp
+4
-4
No files found.
src/common/msg/itti_msg_nrf.hpp
deleted
100644 → 0
View file @
560b64e8
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*
* itti_msg_nrf.hpp
*
* Created on:
* Author:
*/
#ifndef ITTI_MSG_NRF_HPP_INCLUDED_
#define ITTI_MSG_NRF_HPP_INCLUDED_
#include "itti_msg.hpp"
#include "spgwu_profile.hpp"
//#include "PatchItem.h"
class
itti_nrf_msg
:
public
itti_msg
{
public:
itti_nrf_msg
(
const
itti_msg_type_t
msg_type
,
const
task_id_t
orig
,
const
task_id_t
dest
)
:
itti_msg
(
msg_type
,
orig
,
dest
)
{
}
itti_nrf_msg
(
const
itti_nrf_msg
&
i
)
:
itti_msg
(
i
)
{
}
itti_nrf_msg
(
const
itti_nrf_msg
&
i
,
const
task_id_t
orig
,
const
task_id_t
dest
)
:
itti_nrf_msg
(
i
)
{
origin
=
orig
;
destination
=
dest
;
}
};
//-----------------------------------------------------------------------------
class
itti_nrf_register_nf_instance_request
:
public
itti_nrf_msg
{
public:
itti_nrf_register_nf_instance_request
(
const
task_id_t
orig
,
const
task_id_t
dest
)
:
itti_nrf_msg
(
NRF_REGISTER_NF_INSTANCE_REQUEST
,
orig
,
dest
),
http_version
(
1
)
{}
const
char
*
get_msg_name
()
{
return
"NRF_REGISTER_NF_INSTANCE_REQUEST"
;
};
spgwu
::
spgwu_profile
profile
;
uint8_t
http_version
;
};
//-----------------------------------------------------------------------------
class
itti_nrf_register_nf_instance_response
:
public
itti_nrf_msg
{
public:
itti_nrf_register_nf_instance_response
(
const
task_id_t
orig
,
const
task_id_t
dest
)
:
itti_nrf_msg
(
NRF_REGISTER_NF_INSTANCE_RESPONSE
,
orig
,
dest
),
http_version
(
1
)
{}
const
char
*
get_msg_name
()
{
return
"NRF_REGISTER_NF_INSTANCE_RESPONSE"
;
};
spgwu
::
spgwu_profile
profile
;
uint8_t
http_version
;
uint8_t
http_response_code
;
};
//-----------------------------------------------------------------------------
class
itti_nrf_update_nf_instance_request
:
public
itti_nrf_msg
{
public:
itti_nrf_update_nf_instance_request
(
const
task_id_t
orig
,
const
task_id_t
dest
)
:
itti_nrf_msg
(
NRF_UPDATE_NF_INSTANCE_REQUEST
,
orig
,
dest
),
http_version
(
1
)
{}
const
char
*
get_msg_name
()
{
return
"NRF_UPDATE_NF_INSTANCE_REQUEST"
;
};
//std::vector<oai::smf_server::model::PatchItem> patch_items;
uint8_t
http_version
;
std
::
string
upf_instance_id
;
};
//-----------------------------------------------------------------------------
class
itti_nrf_update_nf_instance_response
:
public
itti_nrf_msg
{
public:
itti_nrf_update_nf_instance_response
(
const
task_id_t
orig
,
const
task_id_t
dest
)
:
itti_nrf_msg
(
NRF_UPDATE_NF_INSTANCE_RESPONSE
,
orig
,
dest
),
http_version
(
1
)
{}
const
char
*
get_msg_name
()
{
return
"NRF_UPDATE_NF_INSTANCE_RESPONSE"
;
};
uint8_t
http_version
;
std
::
string
upf_instance_id
;
uint8_t
http_response_code
;
};
//-----------------------------------------------------------------------------
class
itti_nrf_deregister_nf_instance
:
public
itti_nrf_msg
{
public:
itti_nrf_deregister_nf_instance
(
const
task_id_t
orig
,
const
task_id_t
dest
)
:
itti_nrf_msg
(
NRF_DEREGISTER_NF_INSTANCE
,
orig
,
dest
),
http_version
(
1
)
{}
const
char
*
get_msg_name
()
{
return
"NRF_DEREGISTER_NF_INSTANCE"
;
};
uint8_t
http_version
;
std
::
string
upf_instance_id
;
};
#endif
/* ITTI_MSG_NRF_HPP_INCLUDED_ */
src/spgwu/spgwu_nrf.cpp
View file @
bd5d312b
...
...
@@ -272,8 +272,8 @@ void spgwu_nrf::generate_upf_profile() {
generate_uuid
();
// TODO: get hardcoded values from configuration file
upf_profile
.
set_nf_instance_id
(
upf_instance_id
);
upf_profile
.
set_nf_instance_name
(
"OAI-
SM
F"
);
upf_profile
.
set_nf_type
(
"
SM
F"
);
upf_profile
.
set_nf_instance_name
(
"OAI-
UP
F"
);
upf_profile
.
set_nf_type
(
"
UP
F"
);
upf_profile
.
set_nf_status
(
"REGISTERED"
);
upf_profile
.
set_nf_heartBeat_timer
(
50
);
upf_profile
.
set_nf_priority
(
1
);
...
...
src/spgwu/spgwu_nrf.hpp
View file @
bd5d312b
...
...
@@ -35,7 +35,6 @@
#include "itti.hpp"
#include <curl/curl.h>
#include "3gpp_29.510.h"
#include "itti_msg_nrf.hpp"
#include "spgwu_profile.hpp"
namespace
spgwu
{
...
...
src/spgwu/spgwu_profile.cpp
View file @
bd5d312b
...
...
@@ -250,19 +250,19 @@ void spgwu_profile::to_json(nlohmann::json& data) const {
data
[
"capacity"
]
=
capacity
;
// UPF info
data
[
"
sm
fInfo"
]
=
{};
data
[
"
smfInfo"
][
"sNssaiSm
fInfoList"
]
=
nlohmann
::
json
::
array
();
data
[
"
up
fInfo"
]
=
{};
data
[
"
upfInfo"
][
"sNssaiUp
fInfoList"
]
=
nlohmann
::
json
::
array
();
for
(
auto
s
:
upf_info
.
snssai_upf_info_list
)
{
nlohmann
::
json
tmp
=
{};
tmp
[
"sNssai"
][
"sst"
]
=
s
.
snssai
.
sST
;
tmp
[
"sNssai"
][
"sd"
]
=
s
.
snssai
.
sD
;
tmp
[
"dnn
Sm
fInfoList"
]
=
nlohmann
::
json
::
array
();
tmp
[
"dnn
Up
fInfoList"
]
=
nlohmann
::
json
::
array
();
for
(
auto
d
:
s
.
dnn_upf_info_list
)
{
nlohmann
::
json
dnn_json
=
{};
dnn_json
[
"dnn"
]
=
d
.
dnn
;
tmp
[
"dnn
Sm
fInfoList"
].
push_back
(
dnn_json
);
tmp
[
"dnn
Up
fInfoList"
].
push_back
(
dnn_json
);
}
data
[
"
smfInfo"
][
"sNssaiSm
fInfoList"
].
push_back
(
tmp
);
data
[
"
upfInfo"
][
"sNssaiUp
fInfoList"
].
push_back
(
tmp
);
}
Logger
::
spgwu_app
().
debug
(
"UPF profile to json:
\n
%s"
,
data
.
dump
().
c_str
());
...
...
@@ -328,14 +328,14 @@ void spgwu_profile::from_json(const nlohmann::json& data) {
}
// UPF info
if
(
data
.
find
(
"
sm
fInfo"
)
!=
data
.
end
())
{
nlohmann
::
json
info
=
data
[
"
sm
fInfo"
];
if
(
data
.
find
(
"
up
fInfo"
)
!=
data
.
end
())
{
nlohmann
::
json
info
=
data
[
"
up
fInfo"
];
dnn_upf_info_item_t
dnn_item
=
{};
if
(
info
.
find
(
"sNssai
Sm
fInfoList"
)
!=
info
.
end
())
{
if
(
info
.
find
(
"sNssai
Up
fInfoList"
)
!=
info
.
end
())
{
nlohmann
::
json
snssai_upf_info_list
=
data
[
"
smfInfo"
][
"sNssaiSm
fInfoList"
];
data
[
"
upfInfo"
][
"sNssaiUp
fInfoList"
];
for
(
auto
it
:
snssai_upf_info_list
)
{
snssai_upf_info_item_t
upf_info_item
=
{};
...
...
@@ -345,8 +345,8 @@ void spgwu_profile::from_json(const nlohmann::json& data) {
if
(
it
[
"sNssai"
].
find
(
"sd"
)
!=
it
[
"sNssai"
].
end
())
upf_info_item
.
snssai
.
sD
=
it
[
"sNssai"
][
"sd"
].
get
<
std
::
string
>
();
}
if
(
it
.
find
(
"dnn
Sm
fInfoList"
)
!=
it
.
end
())
{
for
(
auto
d
:
it
[
"dnn
Sm
fInfoList"
])
{
if
(
it
.
find
(
"dnn
Up
fInfoList"
)
!=
it
.
end
())
{
for
(
auto
d
:
it
[
"dnn
Up
fInfoList"
])
{
if
(
d
.
find
(
"dnn"
)
!=
d
.
end
())
{
dnn_item
.
dnn
=
d
[
"dnn"
].
get
<
std
::
string
>
();
upf_info_item
.
dnn_upf_info_list
.
push_back
(
dnn_item
);
...
...
src/spgwu/spgwu_profile.hpp
View file @
bd5d312b
...
...
@@ -279,14 +279,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
/*
* Add an snssai_upf_info_item to the upf info
* @param [const snssai_upf_info_item_t &] s: snssai_
sm
f_info_item
* @param [const snssai_upf_info_item_t &] s: snssai_
up
f_info_item
* @return void
*/
void
add_upf_info_item
(
const
snssai_upf_info_item_t
&
s
);
/*
* Get NF instance
sm
f info
* @param [
smf_info_t &] s: store instance's sm
f info
* Get NF instance
up
f info
* @param [
upf_info_t &] s: store instance's up
f info
* @return void:
*/
void
get_upf_info
(
upf_info_t
&
s
)
const
;
...
...
@@ -306,7 +306,7 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
void
to_json
(
nlohmann
::
json
&
data
)
const
;
/*
* Covert from a json represetation to
SM
F profile
* Covert from a json represetation to
UP
F profile
* @param [nlohmann::json &] data: Json data
* @return void
*/
...
...
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