Commit 099086e8 authored by Yann Garcia's avatar Yann Garcia
Browse files

Add skeletons for missing protocol ports and layers; Add skeletons for...

Add skeletons for missing protocol ports and layers; Add skeletons for UpperTesterPort & AdapterConfigPort
parent 770659f9
Loading
Loading
Loading
Loading
+27 −27
Original line number Diff line number Diff line
#include "LibIot__TestInterface.hh"
#include "LibUpperTester.hh"
// #include "LibIot__TestInterface.hh"
// #include "LibUpperTester.hh"

#include "upper_tester_layer_factory.hh"
// #include "upper_tester_layer_factory.hh"

#include "loggers.hh"
// #include "loggers.hh"

#include "converter.hh"
// #include "converter.hh"

upper_tester_layer::upper_tester_layer(const std::string & p_type, const std::string & p_param) : t_layer<LibDiameter__Interface::DiameterPort>(p_type), _params(), _codec_request(), _codec_response(), _codec_register(), _codec_invite(), _codec_ack(), _codec_subscribe(), _codec_message(), _codec_options(), _codec_cancel(), _codec_notify(), _codec_info(), _codec_bye() {
  loggers::get_instance().log(">>> upper_tester_layer::upper_tester_layer: %s, %s", to_string().c_str(), p_param.c_str());
  // Setup parameters
  params::convert(_params, p_param);
}
// upper_tester_layer::upper_tester_layer(const std::string & p_type, const std::string & p_param) : t_layer<LibDiameter__Interface::DiameterPort>(p_type), _params(), _codec_request(), _codec_response(), _codec_register(), _codec_invite(), _codec_ack(), _codec_subscribe(), _codec_message(), _codec_options(), _codec_cancel(), _codec_notify(), _codec_info(), _codec_bye() {
//   loggers::get_instance().log(">>> upper_tester_layer::upper_tester_layer: %s, %s", to_string().c_str(), p_param.c_str());
//   // Setup parameters
//   params::convert(_params, p_param);
// }

void upper_tester_layer::sendMsg(const LibDiameter__TypesAndValues::DIAMETER__MSG& p_diameter_message, params& p_param) {
  loggers::get_instance().log_msg(">>> upper_tester_layer::sendMsg: ", p_diameter_message);
// void upper_tester_layer::sendMsg(const LibDiameter__TypesAndValues::DIAMETER__MSG& p_diameter_message, params& p_param) {
//   loggers::get_instance().log_msg(">>> upper_tester_layer::sendMsg: ", p_diameter_message);

  // Encode DiameterMessage
  OCTETSTRING data;
  _codec_register.encode(p_diameter_message, data);
  send_data(data, _params);
}
//   // Encode DiameterMessage
//   OCTETSTRING data;
//   _codec_register.encode(p_diameter_message, data);
//   send_data(data, _params);
// }

void upper_tester_layer::send_data(OCTETSTRING& data, params& p_params) {
  loggers::get_instance().log_msg(">>> upper_tester_layer::send_data: ", data);
// void upper_tester_layer::send_data(OCTETSTRING& data, params& p_params) {
//   loggers::get_instance().log_msg(">>> upper_tester_layer::send_data: ", data);

  send_to_all_layers(data, p_params);
}
//   send_to_all_layers(data, p_params);
// }

void upper_tester_layer::receive_data(OCTETSTRING& data, params& p_params)
{
  loggers::get_instance().log_msg(">>> upper_tester_layer::receive_data: ", data);
// void upper_tester_layer::receive_data(OCTETSTRING& data, params& p_params)
// {
//   loggers::get_instance().log_msg(">>> upper_tester_layer::receive_data: ", data);

  // Decode Diameter message
}
//   // Decode Diameter message
// }

upper_tester_layer_factory upper_tester_layer_factory::_f;
// upper_tester_layer_factory upper_tester_layer_factory::_f;
+63 −63
Original line number Diff line number Diff line
/*!
 * \file      upper_tester_layer.hh
 * \brief     Header file for ITS HTTP protocol layer.
 * \author    ETSI STF549
 * \copyright ETSI Copyright Notification
 *            No part may be reproduced except as authorized by written permission.
 *            The copyright and the foregoing restriction extend to reproduction in all media.
 *            All rights reserved.
 * \version   0.1
 */
#pragma once
// /*!
//  * \file      upper_tester_layer.hh
//  * \brief     Header file for ITS HTTP protocol layer.
//  * \author    ETSI STF549
//  * \copyright ETSI Copyright Notification
//  *            No part may be reproduced except as authorized by written permission.
//  *            The copyright and the foregoing restriction extend to reproduction in all media.
//  *            All rights reserved.
//  * \version   0.1
//  */
// #pragma once

#include <memory>
// #include <memory>

#include "t_layer.hh"
// #include "t_layer.hh"

namespace LibIot__TestInterface {
  class EquipmentAccessPort; //! Forward declaration of TITAN class
}
// namespace LibIot__TestInterface {
//   class EquipmentAccessPort; //! Forward declaration of TITAN class
// }

namespace LibUpperTester {
  class EquipmentOperationReq; //! Forward declaration of TITAN class
}
// namespace LibUpperTester {
//   class EquipmentOperationReq; //! Forward declaration of TITAN class
// }

class OCTETSTRING; //! Forward declaration of TITAN class
// class OCTETSTRING; //! Forward declaration of TITAN class

/*!
 * \class upper_tester_layer
 * \brief  This class provides a factory class to create an upper_tester_layer class instance
 */
class upper_tester_layer : public t_layer<LibIot__TestInterface::EquipmentAccessPort> {
  params _params;
// /*!
//  * \class upper_tester_layer
//  * \brief  This class provides a factory class to create an upper_tester_layer class instance
//  */
// class upper_tester_layer : public t_layer<LibIot__TestInterface::EquipmentAccessPort> {
//   params _params;

public: //! \publicsection
  /*!
   * \brief Specialised constructor
   *        Create a new instance of the upper_tester_layer class
   * \param[in] p_type \todo
   * \param[in] p_param \todo
   */
  upper_tester_layer() : t_layer<LibIot__TestInterface::EquipmentAccessPort>(), _params() {};
  /*!
   * \brief Specialised constructor
   *        Create a new instance of the upper_tester_layer class
   * \param[in] p_type \todo
   * \param[in] p_param \todo
   */
  upper_tester_layer(const std::string& p_type, const std::string& p_param);
  /*!
   * \brief Default destructor
   */
  virtual ~upper_tester_layer() { };
// public: //! \publicsection
//   /*!
//    * \brief Specialised constructor
//    *        Create a new instance of the upper_tester_layer class
//    * \param[in] p_type \todo
//    * \param[in] p_param \todo
//    */
//   upper_tester_layer() : t_layer<LibIot__TestInterface::EquipmentAccessPort>(), _params() {};
//   /*!
//    * \brief Specialised constructor
//    *        Create a new instance of the upper_tester_layer class
//    * \param[in] p_type \todo
//    * \param[in] p_param \todo
//    */
//   upper_tester_layer(const std::string& p_type, const std::string& p_param);
//   /*!
//    * \brief Default destructor
//    */
//   virtual ~upper_tester_layer() { };

  void sendMsg(const LibUpperTester::EquipmentOperationReq& p_diameter_message, params& p_param);
//   void sendMsg(const LibUpperTester::EquipmentOperationReq& p_diameter_message, params& p_param);

  /*!
   * \virtual
   * \fn void send_data(OCTETSTRING& data, params& p_params);
   * \brief Send bytes formated data to the lower layers
   * \param[in] p_data The data to be sent
   * \param[in] p_params Some parameters to overwrite default value of the lower layers parameters
   */
  virtual void send_data(OCTETSTRING& data, params& p_params);
  /*!
   * \virtual
   * \fn void receive_data(OCTETSTRING& data, params& p_params);
   * \brief Receive bytes formated data from the lower layers
   * \param[in] p_data The bytes formated data received
   * \param[in] p_params Some lower layers parameters values when data was received
   */
  virtual void receive_data(OCTETSTRING& data, params& info);
}; // End of class upper_tester_layer
//   /*!
//    * \virtual
//    * \fn void send_data(OCTETSTRING& data, params& p_params);
//    * \brief Send bytes formated data to the lower layers
//    * \param[in] p_data The data to be sent
//    * \param[in] p_params Some parameters to overwrite default value of the lower layers parameters
//    */
//   virtual void send_data(OCTETSTRING& data, params& p_params);
//   /*!
//    * \virtual
//    * \fn void receive_data(OCTETSTRING& data, params& p_params);
//    * \brief Receive bytes formated data from the lower layers
//    * \param[in] p_data The bytes formated data received
//    * \param[in] p_params Some lower layers parameters values when data was received
//    */
//   virtual void receive_data(OCTETSTRING& data, params& info);
// }; // End of class upper_tester_layer
+41 −41
Original line number Diff line number Diff line
/*!
 * \file      upper_tester_layer_factory.hh
 * \brief     Header file for INT LibIot protocol layer factory.
 * \author    ETSI TTF T010
 * \copyright ETSI Copyright Notification
 *            No part may be reproduced except as authorized by written permission.
 *            The copyright and the foregoing restriction extend to reproduction in all media.
 *            All rights reserved.
 * \version   0.1
 */
#pragma once
// /*!
//  * \file      upper_tester_layer_factory.hh
//  * \brief     Header file for INT LibIot protocol layer factory.
//  * \author    ETSI TTF T010
//  * \copyright ETSI Copyright Notification
//  *            No part may be reproduced except as authorized by written permission.
//  *            The copyright and the foregoing restriction extend to reproduction in all media.
//  *            All rights reserved.
//  * \version   0.1
//  */
// #pragma once

#include "layer_stack_builder.hh"
// #include "layer_stack_builder.hh"

#include "upper_tester_layer.hh"
// #include "upper_tester_layer.hh"

/*!
 * \class upper_tester_layer_factory
 * \brief  This class provides a factory class to create an upper_tester_layer class instance
 */
class upper_tester_layer_factory : public layer_factory {
  static upper_tester_layer_factory _f; //! Reference to the unique instance of this class
public: //! \publicsection
  /*!
   * \brief Default constructor
   *        Create a new instance of the udp_layer_factory class
   * \remark The HTTP layer identifier is HTTP
   */
  upper_tester_layer_factory() {
    // Register factory
    layer_stack_builder::register_layer_factory("UT", this);
  };
  /*!
   * \fn layer* create_layer(const std::string & type, const std::string & param);
   * \brief  Create the layers stack based on the provided layers stack description
   * \param[in] p_type The provided layers stack description
   * \param[in] p_params Optional parameters
   * \return 0 on success, -1 otherwise
   * \inline
   */
  inline virtual layer* create_layer(const std::string& p_type, const std::string& p_param){
    return new upper_tester_layer(p_type, p_param);
  };
}; // End of class upper_tester_layer_factory
// /*!
//  * \class upper_tester_layer_factory
//  * \brief  This class provides a factory class to create an upper_tester_layer class instance
//  */
// class upper_tester_layer_factory : public layer_factory {
//   static upper_tester_layer_factory _f; //! Reference to the unique instance of this class
// public: //! \publicsection
//   /*!
//    * \brief Default constructor
//    *        Create a new instance of the udp_layer_factory class
//    * \remark The HTTP layer identifier is HTTP
//    */
//   upper_tester_layer_factory() {
//     // Register factory
//     layer_stack_builder::register_layer_factory("UT", this);
//   };
//   /*!
//    * \fn layer* create_layer(const std::string & type, const std::string & param);
//    * \brief  Create the layers stack based on the provided layers stack description
//    * \param[in] p_type The provided layers stack description
//    * \param[in] p_params Optional parameters
//    * \return 0 on success, -1 otherwise
//    * \inline
//    */
//   inline virtual layer* create_layer(const std::string& p_type, const std::string& p_param){
//     return new upper_tester_layer(p_type, p_param);
//   };
// }; // End of class upper_tester_layer_factory
+2 −3
Original line number Diff line number Diff line
suite := AtsImsIot_Emergency
suite := AtsImsIot

sources := \
            AtsImsIot_TypesAndValues.ttcn \
@@ -61,10 +61,9 @@ modules := ../LibCommon \
            ../../ccsrc/Ports/Data \
            ../../ccsrc/Ports/Sgi \
            ../../ccsrc/Ports/LibIot \
            ../../ccsrc/EncDec/LibSip \
            ../../ccsrc/Protocols/Diameter \
            ../../ccsrc/Protocols/LowerLayerPPort \
            ../../ccsrc/Protocols/Sip \
            ../../ccsrc/Protocols/Naptr \
            ../../ccsrc/Protocols/UpperTester \
            ../../ccsrc/EncDec/LibSip \
            ../modules/titan.TestPorts.Common_Components.Abstract_Socket \