Commit e08a5729 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen
Browse files

Merge branch 'http2' into 'develop'

HTTP version 2

See merge request oai/oai-cn5g-smf!12
parents 89d041b9 18da34cb
......@@ -87,7 +87,7 @@ cd /openair-cn-cups/build/scripts
#configure SPGWU using an example configure file (spgw_u.conf)
cd /oai-cn5g-smf/src/test/upf/
./spgwu_conf.sh
sudo spgwu -c /usr/local/etc/oai/spgw_u.conf -o
sudo spgwu -c /usr/local/etc/oai/spgw_u.conf
## Build and launch AMF client
......@@ -98,4 +98,8 @@ cmake ..
make
./amf-client -i 172.16.1.101
#Launch AMF client with HTTP2 (-v: http version, -p: port)
./amf-client -i 172.16.1.101 -v 2 -p 9090
......@@ -197,6 +197,72 @@ install_nlohmann_from_git() {
return 0
}
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_nghttp2_from_git() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install nghttp2 ? <y/N> " prompt
OPTION="-y"
else
prompt='y'
OPTION="-y"
fi
if [ $2 -eq 0 ]; then
debug=0
else
debug=1
fi
if [[ $prompt =~ [yY](es)* ]]
then
$SUDO apt-get install $OPTION \
g++ \
cmake \
binutils \
autoconf \
automake \
autotools-dev \
libtool \
pkg-config \
zlib1g-dev \
libcunit1-dev \
libssl-dev \
libxml2-dev libev-dev libevent-dev libjansson-dev libc-ares-dev \
libjemalloc-dev libsystemd-dev cython python3-dev python-setuptools
ret=$?;[[ $ret -ne 0 ]] && return $ret
GIT_URL=https://github.com/nghttp2/nghttp2.git
echo "Install nghttp2 from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext
echo "Downloading nghttp2"
if [[ $OPTION =~ [yY](es)* ]]
then
$SUDO rm -rf nghttp2
fi
git clone $GIT_URL
cd nghttp2
git submodule update --init
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
autoreconf -i
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
automake
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
autoconf
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
./configure --enable-asio-lib
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
return 0
}
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
......@@ -333,6 +399,11 @@ check_install_smf_deps() {
install_nlohmann_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
install_nghttp2_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
$SUDO /sbin/ldconfig -v
ret=$?;[[ $ret -ne 0 ]] && return $ret
return 0
}
#-------------------------------------------------------------------------------
......
......@@ -22,6 +22,7 @@ SMF_CONF[@SMF_INTERFACE_NAME_FOR_SBI@]='eno1:smf'
SMF_CONF[@SMF_INTERFACE_IPV4_ADDRESS_FOR_SBI@]='172.16.1.101'
SMF_CONF[@SMF_INTERFACE_PORT_FOR_SBI@]='80'
SMF_CONF[@SMF_INTERFACE_HTTP2_PORT_FOR_SBI@]='9090'
SMF_CONF[@UDM_IPV4_ADDRESS@]='172.16.1.103'
SMF_CONF[@UDM_PORT@]='80'
......
......@@ -88,6 +88,9 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DE
WORKDIR /openair-smf/bin
COPY --from=oai-smf-builder /openair-smf/build/smf/build/smf oai_smf
COPY --from=oai-smf-builder /usr/local/lib/libpistache.so /usr/local/lib/
COPY --from=oai-smf-builder /usr/local/lib/libnghttp2_asio.so.1 /usr/local/lib/
COPY --from=oai-smf-builder /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 /usr/lib/x86_64-linux-gnu/
COPY --from=oai-smf-builder /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1 /usr/lib/x86_64-linux-gnu/
COPY --from=oai-smf-builder /openair-smf/build/smf/build/libNAS.so /usr/local/lib/
COPY --from=oai-smf-builder /openair-smf/build/smf/build/libSMF_API.so /usr/local/lib/
RUN ldconfig
......
......@@ -29,6 +29,7 @@ class smfConfigGen():
self.kind = ''
self.sbi_name = ''
self.sbi_port = '80'
self.sbi_http2_port = '9090'
self.n4_name = ''
self.amf_ip_addr = ''
self.amf_port = '80'
......@@ -69,6 +70,7 @@ class smfConfigGen():
smfFile.write('SMF_CONF[@PID_DIRECTORY@]=\'/var/run\'\n')
smfFile.write('SMF_CONF[@SMF_INTERFACE_NAME_FOR_SBI@]=\'' + self.sbi_name + '\'\n')
smfFile.write('SMF_CONF[@SMF_INTERFACE_PORT_FOR_SBI@]=' + self.sbi_port + '\n')
smfFile.write('SMF_CONF[@SMF_INTERFACE_HTTP2_PORT_FOR_SBI@]=' + self.sbi_http2_port + '\n')
smfFile.write('SMF_CONF[@SMF_INTERFACE_NAME_FOR_N4@]=\'' + self.n4_name + '\'\n')
smfFile.write('SMF_CONF[@DEFAULT_DNS_IPV4_ADDRESS@]=$MY_PRIMARY_DNS\n')
smfFile.write('SMF_CONF[@DEFAULT_DNS_SEC_IPV4_ADDRESS@]=$MY_SECONDARY_DNS\n')
......
......@@ -36,9 +36,10 @@ SMF =
{
# SMF binded interface for SBI interface (e.g., communication with AMF, UDM)
INTERFACE_NAME = "@SMF_INTERFACE_NAME_FOR_SBI@"; # STRING, interface name
#IPV4_ADDRESS = "@SMF_INTERFACE_IPV4_ADDRESS_FOR_SBI@"; # STRING, CIDR or "read" to let app read interface configured IP address
#IPV4_ADDRESS = "@SMF_INTERFACE_IPV4_ADDRESS_FOR_SBI@"; # STRING, CIDR or "read" to let app read interface configured IP address
IPV4_ADDRESS = "read";
PORT = @SMF_INTERFACE_PORT_FOR_SBI@ #Normally we don't need this (default port 80)
PORT = @SMF_INTERFACE_PORT_FOR_SBI@; #Normally we don't need this (default port 80)
HTTP2_PORT = @SMF_INTERFACE_HTTP2_PORT_FOR_SBI@;
};
TEST_UPF : #for BUPT test only!
......
cmake_minimum_required (VERSION 3.2)
project(smf-api-server)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pg -g3" )
include_directories(model)
include_directories(api)
include_directories(impl)
file(GLOB SRCS
${CMAKE_CURRENT_SOURCE_DIR}/api/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/impl/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/model/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
add_executable(${PROJECT_NAME} ${SRCS} )
target_link_libraries(${PROJECT_NAME} pistache pthread)
......@@ -43,7 +43,7 @@
#include "logger.hpp"
#include "Helpers.h"
#include "simple_parser.hpp"
#include "mime_parser.hpp"
namespace oai {
namespace smf_server {
......@@ -103,7 +103,6 @@ void IndividualSMContextApi::release_sm_context_handler(
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void IndividualSMContextApi::retrieve_sm_context_handler(
......@@ -141,7 +140,7 @@ void IndividualSMContextApi::update_sm_context_handler(
SmContextUpdateMessage smContextUpdateMessage = { };
//simple parser
simple_parser sp = { };
mime_parser sp = { };
sp.parse(request.body());
std::vector<mime_part> parts = { };
......
......@@ -43,11 +43,7 @@
#include "logger.hpp"
#include "Helpers.h"
#include "simple_parser.hpp"
extern "C" {
#include "dynamic_memory_check.h"
}
#include "mime_parser.hpp"
namespace oai {
namespace smf_server {
......@@ -90,7 +86,7 @@ void SMContextsCollectionApi::post_sm_contexts_handler(
SmContextCreateData smContextCreateData = { };
//simple parser
simple_parser sp = { };
mime_parser sp = { };
sp.parse(request.body());
std::vector<mime_part> parts = { };
......@@ -99,7 +95,7 @@ void SMContextsCollectionApi::post_sm_contexts_handler(
Logger::smf_api_server().debug("Number of MIME parts %d", size);
//at least 2 parts for Json data and N1 (+ N2)
if (size < 2) {
response.send(Pistache::Http::Code::Bad_Request, "");
response.send(Pistache::Http::Code::Bad_Request);
return;
}
......@@ -107,14 +103,16 @@ void SMContextsCollectionApi::post_sm_contexts_handler(
try {
nlohmann::json::parse(parts[0].body.c_str()).get_to(smContextCreateData);
smContextMessage.setJsonData(smContextCreateData);
//must include N1 NAS msg
if (parts[1].content_type.compare("application/vnd.3gpp.5gnas") == 0) {
smContextMessage.setBinaryDataN1SmMessage(parts[1].body);
} else if (parts[1].content_type.compare("application/vnd.3gpp.ngap")
== 0) {
smContextMessage.setBinaryDataN2SmInformation(parts[1].body);
} else {
response.send(Pistache::Http::Code::Bad_Request);
return;
}
this->post_sm_contexts(smContextMessage, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
Logger::smf_api_server().warn("Can not parse the json data (error: %s)!",
......
......@@ -32,6 +32,8 @@
*/
#include "IndividualSMContextApiImpl.h"
#include <nghttp2/asio_http2_server.h>
#include "mime_parser.hpp"
namespace oai {
namespace smf_server {
......@@ -56,18 +58,35 @@ void IndividualSMContextApiImpl::release_sm_context(
//TODO: to be updated as update_sm_context_handler
Logger::smf_api_server().info("release_sm_context...");
boost::shared_ptr<boost::promise<smf::pdu_session_release_sm_context_response> > p =
boost::make_shared<
boost::promise<smf::pdu_session_release_sm_context_response> >();
boost::shared_future<smf::pdu_session_release_sm_context_response> f;
f = p->get_future();
//Generate ID for this promise (to be used in SMF-APP)
uint32_t promise_id = generate_promise_id();
Logger::smf_api_server().debug("Promise ID generated %d", promise_id);
m_smf_app->add_promise(promise_id, p);
//handle Nsmf_PDUSession_UpdateSMContext Request
Logger::smf_api_server().info(
"Received a PDUSession_ReleaseSMContext Request: PDU Session Release request from AMF.");
std::shared_ptr<itti_n11_release_sm_context_request> itti_msg =
std::make_shared<itti_n11_release_sm_context_request>(TASK_SMF_N11,
TASK_SMF_APP,
response,
smContextRef);
TASK_SMF_APP,
promise_id,
smContextRef);
itti_msg->scid = smContextRef;
itti_msg->http_version = 1;
m_smf_app->handle_pdu_session_release_sm_context_request(itti_msg);
//wait for the result from APP and send reply to AMF
smf::pdu_session_release_sm_context_response sm_context_response = f.get();
Logger::smf_api_server().debug("Got result for promise ID %d", promise_id);
response.send(Pistache::Http::Code(sm_context_response.get_http_code()));
}
void IndividualSMContextApiImpl::retrieve_sm_context(
......@@ -96,7 +115,7 @@ void IndividualSMContextApiImpl::update_sm_context(
//N2 SM (for Session establishment)
std::string n2_sm_information = smContextUpdateMessage
.getBinaryDataN2SmInformation();
Logger::smf_api_server().debug("smContextMessage, n2 sm information %s",
Logger::smf_api_server().debug("N2 SM Information %s",
n2_sm_information.c_str());
std::string n2_sm_info_type = smContextUpdateData.getN2SmInfoType();
sm_context_req_msg.set_n2_sm_information(n2_sm_information);
......@@ -106,8 +125,7 @@ void IndividualSMContextApiImpl::update_sm_context(
//N1 SM (for session modification)
std::string n1_sm_message =
smContextUpdateMessage.getBinaryDataN1SmMessage();
Logger::smf_api_server().debug("smContextMessage, n1 sm message %s",
n1_sm_message.c_str());
Logger::smf_api_server().debug("N1 SM message %s", n1_sm_message.c_str());
sm_context_req_msg.set_n1_sm_message(n1_sm_message);
}
//Step 2. TODO: initialize necessary values for sm context req from smContextUpdateData
......@@ -135,7 +153,6 @@ void IndividualSMContextApiImpl::update_sm_context(
//TODO: Existing PDU session, step 3, SUPI, DNN, S-NSSAIs, SM Context ID, AMF ID, Request Type, N1 SM Container (PDU Session Establishment Request), User location, Access Type, RAT Type, PEI
//step 15. (SM Context ID -> SCID, N2 SM, Request Type)(Initial Request)
//TODO: verify why Request Type is not define in smContextUpdateData
/* AMF-initiated with a release indication to request the release of the PDU Session (step 3.d, section 4.3.4.2@3GPP TS 23.502)*/
if (smContextUpdateData.releaseIsSet()) {
sm_context_req_msg.set_release(smContextUpdateData.isRelease());
......@@ -146,18 +163,72 @@ void IndividualSMContextApiImpl::update_sm_context(
//step 1.e (AN initiated modification): SM Context ID, N2 SM information (QFI, User location Information and an indication that the QoS Flow is released)
//step 7a, SM Context ID, N2 SM information, UE location information
//Step 11, SM Context ID, N1 SM (PDU Session Modification Command ACK), User location
boost::shared_ptr<boost::promise<smf::pdu_session_update_sm_context_response> > p =
boost::make_shared<
boost::promise<smf::pdu_session_update_sm_context_response> >();
boost::shared_future<smf::pdu_session_update_sm_context_response> f;
f = p->get_future();
//Generate ID for this promise (to be used in SMF-APP)
uint32_t promise_id = generate_promise_id();
Logger::smf_api_server().debug("Promise ID generated %d", promise_id);
m_smf_app->add_promise(promise_id, p);
//Step 3. Handle the itti_n11_update_sm_context_request message in smf_app
std::shared_ptr<itti_n11_update_sm_context_request> itti_msg =
std::make_shared<itti_n11_update_sm_context_request>(TASK_SMF_N11,
TASK_SMF_APP,
response,
promise_id,
smContextRef);
itti_msg->req = sm_context_req_msg;
itti_msg->scid = smContextRef;
itti_msg->http_version = 1;
m_smf_app->handle_pdu_session_update_sm_context_request(itti_msg);
}
//wait for the result from APP and send reply to AMF
smf::pdu_session_update_sm_context_response sm_context_response = f.get();
Logger::smf_api_server().debug("Got result for promise ID %d", promise_id);
nlohmann::json json_data = { };
mime_parser parser = { };
std::string body = { };
sm_context_response.get_json_data(json_data);
Logger::smf_api_server().debug("Json data %s", json_data.dump().c_str());
if (sm_context_response.n1_sm_msg_is_set()
and sm_context_response.n2_sm_info_is_set()) {
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n1_sm_message(),
sm_context_response.get_n2_sm_information());
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY)));
} else if (sm_context_response.n1_sm_msg_is_set()) {
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n1_sm_message(),
multipart_related_content_part_e::NAS);
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY)));
} else if (sm_context_response.n2_sm_info_is_set()) {
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n2_sm_information(),
multipart_related_content_part_e::NGAP);
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY)));
} else {
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType("application/json"));
body = json_data.dump().c_str();
}
response.send(Pistache::Http::Code(sm_context_response.get_http_code()),
body);
}
}
}
}
......
......@@ -87,6 +87,11 @@ class IndividualSMContextApiImpl :
private:
smf::smf_app *m_smf_app;
std::string m_address;
protected:
static uint64_t generate_promise_id() {
return util::uint_uid_generator<uint64_t>::get_instance().get_uid();
}
};
}
......
......@@ -36,6 +36,7 @@
#include "smf_msg.hpp"
#include "itti_msg_n11.hpp"
#include "3gpp_29.502.h"
#include <nghttp2/asio_http2_server.h>
namespace oai {
namespace smf_server {
......@@ -49,9 +50,7 @@ SMContextsCollectionApiImpl::SMContextsCollectionApiImpl(
:
SMContextsCollectionApi(rtr),
m_smf_app(smf_app_inst),
m_address(address)
{
m_address(address) {
}
void SMContextsCollectionApiImpl::post_sm_contexts(
......@@ -66,8 +65,7 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
SmContextCreateData smContextCreateData = smContextMessage.getJsonData();
std::string n1_sm_msg = smContextMessage.getBinaryDataN1SmMessage();
Logger::smf_api_server().debug("smContextMessage, N1 SM message: %s",
n1_sm_msg.c_str());
Logger::smf_api_server().debug("N1 SM message: %s", n1_sm_msg.c_str());
//Step 2. Create a pdu_session_create_sm_context_request message and store the necessary information
Logger::smf_api_server().debug(
......@@ -87,38 +85,36 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
smf_string_to_supi(&supi, supi_str.c_str());
sm_context_req_msg.set_supi(supi);
sm_context_req_msg.set_supi_prefix(supi_prefix);
Logger::smf_api_server().debug(
"SmContextCreateData, SUPI %s, SUPI Prefix %s, IMSI %s",
smContextCreateData.getSupi().c_str(), supi_prefix.c_str(),
supi_str.c_str());
Logger::smf_api_server().debug("SUPI %s, SUPI Prefix %s, IMSI %s",
smContextCreateData.getSupi().c_str(),
supi_prefix.c_str(), supi_str.c_str());
//dnn
Logger::smf_api_server().debug("SmContextCreateData, DNN %s",
Logger::smf_api_server().debug("DNN %s",
smContextCreateData.getDnn().c_str());
sm_context_req_msg.set_dnn(smContextCreateData.getDnn().c_str());
//S-Nssai
Logger::smf_api_server().debug(
"SmContextCreateData, S-NSSAI SST %d, SD %s",
smContextCreateData.getSNssai().getSst(),
"S-NSSAI SST %d, SD %s", smContextCreateData.getSNssai().getSst(),
smContextCreateData.getSNssai().getSd().c_str());
snssai_t snssai(smContextCreateData.getSNssai().getSst(),
smContextCreateData.getSNssai().getSd());
sm_context_req_msg.set_snssai(snssai);
//PDU session ID
Logger::smf_api_server().debug("SmContextCreateData, PDU Session ID %d",
Logger::smf_api_server().debug("PDU Session ID %d",
smContextCreateData.getPduSessionId());
sm_context_req_msg.set_pdu_session_id(smContextCreateData.getPduSessionId());
//AMF ID (ServingNFId)
Logger::smf_api_server().debug("SmContextCreateDatea, ServingNfId %s",
Logger::smf_api_server().debug("ServingNfId %s",
smContextCreateData.getServingNfId().c_str());
sm_context_req_msg.set_serving_nf_id(
smContextCreateData.getServingNfId().c_str()); //TODO: should be verified that AMF ID is stored in GUAMI or ServingNfId
//Request Type
Logger::smf_api_server().debug("SmContextCreateData, RequestType %s",
Logger::smf_api_server().debug("RequestType %s",
smContextCreateData.getRequestType().c_str());
sm_context_req_msg.set_request_type(smContextCreateData.getRequestType());
//PCF ID
......@@ -136,7 +132,7 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
//PCFId
// DNN Selection Mode
Logger::smf_api_server().debug("SmContextCreateData, SelMode %s",
Logger::smf_api_server().debug("SelMode %s",
smContextCreateData.getSelMode().c_str());
sm_context_req_msg.set_dnn_selection_mode(
smContextCreateData.getSelMode().c_str());
......@@ -152,16 +148,40 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
//SM PDU DN request container (Optional)
//Extended protocol configuration options (Optional) e.g, FOR DHCP
boost::shared_ptr<boost::promise<smf::pdu_session_create_sm_context_response> > p =
boost::make_shared<
boost::promise<smf::pdu_session_create_sm_context_response> >();
boost::shared_future<smf::pdu_session_create_sm_context_response> f;
f = p->get_future();
//Generate ID for this promise (to be used in SMF-APP)
uint32_t promise_id = generate_promise_id();
Logger::smf_api_server().debug("Promise ID generated %d", promise_id);
m_smf_app->add_promise(promise_id, p);
//Step 3. Handle the pdu_session_create_sm_context_request message in smf_app
std::shared_ptr<itti_n11_create_sm_context_request> itti_msg =
std::make_shared<itti_n11_create_sm_context_request>(TASK_SMF_N11,
TASK_SMF_APP,
response);
promise_id);
itti_msg->req = sm_context_req_msg;
itti_msg->http_version = 1;
m_smf_app->handle_pdu_session_create_sm_context_request(itti_msg);
//wait for the result from APP and send reply to AMF
smf::pdu_session_create_sm_context_response sm_context_response = f.get();
Logger::smf_api_server().debug("Got result for promise ID %d", promise_id);
nlohmann::json json_data = { };
sm_context_response.get_json_data(json_data);
if (!json_data.empty()) {
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType("application/json"));
response.send(Pistache::Http::Code(sm_context_response.get_http_code()), json_data.dump().c_str());
} else {
response.send(Pistache::Http::Code(sm_context_response.get_http_code()));
}
}
}
}
}
......@@ -73,6 +73,11 @@ class SMContextsCollectionApiImpl :
private:
smf::smf_app *m_smf_app;
std::string m_address;
protected:
static uint64_t generate_promise_id() {
return util::uint_uid_generator<uint64_t>::get_instance().get_uid();
}
};
}
......
......@@ -659,17 +659,6 @@ void SmContextUpdateData::setN2SmInfoType(std::string const& value)
m_N2SmInfoTypeIsSet = true;
}
/*
N2SmInfoType SmContextUpdateData::getN2SmInfoType() const
{
return m_N2SmInfoType;
}
void SmContextUpdateData::setN2SmInfoType(N2SmInfoType const& value)
{
m_N2SmInfoType = value;
m_N2SmInfoTypeIsSet = true;
}
*/
bool SmContextUpdateData::n2SmInfoTypeIsSet() const
{
return m_N2SmInfoTypeIsSet;
......
......@@ -30,6 +30,7 @@
* contact@openairinterface.org
*/
#include "smf-api-server.h"
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
......@@ -39,7 +40,6 @@
#include <unistd.h>
#endif
#include "smf-api-server.h"
#define PISTACHE_SERVER_MAX_PAYLOAD 32768
#ifdef __linux__
......@@ -92,19 +92,3 @@ void SMFApiServer::start() {
void SMFApiServer::shutdown() {
m_httpEndpoint->shutdown();
}
/*
int main() {
#ifdef __linux__
std::vector<int> sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP};
setUpUnixSignals(sigs);
#endif
Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(8080));
SMFApiServer smfApiServer(addr);
smfApiServer.init(2);
smfApiServer.start();
smfApiServer.shutdown();
}
*/
......@@ -31,6 +31,9 @@
* contact@openairinterface.org
*/
#ifndef FILE_SMF_API_SERVER_SEEN