Commit c5ace61c authored by garciay's avatar garciay
Browse files

Add ITS HTTP support

parent 87c716f0
#include <asn1/asn_application.h>
#include "ASN1RecodePer.hh"
#include "asn1_recode_per.hh"
#include <TTCN3.hh>
......@@ -13,7 +13,7 @@ extern "C" {
}
}
int ASN1RecodePer::recode(const asn_TYPE_descriptor_s & td, int from, int to, TTCN_Buffer & buf)
int asn1_recode_per::recode(const asn_TYPE_descriptor_s & td, int from, int to, TTCN_Buffer & buf)
{
int rc = -1;
void * ptr = NULL;
......@@ -32,12 +32,12 @@ int ASN1RecodePer::recode(const asn_TYPE_descriptor_s & td, int from, int to, TT
return rc;
}
int ASN1RecodePer::ber2per(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
int asn1_recode_per::ber2per(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recode(td, (int)ATS_BER, (int)ATS_UNALIGNED_CANONICAL_PER, buf);
}
int ASN1RecodePer::per2ber(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
int asn1_recode_per::per2ber(const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf)
{
return recode(td, (int)ATS_UNALIGNED_BASIC_PER, (int)ATS_DER, buf);
}
......
......@@ -17,7 +17,7 @@ namespace LibItsCommon__Functions
*/
INTEGER fx__getCurrentTime(
) {
unsigned long long ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count() - 1072911600000L; // TODO Add a global method such as its_tme() & its_time_mod() beacuse it is used also in GeoNetworkingLayer
unsigned long long ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count() - 1072911600000L; // TODO Add a global method such as its_tme() & its_time_mod() beacuse it is used also in geonetworking_layer
/*unsigned long long its_ref_time = 1072911600000L;
struct timeval tv;
gettimeofday(&tv, NULL);
......
......@@ -2,7 +2,7 @@
#include "sha256.hh"
#include "sha384.hh"
#include "ec_keys.hh"
#include "security_ecc.hh"
#include "security_services.hh"
......@@ -67,7 +67,7 @@ namespace LibItsSecurity__Functions
hash.generate(tbs, hashData);
// Calculate the signature
std::vector<unsigned char> p_key(static_cast<const unsigned char *>(p__privateKey), static_cast<const unsigned char *>(p__privateKey) + p__privateKey.lengthof());
ec_keys k(ec_elliptic_curves::nist_p_256, p_key);
security_ecc k(ec_elliptic_curves::nist_p_256, p_key);
std::vector<unsigned char> r_sig;
std::vector<unsigned char> s_sig;
if (k.sign(hashData, r_sig, s_sig) == 0) {
......@@ -101,7 +101,7 @@ namespace LibItsSecurity__Functions
hash.generate(tbs, hashData);
// Calculate the signature
std::vector<unsigned char> p_key(static_cast<const unsigned char *>(p__privateKey), static_cast<const unsigned char *>(p__privateKey) + p__privateKey.lengthof());
ec_keys k(ec_elliptic_curves::brainpool_p_256_r1, p_key);
security_ecc k(ec_elliptic_curves::brainpool_p_256_r1, p_key);
std::vector<unsigned char> r_sig;
std::vector<unsigned char> s_sig;
if (k.sign(hashData, r_sig, s_sig) == 0) {
......@@ -135,7 +135,7 @@ namespace LibItsSecurity__Functions
hash.generate(tbs, hashData);
// Calculate the signature
std::vector<unsigned char> p_key(static_cast<const unsigned char *>(p__privateKey), static_cast<const unsigned char *>(p__privateKey) + p__privateKey.lengthof());
ec_keys k(ec_elliptic_curves::brainpool_p_384_r1, p_key);
security_ecc k(ec_elliptic_curves::brainpool_p_384_r1, p_key);
std::vector<unsigned char> r_sig;
std::vector<unsigned char> s_sig;
if (k.sign(hashData, r_sig, s_sig) == 0) {
......@@ -175,7 +175,7 @@ namespace LibItsSecurity__Functions
std::vector<unsigned char> signature(static_cast<const unsigned char *>(p__signature), static_cast<const unsigned char *>(p__signature) + p__signature.lengthof());
std::vector<unsigned char> pub_key_x(static_cast<const unsigned char *>(p__ecdsaNistp256PublicKeyX), static_cast<const unsigned char *>(p__ecdsaNistp256PublicKeyX) + p__ecdsaNistp256PublicKeyX.lengthof());
std::vector<unsigned char> pub_key_y(static_cast<const unsigned char *>(p__ecdsaNistp256PublicKeyY), static_cast<const unsigned char *>(p__ecdsaNistp256PublicKeyY) + p__ecdsaNistp256PublicKeyY.lengthof());
ec_keys k(ec_elliptic_curves::nist_p_256, pub_key_x, pub_key_y);
security_ecc k(ec_elliptic_curves::nist_p_256, pub_key_x, pub_key_y);
if (k.sign_verif(hashData, signature) == 0) {
return TRUE;
}
......@@ -208,7 +208,7 @@ namespace LibItsSecurity__Functions
std::vector<unsigned char> signature(static_cast<const unsigned char *>(p__signature), static_cast<const unsigned char *>(p__signature) + p__signature.lengthof());
std::vector<unsigned char> pub_key_x(static_cast<const unsigned char *>(p__ecdsaBrainpoolp256PublicKeyX), static_cast<const unsigned char *>(p__ecdsaBrainpoolp256PublicKeyX) + p__ecdsaBrainpoolp256PublicKeyX.lengthof());
std::vector<unsigned char> pub_key_y(static_cast<const unsigned char *>(p__ecdsaBrainpoolp256PublicKeyY), static_cast<const unsigned char *>(p__ecdsaBrainpoolp256PublicKeyY) + p__ecdsaBrainpoolp256PublicKeyY.lengthof());
ec_keys k(ec_elliptic_curves::brainpool_p_256_r1, pub_key_x, pub_key_y);
security_ecc k(ec_elliptic_curves::brainpool_p_256_r1, pub_key_x, pub_key_y);
if (k.sign_verif(hashData, signature) == 0) {
return TRUE;
}
......@@ -241,7 +241,7 @@ namespace LibItsSecurity__Functions
std::vector<unsigned char> signature(static_cast<const unsigned char *>(p__signature), static_cast<const unsigned char *>(p__signature) + p__signature.lengthof());
std::vector<unsigned char> pub_key_x(static_cast<const unsigned char *>(p__ecdsaBrainpoolp384PublicKeyX), static_cast<const unsigned char *>(p__ecdsaBrainpoolp384PublicKeyX) + p__ecdsaBrainpoolp384PublicKeyX.lengthof());
std::vector<unsigned char> pub_key_y(static_cast<const unsigned char *>(p__ecdsaBrainpoolp384PublicKeyY), static_cast<const unsigned char *>(p__ecdsaBrainpoolp384PublicKeyY) + p__ecdsaBrainpoolp384PublicKeyY.lengthof());
ec_keys k(ec_elliptic_curves::brainpool_p_384_r1, pub_key_x, pub_key_y);
security_ecc k(ec_elliptic_curves::brainpool_p_384_r1, pub_key_x, pub_key_y);
if (k.sign_verif(hashData, signature) == 0) {
return TRUE;
}
......@@ -255,7 +255,7 @@ namespace LibItsSecurity__Functions
loggers::get_instance().log_msg(">>> fx__encryptWithEciesNistp256WithSha256: ", p__peerPublicKeyX);
loggers::get_instance().log_msg(">>> fx__encryptWithEciesNistp256WithSha256: ", p__publicEncKeyY);
ec_keys ec(ec_elliptic_curves::nist_p_256);
security_ecc ec(ec_elliptic_curves::nist_p_256);
std::vector<unsigned char> peer_public_key_x(static_cast<const unsigned char *>(p__peerPublicKeyX), p__peerPublicKeyX.lengthof() + static_cast<const unsigned char *>(p__peerPublicKeyX));
std::vector<unsigned char> peer_public_key_y(static_cast<const unsigned char *>(p__publicEncKeyY), p__publicEncKeyY.lengthof() + static_cast<const unsigned char *>(p__publicEncKeyY));
int unused = 0;
......@@ -317,7 +317,7 @@ namespace LibItsSecurity__Functions
OCTETSTRING& p__publicKeyX,
OCTETSTRING& p__publicKeyY
) {
ec_keys k(ec_elliptic_curves::nist_p_256);
security_ecc k(ec_elliptic_curves::nist_p_256);
if (k.generate() != 0) {
p__privateKey = OCTETSTRING();
p__publicKeyX = OCTETSTRING();
......@@ -357,7 +357,7 @@ namespace LibItsSecurity__Functions
OCTETSTRING& p__publicKeyX,
OCTETSTRING& p__publicKeyY
) {
ec_keys k(ec_elliptic_curves::brainpool_p_256_r1);
security_ecc k(ec_elliptic_curves::brainpool_p_256_r1);
if (k.generate() != 0) {
p__privateKey = OCTETSTRING();
p__publicKeyX = OCTETSTRING();
......@@ -398,7 +398,7 @@ namespace LibItsSecurity__Functions
OCTETSTRING& p__publicKeyX,
OCTETSTRING& p__publicKeyY
) {
ec_keys k(ec_elliptic_curves::brainpool_p_384_r1);
security_ecc k(ec_elliptic_curves::brainpool_p_384_r1);
if (k.generate() != 0) {
p__privateKey = OCTETSTRING();
p__publicKeyX = OCTETSTRING();
......
......@@ -34,7 +34,7 @@ public: //! \publicsection
* \brief Default constructor
* \todo Remove logs
*/
Codec() : _params(nullptr) { };
explicit Codec() : _params(nullptr) { };
/*!
* \fn ~Codec();
* \brief Default destructor
......
......@@ -33,22 +33,22 @@ class Layer {
protected:
std::string type; //! Type description, it indicates the protocol type (e.g. CAM, DENM, GN, ETH, PCAP...)
public:
public: //! \publicsection
/*!
* \brief Default constructor
* Create a new instance of the Layer class
* \todo Remove logs
*/
Layer() : upperLayers(), lowerLayers(), type(std::string("")) { };
explicit Layer() : upperLayers(), lowerLayers(), type(std::string("")) { };
/*!
* \brief Specialized constructor
* Create a new instance of the Layer class with its type description
* \remark This constructor is called by the Layer factory
* \see LayerFactory
* \see layer_factory
* \todo Remove logs
*/
Layer(const std::string& p_type) : upperLayers(), lowerLayers(), type(std::string(p_type.begin(), p_type.end())) { };
explicit Layer(const std::string& p_type) : upperLayers(), lowerLayers(), type(std::string(p_type.begin(), p_type.end())) { };
/*!
* \brief Default destructor
......@@ -113,17 +113,6 @@ public: //! \publicsection
*/
virtual void receiveData(OCTETSTRING& p_data, Params& p_params) { }
/*!
* \virtual
* \fn OCTETSTRING trigger_ac_event(OCTETSTRING& data, Params& params);
* \brief TODO
* \param[in] p_data
* \param[in] p_params
* \todo Remove the logs
* \virtual
*/
//virtual OCTETSTRING trigger_ac_event(OCTETSTRING& p_data, Params& p_params) { return int2oct(0, 2); }
/*!
* \inline
* \fn const std::string& to_string();
......
......@@ -20,7 +20,7 @@
*/
class Params : public std::map<std::string, std::string> {
public: //! \publicsection
// TODO Use static constexpr (see CommsigniaLayer.hh)
// TODO Use static constexpr (see commsignia_layer.hh)
static const std::string& debug; //! Set to 1 to enable the debug mode
static const std::string& loopback;
......@@ -88,7 +88,7 @@ public: //! \publicsection
* Clone an existing instance of a Params object
* \param[in] p_params An existing instance of a Params object
*/
Params(const Params& p_params) : std::map<std::string, std::string>(p_params.begin(), p_params.end()) {};
explicit Params(const Params& p_params) : std::map<std::string, std::string>(p_params.begin(), p_params.end()) { };
/*!
* \brief Default destructor
......
......@@ -19,8 +19,8 @@ template <typename TPort> class TLayer : public Layer {
TPortList upperPorts;
public:
TLayer() : Layer(), upperPorts() { };
TLayer(const std::string& p_type) : Layer(p_type), upperPorts() { };
explicit TLayer() : Layer(), upperPorts() { };
explicit TLayer(const std::string& p_type) : Layer(p_type), upperPorts() { };
void addUpperPort(TPort * p_port) { upperPorts.push_back(p_port); };
void removeUpperPort(TPort*);
......
......@@ -21,11 +21,11 @@ class TTCN_Typedescriptor_t; //! Forward declaration of TITAN class
struct asn_TYPE_descriptor_s; //! Forward declaration of asn1c class
class ASN1RecodePer
class asn1_recode_per
{
protected:
int ber2per (const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf);
int per2ber (const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf);
int recode (const asn_TYPE_descriptor_s & td, int from, int to, TTCN_Buffer & buf);
}; // End of class ASN1RecodePer
}; // End of class asn1_recode_per
......@@ -18,17 +18,17 @@
#include "Layer.hh"
/*!
* \class Layerfactory
* \class layer_factory
* \brief This class provides a factory class to create Layer class instances
* \abstract
*/
class LayerFactory {
class layer_factory {
public: //! \publicsection
/*!
* \fn Codec();
* \brief Default constructor
*/
LayerFactory() {};
layer_factory() {};
/*!
* \fn Layer * create_layer(const std::string & type, const std::string & param);
* \brief Create the layers stack based on the provided layers stack description (cf. remark)
......@@ -110,5 +110,5 @@ NodeC.geoNetworkingPort.params := "GN(ll_address=70b3d5791b48,latitude=43551050,
* \pure
*/
virtual Layer* create_layer(const std::string & p_type, const std::string & p_params) = 0;
}; // End of class LayerFactory
}; // End of class layer_factory
/*!
* \file LayerStackBuilder.hh
* \file layer_stack_builder.hh
* \brief Header file for ITS protocol stack builder.
* \author ETSI STF525
* \copyright ETSI Copyright Notification
......@@ -10,50 +10,50 @@
*/
#pragma once
#include "LayerFactory.hh"
#include "layer_factory.hh"
/*!
* \class LayerStackBuilder
* \class layer_stack_builder
* \brief This class provides a factory class to create Layer class instances
*/
class LayerStackBuilder {
class layer_stack_builder {
private: //! \privatesection
typedef std::map<std::string, LayerFactory*> LayerFactoryMap;
typedef std::map<std::string, layer_factory*> LayerFactoryMap;
static LayerStackBuilder * _instance; //! Smart pointer to the unique instance of the logger framework
std::map<std::string, LayerFactory*> _layer_factories; //! The list of the registered \see TLayer factories
static layer_stack_builder * _instance; //! Smart pointer to the unique instance of the logger framework
std::map<std::string, layer_factory*> _layer_factories; //! The list of the registered \see TLayer factories
/*!
* \brief Default constructor
* Create a new instance of the LayerStackBuilder class
* Create a new instance of the layer_stack_builder class
* \private
*/
LayerStackBuilder(); // can not be created manually
layer_stack_builder(); // can not be created manually
public: //! \publicsection
/*!
* \fn LayerStackBuilder* get_instance();
* \fn layer_stack_builder* get_instance();
* \brief Accessor for the unique instance of the logger framework
* \static
*/
static LayerStackBuilder* get_instance();
static layer_stack_builder* get_instance();
/*!
* \fn void register_layer_factory(const std::string & p_type, LayerFactory* p_layer_factory);
* \fn void register_layer_factory(const std::string & p_type, layer_factory* p_layer_factory);
* \brief Add a new layer factory
* \param[in] p_type The layer identifier (e.g. GN for the GeoNetworking layer...)
* \param[in] p_layer_factory A reference to the \see LayerFactory
* \param[in] p_layer_factory A reference to the \see layer_factory
* \static
*/
static void register_layer_factory(const std::string & p_type, LayerFactory* p_layer_factory);
static void register_layer_factory(const std::string & p_type, layer_factory* p_layer_factory);
private: //! \privatesection
/*!
* \fn void _register_layer_factory(const std::string & p_type, LayerFactory* p_layer_factory);
* \fn void _register_layer_factory(const std::string & p_type, layer_factory* p_layer_factory);
* \brief Add a new layer factory
* \param[in] p_type The layer identifier (e.g. GN for the GeoNetworking layer...)
* \param[in] p_layer_factory A reference to the \see LayerFactory
* \param[in] p_layer_factory A reference to the \see layer_factory
*/
void _register_layer_factory(const std::string & p_type, LayerFactory* p_layer_factory);
void _register_layer_factory(const std::string & p_type, layer_factory* p_layer_factory);
public: //! \publicsection
/*!
......@@ -63,5 +63,5 @@ public: //! \publicsection
* \return The created layer object on success, nullptr otherwise
*/
Layer* create_layer_stack(const char* p_layer_stack_description);
}; // End of class LayerStackBuilder
}; // End of class layer_stack_builder
......@@ -11,7 +11,7 @@
#pragma once
#include "Params.hh"
#include "ASN1RecodePer.hh"
#include "asn1_recode_per.hh"
class BITSTRING; //! Forward declaration of TITAN class
class TTCN_Typedescriptor_t; //! Forward declaration of TITAN class
......@@ -19,12 +19,12 @@ class TTCN_Typedescriptor_t; //! Forward declaration of TITAN class
struct asn_TYPE_descriptor_s; //! Declare asn1c class
/*!
* \class PERCodec
* \class per_code
* \brief This class This class provides the interface for all ASN.1 PER codecs.
* \remark This class uses asn1c external tool
*/
template<typename TPDU>
class PERCodec : public ASN1RecodePer
class per_code : public asn1_recode_per
{
public: //! \publicsection
/*!
......@@ -47,7 +47,7 @@ public: //! \publicsection
protected: //! \protectedsection
int _decode (const TTCN_Typedescriptor_t& ttcn, const asn_TYPE_descriptor_s & td, const BITSTRING& p_data, TPDU& msg);
int _encode (const TTCN_Typedescriptor_t& ttcn, const asn_TYPE_descriptor_s & td, const TPDU& msg, BITSTRING& p_data);
}; // End of class PERCodec
}; // End of class per_code
#include "PERCodec.t.hh"
#include "per_code.t.hh"
#include <TTCN3.hh>
template<class TPDU>
int PERCodec<TPDU>::_decode (const TTCN_Typedescriptor_t& ttcn, const asn_TYPE_descriptor_s & td, const BITSTRING& p_data, TPDU& msg) {
int per_code<TPDU>::_decode (const TTCN_Typedescriptor_t& ttcn, const asn_TYPE_descriptor_s & td, const BITSTRING& p_data, TPDU& msg) {
TTCN_Buffer buf(bit2oct(p_data));
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
int rc = per2ber (td, buf);
......@@ -13,7 +13,7 @@ int PERCodec<TPDU>::_decode (const TTCN_Typedescriptor_t& ttcn, const asn_TYPE_d
}
template<class TPDU>
int PERCodec<TPDU>::_encode (const TTCN_Typedescriptor_t& ttcn, const asn_TYPE_descriptor_s & td, const TPDU& msg, BITSTRING& p_data) {
int per_code<TPDU>::_encode (const TTCN_Typedescriptor_t& ttcn, const asn_TYPE_descriptor_s & td, const TPDU& msg, BITSTRING& p_data) {
int rc = -1;
TTCN_Buffer buf;
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
......
#include <stdexcept>
#include <regex>
#include "LayerStackBuilder.hh"
#include "layer_stack_builder.hh"
#include "loggers.hh"
LayerStackBuilder* LayerStackBuilder::_instance = NULL;
layer_stack_builder* layer_stack_builder::_instance = NULL;
// static functions
LayerStackBuilder * LayerStackBuilder::get_instance()
layer_stack_builder * layer_stack_builder::get_instance()
{
return _instance ? _instance : _instance = new LayerStackBuilder();
return _instance ? _instance : _instance = new layer_stack_builder();
}
void LayerStackBuilder::register_layer_factory(const std::string & p_type, LayerFactory* p_layer_factory)
void layer_stack_builder::register_layer_factory(const std::string & p_type, layer_factory* p_layer_factory)
{
LayerStackBuilder::get_instance()->_register_layer_factory(p_type, p_layer_factory);
layer_stack_builder::get_instance()->_register_layer_factory(p_type, p_layer_factory);
}
// member functions
LayerStackBuilder::LayerStackBuilder()
layer_stack_builder::layer_stack_builder()
{
}
void LayerStackBuilder::_register_layer_factory(const std::string & p_type, LayerFactory* p_layer_factory)
void layer_stack_builder::_register_layer_factory(const std::string & p_type, layer_factory* p_layer_factory)
{
_layer_factories[p_type] = p_layer_factory;
}
Layer* LayerStackBuilder::create_layer_stack(const char* p_layer_stack_description)
Layer* layer_stack_builder::create_layer_stack(const char* p_layer_stack_description)
{
loggers::get_instance().log(">>> LayerStackBuilder::create_layer_stack: %s", p_layer_stack_description);
loggers::get_instance().log(">>> layer_stack_builder::create_layer_stack: %s", p_layer_stack_description);
Layer * entry = NULL; // Initial layer (the first declared)
Layer * up = NULL; // Upper layer
......@@ -42,18 +42,18 @@ Layer* LayerStackBuilder::create_layer_stack(const char* p_layer_stack_descripti
std::sregex_iterator end = std::sregex_iterator();
for (std::sregex_iterator it = begin; it != end; ++it) {
std::smatch m = *it;
loggers::get_instance().log("LayerStackBuilder::create_layer_stack: %d - %s - %s - %s - %s", m.size(), m[0].str().c_str(), m[1].str().c_str(), m[2].str().c_str(), m[3].str().c_str());
loggers::get_instance().log("layer_stack_builder::create_layer_stack: %d - %s - %s - %s - %s", m.size(), m[0].str().c_str(), m[1].str().c_str(), m[2].str().c_str(), m[3].str().c_str());
LayerFactoryMap::iterator i = _layer_factories.find(m[1].str());
if (i == _layer_factories.end()) {
loggers::get_instance().error("LayerStackBuilder::create_layer_stack: %s: Unknown layer type", m[1].str().c_str());
loggers::get_instance().error("layer_stack_builder::create_layer_stack: %s: Unknown layer type", m[1].str().c_str());
}
loggers::get_instance().log("LayerStackBuilder::create_layer_stack: Create layer %s, %s", m[1].str().c_str(), m[3].str().c_str());
loggers::get_instance().log("layer_stack_builder::create_layer_stack: Create layer %s, %s", m[1].str().c_str(), m[3].str().c_str());
Layer * l = i->second->create_layer(m[1].str(), m[3].str());
if (NULL == l) {
loggers::get_instance().error("LayerStackBuilder::create_layer_stack: %s: Layer creation error", m[1].str().c_str());
loggers::get_instance().error("layer_stack_builder::create_layer_stack: %s: Layer creation error", m[1].str().c_str());
}
loggers::get_instance().log("LayerStackBuilder::create_layer_stack: Setup layers for %s", l->to_string().c_str());
loggers::get_instance().log("layer_stack_builder::create_layer_stack: Setup layers for %s", l->to_string().c_str());
l->addUpperLayer(up);
if (entry == NULL) { // Set the first declared layer
entry = l;
......
......@@ -8,7 +8,7 @@
// add your member functions here.
#include "BtpPort.hh"
#include "BTPLayerFactory.hh"
#include "btp_layer_factory.hh"
#include "loggers.hh"
namespace LibItsBtp__TestSystem {
......@@ -55,11 +55,11 @@ namespace LibItsBtp__TestSystem {
// Setup parameters
Params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
// Create layer
_layer = LayerStackBuilder::get_instance()->create_layer_stack(it->second.c_str());
if (static_cast<BTPLayer *>(_layer) == NULL) {
_layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
if (static_cast<btp_layer *>(_layer) == NULL) {
loggers::get_instance().error("BtpPort::user_map: Invalid stack configuration: %s", it->second.c_str());
}
static_cast<BTPLayer *>(_layer)->addUpperPort(this);
static_cast<btp_layer *>(_layer)->addUpperPort(this);
} else {
loggers::get_instance().error("BtpPort::user_map: No layers defined in configuration file");
}
......@@ -86,7 +86,7 @@ namespace LibItsBtp__TestSystem {
float duration;
loggers::get_instance().set_start_time(_time_key);
static_cast<BTPLayer *>(_layer)->sendMsg(send_par, _layer_params);
static_cast<btp_layer *>(_layer)->sendMsg(send_par, _layer_params);
loggers::get_instance().set_stop_time(_time_key, duration);
}
......
......@@ -8,7 +8,7 @@
// add your member functions here.
#include "CamPort.hh"
#include "CAMLayerFactory.hh"
#include "cam_layer_factory.hh"
#include "loggers.hh"
namespace LibItsCam__TestSystem {
......@@ -60,11 +60,11 @@ namespace LibItsCam__TestSystem {
// Setup parameters
Params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
// Create layer
_layer = LayerStackBuilder::get_instance()->create_layer_stack(it->second.c_str());
if (static_cast<CAMLayer *>(_layer) == NULL) {
_layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
if (static_cast<cam_layer *>(_layer) == NULL) {
loggers::get_instance().error("CamPort::user_map: Invalid stack configuration: %s", it->second.c_str());
}
static_cast<CAMLayer *>(_layer)->addUpperPort(this);
static_cast<cam_layer *>(_layer)->addUpperPort(this);
} else {
loggers::get_instance().error("CamPort::user_map: No layers defined in configuration file");
}
......@@ -96,7 +96,7 @@ namespace LibItsCam__TestSystem {
float duration;
loggers::get_instance().set_start_time(_time_key);
Params params;
static_cast<CAMLayer *>(_layer)->sendMsg(send_par, params);
static_cast<cam_layer *>(_layer)->sendMsg(send_par, params);
loggers::get_instance().set_stop_time(_time_key, duration);
}
......
......@@ -52,7 +52,7 @@ namespace LibItsCam__TestSystem {
Params::iterator it = _cfg_params.find(std::string("params"));
if (it != _cfg_params.end()) {
loggers::get_instance().log("UpperTesterPort_Cam::user_map: %s", it->second.c_str());
_layer = LayerStackBuilder::get_instance()->create_layer_stack(it->second.c_str());
_layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
if (static_cast<UpperTesterCamLayer *>(_layer) == NULL) {
loggers::get_instance().error("UpperTesterPort_Cam::user_map: Invalid stack configuration: %s", it->second.c_str());
}
......
......@@ -8,7 +8,7 @@
// add your member functions here.
#include "DenmPort.hh"
#include "DENMLayerFactory.hh"
#include "denm_layer_factory.hh"
#include "loggers.hh"
namespace LibItsDenm__TestSystem {
......@@ -60,11 +60,11 @@ namespace LibItsDenm__TestSystem {
// Setup parameters
Params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
// Create layer
_layer = LayerStackBuilder::get_instance()->create_layer_stack(it->second.c_str());
if (static_cast<DENMLayer *>(_layer) == NULL) {
_layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
if (static_cast<denm_layer *>(_layer) == NULL) {
loggers::get_instance().error("DenmPort::user_map: Invalid stack configuration: %s", it->second.c_str());
}
static_cast<DENMLayer *>(_layer)->addUpperPort(this);
static_cast<denm_layer *>(_layer)->addUpperPort(this);
} else {
loggers::get_instance().error("DenmPort::user_map: No layers defined in configuration file");
}
......@@ -96,7 +96,7 @@ namespace LibItsDenm__TestSystem {
float duration;
loggers::get_instance().set_start_time(_time_key);
Params params;
static_cast<DENMLayer *>(_layer)->sendMsg(send_par, params);
static_cast<denm_layer *>(_layer)->sendMsg(send_par, params);
loggers::get_instance().set_stop_time(_time_key, duration);
}
......
......@@ -52,7 +52,7 @@ namespace LibItsDenm__TestSystem {
Params::iterator it = _cfg_params.find(std::string("params"));
if (it != _cfg_params.end()) {
loggers::get_instance().log("UpperTesterPort_Denm::user_map: %s", it->second.c_str());
_layer = LayerStackBuilder::get_instance()->create_layer_stack(it->second.c_str());
_layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
if (static_cast<UpperTesterDenmLayer *>(_layer) == NULL) {
loggers::get_instance().error("UpperTesterPort_Denm::user_map: Invalid stack configuration: %s", it->second.c_str());