Commit 2b72ad41 authored by yangjian's avatar yangjian

add ausf

parent a7683bb2
...@@ -28,6 +28,14 @@ AMF = ...@@ -28,6 +28,14 @@ AMF =
PORT = 38412; PORT = 38412;
PPID = 60; PPID = 60;
}; };
# AMF binded interface for Nausf interface
NAUSF:
{
INTERFACE_NAME = "ens33"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 8383; # YOUR NETWORK CONFIG HERE
};
N11:{ N11:{
SMF_INSTANCES_POOL = ( SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.199.203"; PORT = "8889"; VERSION = "v2"; SELECTED = "true"}, {SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.199.203"; PORT = "8889"; VERSION = "v2"; SELECTED = "true"},
......
...@@ -56,6 +56,7 @@ namespace config { ...@@ -56,6 +56,7 @@ namespace config {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
amf_config::amf_config() { amf_config::amf_config() {
//TODO: //TODO:
is_Nausf = true;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -162,6 +163,11 @@ int amf_config::load(const std::string &config_file) { ...@@ -162,6 +163,11 @@ int amf_config::load(const std::string &config_file) {
const Setting &new_if_cfg = amf_cfg[AMF_CONFIG_STRING_INTERFACES]; const Setting &new_if_cfg = amf_cfg[AMF_CONFIG_STRING_INTERFACES];
const Setting &n2_amf_cfg = new_if_cfg[AMF_CONFIG_STRING_INTERFACE_NGAP_AMF]; const Setting &n2_amf_cfg = new_if_cfg[AMF_CONFIG_STRING_INTERFACE_NGAP_AMF];
load_interface(n2_amf_cfg, n2); load_interface(n2_amf_cfg, n2);
if(is_Nausf)
{
const Setting &nausf_amf_cfg = new_if_cfg[AMF_CONFIG_STRING_INTERFACE_NAUSF];
load_interface(nausf_amf_cfg, nausf);
}
const Setting &n11_cfg = new_if_cfg[AMF_CONFIG_STRING_INTERFACE_N11]; const Setting &n11_cfg = new_if_cfg[AMF_CONFIG_STRING_INTERFACE_N11];
load_interface(n11_cfg, n11); load_interface(n11_cfg, n11);
const Setting &smf_addr_pool = n11_cfg[AMF_CONFIG_STRING_SMF_INSTANCES_POOL]; const Setting &smf_addr_pool = n11_cfg[AMF_CONFIG_STRING_SMF_INSTANCES_POOL];
...@@ -278,6 +284,18 @@ void amf_config::display() { ...@@ -278,6 +284,18 @@ void amf_config::display() {
Logger::config().info(" ip ...................: %s", inet_ntoa(n2.addr4)); Logger::config().info(" ip ...................: %s", inet_ntoa(n2.addr4));
Logger::config().info(" port .................: %d", n2.port); Logger::config().info(" port .................: %d", n2.port);
if(is_Nausf)
{
Logger::config().info("- Nausf Networking:");
Logger::config().info(" iface ................: %s", nausf.if_name.c_str());
Logger::config().info(" ip ...................: %s", inet_ntoa(nausf.addr4));
Logger::config().info(" port .................: %d", nausf.port);
}
else
{
Logger::config().warn("- Not using ausf: Please remove [--no-ausf] using it.");
}
Logger::config().info("- N11 Networking:"); Logger::config().info("- N11 Networking:");
Logger::config().info(" iface ................: %s", n11.if_name.c_str()); Logger::config().info(" iface ................: %s", n11.if_name.c_str());
Logger::config().info(" ip ...................: %s", Logger::config().info(" ip ...................: %s",
......
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
#define AMF_CONFIG_STRING_STATISTICS_TIMER_INTERVAL "STATISTICS_TIMER_INTERVAL" #define AMF_CONFIG_STRING_STATISTICS_TIMER_INTERVAL "STATISTICS_TIMER_INTERVAL"
#define AMF_CONFIG_STRING_INTERFACES "INTERFACES" #define AMF_CONFIG_STRING_INTERFACES "INTERFACES"
#define AMF_CONFIG_STRING_INTERFACE_NGAP_AMF "NGAP_AMF" #define AMF_CONFIG_STRING_INTERFACE_NGAP_AMF "NGAP_AMF"
#define AMF_CONFIG_STRING_INTERFACE_NAUSF "NAUSF"
#define AMF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME" #define AMF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME"
#define AMF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS" #define AMF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
#define AMF_CONFIG_STRING_PORT "PORT" #define AMF_CONFIG_STRING_PORT "PORT"
...@@ -170,6 +172,7 @@ class amf_config { ...@@ -170,6 +172,7 @@ class amf_config {
std::string pid_dir; std::string pid_dir;
interface_cfg_t n2; interface_cfg_t n2;
interface_cfg_t n11; interface_cfg_t n11;
interface_cfg_t nausf;
itti_cfg_t itti; itti_cfg_t itti;
unsigned int statistics_interval; unsigned int statistics_interval;
std::string AMF_Name; std::string AMF_Name;
...@@ -181,6 +184,8 @@ class amf_config { ...@@ -181,6 +184,8 @@ class amf_config {
auth_conf auth_para; auth_conf auth_para;
nas_conf_t nas_cfg; nas_conf_t nas_cfg;
std::vector<smf_inst_t> smf_pool; std::vector<smf_inst_t> smf_pool;
bool is_Nausf;
}; };
} }
......
...@@ -53,12 +53,22 @@ ...@@ -53,12 +53,22 @@
#include "comUt.hpp" #include "comUt.hpp"
#include "sha256.hpp" #include "sha256.hpp"
#include "AuthenticationInfo.h"
#include "UEAuthenticationCtx.h"
#include "ConfirmationData.h"
#include "ConfirmationDataResponse.h"
#include <curl/curl.h>
extern "C" extern "C"
{ {
#include "dynamic_memory_check.h" #include "dynamic_memory_check.h"
#include "bstrlib.h" #include "bstrlib.h"
} }
using namespace oai::amf::model;
using namespace nas; using namespace nas;
using namespace amf_application; using namespace amf_application;
using namespace config; using namespace config;
...@@ -70,6 +80,9 @@ extern amf_config amf_cfg; ...@@ -70,6 +80,9 @@ extern amf_config amf_cfg;
extern amf_app *amf_app_inst; extern amf_app *amf_app_inst;
extern amf_n2 *amf_n2_inst; extern amf_n2 *amf_n2_inst;
extern statistics stacs; extern statistics stacs;
extern void convert_string_2_hex(std::string &input, std::string &output);
extern unsigned char * format_string_as_hex(std::string str);
Sha256 ctx; Sha256 ctx;
random_state_t random_state; random_state_t random_state;
...@@ -1110,15 +1123,251 @@ bool amf_n1::auth_vectors_generator(std::shared_ptr<nas_context> &nc) ...@@ -1110,15 +1123,251 @@ bool amf_n1::auth_vectors_generator(std::shared_ptr<nas_context> &nc)
{ {
Logger::amf_n1().debug("Start to generate authentication vectors"); Logger::amf_n1().debug("Start to generate authentication vectors");
authentication_vectors_generator_in_udm(nc); authentication_vectors_generator_in_udm(nc);
if(amf_cfg.is_Nausf)
{
if(!authentication_vectors_from_ausf(nc))
return false;
}
else
{
authentication_vectors_generator_in_ausf(nc); authentication_vectors_generator_in_ausf(nc);
Logger::amf_n1().debug("Deriving kamf"); Logger::amf_n1().debug("Deriving kamf");
for (int i = 0; i < MAX_5GS_AUTH_VECTORS; i++) for (int i = 0; i < MAX_5GS_AUTH_VECTORS; i++)
{ {
Authentication_5gaka::derive_kamf(nc.get()->imsi, nc.get()->_5g_av[i].kseaf, nc.get()->kamf[i], 0x0000); //second parameter: abba Authentication_5gaka::derive_kamf(nc.get()->imsi, nc.get()->_5g_av[i].kseaf, nc.get()->kamf[i], 0x0000); //second parameter: abba
} }
}
return true;
}
//------------------------------------------------------------------------------
#define CURL_TIMEOUT_MS 100L
std::size_t callback_ausf(const char *in, std::size_t size, std::size_t num,std::string *out) {
const std::size_t totalBytes(size * num);
out->append(in, totalBytes);
return totalBytes;
}
void amf_n1::curl_http_client(std::string remoteUri, std::string Method,
std::string msgBody, std::string &Response) {
Logger::amf_n1().info("Send HTTP message with body %s", msgBody.c_str());
uint32_t str_len = msgBody.length();
char *body_data = (char *)malloc(str_len + 1);
memset(body_data, 0, str_len + 1);
memcpy((void *)body_data, (void *)msgBody.c_str(), str_len);
curl_global_init(CURL_GLOBAL_ALL);
CURL *curl = curl_easy_init();
if (curl) {
CURLcode res = {};
struct curl_slist *headers = nullptr;
if (!Method.compare("POST") || !Method.compare("PATCH") || !Method.compare("PUT")){
std::string content_type = "Content-Type: application/json";
headers = curl_slist_append(headers, content_type.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
}
curl_easy_setopt(curl, CURLOPT_URL, remoteUri.c_str());
if (!Method.compare("POST"))
curl_easy_setopt(curl, CURLOPT_HTTPPOST, 1);
else if(!Method.compare("PATCH"))
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
else if(!Method.compare("PUT"))
{
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
}
else
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1);
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT_MS);
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1);
curl_easy_setopt(curl, CURLOPT_INTERFACE, "ens33");
// Logger::amf_n1().info("[CURL] request sent by interface " + udm_cfg.nudr.if_name);
// Response information.
long httpCode = {0};
std::unique_ptr<std::string> httpData(new std::string());
std::unique_ptr<std::string> httpHeaderData(new std::string());
// Hook up data handling function.
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &callback_ausf);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, httpData.get());
curl_easy_setopt(curl, CURLOPT_HEADERDATA, httpHeaderData.get());
if (!Method.compare("POST") || !Method.compare("PATCH") || !Method.compare("PUT")){
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, msgBody.length());
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body_data);
}
res = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpCode);
// get the response
std::string response = *httpData.get();
std::string json_data_response = "";
std::string resMsg = "";
bool is_response_ok = true;
Logger::amf_n1().info("Get response with httpcode (%d)", httpCode);
if (httpCode == 0) {
Logger::amf_n1().info("Cannot get response when calling %s", remoteUri.c_str());
// free curl before returning
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return;
}
nlohmann::json response_data = {};
if (httpCode != 200 && httpCode != 201 && httpCode != 204) {
is_response_ok = false;
if (response.size() < 1) {
Logger::amf_n1().info("There's no content in the response");
// TODO: send context response error
return;
}
Logger::amf_n1().info("Wrong response code");
return;
}
else {
Response = *httpData.get();
}
if (!is_response_ok) {
try {
response_data = nlohmann::json::parse(json_data_response);
} catch (nlohmann::json::exception &e) {
Logger::amf_n1().info("Could not get Json content from the response");
// Set the default Cause
response_data["error"]["cause"] = "504 Gateway Timeout";
}
Logger::amf_n1().info("Get response with jsonData: %s", json_data_response.c_str());
std::string cause = response_data["error"]["cause"];
Logger::amf_n1().info("Call Network Function services failure");
Logger::amf_n1().info("Cause value: %s", cause.c_str());
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
curl_global_cleanup();
if (body_data) {
free(body_data);
body_data = NULL;
}
fflush(stdout);
}
bool amf_n1::authentication_vectors_from_ausf(std::shared_ptr<nas_context> &nc)
{
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_port = std::to_string(amf_cfg.nausf.port);
std::string remoteUri = ausf_ip + ":" + ausf_port + "/nausf-auth/v1/ue-authentications";
std::string msgBody;
std::string Response;
nlohmann::json authenticationinfo_j;
AuthenticationInfo authenticationinfo;
authenticationinfo.setSupiOrSuci(nc.get()->imsi);
authenticationinfo.setServingNetworkName(nc.get()->serving_network);
to_json(authenticationinfo_j,authenticationinfo);
msgBody=authenticationinfo_j.dump();
curl_http_client(remoteUri,"POST",msgBody,Response);
Logger::amf_n1().info("POST response : %s", Response.c_str());
try
{
UEAuthenticationCtx ueauthenticationctx;
nlohmann::json::parse(Response.c_str()).get_to(ueauthenticationctx);
unsigned char *r5gauthdata_rand = format_string_as_hex(ueauthenticationctx.getR5gAuthData().getRand());
memcpy(nc.get()->_5g_av[0].rand, r5gauthdata_rand, 16);
print_buffer("amf_n1", "5G AV: rand", nc.get()->_5g_av[0].rand, 16);
free_wrapper((void**) &r5gauthdata_rand);
unsigned char *r5gauthdata_autn = format_string_as_hex(ueauthenticationctx.getR5gAuthData().getAutn());
memcpy(nc.get()->_5g_av[0].autn, r5gauthdata_autn, 16);
print_buffer("amf_n1", "5G AV: autn", nc.get()->_5g_av[0].autn, 16);
free_wrapper((void**) &r5gauthdata_autn);
unsigned char *r5gauthdata_hxresstar = format_string_as_hex(ueauthenticationctx.getR5gAuthData().getHxresStar());
memcpy(nc.get()->_5g_av[0].hxresStar, r5gauthdata_hxresstar, 16);
print_buffer("amf_n1", "5G AV: hxres*", nc.get()->_5g_av[0].hxresStar, 16);
free_wrapper((void**) &r5gauthdata_hxresstar);
std::map<std::string, LinksValueSchema>::iterator iter;
iter = ueauthenticationctx.getLinks().find("5G_AKA");
if (iter != ueauthenticationctx.getLinks().end()) {
nc.get()->Href = iter->second.getHref();
Logger::amf_n1().info("Links is: ",nc.get()->Href);
} else {
Logger::amf_n1().error("Not found 5G_AKA");
}
}
catch (nlohmann::json::exception &e)
{
Logger::amf_n1().info("Could not get Json content from AUSF response");
//TODO: error handling
return false;
}
return true;
}
bool amf_n1::_5g_aka_confirmation_from_ausf(std::shared_ptr<nas_context> &nc,std::string &resStar)
{
Logger::amf_n1().debug("_5g_aka_confirmation_from_ausf");
std::string remoteUri = nc.get()->Href;
std::string msgBody;
std::string Response;
std::string resStar_string;
convert_string_2_hex(resStar,resStar_string);
nlohmann::json confirmationdata_j;
ConfirmationData confirmationdata;
confirmationdata.setResStar(resStar_string);
to_json(confirmationdata_j,confirmationdata);
msgBody=confirmationdata_j.dump();
curl_http_client(remoteUri,"PUT",msgBody,Response);
//free(resStar_string.c_str());
try
{
ConfirmationDataResponse confirmationdataresponse;
nlohmann::json::parse(Response.c_str()).get_to(confirmationdataresponse);
unsigned char *kseaf_hex = format_string_as_hex(confirmationdataresponse.getKseaf());
memcpy(nc.get()->_5g_av[0].kseaf, kseaf_hex, 32);
print_buffer("amf_n1", "5G AV: kseaf", nc.get()->_5g_av[0].kseaf, 32);
free_wrapper((void**) &kseaf_hex);
Logger::amf_n1().debug("Deriving kamf");
for (int i = 0; i < MAX_5GS_AUTH_VECTORS; i++)
{
Authentication_5gaka::derive_kamf(nc.get()->imsi, nc.get()->_5g_av[i].kseaf, nc.get()->kamf[i], 0x0000); //second parameter: abba
print_buffer("amf_n1", "kamf", nc.get()->kamf[i], 32);
}
}
catch (nlohmann::json::exception &e)
{
Logger::amf_n1().info("Could not get Json content from AUSF response");
//TODO: error handling
return false;
}
return true; return true;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool amf_n1::authentication_vectors_generator_in_ausf(std::shared_ptr<nas_context> &nc) bool amf_n1::authentication_vectors_generator_in_ausf(std::shared_ptr<nas_context> &nc)
{ // A.5, 3gpp ts33.501 { // A.5, 3gpp ts33.501
...@@ -1477,6 +1726,14 @@ void amf_n1::authentication_response_handle(uint32_t ran_ue_ngap_id, long amf_ue ...@@ -1477,6 +1726,14 @@ void amf_n1::authentication_response_handle(uint32_t ran_ue_ngap_id, long amf_ue
Logger::amf_n1().warn("Cannot receive AuthenticationResponseParameter (RES*)"); Logger::amf_n1().warn("Cannot receive AuthenticationResponseParameter (RES*)");
} }
else else
{
if(amf_cfg.is_Nausf)
{
std::string data = bdata(resStar);
if(!_5g_aka_confirmation_from_ausf(nc,data))
isAuthOk = false;
}
else
{ {
//Get stored XRES* //Get stored XRES*
int secu_index = nc.get()->security_ctx->vector_pointer; int secu_index = nc.get()->security_ctx->vector_pointer;
...@@ -1503,6 +1760,8 @@ void amf_n1::authentication_response_handle(uint32_t ran_ue_ngap_id, long amf_ue ...@@ -1503,6 +1760,8 @@ void amf_n1::authentication_response_handle(uint32_t ran_ue_ngap_id, long amf_ue
isAuthOk = false; isAuthOk = false;
} }
} }
}
//If success, start SMC procedure; else if failure, response registration reject message with corresponding cause //If success, start SMC procedure; else if failure, response registration reject message with corresponding cause
if (!isAuthOk) if (!isAuthOk)
{ {
......
...@@ -100,6 +100,9 @@ class amf_n1 { ...@@ -100,6 +100,9 @@ class amf_n1 {
//authentication //authentication
bool auth_vectors_generator(std::shared_ptr<nas_context> &nc); bool auth_vectors_generator(std::shared_ptr<nas_context> &nc);
bool authentication_vectors_generator_in_ausf(std::shared_ptr<nas_context> &nc); bool authentication_vectors_generator_in_ausf(std::shared_ptr<nas_context> &nc);
void curl_http_client(std::string remoteUri, std::string Method, std::string msgBody, std::string &Response);
bool authentication_vectors_from_ausf(std::shared_ptr<nas_context> &nc);
bool _5g_aka_confirmation_from_ausf(std::shared_ptr<nas_context> &nc,std::string &resStar);
bool authentication_vectors_generator_in_udm(std::shared_ptr<nas_context> &nc); bool authentication_vectors_generator_in_udm(std::shared_ptr<nas_context> &nc);
//mysql handlers in mysql_db.cpp //mysql handlers in mysql_db.cpp
bool get_mysql_auth_info(std::string imsi, mysql_auth_info_t &resp); bool get_mysql_auth_info(std::string imsi, mysql_auth_info_t &resp);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
*/ */
#include "conversions.hpp" #include "conversions.hpp"
#include <iostream>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
...@@ -141,3 +142,4 @@ std::string conv::toString(const struct in6_addr &in6addr) { ...@@ -141,3 +142,4 @@ std::string conv::toString(const struct in6_addr &in6addr) {
} }
return s; return s;
} }
...@@ -73,6 +73,7 @@ class nas_context { ...@@ -73,6 +73,7 @@ class nas_context {
auc_vector_t _vector[MAX_5GS_AUTH_VECTORS];/* 5GS authentication vector */ auc_vector_t _vector[MAX_5GS_AUTH_VECTORS];/* 5GS authentication vector */
_5G_HE_AV_t _5g_he_av[MAX_5GS_AUTH_VECTORS]; //generated by UDM _5G_HE_AV_t _5g_he_av[MAX_5GS_AUTH_VECTORS]; //generated by UDM
_5G_AV_t _5g_av[MAX_5GS_AUTH_VECTORS]; //generated by ausf _5G_AV_t _5g_av[MAX_5GS_AUTH_VECTORS]; //generated by ausf
std::string Href;
uint8_t kamf[MAX_5GS_AUTH_VECTORS][32]; uint8_t kamf[MAX_5GS_AUTH_VECTORS][32];
security_context_t _security; security_context_t _security;
......
...@@ -69,6 +69,7 @@ if (!Options::parse(argc, argv)) { ...@@ -69,6 +69,7 @@ if (!Options::parse(argc, argv)) {
Logger::init( "AMF" , Options::getlogStdout() , Options::getlogRotFilelog()); Logger::init( "AMF" , Options::getlogStdout() , Options::getlogRotFilelog());
Logger::amf_app().startup("Options parsed!"); Logger::amf_app().startup("Options parsed!");
amf_cfg.is_Nausf = Options::isNausf();
amf_cfg.load(Options::getlibconfigConfig()); amf_cfg.load(Options::getlibconfigConfig());
amf_cfg.display(); amf_cfg.display();
modules.load(Options::getlibconfigConfig()); modules.load(Options::getlibconfigConfig());
......
...@@ -26,11 +26,12 @@ int Options::options; ...@@ -26,11 +26,12 @@ int Options::options;
std::string Options::m_libconfigcfg; std::string Options::m_libconfigcfg;
bool Options::m_log_rot_file_log; bool Options::m_log_rot_file_log;
bool Options::m_log_stdout; bool Options::m_log_stdout;
bool Options::m_is_Nausf = true;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void Options::help() { void Options::help() {
std::cout << std::endl << "Usage: AMF [OPTIONS]..." << std::endl << " -h, --help Print help and exit" << std::endl << " -c, --libconfigcfg filename Read the application configuration from this file." << std::endl std::cout << std::endl << "Usage: AMF [OPTIONS]..." << std::endl << " -h, --help Print help and exit" << std::endl << " -c, --libconfigcfg filename Read the application configuration from this file." << std::endl
<< " -o, --stdoutlog Send the application logs to STDOUT fd." << std::endl << " -r, --rotatelog Send the application logs to local file (in current working directory)." << std::endl; << " -o, --stdoutlog Send the application logs to STDOUT fd." << std::endl << " -r, --rotatelog Send the application logs to local file (in current working directory)." << std::endl<< " --no-ausf Do not connect ausf." << std::endl;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -50,13 +51,15 @@ bool Options::validateOptions() { ...@@ -50,13 +51,15 @@ bool Options::validateOptions() {
} }
#define OPTIONS_NAUSF_VAL 0xFFFF
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool Options::parseInputOptions(int argc, char **argv) { bool Options::parseInputOptions(int argc, char **argv) {
int c; int c;
int lopt;
int option_index = 0; int option_index = 0;
bool result = true; bool result = true;
struct option long_options[] = { { "help", no_argument, NULL, 'h' }, { "libconfigcfg", required_argument, NULL, 'f' }, { "stdoutlog", no_argument, NULL, 'o' }, { "rotatelog", no_argument, NULL, 'r' }, { NULL, 0, NULL, 0 } }; struct option long_options[] = { { "help", no_argument, NULL, 'h' }, { "libconfigcfg", required_argument, NULL, 'f' }, { "stdoutlog", no_argument, NULL, 'o' }, { "rotatelog", no_argument, NULL, 'r' }, { "no-ausf", no_argument, &lopt, OPTIONS_NAUSF_VAL }, { NULL, 0, NULL, 0 } };
// Loop on arguments // Loop on arguments
while (1) { while (1) {
...@@ -65,6 +68,14 @@ bool Options::parseInputOptions(int argc, char **argv) { ...@@ -65,6 +68,14 @@ bool Options::parseInputOptions(int argc, char **argv) {
break; // Exit from the loop. break; // Exit from the loop.
switch (c) { switch (c) {
case 0:{
switch (lopt){
case OPTIONS_NAUSF_VAL:{
m_is_Nausf = false;
}
}
break;
}
case 'h': { case 'h': {
help(); help();
exit(0); exit(0);
......
...@@ -33,6 +33,7 @@ public: ...@@ -33,6 +33,7 @@ public:
static const std::string &getlibconfigConfig() { return m_libconfigcfg; } static const std::string &getlibconfigConfig() { return m_libconfigcfg; }
static const bool &getlogRotFilelog() { return m_log_rot_file_log; } static const bool &getlogRotFilelog() { return m_log_rot_file_log; }
static const bool &getlogStdout() { return m_log_stdout; } static const bool &getlogStdout() { return m_log_stdout; }
static const bool &isNausf() { return m_is_Nausf; }
private: private:
...@@ -48,6 +49,7 @@ private: ...@@ -48,6 +49,7 @@ private:
static bool m_log_rot_file_log; static bool m_log_rot_file_log;
static bool m_log_stdout; static bool m_log_stdout;
static bool m_is_Nausf;
static std::string m_libconfigcfg; static std::string m_libconfigcfg;
}; };
......
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AuthenticationInfo.h"
namespace oai {
namespace amf {
namespace model {
AuthenticationInfo::AuthenticationInfo()
{
m_SupiOrSuci = "";
m_ServingNetworkName = "";
// m_ResynchronizationInfoIsSet = false;
// m_Pei = "";
// m_PeiIsSet = false;
// m_TraceDataIsSet = false;
// m_UdmGroupId = "";
// m_UdmGroupIdIsSet = false;
// m_RoutingIndicator = "";
// m_RoutingIndicatorIsSet = false;
// m_CellCagInfoIsSet = false;
// m_N5gcInd = false;
// m_N5gcIndIsSet = false;
}
AuthenticationInfo::~AuthenticationInfo()
{
}
void AuthenticationInfo::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const AuthenticationInfo& o)
{
j = nlohmann::json();
j["supiOrSuci"] = o.m_SupiOrSuci;
j["servingNetworkName"] = o.m_ServingNetworkName;
// if(o.resynchronizationInfoIsSet())
// j["resynchronizationInfo"] = o.m_ResynchronizationInfo;
// if(o.peiIsSet())
// j["pei"] = o.m_Pei;
// if(o.traceDataIsSet())
// j["traceData"] = o.m_TraceData;
// if(o.udmGroupIdIsSet())
// j["udmGroupId"] = o.m_UdmGroupId;
// if(o.routingIndicatorIsSet())
// j["routingIndicator"] = o.m_RoutingIndicator;
// if(o.cellCagInfoIsSet() || !o.m_CellCagInfo.empty())
// j["cellCagInfo"] = o.m_CellCagInfo;
// if(o.n5gcIndIsSet())
// j["n5gcInd"] = o.m_N5gcInd;
}
void from_json(const nlohmann::json& j, AuthenticationInfo& o)
{
j.at("supiOrSuci").get_to(o.m_SupiOrSuci);
j.at("servingNetworkName").get_to(o.m_ServingNetworkName);
// if(j.find("resynchronizationInfo") != j.end())
// {
// j.at("resynchronizationInfo").get_to(o.m_ResynchronizationInfo);
// o.m_ResynchronizationInfoIsSet = true;
// }
// if(j.find("pei") != j.end())
// {
// j.at("pei").get_to(o.m_Pei);
// o.m_PeiIsSet = true;
// }
// if(j.find("traceData") != j.end())
// {
// j.at("traceData").get_to(o.m_TraceData);
// o.m_TraceDataIsSet = true;
// }
// if(j.find("udmGroupId") != j.end())
// {
// j.at("udmGroupId").get_to(o.m_UdmGroupId);
// o.m_UdmGroupIdIsSet = true;
// }
// if(j.find("routingIndicator") != j.end())
// {
// j.at("routingIndicator").get_to(o.m_RoutingIndicator);
// o.m_RoutingIndicatorIsSet = true;
// }
// if(j.find("cellCagInfo") != j.end())
// {
// j.at("cellCagInfo").get_to(o.m_CellCagInfo);
// o.m_CellCagInfoIsSet = true;
// }
// if(j.find("n5gcInd") != j.end())
// {
// j.at("n5gcInd").get_to(o.m_N5gcInd);
// o.m_N5gcIndIsSet = true;
// }
}
std::string AuthenticationInfo::getSupiOrSuci() const
{
return m_SupiOrSuci;
}
void AuthenticationInfo::setSupiOrSuci(std::string const& value)
{
m_SupiOrSuci = value;
}
std::string AuthenticationInfo::getServingNetworkName() const
{
return m_ServingNetworkName;
}
void AuthenticationInfo::setServingNetworkName(std::string const& value)
{
m_ServingNetworkName = value;
}
//ResynchronizationInfo AuthenticationInfo::getResynchronizationInfo() const
//{
// return m_ResynchronizationInfo;
//}
//void AuthenticationInfo::setResynchronizationInfo(ResynchronizationInfo const& value)
//{
// m_ResynchronizationInfo = value;
// m_ResynchronizationInfoIsSet = true;
//}
//bool AuthenticationInfo::resynchronizationInfoIsSet() const
//{
// return m_ResynchronizationInfoIsSet;
//}
//void AuthenticationInfo::unsetResynchronizationInfo()
//{
// m_ResynchronizationInfoIsSet = false;
//}
//std::string AuthenticationInfo::getPei() const
//{
// return m_Pei;
//}
//void AuthenticationInfo::setPei(std::string const& value)
//{
// m_Pei = value;
// m_PeiIsSet = true;
//}
//bool AuthenticationInfo::peiIsSet() const
//{
// return m_PeiIsSet;
//}
//void AuthenticationInfo::unsetPei()
//{
// m_PeiIsSet = false;
//}
//TraceData AuthenticationInfo::getTraceData() const
//{
// return m_TraceData;
//}
//void AuthenticationInfo::setTraceData(TraceData const& value)
//{
// m_TraceData = value;
// m_TraceDataIsSet = true;
//}
//bool AuthenticationInfo::traceDataIsSet() const
//{
// return m_TraceDataIsSet;
//}
//void AuthenticationInfo::unsetTraceData()
//{
// m_TraceDataIsSet = false;
//}
//std::string AuthenticationInfo::getUdmGroupId() const
//{
// return m_UdmGroupId;
//}
//void AuthenticationInfo::setUdmGroupId(std::string const& value)
//{
// m_UdmGroupId = value;
// m_UdmGroupIdIsSet = true;
//}
//bool AuthenticationInfo::udmGroupIdIsSet() const
//{
// return m_UdmGroupIdIsSet;
//}
//void AuthenticationInfo::unsetUdmGroupId()
//{
// m_UdmGroupIdIsSet = false;
//}
//std::string AuthenticationInfo::getRoutingIndicator() const
//{
// return m_RoutingIndicator;
//}
//void AuthenticationInfo::setRoutingIndicator(std::string const& value)
//{
// m_RoutingIndicator = value;
// m_RoutingIndicatorIsSet = true;
//}
//bool AuthenticationInfo::routingIndicatorIsSet() const
//{
// return m_RoutingIndicatorIsSet;
//}
//void AuthenticationInfo::unsetRoutingIndicator()
//{
// m_RoutingIndicatorIsSet = false;
//}
//std::vector<std::string>& AuthenticationInfo::getCellCagInfo()
//{
// return m_CellCagInfo;
//}
//void AuthenticationInfo::setCellCagInfo(std::vector<std::string> const& value)
//{
// m_CellCagInfo = value;
// m_CellCagInfoIsSet = true;
//}
//bool AuthenticationInfo::cellCagInfoIsSet() const
//{
// return m_CellCagInfoIsSet;
//}
//void AuthenticationInfo::unsetCellCagInfo()
//{
// m_CellCagInfoIsSet = false;
//}
//bool AuthenticationInfo::isN5gcInd() const
//{
// return m_N5gcInd;
//}
//void AuthenticationInfo::setN5gcInd(bool const value)
//{
// m_N5gcInd = value;
// m_N5gcIndIsSet = true;
//}
//bool AuthenticationInfo::n5gcIndIsSet() const
//{
// return m_N5gcIndIsSet;
//}
//void AuthenticationInfo::unsetN5gcInd()
//{
// m_N5gcIndIsSet = false;
//}
}
}
}
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB,
* ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AuthenticationInfo.h
*
*
*/
#ifndef AuthenticationInfo_H_
#define AuthenticationInfo_H_
//#include "ResynchronizationInfo.h"
//#include "TraceData.h"
#include <nlohmann/json.hpp>
#include <string>
#include <vector>
namespace oai {
namespace amf {
namespace model {
/// <summary>
///
/// </summary>
class AuthenticationInfo {
public:
AuthenticationInfo();
virtual ~AuthenticationInfo();
void validate();
/////////////////////////////////////////////
/// AuthenticationInfo members
/// <summary>
///
/// </summary>
std::string getSupiOrSuci() const;
void setSupiOrSuci(std::string const &value);
/// <summary>
///
/// </summary>
std::string getServingNetworkName() const;
void setServingNetworkName(std::string const &value);
/// <summary>
///
/// </summary>
// ResynchronizationInfo getResynchronizationInfo() const;
// void setResynchronizationInfo(ResynchronizationInfo const &value);
// bool resynchronizationInfoIsSet() const;
// void unsetResynchronizationInfo();
// /// <summary>
// ///
// /// </summary>
// std::string getPei() const;
// void setPei(std::string const &value);
// bool peiIsSet() const;
// void unsetPei();
// /// <summary>
// ///
// /// </summary>
// TraceData getTraceData() const;
// void setTraceData(TraceData const &value);
// bool traceDataIsSet() const;
// void unsetTraceData();
// /// <summary>
// ///
// /// </summary>
// std::string getUdmGroupId() const;
// void setUdmGroupId(std::string const &value);
// bool udmGroupIdIsSet() const;
// void unsetUdmGroupId();
// /// <summary>
// ///
// /// </summary>
// std::string getRoutingIndicator() const;
// void setRoutingIndicator(std::string const &value);
// bool routingIndicatorIsSet() const;
// void unsetRoutingIndicator();
// /// <summary>
// ///
// /// </summary>
// std::vector<std::string> &getCellCagInfo();
// void setCellCagInfo(std::vector<std::string> const &value);
// bool cellCagInfoIsSet() const;
// void unsetCellCagInfo();
// /// <summary>
// ///
// /// </summary>
// bool isN5gcInd() const;
// void setN5gcInd(bool const value);
// bool n5gcIndIsSet() const;
// void unsetN5gcInd();
friend void to_json(nlohmann::json &j, const AuthenticationInfo &o);
friend void from_json(const nlohmann::json &j, AuthenticationInfo &o);
protected:
std::string m_SupiOrSuci;
std::string m_ServingNetworkName;
// ResynchronizationInfo m_ResynchronizationInfo;
// bool m_ResynchronizationInfoIsSet;
// std::string m_Pei;
// bool m_PeiIsSet;
// TraceData m_TraceData;
// bool m_TraceDataIsSet;
// std::string m_UdmGroupId;
// bool m_UdmGroupIdIsSet;
// std::string m_RoutingIndicator;
// bool m_RoutingIndicatorIsSet;
// std::vector<std::string> m_CellCagInfo;
// bool m_CellCagInfoIsSet;
// bool m_N5gcInd;
// bool m_N5gcIndIsSet;
};
} // namespace model
} // namespace amf
} // namespace oai
#endif /* AuthenticationInfo_H_ */
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Av5gAka.h"
namespace oai {
namespace amf {
namespace model {
Av5gAka::Av5gAka()
{
m_Rand = "";
m_HxresStar = "";
m_Autn = "";
}
Av5gAka::~Av5gAka()
{
}
void Av5gAka::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const Av5gAka& o)
{
j = nlohmann::json();
j["rand"] = o.m_Rand;
j["hxresStar"] = o.m_HxresStar;
j["autn"] = o.m_Autn;
}
void from_json(const nlohmann::json& j, Av5gAka& o)
{
j.at("rand").get_to(o.m_Rand);
j.at("hxresStar").get_to(o.m_HxresStar);
j.at("autn").get_to(o.m_Autn);
}
std::string Av5gAka::getRand() const
{
return m_Rand;
}
void Av5gAka::setRand(std::string const& value)
{
m_Rand = value;
}
std::string Av5gAka::getHxresStar() const
{
return m_HxresStar;
}
void Av5gAka::setHxresStar(std::string const& value)
{
m_HxresStar = value;
}
std::string Av5gAka::getAutn() const
{
return m_Autn;
}
void Av5gAka::setAutn(std::string const& value)
{
m_Autn = value;
}
}
}
}
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Av5gAka.h
*
*
*/
#ifndef Av5gAka_H_
#define Av5gAka_H_
#include <string>
#include <nlohmann/json.hpp>
namespace oai {
namespace amf {
namespace model {
/// <summary>
///
/// </summary>
class Av5gAka
{
public:
Av5gAka();
virtual ~Av5gAka();
void validate();
/////////////////////////////////////////////
/// Av5gAka members
/// <summary>
///
/// </summary>
std::string getRand() const;
void setRand(std::string const& value);
/// <summary>
///
/// </summary>
std::string getHxresStar() const;
void setHxresStar(std::string const& value);
/// <summary>
///
/// </summary>
std::string getAutn() const;
void setAutn(std::string const& value);
friend void to_json(nlohmann::json& j, const Av5gAka& o);
friend void from_json(const nlohmann::json& j, Av5gAka& o);
protected:
std::string m_Rand;
std::string m_HxresStar;
std::string m_Autn;
};
}
}
}
#endif /* Av5gAka_H_ */
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "ConfirmationData.h"
namespace oai {
namespace amf {
namespace model {
ConfirmationData::ConfirmationData()
{
m_ResStar = "";
}
ConfirmationData::~ConfirmationData()
{
}
void ConfirmationData::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const ConfirmationData& o)
{
j = nlohmann::json();
j["resStar"] = o.m_ResStar;
}
void from_json(const nlohmann::json& j, ConfirmationData& o)
{
j.at("resStar").get_to(o.m_ResStar);
}
std::string ConfirmationData::getResStar() const
{
return m_ResStar;
}
void ConfirmationData::setResStar(std::string const& value)
{
m_ResStar = value;
}
}
}
}
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ConfirmationData.h
*
*
*/
#ifndef ConfirmationData_H_
#define ConfirmationData_H_
#include <string>
#include <nlohmann/json.hpp>
namespace oai {
namespace amf {
namespace model {
/// <summary>
///
/// </summary>
class ConfirmationData
{
public:
ConfirmationData();
virtual ~ConfirmationData();
void validate();
/////////////////////////////////////////////
/// ConfirmationData members
/// <summary>
///
/// </summary>
std::string getResStar() const;
void setResStar(std::string const& value);
friend void to_json(nlohmann::json& j, const ConfirmationData& o);
friend void from_json(const nlohmann::json& j, ConfirmationData& o);
protected:
std::string m_ResStar;
};
}
}
}
#endif /* ConfirmationData_H_ */
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "ConfirmationDataResponse.h"
namespace oai {
namespace amf {
namespace model {
ConfirmationDataResponse::ConfirmationDataResponse()
{
m_Supi = "";
m_SupiIsSet = false;
m_Kseaf = "";
m_KseafIsSet = false;
}
ConfirmationDataResponse::~ConfirmationDataResponse()
{
}
void ConfirmationDataResponse::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const ConfirmationDataResponse& o)
{
j = nlohmann::json();
j["authResult"] = o.m_AuthResult;
if(o.supiIsSet())
j["supi"] = o.m_Supi;
if(o.kseafIsSet())
j["kseaf"] = o.m_Kseaf;
}
void from_json(const nlohmann::json& j, ConfirmationDataResponse& o)
{
j.at("authResult").get_to(o.m_AuthResult);
if(j.find("supi") != j.end())
{
j.at("supi").get_to(o.m_Supi);
o.m_SupiIsSet = true;
}
if(j.find("kseaf") != j.end())
{
j.at("kseaf").get_to(o.m_Kseaf);
o.m_KseafIsSet = true;
}
}
// AuthResult ConfirmationDataResponse::getAuthResult() const
// {
// return m_AuthResult;
// }
// void ConfirmationDataResponse::setAuthResult(AuthResult const& value)
// {
// m_AuthResult = value;
// }
bool ConfirmationDataResponse::getAuthResult() const
{
return m_AuthResult;
}
void ConfirmationDataResponse::setAuthResult(bool const& value)
{
m_AuthResult = value;
}
std::string ConfirmationDataResponse::getSupi() const
{
return m_Supi;
}
void ConfirmationDataResponse::setSupi(std::string const& value)
{
m_Supi = value;
m_SupiIsSet = true;
}
bool ConfirmationDataResponse::supiIsSet() const
{
return m_SupiIsSet;
}
void ConfirmationDataResponse::unsetSupi()
{
m_SupiIsSet = false;
}
std::string ConfirmationDataResponse::getKseaf() const
{
return m_Kseaf;
}
void ConfirmationDataResponse::setKseaf(std::string const& value)
{
m_Kseaf = value;
m_KseafIsSet = true;
}
bool ConfirmationDataResponse::kseafIsSet() const
{
return m_KseafIsSet;
}
void ConfirmationDataResponse::unsetKseaf()
{
m_KseafIsSet = false;
}
}
}
}
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB,
* ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* ConfirmationDataResponse.h
*
*
*/
#ifndef ConfirmationDataResponse_H_
#define ConfirmationDataResponse_H_
#include <nlohmann/json.hpp>
#include <string>
namespace oai {
namespace amf {
namespace model {
/// <summary>
///
/// </summary>
class ConfirmationDataResponse {
public:
ConfirmationDataResponse();
virtual ~ConfirmationDataResponse();
void validate();
/////////////////////////////////////////////
/// ConfirmationDataResponse members
/// <summary>
///
/// </summary>
bool getAuthResult() const;
void setAuthResult(bool const &value);
// AuthResult getAuthResult() const;
// void setAuthResult(AuthResult const &value);
/// <summary>
///
/// </summary>
std::string getSupi() const;
void setSupi(std::string const &value);
bool supiIsSet() const;
void unsetSupi();
/// <summary>
///
/// </summary>
std::string getKseaf() const;
void setKseaf(std::string const &value);
bool kseafIsSet() const;
void unsetKseaf();
friend void to_json(nlohmann::json &j, const ConfirmationDataResponse &o);
friend void from_json(const nlohmann::json &j, ConfirmationDataResponse &o);
protected:
bool m_AuthResult;
// AuthResult m_AuthResult; //AuthResult not defined
std::string m_Supi;
bool m_SupiIsSet;
std::string m_Kseaf;
bool m_KseafIsSet;
};
} // namespace model
} // namespace amf
} // namespace oai
#endif /* ConfirmationDataResponse_H_ */
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB,
* ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "LinksValueSchema.h"
namespace oai {
namespace amf {
namespace model {
LinksValueSchema::LinksValueSchema() {
m_Href = "";
m_HrefIsSet = false;
}
LinksValueSchema::~LinksValueSchema() {}
void LinksValueSchema::validate() {
// TODO: implement validation
}
void to_json(nlohmann::json &j, const LinksValueSchema &o) {
j = nlohmann::json();
if (o.hrefIsSet())
j["href"] = o.m_Href;
}
void from_json(const nlohmann::json &j, LinksValueSchema &o) {
if (j.find("href") != j.end()) {
j.at("href").get_to(o.m_Href);
o.m_HrefIsSet = true;
}
}
std::string LinksValueSchema::getHref() const { return m_Href; }
void LinksValueSchema::setHref(std::string const &value) {
m_Href = value;
m_HrefIsSet = true;
}
bool LinksValueSchema::hrefIsSet() const { return m_HrefIsSet; }
void LinksValueSchema::unsetHref() { m_HrefIsSet = false; }
} // namespace model
} // namespace server
} // namespace openapitools
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* LinksValueSchema.h
*
*
*/
#ifndef LinksValueSchema_H_
#define LinksValueSchema_H_
#include <string>
#include <nlohmann/json.hpp>
namespace oai {
namespace amf {
namespace model {
/// <summary>
///
/// </summary>
class LinksValueSchema
{
public:
LinksValueSchema();
virtual ~LinksValueSchema();
void validate();
/////////////////////////////////////////////
/// LinksValueSchema members
/// <summary>
///
/// </summary>
std::string getHref() const;
void setHref(std::string const& value);
bool hrefIsSet() const;
void unsetHref();
friend void to_json(nlohmann::json& j, const LinksValueSchema& o);
friend void from_json(const nlohmann::json& j, LinksValueSchema& o);
protected:
std::string m_Href;
bool m_HrefIsSet;
};
}
}
}
#endif /* LinksValueSchema_H_ */
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "UEAuthenticationCtx.h"
namespace oai {
namespace amf {
namespace model {
UEAuthenticationCtx::UEAuthenticationCtx()
{
m_AuthType = "";
m_ServingNetworkName = "";
m_ServingNetworkNameIsSet = false;
}
UEAuthenticationCtx::~UEAuthenticationCtx()
{
}
void UEAuthenticationCtx::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const UEAuthenticationCtx& o)
{
j = nlohmann::json();
j["authType"] = o.m_AuthType;
j["5gAuthData"] = o.m_r_5gAuthData;
j["_links"] = o.m__links;
if(o.servingNetworkNameIsSet())
j["servingNetworkName"] = o.m_ServingNetworkName;
}
void from_json(const nlohmann::json& j, UEAuthenticationCtx& o)
{
j.at("authType").get_to(o.m_AuthType);
j.at("5gAuthData").get_to(o.m_r_5gAuthData);
j.at("_links").get_to(o.m__links);
if(j.find("servingNetworkName") != j.end())
{
j.at("servingNetworkName").get_to(o.m_ServingNetworkName);
o.m_ServingNetworkNameIsSet = true;
}
}
std::string UEAuthenticationCtx::getAuthType() const
{
return m_AuthType;
}
void UEAuthenticationCtx::setAuthType(std::string const& value)
{
m_AuthType = value;
}
Av5gAka UEAuthenticationCtx::getR5gAuthData() const
{
return m_r_5gAuthData;
}
void UEAuthenticationCtx::setR5gAuthData(Av5gAka const& value)
{
m_r_5gAuthData = value;
}
std::map<std::string, LinksValueSchema>& UEAuthenticationCtx::getLinks()
{
return m__links;
}
void UEAuthenticationCtx::setLinks(std::map<std::string, LinksValueSchema> const& value)
{
m__links = value;
}
std::string UEAuthenticationCtx::getServingNetworkName() const
{
return m_ServingNetworkName;
}
void UEAuthenticationCtx::setServingNetworkName(std::string const& value)
{
m_ServingNetworkName = value;
m_ServingNetworkNameIsSet = true;
}
bool UEAuthenticationCtx::servingNetworkNameIsSet() const
{
return m_ServingNetworkNameIsSet;
}
void UEAuthenticationCtx::unsetServingNetworkName()
{
m_ServingNetworkNameIsSet = false;
}
}
}
}
/**
* AUSF API
* AUSF UE Authentication Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* UEAuthenticationCtx.h
*
*
*/
#ifndef UEAuthenticationCtx_H_
#define UEAuthenticationCtx_H_
#include "Av5gAka.h"
#include "LinksValueSchema.h"
#include <string>
#include <map>
#include <vector>
#include <nlohmann/json.hpp>
namespace oai {
namespace amf {
namespace model {
/// <summary>
///
/// </summary>
class UEAuthenticationCtx
{
public:
UEAuthenticationCtx();
virtual ~UEAuthenticationCtx();
void validate();
/////////////////////////////////////////////
/// UEAuthenticationCtx members
/// <summary>
///
/// </summary>
std::string getAuthType() const;
void setAuthType(std::string const& value);
/// <summary>
///
/// </summary>
Av5gAka getR5gAuthData() const;
void setR5gAuthData(Av5gAka const& value);
/// <summary>
///
/// </summary>
std::map<std::string, LinksValueSchema>& getLinks();
void setLinks(std::map<std::string, LinksValueSchema> const& value);
/// <summary>
///
/// </summary>
std::string getServingNetworkName() const;
void setServingNetworkName(std::string const& value);
bool servingNetworkNameIsSet() const;
void unsetServingNetworkName();
friend void to_json(nlohmann::json& j, const UEAuthenticationCtx& o);
friend void from_json(const nlohmann::json& j, UEAuthenticationCtx& o);
protected:
std::string m_AuthType;
Av5gAka m_r_5gAuthData;
std::map<std::string, LinksValueSchema> m__links;
std::string m_ServingNetworkName;
bool m_ServingNetworkNameIsSet;
};
}
}
}
#endif /* UEAuthenticationCtx_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment