Commit 693f91b4 authored by garciay's avatar garciay
Browse files

Validate GeNetworking, CAM,DENM & Security

Bug fixed in fx__getCurrentTime()
parent 2bfadde8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ namespace LibItsDenm__EncdecDeclarations {

  INTEGER fx__dec__DenmInd(BITSTRING& b, LibItsDenm__TestSystem::DenmInd& p_denmInd)
  {
    loggers::get_instance().log_msg(">>> fx__enc__DenmInd: ", p_denmInd);
    loggers::get_instance().log(">>> fx__dec__DenmInd");
    
    DENMCodec codec;
    DENM__PDU__Descriptions::DENM denm;
+85 −86
Original line number Diff line number Diff line
#include "LibItsCommon_Functions.hh"
//#include "ITS_Container.hh"
#include <time.h>
#include <chrono>
#include <math.h>

#ifndef M_PI
@@ -17,15 +17,14 @@ namespace LibItsCommon__Functions
   */
  INTEGER fx__getCurrentTime(
) {
            unsigned long long timestamp2014 = 1356998400000;
    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 its_ref_time = 1072911600000L;
    struct timeval tv;
    gettimeofday(&tv, NULL);

            unsigned long long timestampNow = tv.tv_sec*1000 + tv.tv_usec/1000;

//    i.set_long_long_val(timestampNow - timestamp2014);
//    return i;
            return INTEGER(timestampNow - timestamp2014);
    unsigned long long ms = tv.tv_sec * 1000 + tv.tv_usec / 1000;*/
    INTEGER i;
    i.set_long_long_val(ms);
    return i;
  }
  /**
   * @desc    Gets the current time since 01/01/2004
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@ public:
  static const std::string& distanceB;             //! Test system GeoNetworking DistanceB parameter name
  static const std::string& angle;                 //! Test system GeoNetworking Angle parameter name
  
  static const std::string& next_header;           //! Upper layer settings
  static const std::string& header_type;           //! Upper layer settings
  static const std::string& header_sub_type;       //! Upper layer settings
  
  /*!
   * \brief Default constructor
   *        Create a new instance of the Params class
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ const std::string& Params::distanceA = std::string("distanceA");
const std::string& Params::distanceB = std::string("distanceB");
const std::string& Params::angle = std::string("angle");

const std::string& Params::next_header = std::string("next_header");
const std::string& Params::header_type = std::string("header_type");
const std::string& Params::header_sub_type = std::string("header_sub_type");

void Params::convert(Params& p_param, const std::string p_parameters) {
  // Sanity checks
  if (p_parameters.length() == 0) {
+4 −1
Original line number Diff line number Diff line
@@ -52,6 +52,9 @@ namespace LibItsBtp__TestSystem {
    Params::iterator it = _cfg_params.find(std::string("params"));
    if (it != _cfg_params.end()) {
      loggers::get_instance().log("BtpPort::user_map: %s", it->second.c_str());
      // Setup parameters
      Params::convert(_layer_params, it->second); // TODO This _layer_params seems to be useless
      // Create layer
      _layer = LayerStackBuilder::GetInstance()->createLayerStack(it->second.c_str());
      if (static_cast<BTPLayer *>(_layer) == NULL) {
        loggers::get_instance().error("BtpPort::user_map: Invalid stack configuration: %s", it->second.c_str());
Loading