Commit 97bebada authored by HFJ's avatar HFJ

err in 5gaka not fixed

parent 08458e54
cmake_minimum_required (VERSION 3.2)
project(api-server)
project(ausf-server)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pg -g3" )
include(ExternalProject)
#set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external)
#ExternalProject_Add(PISTACHE
# GIT_REPOSITORY https://github.com/oktal/pistache.git
# CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
#)
ExternalProject_Add(PISTACHE
GIT_REPOSITORY https://github.com/oktal/pistache.git
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
ExternalProject_Add(NLOHMANN
GIT_REPOSITORY https://github.com/nlohmann/json.git
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/build/ext/spdlog/include)
#ExternalProject_Add(NLOHMANN
# GIT_REPOSITORY https://github.com/nlohmann/json.git
# CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
### for common
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/unicode)
file(GLOB COMMON_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/conversions.cpp)
### end for common
#)
#include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
#link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)
### for generated libcommon
include_directories(libcom)
file(GLOB LIB_COMMON_SRC ${CMAKE_CURRENT_SOURCE_DIR}/libcom/*.c)
###end
### for authentication
include_directories(5gaka)
include_directories(5gaka/test)
include_directories(5gaka/algorithm_from_spec)
file(GLOB 5GAKA_SRC ${CMAKE_CURRENT_SOURCE_DIR}/5gaka/*.cpp)
###end for
### for log
add_library( LOG STATIC
${CMAKE_CURRENT_SOURCE_DIR}/common/logger.cpp)
###end for log
include_directories(model)
include_directories(api)
......@@ -32,6 +59,7 @@ file(GLOB SRCS
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
add_executable(${PROJECT_NAME} ${SRCS} )
#add_dependencies(${PROJECT_NAME} PISTACHE NLOHMANN)
add_executable(${PROJECT_NAME} ${SRCS} ${5GAKA_SRC} ${LIB_COMMON_SRC} ${COMMON_SRC} )
add_dependencies(${PROJECT_NAME} PISTACHE NLOHMANN)
target_link_libraries(${PROJECT_NAME} pistache pthread)
......@@ -81,11 +81,10 @@ void AuthenticationResultDeletionApi::delete_eap_authentication_result_handler(c
}
void AuthenticationResultDeletionApi::authentication_result_deletion_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist-resDel");
}
}
}
}
}
}
\ No newline at end of file
......@@ -10,9 +10,12 @@
* Do not edit the class manually.
*/
#include <iostream>
#include "DefaultApi.h"
#include "Helpers.h"
using namespace std;
namespace org {
namespace openapitools {
namespace server {
......@@ -21,6 +24,7 @@ namespace api {
using namespace org::openapitools::server::helpers;
using namespace org::openapitools::server::model;
DefaultApi::DefaultApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
......@@ -32,10 +36,10 @@ void DefaultApi::init() {
void DefaultApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Post(*router, base + "/ue-authentications/:authCtxId/eap-session", Routes::bind(&DefaultApi::eap_auth_method_handler, this));
Routes::Post(*router, base + "/rg-authentications", Routes::bind(&DefaultApi::rg_authentications_post_handler, this));
Routes::Put(*router, base + "/ue-authentications/:authCtxId/5g-aka-confirmation", Routes::bind(&DefaultApi::ue_authentications_auth_ctx_id5g_aka_confirmation_put_handler, this));
Routes::Post(*router, base + "/ue-authentications/deregister", Routes::bind(&DefaultApi::ue_authentications_deregister_post_handler, this));
//Routes::Post(*router, base + "/ue-authentications/:authCtxId/eap-session", Routes::bind(&DefaultApi::eap_auth_method_handler, this));
//Routes::Post(*router, base + "/rg-authentications", Routes::bind(&DefaultApi::rg_authentications_post_handler, this));
//Routes::Put(*router, base + "/ue-authentications/:authCtxId/5g-aka-confirmation", Routes::bind(&DefaultApi::ue_authentications_auth_ctx_id5g_aka_confirmation_put_handler, this));
//Routes::Post(*router, base + "/ue-authentications/deregister", Routes::bind(&DefaultApi::ue_authentications_deregister_post_handler, this));
Routes::Post(*router, base + "/ue-authentications", Routes::bind(&DefaultApi::ue_authentications_post_handler, this));
// Default handler, called when a route is not found
......@@ -163,7 +167,8 @@ void DefaultApi::ue_authentications_post_handler(const Pistache::Rest::Request &
}
void DefaultApi::default_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
cout << "in default api handler" << endl;
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist-default");
}
}
......
......@@ -23,6 +23,10 @@
#include "AuthenticationResultDeletionApiImpl.h"
#include "DefaultApiImpl.h"
// #include "authentication_algorithms_with_5gaka.hpp"
// #include "test.hpp"
#include "logger.hpp"
#define PISTACHE_SERVER_THREADS 2
#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768
#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768
......@@ -77,11 +81,13 @@ int main() {
opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE);
httpEndpoint->init(opts);
AuthenticationResultDeletionApiImpl AuthenticationResultDeletionApiserver(router);
AuthenticationResultDeletionApiserver.init();
DefaultApiImpl DefaultApiserver(router);
DefaultApiserver.init();
Logger::ausf_server().debug("test logger!");
// f1_test();
//AuthenticationResultDeletionApiImpl AuthenticationResultDeletionApiserver(router);
//AuthenticationResultDeletionApiserver.init();
// DefaultApiImpl DefaultApiserver(router);
// DefaultApiserver.init();
httpEndpoint->setHandler(router->handler());
httpEndpoint->serve();
......
......@@ -64,11 +64,11 @@ void UEAuthenticationCtx::setAuthType(AuthType const& value)
{
m_AuthType = value;
}
OneOfAv5gAkastring UEAuthenticationCtx::getR5gAuthData() const
Av5gAka UEAuthenticationCtx::getR5gAuthData() const
{
return m_r_5gAuthData;
}
void UEAuthenticationCtx::setR5gAuthData(OneOfAv5gAkastring const& value)
void UEAuthenticationCtx::setR5gAuthData(Av5gAka const& value)
{
m_r_5gAuthData = value;
}
......
......@@ -19,7 +19,7 @@
#define UEAuthenticationCtx_H_
#include "OneOfAv5gAkastring.h"
#include "Av5gAka.h"
#include "LinksValueSchema.h"
#include "AuthType.h"
#include <string>
......@@ -54,8 +54,8 @@ public:
/// <summary>
///
/// </summary>
OneOfAv5gAkastring getR5gAuthData() const;
void setR5gAuthData(OneOfAv5gAkastring const& value);
Av5gAka getR5gAuthData() const;
void setR5gAuthData(Av5gAka const& value);
/// <summary>
///
/// </summary>
......@@ -74,7 +74,7 @@ public:
protected:
AuthType m_AuthType;
OneOfAv5gAkastring m_r_5gAuthData;
Av5gAka m_r_5gAuthData;
std::map<std::string, LinksValueSchema> m__links;
......
This diff is collapsed.
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