Create virtualization folder; Create EdgePlatformApplicationEnablementAPI for...

Create virtualization folder; Create EdgePlatformApplicationEnablementAPI for MEC-10-2 v2.2.1; Remove useless folders

Merge request reports

Loading
+2 −0
Changes for ccsrc/Framework/include/params.hh: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -81,6 +81,8 @@ public: //! \publicsection
  static const std::string& server;                //! HTTP server address (e.g. www.etsi.org)
  static const std::string& port;                  //! HTTP server port. Default: 80
  static const std::string& use_ssl;               //! Set to 1 to use SSL to communicate with the HTTP server. Default: false
  static const std::string& mutual_auth;           //! Set to 1 to use mutual authentication. Default: false
  static const std::string& trusted_ca_list;       //! List of trusted CA certificates
  static const std::string& server_mode;           //! Does the test sytem acting as a server. Default: 0
  static const std::string& local_port;            //! Local listener port. Default: 80
  
+2 −0
Changes for ccsrc/Framework/src/params.cc: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -73,6 +73,8 @@ const std::string& params::interface_id = std::string("interface_id");
const std::string& params::server = std::string("server");
const std::string& params::port = std::string("port");
const std::string& params::use_ssl = std::string("use_ssl");
const std::string& params::mutual_auth = std::string("mutual_auth");
const std::string& params::trusted_ca_list = std::string("trusted_ca_list");
const std::string& params::server_mode = std::string("server_mode");
const std::string& params::local_port = std::string("local_port");

+9 −0
Changes for ccsrc/Protocols/Http/http_codec.cc: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ int http_codec::decode (const OCTETSTRING& data, LibItsHttp__TypesAndValues::Htt
    return -1;
  }
  loggers::get_instance().log_msg("http_codec::decode: message_id: ", message_id);

  // Extract parameters
  try {
    std::string str(static_cast<const char*>(message_id));
@@ -555,6 +556,14 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
        loggers::get_instance().log("http_codec::decode_body: str: '%s'", str.c_str());
        int len = std::stoi(str, nullptr, 16);//converter::get_instance().string_to_int(str);
        loggers::get_instance().log("http_codec::decode_body: Chunk len: %d", len);
        if (len > body.lengthof()) { // Missing data :(
          loggers::get_instance().warning("http_codec::decode_body: Missing data and chunked mode");
          _params->insert(std::pair<std::string, std::string>("missing_data", "1"));
          _params->log();
          OCTETSTRING raw_trunk(len, idx + static_cast<const unsigned char*>(body));
          loggers::get_instance().log_msg("http_codec::decode_body: raw_trunk: ", raw_trunk);
          return -1;
        }
        while (counter < body.lengthof() && ((body[counter].get_octet() == '\r') || (body[counter].get_octet() == '\n'))) { // Skip additional \n
          counter += 1;
        } // End of 'while' statement
+28 −3
Changes for ccsrc/Protocols/Http/http_layer.cc: 28 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ using namespace std; // Required for isnan()
#include "LibItsHttp_TypesAndValues.hh"
#include "LibItsHttp_TestSystem.hh"

http_layer::http_layer(const std::string & p_type, const std::string & param) : t_layer<LibItsHttp__TestSystem::HttpPort>(p_type), _params(), _device_mode{false}
http_layer::http_layer(const std::string & p_type, const std::string & param) : t_layer<LibItsHttp__TestSystem::HttpPort>(p_type), _params(), _device_mode{false}, _stream_buffer(0, NULL)
{
  loggers::get_instance().log(">>> http_layer::http_layer: %s, %s", to_string().c_str(), param.c_str());
  // Setup parameters
@@ -83,13 +83,38 @@ void http_layer::send_data(OCTETSTRING& data, params& params) {
void http_layer::receive_data(OCTETSTRING& data, params& params)
{
  loggers::get_instance().log_msg(">>> http_layer::receive_data: ", data);
  loggers::get_instance().log_msg(">>> http_layer::receive_data: _stream_buffer= ", _stream_buffer);

  // Decode HTTP message
  LibItsHttp__TypesAndValues::HttpMessage http_message;
  if (_codec.decode(data, http_message) == -1) {
    loggers::get_instance().warning("http_layer::receive_data: Failed to decode data");
  if (!_stream_buffer.is_bound() || (_stream_buffer.lengthof() == 0)) {
    if (data.lengthof() < 6) { // 'HTTP/' or 'GET /'
      loggers::get_instance().warning("http_layer::receive_data: Inconsistant buffer length");
      return;
    }
    if (_codec.decode(data, http_message, &params) == -1) {
      loggers::get_instance().warning("http_layer::receive_data (0): Failed to decode data");
      return;
    }
  } else { // First chunk is received
    loggers::get_instance().warning("http_layer::receive_data: #######################################");
    _stream_buffer += data;
    if (_codec.decode(_stream_buffer, http_message, &params) == -1) {
      loggers::get_instance().warning("http_layer::receive_data (1): Failed to decode data");
      return;
    }
  }
  params::const_iterator it = params.find("missing_data");
  if (it != params.cend()) { // Transport layer didn't reassemble chunks, keep current state and wait for the next chunk
    // Store data and wait for the next stream
    loggers::get_instance().warning("http_layer::receive_data: Missing data, save current stream");
    _stream_buffer += data;
    return; // Terminate here
  } else {
    // Reset stream buffer and continue
    loggers::get_instance().log("http_layer::receive_data: Reset stream buffer");
    _stream_buffer.clean_up();
  }
  if (_device_mode) {
    OCTETSTRING os;
    if (http_message.ischosen(LibItsHttp__TypesAndValues::HttpMessage::ALT_response)) {
+1 −0
Changes for ccsrc/Protocols/Http/http_layer.hh: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ class http_layer : public t_layer<LibItsHttp__TestSystem::HttpPort> {
  params _params;
  http_codec _codec;
  bool _device_mode;
  OCTETSTRING _stream_buffer; 

public: //! \publicsection
  /*!
Loading
Loading