Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-NRF
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
OpenXG
OpenXG-NRF
Commits
336a7f03
Commit
336a7f03
authored
Oct 25, 2021
by
kharade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
profile update for attribute Ip Endpoint
parent
b8df9909
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
src/common/3gpp_29.510.h
src/common/3gpp_29.510.h
+24
-0
src/common/utils/api_conversions.cpp
src/common/utils/api_conversions.cpp
+11
-0
src/nrf_app/nrf_profile.cpp
src/nrf_app/nrf_profile.cpp
+11
-0
No files found.
src/common/3gpp_29.510.h
View file @
336a7f03
...
...
@@ -23,6 +23,8 @@
#define FILE_3GPP_29_510_NRF_SEEN
#include <vector>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "3gpp_23.003.h"
enum
class
nf_status_e
{
REGISTERED
=
0
,
SUSPENDED
=
1
,
UNDISCOVERABLE
=
2
};
...
...
@@ -304,12 +306,30 @@ typedef struct nf_service_version_s {
}
}
nf_service_version_t
;
typedef
struct
ip_endpoint_s
{
// struct in6_addr ipv6_address;
struct
in_addr
ipv4_address
;
std
::
string
transport
;
// TCP
unsigned
int
port
;
std
::
string
to_string
()
const
{
std
::
string
s
=
{};
s
.
append
(
"Ipv4 Address: "
);
s
.
append
(
inet_ntoa
(
ipv4_address
));
s
.
append
(
", TransportProtocol: "
);
s
.
append
(
transport
);
s
.
append
(
", Port: "
);
s
.
append
(
std
::
to_string
(
port
));
return
s
;
}
}
ip_endpoint_t
;
typedef
struct
nf_service_s
{
std
::
string
service_instance_id
;
std
::
string
service_name
;
std
::
vector
<
nf_service_version_t
>
versions
;
std
::
string
scheme
;
std
::
string
nf_service_status
;
std
::
vector
<
ip_endpoint_t
>
ip_endpoints
;
std
::
string
to_string
()
const
{
std
::
string
s
=
{};
...
...
@@ -324,6 +344,10 @@ typedef struct nf_service_s {
s
.
append
(
scheme
);
s
.
append
(
", Service status: "
);
s
.
append
(
nf_service_status
);
s
.
append
(
", IpEndPoints: "
);
for
(
auto
endpoint
:
ip_endpoints
)
{
s
.
append
(
endpoint
.
to_string
());
}
return
s
;
}
}
nf_service_t
;
...
...
src/common/utils/api_conversions.cpp
View file @
336a7f03
...
...
@@ -46,6 +46,7 @@
#include "logger.hpp"
#include "nrf.h"
#include "string.hpp"
#include "common_defs.h"
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
...
...
@@ -332,6 +333,16 @@ bool api_conv::profile_api_to_nrf_profile(
ns
.
versions
.
push_back
(
version
);
}
ns
.
nf_service_status
=
service
.
getNfServiceStatus
();
if
(
service
.
ipEndPointsIsSet
())
{
for
(
auto
v
:
service
.
getIpEndPoints
())
{
ip_endpoint_t
ip_end
;
IPV4_STR_ADDR_TO_INADDR
(
v
.
getIpv4Address
().
c_str
(),
ip_end
.
ipv4_address
,
""
);
ip_end
.
port
=
v
.
getPort
();
//ip_end.transport = v.getTransport();
ns
.
ip_endpoints
.
push_back
(
ip_end
);
}
}
profile
.
get
()
->
add_nf_service
(
ns
);
}
}
...
...
src/nrf_app/nrf_profile.cpp
View file @
336a7f03
...
...
@@ -608,6 +608,17 @@ void nrf_profile::to_json(nlohmann::json& data) const {
}
srv_tmp
[
"scheme"
]
=
service
.
scheme
;
srv_tmp
[
"nfServiceStatus"
]
=
service
.
nf_service_status
;
if
(
!
service
.
ip_endpoints
.
empty
())
{
// IP endpoints
srv_tmp
[
"ipEndPoints"
]
=
nlohmann
::
json
::
array
();
for
(
auto
endpoint
:
service
.
ip_endpoints
)
{
nlohmann
::
json
ep_tmp
=
{};
ep_tmp
[
"ipv4Address"
]
=
inet_ntoa
(
endpoint
.
ipv4_address
);
ep_tmp
[
"transport"
]
=
endpoint
.
transport
;
ep_tmp
[
"port"
]
=
endpoint
.
port
;
srv_tmp
[
"ipEndPoints"
].
push_back
(
ep_tmp
);
}
}
data
[
"nfServices"
].
push_back
(
srv_tmp
);
}
data
[
"json_data"
]
=
json_data
;
...
...
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