Commit 9a00386f authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'padding_issue_ngap_msg' into 'develop'

Fix padding issue for NGAP, NAS messages

See merge request oai/oai-cn5g-smf!13
parents e08a5729 e062b8f8
......@@ -203,7 +203,7 @@ install_nlohmann_from_git() {
install_nghttp2_from_git() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install nghttp2 ? <y/N> " prompt
OPTION="-y"
OPTION=""
else
prompt='y'
OPTION="-y"
......@@ -260,8 +260,7 @@ install_nghttp2_from_git() {
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
return 0
return 0
}
#-------------------------------------------------------------------------------
......@@ -401,8 +400,6 @@ check_install_smf_deps() {
install_nghttp2_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
$SUDO /sbin/ldconfig -v
ret=$?;[[ $ret -ne 0 ]] && return $ret
return 0
}
......
......@@ -41,8 +41,8 @@ Based on document **3GPP TS 23.501 v16.0.0 §6.2.2**.
| 1 | Session Management (Session Establishment/Modification/Release) | :heavy_check_mark: | |
| 2 | UE IP address allocation & management​ | :heavy_check_mark: | Only support static ipv4 address allocation |
| 3 | DHCPv4 (server and client) and DHCPv6 (server and client) function | :x: | |
| 4 | Respond to ARP requests and/or IPv6 Neighbour Solicitation requests | :x: | Local configuration in SMF |
| 5 | Selection of UPF function​ | :x: | |
| 4 | Respond to ARP requests and/or IPv6 Neighbour Solicitation requests | :x: | |
| 5 | Selection of UPF function​ | :heavy_check_mark: | Local configuration in SMF |
| 6 | Configures traffic steering at UPF | :x: | |
| 7 | Termination of interfaces towards PCFs | :x: | |
| 8 | Lawful intercept | :x: | |
......@@ -55,5 +55,3 @@ Based on document **3GPP TS 23.501 v16.0.0 §6.2.2**.
| 15 | Support of header compression. ​ | :x: | |
| 16 | Act as I-SMF in deployments | :x: | |
| 17 | Provisioning of external parameters | :x: | |
......@@ -19,6 +19,14 @@
* contact@openairinterface.org
*/
/*! \file smf_http2-server.cpp
\brief
\author Tien-Thinh NGUYEN
\company Eurecom
\date 2020
\email: tien-thinh.nguyen@eurecom.fr
*/
#include "smf-http2-server.h"
#include <string>
#include <boost/algorithm/string.hpp>
......
......@@ -19,6 +19,14 @@
* contact@openairinterface.org
*/
/*! \file smf_http2-server.h
\brief
\author Tien-Thinh NGUYEN
\company Eurecom
\date 2020
\email: tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_SMF_HTTP2_SERVER_SEEN
#define FILE_SMF_HTTP2_SERVER_SEEN
......
......@@ -64,10 +64,8 @@ void mime_parser::get_mime_parts(std::vector<mime_part> &parts) const {
for (auto it : mime_parts) {
parts.push_back(it);
}
}
//---------------------------------------------------------------------------------------------
unsigned char* mime_parser::format_string_as_hex(const std::string &str) {
unsigned int str_len = str.length();
......@@ -101,6 +99,8 @@ void mime_parser::create_multipart_related_content(std::string &body,
const std::string &n1_message,
const std::string &n2_message) {
//TODO: provide Content-Ids as function parameters
//format string as hex
unsigned char *n1_msg_hex = format_string_as_hex(n1_message);
unsigned char *n2_msg_hex = format_string_as_hex(n2_message);
......@@ -131,6 +131,7 @@ void mime_parser::create_multipart_related_content(
std::string &body, const std::string &json_part, const std::string boundary,
const std::string &message, const multipart_related_content_part_e content_type) {
//TODO: provide Content-Id as function parameters
//format string as hex
unsigned char *msg_hex = format_string_as_hex(message);
......
......@@ -186,10 +186,10 @@ int nas_message_encode(unsigned char *buffer, const nas_message_t *const msg,
if (bytes < 0) {
return bytes;
}
// if (size > 1) {
// return size + bytes;
// }
if (size > 1) {
return size + bytes;
}
return bytes;
}
......
......@@ -24,8 +24,8 @@ typedef struct asn_per_constraint_s {
} flags;
int range_bits; /* Full number of bits in the range */
int effective_bits; /* Effective bits */
long lower_bound; /* "lb" value */
long upper_bound; /* "ub" value */
long long lower_bound; /* "lb" value */
long long upper_bound; /* "ub" value */
} asn_per_constraint_t;
typedef struct asn_per_constraints_s {
asn_per_constraint_t value;
......
......@@ -46,6 +46,7 @@ itti_mw *itti_inst = nullptr;
async_shell_cmd *async_shell_cmd_inst = nullptr;
smf_app *smf_app_inst = nullptr;
smf_config smf_cfg;
SMFApiServer *smf_api_server_1 = nullptr;
void send_heartbeat_to_tasks(const uint32_t sequence);
......@@ -73,7 +74,9 @@ void my_app_signal_handler(int s)
if (itti_inst) delete itti_inst; itti_inst = nullptr;
std::cout << "ITTI memory done." << std::endl;
if (smf_app_inst) delete smf_app_inst; smf_app_inst = nullptr;
std::cout << "PGW APP memory done." << std::endl;
std::cout << "SMF APP memory done." << std::endl;
smf_api_server_1->shutdown();
if (smf_api_server_1) delete smf_api_server_1; smf_api_server_1 = nullptr;
std::cout << "Freeing Allocated memory done" << std::endl;
exit(0);
}
......@@ -124,13 +127,15 @@ int main(int argc, char **argv)
//SMF Pistache API server (HTTP1)
Pistache::Address addr(std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.sbi.addr4))) , Pistache::Port(smf_cfg.sbi.port));
SMFApiServer smfApiServer(addr, smf_app_inst);
smfApiServer.init(2);
std::thread smf_api_manager(&SMFApiServer::start, smfApiServer);
SMFApiServer *smf_api_server_1 = new SMFApiServer(addr, smf_app_inst);
smf_api_server_1->init(2);
smf_api_server_1->start();
//std::thread smf_api_manager(&SMFApiServer::start, smf_api_server_1);
//SMF NGHTTP API server (HTTP2)
smf_http2_server *smf_server = new smf_http2_server(conv::toString(smf_cfg.sbi.addr4), smf_cfg.sbi_http2_port, smf_app_inst);
std::thread smf_api(&smf_http2_server::start, smf_server);
smf_http2_server *smf_api_server_2 = new smf_http2_server(conv::toString(smf_cfg.sbi.addr4), smf_cfg.sbi_http2_port, smf_app_inst);
smf_api_server_2->start();
//std::thread smf_api(&smf_http2_server::start, smf_api_server_2);
FILE *fp = NULL;
std::string filename = fmt::format("/tmp/smf_{}.status", getpid());
......
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