Commit 23f3e699 authored by garciay's avatar garciay
Browse files

Layers ongoing

parent fe15bc8d
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -55,8 +55,15 @@ namespace LibItsCam__EncdecDeclarations {

    // Calculate the size of the lower layers information
    int s = (
	     LibItsGeoNetworking__TestSystem::GeoNetworkingInd_macDestinationAddress_raw_.fieldlength +
	     LibItsGeoNetworking__TestSystem::GeoNetworkingInd_its__aid_raw_.fieldlength
	     LibItsCam__TestSystem::CamInd_gnNextHeader_raw_.fieldlength +
	     LibItsCam__TestSystem::CamInd_gnHeaderType_raw_.fieldlength +
	     LibItsCam__TestSystem::CamInd_gnHeaderSubtype_raw_.fieldlength +
	     LibItsCam__TestSystem::CamInd_gnLifetime_raw_.fieldlength +
	     LibItsCam__TestSystem::CamInd_gnTrafficClass_raw_.fieldlength +
	     LibItsCam__TestSystem::CamInd_btpDestinationPort_raw_.fieldlength +
	     LibItsCam__TestSystem::CamInd_btpInfo_raw_.fieldlength +
	     LibItsCam__TestSystem::CamInd_ssp_raw_.fieldlength +
	     LibItsCam__TestSystem::CamInd_its__aid_raw_.fieldlength
	     ) / 8;
    if (codec.decode(OCTETSTRING(is.lengthof() - s, static_cast<const unsigned char *>(is)), cam) == -1) {
      loggers::get_instance().warning("fx__dec__CamInd: -1 result code was returned");
+5 −3
Original line number Diff line number Diff line
@@ -60,7 +60,8 @@ namespace LibItsGeoNetworking__EncdecDeclarations {
      return -1;
    }
    p.msgOut() = pdu;
    TTCN_Buffer decoding_buffer(OCTETSTRING(is.lengthof() - s, static_cast<const unsigned char *>(is) + is.lengthof() - s));
    TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s));
    loggers::get_instance().log_to_hexa("fx__dec__GeoNetworkingInd: Lower layer: ", decoding_buffer);
    for (int i = 1; i < p.get_count(); i++) {
      loggers::get_instance().log("fx__dec__GeoNetworkingReq: processing %s/%s/%s", p.fld_name(i), p.fld_descr(i)->name, p.get_at(i)->get_descriptor()->name);
      p.get_at(i)->decode(*p.fld_descr(i), decoding_buffer, TTCN_EncDec::CT_RAW);      
@@ -126,11 +127,12 @@ namespace LibItsGeoNetworking__EncdecDeclarations {
      return -1;
    }
    p_geoNetworkingInd.msgIn() = pdu;
    TTCN_Buffer decoding_buffer(OCTETSTRING(is.lengthof() - s, static_cast<const unsigned char *>(is) + is.lengthof() - s));
    TTCN_Buffer decoding_buffer(OCTETSTRING(s, static_cast<const unsigned char *>(is) + is.lengthof() - s));
    loggers::get_instance().log_to_hexa("fx__dec__GeoNetworkingInd: Lower layer: ", decoding_buffer);
    for (int i = 1; i < p_geoNetworkingInd.get_count(); i++) {
      loggers::get_instance().log("fx__dec__GeoNetworkingInd: processing %s/%s/%s - %d - %d", p_geoNetworkingInd.fld_name(i), p_geoNetworkingInd.fld_descr(i)->name, p_geoNetworkingInd.get_at(i)->get_descriptor()->name, p_geoNetworkingInd.get_at(i)->is_optional(), p_geoNetworkingInd.get_at(i)->is_present());
      if (p_geoNetworkingInd.get_at(i)->is_optional()) {
	loggers::get_instance().log("fx__dec__GeoNetworkingInd: Bytes remaining: %d - ssp lenth: %d", decoding_buffer.get_len() - decoding_buffer.get_pos(), p_geoNetworkingInd.fld_descr(i)->raw->fieldlength / 8);
	loggers::get_instance().log("fx__dec__GeoNetworkingInd: Bytes remaining: %d - field lenth: %d", decoding_buffer.get_len() - decoding_buffer.get_pos(), p_geoNetworkingInd.fld_descr(i)->raw->fieldlength / 8);
	if (std::string(p_geoNetworkingInd.fld_name(i)).compare("ssp") == 0) {
	  if ((decoding_buffer.get_len() - decoding_buffer.get_pos()) >= p_geoNetworkingInd.fld_descr(i)->raw->fieldlength / 8) {
	    loggers::get_instance().log("fx__dec__GeoNetworkingInd: decoding %s", p_geoNetworkingInd.fld_descr(i)->name);
+2 −1
Original line number Diff line number Diff line
@@ -85,7 +85,8 @@ public:
  void removeUpperPort(TPort*);

protected:
  template <typename TMessage> void toAllUpperPorts(const TMessage& m, const Params& param) {
  template <typename TMessage>
  inline void toAllUpperPorts(const TMessage& m, const Params& param) {
    loggers::get_instance().log(">>> TLayer::toAllUpperPorts: %d", upperPorts.size());
    for(TPortListIterator it=upperPorts.begin(); it<upperPorts.end(); ++it){
      (*it)->receiveMsg(m, param);
+5 −2
Original line number Diff line number Diff line
@@ -53,7 +53,10 @@ namespace LibItsBtp__TestSystem {
    if (it != _cfg_params.end()) {
      loggers::get_instance().log("BtpPort::user_map: %s", it->second.c_str());
      _layer = LayerStackBuilder::GetInstance()->createLayerStack(it->second.c_str());
      dynamic_cast<BTPLayer *>(_layer)->addUpperPort(this);
      if (static_cast<BTPLayer *>(_layer) == NULL) {
	loggers::get_instance().error("BtpPort::user_map: Invalid stack configuration: %s", it->second.c_str());
      }
      static_cast<BTPLayer *>(_layer)->addUpperPort(this);
    } else {
      loggers::get_instance().error("BtpPort::user_map: No layers defined in configuration file");
    }
@@ -80,7 +83,7 @@ namespace LibItsBtp__TestSystem {
    
    float duration;
    loggers::get_instance().set_start_time(_time_key);
    dynamic_cast<BTPLayer *>(_layer)->sendMsg(send_par, _layer_params);
    static_cast<BTPLayer *>(_layer)->sendMsg(send_par, _layer_params);
    loggers::get_instance().set_stop_time(_time_key, duration);
  }

+5 −2
Original line number Diff line number Diff line
@@ -58,7 +58,10 @@ namespace LibItsCam__TestSystem {
    if (it != _cfg_params.end()) {
      loggers::get_instance().log("CamPort::user_map: %s", it->second.c_str());
      _layer = LayerStackBuilder::GetInstance()->createLayerStack(it->second.c_str());
      dynamic_cast<CAMLayer *>(_layer)->addUpperPort(this);
      if (static_cast<CAMLayer *>(_layer) == NULL) {
	loggers::get_instance().error("CamPort::user_map: Invalid stack configuration: %s", it->second.c_str());
      }
      static_cast<CAMLayer *>(_layer)->addUpperPort(this);
    } else {
      loggers::get_instance().error("CamPort::user_map: No layers defined in configuration file");
    }
@@ -89,7 +92,7 @@ namespace LibItsCam__TestSystem {
    
    float duration;
    loggers::get_instance().set_start_time(_time_key);
    dynamic_cast<CAMLayer *>(_layer)->sendMsg(send_par, _layer_params);
    static_cast<CAMLayer *>(_layer)->sendMsg(send_par, _layer_params);
    loggers::get_instance().set_stop_time(_time_key, duration);
  }

Loading