Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UDM
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-UDM
Commits
008d8bb5
Commit
008d8bb5
authored
Feb 08, 2021
by
Fang-WANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plmnid process is ok
parent
9477c7e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
8 deletions
+31
-8
src/api/AccessAndMobilitySubscriptionDataRetrievalApi.cpp
src/api/AccessAndMobilitySubscriptionDataRetrievalApi.cpp
+10
-7
src/common/conversions.cpp
src/common/conversions.cpp
+18
-0
src/common/conversions.hpp
src/common/conversions.hpp
+2
-0
src/impl/AccessAndMobilitySubscriptionDataRetrievalApiImpl.cpp
...mpl/AccessAndMobilitySubscriptionDataRetrievalApiImpl.cpp
+1
-1
No files found.
src/api/AccessAndMobilitySubscriptionDataRetrievalApi.cpp
View file @
008d8bb5
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#include "AccessAndMobilitySubscriptionDataRetrievalApi.h"
#include "AccessAndMobilitySubscriptionDataRetrievalApi.h"
#include "Helpers.h"
#include "Helpers.h"
#include "conversions.hpp"
namespace
oai
{
namespace
oai
{
namespace
udm
{
namespace
udm
{
...
@@ -62,14 +63,16 @@ void AccessAndMobilitySubscriptionDataRetrievalApi::get_am_data_handler(
...
@@ -62,14 +63,16 @@ void AccessAndMobilitySubscriptionDataRetrievalApi::get_am_data_handler(
}
}
auto
plmnIdQuery
=
request
.
query
().
get
(
"plmn-id"
);
auto
plmnIdQuery
=
request
.
query
().
get
(
"plmn-id"
);
Pistache
::
Optional
<
PlmnId
>
plmnId
;
Pistache
::
Optional
<
PlmnId
>
plmnId
;
/* if(!plmnIdQuery.isEmpty()){
if
(
!
plmnIdQuery
.
isEmpty
()){
PlmnId value;
PlmnId
value
;
if(fromStringValue(plmnIdQuery.get(), value)){
std
::
string
valueplmnIdQuery
=
plmnIdQuery
.
get
();
plmnId = Pistache::Some(value);
std
::
string
valuechange
=
conv
::
UrlDecode
(
valueplmnIdQuery
);
}
nlohmann
::
json
::
parse
(
valuechange
).
get_to
(
value
);
}
plmnId
=
Pistache
::
Some
(
value
);
}
*/
// Getting the header params
// Getting the header params
auto
ifNoneMatch
=
request
.
headers
().
tryGetRaw
(
"If-None-Match"
);
auto
ifNoneMatch
=
request
.
headers
().
tryGetRaw
(
"If-None-Match"
);
auto
ifModifiedSince
=
request
.
headers
().
tryGetRaw
(
"If-Modified-Since"
);
auto
ifModifiedSince
=
request
.
headers
().
tryGetRaw
(
"If-Modified-Since"
);
...
...
src/common/conversions.cpp
View file @
008d8bb5
...
@@ -207,4 +207,22 @@ void conv::hex_str_to_uint8(const char *string, uint8_t *des) {
...
@@ -207,4 +207,22 @@ void conv::hex_str_to_uint8(const char *string, uint8_t *des) {
index
++
;
index
++
;
}
}
}
std
::
string
conv
::
UrlDecode
(
std
::
string
&
SRC
)
{
std
::
string
ret
;
char
ch
;
int
ii
;
for
(
size_t
i
=
0
;
i
<
SRC
.
length
();
i
++
)
{
if
(
int
(
SRC
[
i
])
==
37
)
{
sscanf
(
SRC
.
substr
(
i
+
1
,
2
).
c_str
(),
"%x"
,
&
ii
);
ch
=
static_cast
<
char
>
(
ii
);
ret
+=
ch
;
i
=
i
+
2
;
}
else
{
ret
+=
SRC
[
i
];
}
}
return
(
ret
);
}
}
\ No newline at end of file
src/common/conversions.hpp
View file @
008d8bb5
...
@@ -58,5 +58,7 @@ public:
...
@@ -58,5 +58,7 @@ public:
const
uint8_t
digit3
);
const
uint8_t
digit3
);
static
std
::
string
uint8_to_hex_string
(
const
uint8_t
*
v
,
const
size_t
s
);
static
std
::
string
uint8_to_hex_string
(
const
uint8_t
*
v
,
const
size_t
s
);
static
void
hex_str_to_uint8
(
const
char
*
string
,
uint8_t
*
des
);
static
void
hex_str_to_uint8
(
const
char
*
string
,
uint8_t
*
des
);
static
std
::
string
UrlDecode
(
std
::
string
&
SRC
);
};
};
#endif
/* FILE_CONVERSIONS_HPP_SEEN */
#endif
/* FILE_CONVERSIONS_HPP_SEEN */
src/impl/AccessAndMobilitySubscriptionDataRetrievalApiImpl.cpp
View file @
008d8bb5
...
@@ -43,7 +43,7 @@ void AccessAndMobilitySubscriptionDataRetrievalApiImpl::get_am_data(
...
@@ -43,7 +43,7 @@ void AccessAndMobilitySubscriptionDataRetrievalApiImpl::get_am_data(
std
::
string
udr_ip
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
udm_cfg
.
nudr
.
addr4
)));
std
::
string
udr_ip
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
udm_cfg
.
nudr
.
addr4
)));
std
::
string
udr_port
=
std
::
to_string
(
udm_cfg
.
nudr
.
port
);
std
::
string
udr_port
=
std
::
to_string
(
udm_cfg
.
nudr
.
port
);
//std::string remote_uri = udr_ip + ":" + udr_port + "/nudr-dr/v2/subscription-data/"+supi+plmnId+"/provisioned-data/am-data";
//std::string remote_uri = udr_ip + ":" + udr_port + "/nudr-dr/v2/subscription-data/"+supi+plmnId+"/provisioned-data/am-data";
std
::
string
remote_uri
=
udr_ip
+
":"
+
udr_port
+
"/nudr-dr/v2/subscription-data/"
+
supi
+
"/
456789
/provisioned-data/am-data"
;
std
::
string
remote_uri
=
udr_ip
+
":"
+
udr_port
+
"/nudr-dr/v2/subscription-data/"
+
supi
+
"/
"
+
plmnId
.
get
().
getMcc
()
+
plmnId
.
get
().
getMnc
()
+
"
/provisioned-data/am-data"
;
std
::
string
method
(
"GET"
);
std
::
string
method
(
"GET"
);
std
::
string
body
(
""
);
std
::
string
body
(
""
);
...
...
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