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
bda176b2
Commit
bda176b2
authored
Nov 09, 2021
by
Niuhaiwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dataexposure from amf
parent
79fd5d1e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
183 additions
and
4 deletions
+183
-4
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+3
-0
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+6
-3
src/sbi/amf_server/AMFApiServer.cpp
src/sbi/amf_server/AMFApiServer.cpp
+1
-1
src/sbi/amf_server/AMFApiServer.hpp
src/sbi/amf_server/AMFApiServer.hpp
+6
-0
src/sbi/amf_server/api/DataExposure.cpp
src/sbi/amf_server/api/DataExposure.cpp
+107
-0
src/sbi/amf_server/api/DataExposure.h
src/sbi/amf_server/api/DataExposure.h
+60
-0
No files found.
src/amf-app/amf_app.cpp
View file @
bda176b2
...
...
@@ -213,6 +213,8 @@ void amf_app_task(void*) {
tid
=
itti_inst
->
timer_setup
(
amf_cfg
.
statistics_interval
,
0
,
TASK_AMF_APP
,
TASK_AMF_APP_PERIODIC_STATISTICS
,
0
);
stacs
.
display
();
#if 0
long average_cap = 0;
for(int i=0;i<amf_capability.size();i++){
average_cap += amf_capability[i];
...
...
@@ -235,6 +237,7 @@ void amf_app_task(void*) {
//double sumValue = accumulate(begin(delay_nudsf), end(delay_nudsf), 0.0);
//double meanValue = sumValue / delay_nudsf.size();
//Logger::amf_app().debug("dukl meanValue %4f", meanValue);
#endif
#if 0
if(delay_nudsf.size() == last_delay_nudsf_size && delay_nudsf.size()!=0){
Logger::amf_app().debug("total time %9f", accumulate(begin(delay_nudsf), end(delay_nudsf), 0.0));
...
...
src/amf-app/amf_n1.cpp
View file @
bda176b2
...
...
@@ -2180,11 +2180,14 @@ bool amf_n1::authentication_vectors_from_ausf(
#endif
Logger
::
amf_n1
().
debug
(
"authentication_vectors_from_ausf"
);
std
::
string
ausf_ip
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
amf_cfg
.
nausf
.
addr4
)));
//
std::string ausf_ip =
//
std::string(inet_ntoa(*((struct in_addr *)&amf_cfg.nausf.addr4)));
std
::
string
ausf_port
=
std
::
to_string
(
amf_cfg
.
nausf
.
port
);
//printf("ausf ip: %s\n", ausf_ip.c_str());
printf
(
"ausf config ip: %s
\n
"
,
amf_cfg
.
nausf
.
addr4
.
c_str
());
//ausf_ip = "10.244.2.6";
std
::
string
remoteUri
=
ausf_ip
+
":"
+
ausf_port
+
"/nausf-auth/v1/ue-authentications"
;
"http://"
+
amf_cfg
.
nausf
.
addr4
+
":"
+
ausf_port
+
"/nausf-auth/v1/ue-authentications"
;
Logger
::
amf_n1
().
debug
(
"remote ausf URI: %s"
,
remoteUri
.
c_str
());
std
::
string
msgBody
;
std
::
string
Response
;
...
...
src/sbi/amf_server/AMFApiServer.cpp
View file @
bda176b2
...
...
@@ -17,7 +17,7 @@ void AMFApiServer::init(size_t thr) {
m_nonUEN2MessagesCollectionDocumentApiImpl
->
init
();
m_nonUEN2MessagesSubscriptionsCollectionDocumentApiImpl
->
init
();
m_subscriptionsCollectionDocumentApiImpl
->
init
();
m_dataExposure
->
init
();
m_testSignallingApiImpl
->
init
();
Logger
::
amf_server
().
debug
(
"Initiate AMF server endpoints done!"
);
}
...
...
src/sbi/amf_server/AMFApiServer.hpp
View file @
bda176b2
...
...
@@ -16,6 +16,7 @@
#include "NonUEN2MessagesCollectionDocumentApiImpl.h"
#include "NonUEN2MessagesSubscriptionsCollectionDocumentApiImpl.h"
#include "SubscriptionsCollectionDocumentApiImpl.h"
#include "DataExposure.h"
#include "TestSignallingApiImpl.h"
...
...
@@ -65,6 +66,9 @@ class AMFApiServer {
m_testSignallingApiImpl
=
std
::
make_shared
<
TestSignallingApiImpl
>
(
m_router
,
amf_app_inst
);
m_dataExposure
=
std
::
make_shared
<
DataExposureApi
>
(
m_router
);
}
void
init
(
size_t
thr
=
1
);
...
...
@@ -97,4 +101,6 @@ class AMFApiServer {
std
::
shared_ptr
<
TestSignallingApiImpl
>
m_testSignallingApiImpl
;
std
::
shared_ptr
<
DataExposureApi
>
m_dataExposure
;
};
src/sbi/amf_server/api/DataExposure.cpp
0 → 100644
View file @
bda176b2
/**
* Nudsf_DataRepository
* Nudsf Data Repository Service. © 2021, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0-alpha.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "DataExposure.h"
//#include "Helpers.h"
#include "logger.hpp"
#include <nlohmann/json.hpp>
#include "TransData.hpp"
#include <stdlib.h>
#include <map>
#include <algorithm>
#include <cmath>
#include "amf_statistics.hpp"
using
json
=
nlohmann
::
json
;
extern
statistics
stacs
;
//using namespace org::openapitools::server::model;
namespace
oai
{
namespace
amf
{
namespace
api
{
using
namespace
oai
::
amf
::
model
;
DataExposureApi
::
DataExposureApi
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
)
{
router
=
rtr
;
}
void
DataExposureApi
::
init
()
{
setupRoutes
();
}
void
DataExposureApi
::
setupRoutes
()
{
using
namespace
Pistache
::
Rest
;
Routes
::
Get
(
*
router
,
base
+
"/getNFService"
,
Routes
::
bind
(
&
DataExposureApi
::
getNFService
,
this
));
}
void
DataExposureApi
::
getNFService
(
const
Pistache
::
Rest
::
Request
&
request
,
Pistache
::
Http
::
ResponseWriter
response
)
{
printf
(
"getNFService
\n
"
);
try
{
json
resp
;
int
i
=
0
;
for
(
auto
const
&
ue
:
stacs
.
ue_infos
)
{
Logger
::
amf_app
().
info
(
"|%7d|%22s|%18s|%15s|%16d|%11d|%9s|%7d|"
,
i
+
1
,
ue
.
second
.
registerStatus
.
c_str
(),
ue
.
second
.
imsi
.
c_str
(),
ue
.
second
.
guti
.
c_str
(),
ue
.
second
.
ranid
,
ue
.
second
.
amfid
,
(
ue
.
second
.
mcc
+
ue
.
second
.
mnc
).
c_str
(),
ue
.
second
.
cellId
);
i
++
;
json
ues
;
ues
[
"status"
]
=
ue
.
second
.
registerStatus
.
c_str
();
ues
[
"imsi"
]
=
ue
.
second
.
imsi
.
c_str
();
ues
[
"guti"
]
=
ue
.
second
.
guti
.
c_str
();
ues
[
"ranid"
]
=
ue
.
second
.
ranid
;
ues
[
"amfid"
]
=
ue
.
second
.
amfid
;
ues
[
"location"
][
"plmn"
]
=
(
ue
.
second
.
mcc
+
ue
.
second
.
mnc
).
c_str
();
ues
[
"location"
][
"cellid"
]
=
ue
.
second
.
cellId
;
resp
[
"ues"
].
push_back
(
ues
);
}
for
(
i
=
0
;
i
<
stacs
.
gnbs
.
size
();
i
++
)
{
Logger
::
amf_app
().
info
(
"| %d | Connected | 0x%x | %s "
" | %s, %d | "
,
i
+
1
,
stacs
.
gnbs
[
i
].
gnb_id
,
stacs
.
gnbs
[
i
].
gnb_name
.
c_str
(),
(
stacs
.
gnbs
[
i
].
mcc
+
stacs
.
gnbs
[
i
].
mnc
).
c_str
(),
stacs
.
gnbs
[
i
].
tac
);
json
gnbs
;
gnbs
[
"gnb_id"
]
=
stacs
.
gnbs
[
i
].
gnb_id
;
gnbs
[
"gnb_name"
]
=
stacs
.
gnbs
[
i
].
gnb_name
.
c_str
();
gnbs
[
"tai"
][
"plmn"
]
=
(
stacs
.
gnbs
[
i
].
mcc
+
stacs
.
gnbs
[
i
].
mnc
).
c_str
();
gnbs
[
"tai"
][
"tac"
]
=
stacs
.
gnbs
[
i
].
tac
;
resp
[
"gnbs"
].
push_back
(
gnbs
);
}
printf
(
"response: %s
\n
"
,
resp
.
dump
().
c_str
());
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
resp
.
dump
().
c_str
());
return
;
}
catch
(
nlohmann
::
detail
::
exception
&
e
)
{
//send a 400 error
response
.
send
(
Pistache
::
Http
::
Code
::
Bad_Request
,
e
.
what
());
return
;
}
catch
(
Pistache
::
Http
::
HttpError
&
e
)
{
response
.
send
(
static_cast
<
Pistache
::
Http
::
Code
>
(
e
.
code
()),
e
.
what
());
return
;
}
catch
(
std
::
exception
&
e
)
{
//send a 500 error
response
.
send
(
Pistache
::
Http
::
Code
::
Internal_Server_Error
,
e
.
what
());
return
;
}
}
}
}
}
src/sbi/amf_server/api/DataExposure.h
0 → 100644
View file @
bda176b2
/**
* Nudsf_DataRepository
* Nudsf Data Repository Service. © 2021, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0-alpha.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* RecordCRUDApi.h
*
*
*/
#ifndef _DATA_EXPOSURE_API_H_
#define _DATA_EXPOSURE_API_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include <string>
#include <vector>
#include "TransData.hpp"
#include <iostream>
#include <stdlib.h>
namespace
oai
{
namespace
amf
{
namespace
api
{
using
namespace
oai
::
amf
::
model
;
class
DataExposureApi
{
public:
DataExposureApi
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
);
virtual
~
DataExposureApi
()
{}
void
init
();
const
std
::
string
base
=
"/data_exposure/v1"
;
private:
void
setupRoutes
();
void
getNFService
(
const
Pistache
::
Rest
::
Request
&
request
,
Pistache
::
Http
::
ResponseWriter
response
);
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
router
;
};
}
}
}
#endif
/* RecordCRUDApi_H_ */
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