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

Merge develop into FQDN to have fqdn profile

parents 8257dc81 d01bad06
......@@ -31,6 +31,7 @@ source $THIS_SCRIPT_PATH/build_helper
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_fb_folly_from_source(){
echo "Starting to install folly"
if [ $1 -eq 0 ]; then
OPTION=""
read -p "Do you want to install FaceBook folly (github)? <y/N> " prompt
......@@ -142,6 +143,6 @@ install_fb_folly_from_source(){
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
echo_success "End of folly installation"
echo_success "folly installation complete"
return 0
}
......@@ -75,6 +75,7 @@ install_boost_1_66() {
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_fmt() {
echo "Starting to install fmt"
if [ $1 -eq 0 ]; then
read -p "Do you want to install open-source formatting library for C++ ? <y/N> " prompt
OPTION=""
......@@ -103,6 +104,7 @@ install_fmt() {
cd /tmp
rm -rf /tmp/fmt*
fi
echo "fmt installation complete"
return 0
}
......@@ -110,6 +112,7 @@ install_fmt() {
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_spdlog_from_git() {
echo "Starting to install spdlog"
if [ $1 -eq 0 ]; then
read -p "Do you want to install spdlog ? <y/N> " prompt
OPTION=""
......@@ -142,6 +145,7 @@ install_spdlog_from_git() {
sed -i '/#define SPDLOG_ENABLE_SYSLOG/s/^\/\///g' include/spdlog/tweakme.h
popd
fi
echo "spdlog installation complete"
return 0
}
......@@ -149,6 +153,7 @@ install_spdlog_from_git() {
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_pistache_from_git() {
echo "Starting to install pistache"
if [ $1 -eq 0 ]; then
read -p "Do you want to install Pistache ? <y/N> " prompt
OPTION="-y"
......@@ -191,6 +196,7 @@ install_pistache_from_git() {
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
echo "pistache installation complete"
return 0
}
......@@ -198,6 +204,7 @@ install_pistache_from_git() {
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_nlohmann_from_git() {
echo "Starting to install Nlohmann Json"
if [ $1 -eq 0 ]; then
read -p "Do you want to install Nlohmann Json ? <y/N> " prompt
OPTION=""
......@@ -236,6 +243,7 @@ install_nlohmann_from_git() {
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
echo "Nlohmann Json installation complete"
return 0
}
......@@ -243,6 +251,7 @@ install_nlohmann_from_git() {
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_nghttp2_from_git() {
echo "Starting to install nghttp2"
if [ $1 -eq 0 ]; then
read -p "Do you want to install nghttp2 ? <y/N> " prompt
OPTION=""
......@@ -324,6 +333,7 @@ install_nghttp2_from_git() {
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
echo "nghttp2 installation complete"
return 0
}
......@@ -461,6 +471,7 @@ check_install_smf_deps() {
echo "Install distro libs"
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret
echo "distro libs installation complete"
# Use fmt lib included in spdlog
#install_fmt $1
......@@ -581,6 +592,7 @@ check_install_smf_min_deps() {
echo "Install networking tools"
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret
echo "networking tools installation complete"
return 0
}
......
......@@ -68,6 +68,7 @@ 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 /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.65.1 /usr/lib/x86_64-linux-gnu/
COPY --from=oai-smf-builder /openair-smf/build/smf/build/nas/libNAS.so /usr/local/lib/
RUN ldconfig
......
......@@ -479,8 +479,6 @@ class HtmlReport():
section_end_pattern = 'build_smf --clean --Verbose --build-type Release --jobs'
section_status = False
package_install = False
fmt_build_start = False
fmt_build_status = False
folly_build_start = False
folly_build_status = False
spdlog_build_start = False
......@@ -489,6 +487,8 @@ class HtmlReport():
pistache_build_status = False
json_build_start = False
json_build_status = False
nghttp2_build_start = False
nghttp2_build_status = False
base_image = False
with open(cwd + '/archives/' + logFileName, 'r') as logfile:
for line in logfile:
......@@ -505,35 +505,39 @@ class HtmlReport():
result = re.search('SMF deps installation successful', line)
if result is not None:
status = True
result = re.search('Install fmt from source', line)
result = re.search('distro libs installation complete', line)
if result is not None:
package_install = True
fmt_build_start = True
result = re.search('Installing: /usr/local/lib/pkgconfig/fmt.pc', line)
if result is not None:
fmt_build_status = True
result = re.search('Cloning into \'folly\'', line)
result = re.search('Starting to install folly', line)
if result is not None:
folly_build_start = True
result = re.search('Installing: /usr/local/lib/libfollybenchmark.a', line)
if result is not None:
result = re.search('folly installation complete', line)
if result is not None and folly_build_start:
folly_build_status = True
result = re.search('Install spdlog from', line)
result = re.search('Starting to install spdlog', line)
if result is not None:
spdlog_build_start = True
result = re.search('Install Pistache from', line)
if result is not None:
result = re.search('spdlog installation complete', line)
if result is not None and spdlog_build_start:
spdlog_build_status = True
pistache_build_start = True
result = re.search('Installing: /usr/local/lib/libpistache.a', line)
result = re.search('Starting to install pistache', line)
if result is not None:
pistache_build_start = True
result = re.search('pistache installation complete', line)
if result is not None and pistache_build_start:
pistache_build_status = True
result = re.search('Install Nlohmann Json', line)
result = re.search('Starting to install Nlohmann Json', line)
if result is not None:
json_build_start = True
result = re.search('Nlohmann Json installation complete', line)
if result is not None and json_build_start:
json_build_status = True
result = re.search('Installing: /usr/local/lib/cmake/nlohmann_json/nlohmann_jsonTargets.cmake', line)
result = re.search('Starting to install nghttp2', line)
if result is not None:
json_build_status = True
nghttp2_build_start = True
result = re.search('nghttp2 installation complete', line)
if result is not None and nghttp2_build_start:
nghttp2_build_status = True
logfile.close()
if base_image:
cell_msg = ' <td bgcolor="LimeGreen"><pre style="border:none; background-color:LimeGreen"><b>'
......@@ -552,23 +556,17 @@ class HtmlReport():
else:
cell_msg += ' ** Packages Installation: KO\n'
if base_image:
cell_msg += ' ** fmt Installation: N/A\n'
elif fmt_build_status:
cell_msg += ' ** fmt Installation: OK\n'
cell_msg += ' ** spdlog Installation: N/A\n'
elif spdlog_build_status:
cell_msg += ' ** spdlog Installation: OK\n'
else:
cell_msg += ' ** fmt Installation: KO\n'
cell_msg += ' ** spdlog Installation: KO\n'
if base_image:
cell_msg += ' ** folly Installation: N/A\n'
elif folly_build_status:
cell_msg += ' ** folly Installation: OK\n'
else:
cell_msg += ' ** folly Installation: KO\n'
if base_image:
cell_msg += ' ** spdlog Installation: N/A\n'
elif spdlog_build_status:
cell_msg += ' ** spdlog Installation: OK\n'
else:
cell_msg += ' ** spdlog Installation: KO\n'
if base_image:
cell_msg += ' ** pistache Installation: N/A\n'
elif pistache_build_status:
......@@ -581,6 +579,12 @@ class HtmlReport():
cell_msg += ' ** Nlohmann Json Installation: OK\n'
else:
cell_msg += ' ** Nlohmann Json Installation: KO\n'
if base_image:
cell_msg += ' ** nghttp2 Installation: N/A\n'
elif nghttp2_build_status:
cell_msg += ' ** nghttp2 Installation: OK\n'
else:
cell_msg += ' ** nghttp2 Installation: KO\n'
cell_msg += '</b></pre></td>\n'
else:
cell_msg = ' <td bgcolor="Tomato"><pre style="border:none; background-color:Tomato"><b>'
......
......@@ -93,6 +93,7 @@ COPY --from=oai-smf-builder /usr/lib64/libdouble-conversion.so.1 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libconfig++.so.9 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libboost_system.so.1.66.0 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libboost_thread.so.1.66.0 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libboost_chrono.so.1.66.0 /usr/lib64/
COPY --from=oai-smf-builder /usr/local/lib/libnghttp2_asio.so.1 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libasan.so.5 /usr/lib64/
COPY --from=oai-smf-builder /openair-smf/build/smf/build/nas/libNAS.so /usr/lib64/
......
......@@ -82,10 +82,10 @@ COPY --from=oai-smf-builder /openair-smf/build/smf/build/smf oai_smf
COPY --from=oai-smf-builder /openair-smf/scripts/entrypoint.sh entrypoint.sh
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 /usr/lib/libboost_system.so.1.67.0 /usr/local/lib/
COPY --from=oai-smf-builder /usr/lib/libboost_thread.so.1.67.0 /usr/local/lib/
COPY --from=oai-smf-builder /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.67.0 /usr/lib/x86_64-linux-gnu/
COPY --from=oai-smf-builder /openair-smf/build/smf/build/nas/libNAS.so /usr/local/lib/
RUN ldconfig
......
......@@ -143,7 +143,6 @@ void IndividualSMContextApiImpl::update_sm_context(
Logger::smf_api_server().debug("Got result for promise ID %d", promise_id);
nlohmann::json json_data = {};
mime_parser parser = {};
std::string body = {};
std::string json_format;
......@@ -153,7 +152,7 @@ void IndividualSMContextApiImpl::update_sm_context(
if (sm_context_response.n1_sm_msg_is_set() and
sm_context_response.n2_sm_info_is_set()) {
parser.create_multipart_related_content(
mime_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(), json_format);
......@@ -161,7 +160,7 @@ void IndividualSMContextApiImpl::update_sm_context(
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(
mime_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, json_format);
......@@ -169,7 +168,7 @@ void IndividualSMContextApiImpl::update_sm_context(
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(
mime_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, json_format);
......
......@@ -41,6 +41,12 @@
#include "smf_config.hpp"
#include "3gpp_conversions.hpp"
#include "mime_parser.hpp"
#include <boost/thread.hpp>
#include <boost/thread/future.hpp>
#include <boost/chrono.hpp>
#include <boost/chrono/chrono.hpp>
#include <boost/chrono/duration.hpp>
#include <boost/chrono/system_clocks.hpp>
extern smf::smf_config smf_cfg;
......@@ -98,40 +104,51 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
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 = {};
mime_parser parser = {};
std::string json_format = {};
std::string body = {};
sm_context_response.get_json_data(json_data);
sm_context_response.get_json_format(json_format);
if (sm_context_response.n1_sm_msg_is_set()) { // add N1 container if
// available
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, json_format);
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY)));
} else if (!json_data.empty()) { // if not, include json data if available
response.headers().add<Pistache::Http::Header::Location>(
sm_context_response.get_smf_context_uri()); // Location header
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(json_format));
body = json_data.dump().c_str();
} else { // otherwise, send reply without content
response.send(Pistache::Http::Code(sm_context_response.get_http_code()));
return;
boost::future_status status;
// wait for timeout or ready
status = f.wait_for(boost::chrono::milliseconds(FUTURE_STATUS_TIMEOUT_MS));
if (status == boost::future_status::ready) {
assert(f.is_ready());
assert(f.has_value());
assert(!f.has_exception());
// 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 = {};
std::string json_format = {};
std::string body = {};
sm_context_response.get_json_data(json_data);
sm_context_response.get_json_format(json_format);
if (sm_context_response.n1_sm_msg_is_set()) { // add N1 container if
// available
mime_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, json_format);
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" +
std::string(CURL_MIME_BOUNDARY)));
} else if (!json_data.empty()) { // if not, include json data if available
response.headers().add<Pistache::Http::Header::Location>(
sm_context_response.get_smf_context_uri()); // Location header
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(json_format));
body = json_data.dump().c_str();
} else { // otherwise, send reply without content
response.send(Pistache::Http::Code(sm_context_response.get_http_code()));
return;
}
response.send(
Pistache::Http::Code(sm_context_response.get_http_code()), body);
} else {
response.send(Pistache::Http::Code::Request_Timeout);
}
response.send(
Pistache::Http::Code(sm_context_response.get_http_code()), body);
}
} // namespace api
} // namespace smf_server
......
......@@ -420,7 +420,6 @@ void smf_http2_server::update_sm_context_handler(
Logger::smf_api_server().debug("Got result for promise ID %d", promise_id);
nlohmann::json json_data = {};
mime_parser parser = {};
std::string body = {};
header_map h = {};
std::string json_format = {};
......@@ -431,7 +430,7 @@ void smf_http2_server::update_sm_context_handler(
if (sm_context_response.n1_sm_msg_is_set() and
sm_context_response.n2_sm_info_is_set()) {
parser.create_multipart_related_content(
mime_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(), json_format);
......@@ -439,7 +438,7 @@ void smf_http2_server::update_sm_context_handler(
"content-type", header_value{"multipart/related; boundary=" +
std::string(CURL_MIME_BOUNDARY)});
} else if (sm_context_response.n1_sm_msg_is_set()) {
parser.create_multipart_related_content(
mime_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, json_format);
......@@ -447,7 +446,7 @@ void smf_http2_server::update_sm_context_handler(
"content-type", header_value{"multipart/related; boundary=" +
std::string(CURL_MIME_BOUNDARY)});
} else if (sm_context_response.n2_sm_info_is_set()) {
parser.create_multipart_related_content(
mime_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, json_format);
......
......@@ -194,18 +194,20 @@ typedef struct qos_profile_s {
#define NNRF_NFM_BASE "/nnrf-nfm/"
#define NNRF_NF_REGISTER_URL "/nf-instances/"
#define NNRF_NF_STATUS_SUBSCRIBE_URL "/subscriptions"
#define NRF_CURL_TIMEOUT_MS 100L
// for CURL
#define AMF_CURL_TIMEOUT_MS 100L
#define NF_CURL_TIMEOUT_MS 100L
#define MAX_WAIT_MSECS 10000 // 1 second
#define AMF_NUMBER_RETRIES 3
#define UDM_CURL_TIMEOUT_MS 100L
#define UDM_NUMBER_RETRIES 3
constexpr auto CURL_MIME_BOUNDARY = "----Boundary";
// for N1N2
#define BUF_LEN 512
// FOR FUTURE PROMISE
#define FUTURE_STATUS_TIMEOUT_MS 100
// for PFCP
constexpr uint64_t SECONDS_SINCE_FIRST_EPOCH = 2208988800;
// 8.22 Fully Qualified TEID (F-TEID) - 3GPP TS 29.274 V16.0.0
......
......@@ -163,7 +163,8 @@ int balloc(bstring b, int olen) {
#if defined(BSTRLIB_TEST_CANARY)
if (len > b->slen + 1) {
memchr(b->data + b->slen + 1, 'X', len - (b->slen + 1));
if ((memchr(b->data + b->slen + 1, 'X', len - (b->slen + 1))) == NULL)
return BSTR_ERR;
}
#endif
}
......@@ -217,7 +218,8 @@ bstring bfromcstr(const char* str) {
b = (bstring) bstr__alloc(sizeof(struct tagbstring));
if (NULL == b) return NULL;
b->slen = (int) j;
if (NULL == (b->data = (unsigned char*) bstr__alloc(b->mlen = i))) {
b->data = (unsigned char*) bstr__alloc(b->mlen = i);
if (b->data == NULL) {
bstr__free(b);
return NULL;
}
......@@ -1587,7 +1589,8 @@ int binsertblk(
/* Aliasing case */
if (((size_t)((unsigned char*) blk + len)) >= ((size_t) b->data) &&
((size_t) blk) < ((size_t)(b->data + b->mlen))) {
if (NULL == (aux = (unsigned char*) bstr__alloc(len))) return BSTR_ERR;
aux = (unsigned char*) bstr__alloc(len);
if (aux == NULL) return BSTR_ERR;
bstr__memcpy(aux, blk, len);
}
......@@ -2475,8 +2478,10 @@ bstring bjoinblk(const struct bstrList* bl, const void* blk, int len) {
* NULL is returned, otherwise a bstring with the correct result is returned.
*/
bstring bjoin(const struct bstrList* bl, const_bstring sep) {
if (sep == NULL) return NULL;
if (sep != NULL && (sep->slen < 0 || sep->data == NULL)) return NULL;
if (sep == NULL)
return NULL;
else if (sep->slen < 0 || sep->data == NULL)
return NULL;
return bjoinblk(bl, sep->data, sep->slen);
}
......
......@@ -113,7 +113,8 @@ CBString::CBString(char c, int len) {
CBString::CBString(char c) {
mlen = 2;
slen = 1;
if (NULL == (data = (unsigned char*) bstr__alloc(mlen))) {
data = (unsigned char*) bstr__alloc(mlen);
if (data == NULL) {
mlen = slen = 0;
bstringThrow("Failure in (char) constructor");
} else {
......@@ -125,7 +126,8 @@ CBString::CBString(char c) {
CBString::CBString(unsigned char c) {
mlen = 2;
slen = 1;
if (NULL == (data = (unsigned char*) bstr__alloc(mlen))) {
data = (unsigned char*) bstr__alloc(mlen);
if (data == NULL) {
mlen = slen = 0;
bstringThrow("Failure in (char) constructor");
} else {
......@@ -141,7 +143,8 @@ CBString::CBString(const char* s) {
bstringThrow("Failure in (char *) constructor, string too large") slen =
(int) sslen;
mlen = slen + 1;
if (NULL != (data = (unsigned char*) bstr__alloc(mlen))) {
data = (unsigned char*) bstr__alloc(mlen);
if (data != NULL) {
bstr__memcpy(data, s, mlen);
return;
}
......@@ -158,7 +161,8 @@ CBString::CBString(int len, const char* s) {
(int) sslen;
mlen = slen + 1;
if (mlen < len) mlen = len;
if (NULL != (data = (unsigned char*) bstr__alloc(mlen))) {
data = (unsigned char*) bstr__alloc(mlen);
if (data != NULL) {
bstr__memcpy(data, s, slen + 1);
return;
}
......@@ -1519,7 +1523,6 @@ void CBStringList::splitstr(const CBString& b, const CBString& s) {
static int streamSplitCb(void* parm, int ofs, const_bstring entry) {
CBStringList* r = (CBStringList*) parm;
ofs = ofs;
r->push_back(CBString(*entry));
return 0;
}
......
......@@ -23,6 +23,10 @@
#include "logger.hpp"
#include "conversions.hpp"
extern "C" {
#include "dynamic_memory_check.h"
}
bool mime_parser::parse(const std::string& str) {
std::string CRLF = "\r\n";
Logger::smf_app().debug("Parsing the message with Simple Parser");
......@@ -127,6 +131,10 @@ void mime_parser::create_multipart_related_content(
body.append(CRLF);
body.append(std::string((char*) n2_msg_hex, n2_message.length() / 2) + CRLF);
body.append("--" + boundary + "--" + CRLF);
// free memory
free_wrapper((void**) &n1_msg_hex);
free_wrapper((void**) &n2_msg_hex);
}
//------------------------------------------------------------------------------
......@@ -158,4 +166,7 @@ void mime_parser::create_multipart_related_content(
body.append(CRLF);
body.append(std::string((char*) msg_hex, message.length() / 2) + CRLF);
body.append("--" + boundary + "--" + CRLF);
// free memory
free_wrapper((void**) &msg_hex);
}
......@@ -62,7 +62,7 @@ class mime_parser {
* @param [const std::string&] str: input string
* @return String represents string in hex format
*/
unsigned char* format_string_as_hex(const std::string& str);
static unsigned char* format_string_as_hex(const std::string& str);
/*
* Create HTTP body content for multipart/related message
......@@ -73,7 +73,7 @@ class mime_parser {
* @param [std::string] n2_message: N2 (NGAP) part
* @return void
*/
void create_multipart_related_content(
void static create_multipart_related_content(
std::string& body, const std::string& json_part,
const std::string boundary, const std::string& n1_message,
const std::string& n2_message,
......@@ -88,7 +88,7 @@ class mime_parser {
* @param [uint8_t] content_type: 1 for NAS content, else NGAP content
* @return void
*/
void create_multipart_related_content(
void static 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,
......
......@@ -58,7 +58,7 @@ int decode_authentication_response(
return decoded_result;
else {
decoded += decoded_result;
printf("decoded(%d)\n", decoded);
printf("decoded(%u)\n", decoded);
authentication_response->presence |=
AUTHENTICATION_RESPONSE_AUTNENTICATION_RESPONSE_PARAMETER_PRESENT;
}
......
......@@ -32,7 +32,7 @@ int decode_registration_request(
uint32_t len) {
uint32_t decoded = 0;
int decoded_result = 0;
printf("decode_registration_request len:%d\n", len);
printf("decode_registration_request len:%u\n", len);
if ((decoded_result = decode__5gs_registration_type(
&registration_request->_5gsregistrationtype, 0, buffer + decoded,
......
......@@ -1288,6 +1288,34 @@ int asn_INTEGER2ulong(const INTEGER_t* iptr, unsigned long* l) {
}