Commit ade618da authored by YannGarcia's avatar YannGarcia
Browse files

STF580: Add LTE-V2X support & SSPs changes & scripts changes for CI

parent e44b485d
Loading
Loading
Loading
Loading
+104 −54
Original line number Original line Diff line number Diff line
@@ -10,7 +10,7 @@


unsigned char commsignia_layer::_fixed_header[10] = { 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x0D };
unsigned char commsignia_layer::_fixed_header[10] = { 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x0D };


commsignia_layer::commsignia_layer(const std::string & p_type, const std::string & param) : layer(p_type), _params(), _c2p_recv{0}, _802_11p_hdr{0}, _c2p_llc_hdr{0}, _mac_src(), _eth_type() {
commsignia_layer::commsignia_layer(const std::string & p_type, const std::string & param) : layer(p_type), _params(), _mac_src(), _eth_type() {
  loggers::get_instance().log(">>> commsignia_layer::commsignia_layer: %s, %s", to_string().c_str(), param.c_str());
  loggers::get_instance().log(">>> commsignia_layer::commsignia_layer: %s, %s", to_string().c_str(), param.c_str());
  
  
  // Setup parameters
  // Setup parameters
@@ -31,7 +31,7 @@ commsignia_layer::commsignia_layer(const std::string & p_type, const std::string
  _eth_type = converter::get_instance().hexa_to_bytes(_params[params::eth_type]);
  _eth_type = converter::get_instance().hexa_to_bytes(_params[params::eth_type]);
  it = _params.find(params::interface_id);
  it = _params.find(params::interface_id);
  if (it == _params.cend()) {
  if (it == _params.cend()) {
    _params.insert(std::pair<std::string, std::string>(std::string("interface_id"), "1"));
    _params.insert(std::pair<std::string, std::string>(std::string("interface_id"), "1")); // The interfce id for filtering & to send on
  }
  }
  it = _params.find(std::string("power_tx"));
  it = _params.find(std::string("power_tx"));
  if (it == _params.cend()) {
  if (it == _params.cend()) {
@@ -58,14 +58,14 @@ void commsignia_layer::send_data(OCTETSTRING& data, params& params) {
    buffer += int2oct(0, 1); // Injection to radio
    buffer += int2oct(0, 1); // Injection to radio
  }
  }
  buffer += int2oct(0, 1); // Fix
  buffer += int2oct(0, 1); // Fix
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: ", buffer);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: Injection=", buffer);
  buffer += int2oct(std::stoi(_params[params::interface_id]), 4);
  buffer += int2oct(std::stoi(_params[params::interface_id]), 4);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: ", buffer);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: Interface=", buffer);
  buffer += int2oct(std::stoi(_params[std::string("data_rate")]), 2);
  buffer += int2oct(std::stoi(_params[std::string("data_rate")]), 2);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: ", buffer);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: data_rate=", buffer);
  buffer += int2oct(7, 1); // MAC user priority
  buffer += int2oct(7, 1); // MAC user priority
  buffer += int2oct(0x80000000 & std::stoi(_params[std::string("power_tx")]), 4); // Negative number
  buffer += int2oct(0x80000000 & std::stoi(_params[std::string("power_tx")]), 4); // Negative number
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: ", buffer);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: PowerTx=", buffer);
  // Destination MAC address
  // Destination MAC address
  params::const_iterator it = params.find(params::mac_dst); // Find in provided parameters, params
  params::const_iterator it = params.find(params::mac_dst); // Find in provided parameters, params
  if (it != params.cend()) {
  if (it != params.cend()) {
@@ -78,7 +78,7 @@ void commsignia_layer::send_data(OCTETSTRING& data, params& params) {
      buffer += str2oct(CHARSTRING(_params[params::mac_bc].c_str()));
      buffer += str2oct(CHARSTRING(_params[params::mac_bc].c_str()));
    }
    }
  }
  }
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: ", buffer);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: mac_dst=", buffer);
  // Source MAC address
  // Source MAC address
  it = params.find(params::mac_src); // Find in provided parameters, params
  it = params.find(params::mac_src); // Find in provided parameters, params
  if (it != params.cend()) {
  if (it != params.cend()) {
@@ -91,14 +91,14 @@ void commsignia_layer::send_data(OCTETSTRING& data, params& params) {
      buffer += str2oct(CHARSTRING(_params[params::mac_src].c_str()));
      buffer += str2oct(CHARSTRING(_params[params::mac_src].c_str()));
    }
    }
  }
  }
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: ", buffer);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: mac_src=", buffer);
  buffer += int2oct(0, 2); // Fixed
  buffer += int2oct(0, 2); // Fixed
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: ", buffer);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: Fixed=", buffer);
  buffer += int2oct(data.lengthof(), 2);
  buffer += int2oct(data.lengthof(), 2); // Data length
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: ", buffer);
  loggers::get_instance().log_msg("commsignia_layer::send_data: buffer: Data length=", buffer);
  buffer += data;
  buffer += data; // Payload
  
  
  loggers::get_instance().log_msg("commsignia_layer::send_data: ", buffer);
  loggers::get_instance().log_msg("commsignia_layer::send_data: Final buffer=", buffer);
  send_to_all_layers(buffer, params);
  send_to_all_layers(buffer, params);
}
}


@@ -106,38 +106,91 @@ void commsignia_layer::receive_data(OCTETSTRING& data, params& params) {
  loggers::get_instance().log_msg(">>> commsignia_layer::receive_data: ", data);
  loggers::get_instance().log_msg(">>> commsignia_layer::receive_data: ", data);
  
  
  const unsigned char* p = static_cast<const unsigned char *>(data);
  const unsigned char* p = static_cast<const unsigned char *>(data);
  const unsigned char c2p_ver = (unsigned char)*p;
  
  
  // Check the frame version
  // Check the frame version
  if (*p != 0x12) {
  if ((c2p_ver != 0x11) && (c2p_ver != 0x17)) { // Rx G5 or LTE-V2X
    // Discard it, on;y use TX version
    // Discard it, only use G5 or LTE-V2X RX version
    return;
    return;
  }
  }


  const commsignia_layer::c2p_s_v1_tx_t* r = (const commsignia_layer::c2p_s_v1_tx_t*)p;
  if (c2p_ver == 0x11) { // G5
  loggers::get_instance().log("commsignia_layer::receive_data: version=%02x", r->s_header.u8_ver_type);
    commsignia_layer::c2p_s_v1_rx_t r;
  loggers::get_instance().log("commsignia_layer::receive_data: timestamp1=%08x", ntohl(r->s_header.u32_tst_sec));
    r.s_header.u8_ver_type = (unsigned char)*p++;
  loggers::get_instance().log("commsignia_layer::receive_data: timestamp2=%08x", ntohl(r->s_header.u32_tst_msec));
    loggers::get_instance().log("commsignia_layer::receive_data: version=%02x", r.s_header.u8_ver_type);
  loggers::get_instance().log("commsignia_layer::receive_data: primary_channel=%08x", r->u8_primary_channel);
    memcpy((void*)&r.s_header.u32_tst_sec, (unsigned int*)p, sizeof(unsigned int)); p += sizeof(unsigned int);
  loggers::get_instance().log("commsignia_layer::receive_data: secondary_channel=%08x", r->u8_secondary_channel);
    loggers::get_instance().log("commsignia_layer::receive_data: time (in s)=%08x", /*ntohl(*/r.s_header.u32_tst_sec)/*)*/;
  loggers::get_instance().log("commsignia_layer::receive_data: antenna=%02x", r->u8_antenna);
    memcpy((void*)&r.s_header.u32_tst_msec, (unsigned int*)p, sizeof(unsigned int)); p += sizeof(unsigned int);
  loggers::get_instance().log("commsignia_layer::receive_data: speed=%d", ntohs(r->u16_speed));
    loggers::get_instance().log("commsignia_layer::receive_data: time (in ms)=%08x", /*ntohl(*/r.s_header.u32_tst_msec)/*)*/;
  loggers::get_instance().log("commsignia_layer::receive_data: heading=%d", ntohs(r->u16_heading));
    r.u8_primary_channel = (unsigned char)*p++;
  loggers::get_instance().log("commsignia_layer::receive_data: txp=%02x", r->s8_txp);
    loggers::get_instance().log("commsignia_layer::receive_data: primary_channel=%02x", r.u8_primary_channel);
  loggers::get_instance().log("commsignia_layer::receive_data: s8_tssi_ant_1=%d", r->s8_tssi_ant_1);
    r.u8_secondary_channel = (unsigned char)*p++;
  loggers::get_instance().log("commsignia_layer::receive_data: s8_tssi_ant_2=%d", r->s8_tssi_ant_2);
    loggers::get_instance().log("commsignia_layer::receive_data: secondary_channel=%02x", r.u8_secondary_channel);
    r.u8_used_interface = (unsigned char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: used_interface=%02x", r.u8_used_interface);
    r.u8_data_rate = (unsigned char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: data_rate=%02x", r.u8_data_rate);
    r.u8_antenna = (unsigned char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: antenna=%02x", r.u8_antenna);
    memcpy((void*)&r.s32_latitude, (int*)p, sizeof(int)); p += sizeof(int);
    loggers::get_instance().log("commsignia_layer::receive_data: latitude=%08x", r.s32_latitude);
    memcpy((void*)&r.s32_longitude, (int*)p, sizeof(int)); p += sizeof(int);
    loggers::get_instance().log("commsignia_layer::receive_data: longitude=%08x", r.s32_longitude);
    memcpy((void*)&r.u16_speed, (unsigned short*)p, sizeof(unsigned short)); p += sizeof(unsigned short);
    loggers::get_instance().log("commsignia_layer::receive_data: speed=%02x", r.u16_speed); // ntohs
    memcpy((void*)&r.u16_heading, (unsigned short*)p, sizeof(unsigned short)); p += sizeof(unsigned short);
    loggers::get_instance().log("commsignia_layer::receive_data: heading=%02x", r.u16_heading);
    r.s8_rssi_ant_1 = (unsigned char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: s8_rssi_ant_1=%02x", r.s8_rssi_ant_1);
    r.s8_rssi_ant_2 = (unsigned char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: s8_rssi_ant_2=%02x", r.s8_rssi_ant_2);
    r.s8_noise_ant_1 = (unsigned char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: s8_noise_ant_1=%02x", r.s8_noise_ant_1);
    r.s8_noise_ant_2 = (unsigned char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: s8_noise_ant_2=%02x", r.s8_noise_ant_2);
    memcpy((void*)&r.u16_cbr_ant_1, (unsigned short*)p, sizeof(unsigned short)); p += sizeof(unsigned short);
    loggers::get_instance().log("commsignia_layer::receive_data: cbr_ant_1=%04x", r.u16_cbr_ant_1);
    memcpy((void*)&r.u16_cbr_ant_2, (unsigned short*)p, sizeof(unsigned short)); p += sizeof(unsigned short);
    loggers::get_instance().log("commsignia_layer::receive_data: cbr_ant_2=%04x", r.u16_cbr_ant_2);
    // Filtering on antenna index
    // Filtering on antenna index
  loggers::get_instance().log("commsignia_layer::receive_data: compare %02x with %02x", r->u8_antenna, static_cast<unsigned char>(std::stoi(_params[params::interface_id])));
    loggers::get_instance().log("commsignia_layer::receive_data: compare %02x with %02x", r.u8_antenna, static_cast<unsigned char>(std::stoi(_params[params::interface_id])));
  if (r->u8_antenna != std::stoi(_params[params::interface_id])) {
    if (r.u8_antenna != std::stoi(_params[params::interface_id])) {
      // Discard packet
      // Discard packet
      loggers::get_instance().warning("commsignia_layer::receive_data: Discard packet due to wrong antenna id");
      loggers::get_instance().warning("commsignia_layer::receive_data: Discard packet due to wrong antenna id");
      // TODO return;
      // TODO return;
    } // else, continue
    } // else, continue

  } else { // LTE-CV2X
  const commsignia_layer::c2p_802_11p_hdr* h = (const commsignia_layer::c2p_802_11p_hdr*)(p + sizeof(commsignia_layer::c2p_s_v1_tx_t) - 1);
    commsignia_layer::c2p_s_v1_rx_cv2x_t r;
  loggers::get_instance().log("commsignia_layer::receive_data: frame_ctrl=%04x", ntohs(h->frame_ctrl));
    r.s_header.u8_ver_type = (unsigned char)*p++;
  OCTETSTRING dst = OCTETSTRING(6, (const unsigned char*)&h->dst_addr);
    loggers::get_instance().log("commsignia_layer::receive_data: version=%02x", r.s_header.u8_ver_type);
    memcpy((void*)&r.s_header.u32_tst_sec, (unsigned int*)p, sizeof(unsigned int)); p += sizeof(unsigned int);
    loggers::get_instance().log("commsignia_layer::receive_data: time (in s)=%08x", /*ntohl(*/r.s_header.u32_tst_sec)/*)*/;
    memcpy((void*)&r.s_header.u32_tst_msec, (unsigned int*)p, sizeof(unsigned int)); p += sizeof(unsigned int);
    loggers::get_instance().log("commsignia_layer::receive_data: time (in ms)=%08x", /*ntohl(*/r.s_header.u32_tst_msec)/*)*/;
    r.u8_socket_index = (unsigned char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: u8_socket_index=%02x", r.u8_socket_index);
    memcpy((void*)&r.u16_ethertype, (unsigned short*)p, sizeof(unsigned short)); p += sizeof(unsigned short);
    loggers::get_instance().log("commsignia_layer::receive_data: u16_ethertype=%04x", r.u16_ethertype);
    r.s8_rssi = (signed char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: s8_rssi=%02x", r.s8_rssi);
    r.u8_datarate_500kbps = (unsigned char)*p++;
    loggers::get_instance().log("commsignia_layer::receive_data: u8_datarate_500kbps=%02x", r.u8_datarate_500kbps);
  }
  
  commsignia_layer::c2p_802_11p_hdr h;
  memcpy((void*)&h.frame_ctrl, (unsigned short*)p, sizeof(unsigned short)); p += sizeof(unsigned short);
  loggers::get_instance().log("commsignia_layer::receive_data: frame_ctrl=%04x", h.frame_ctrl);
  memcpy((void*)&h.duration, (unsigned short*)p, sizeof(unsigned short)); p += sizeof(unsigned short);
  loggers::get_instance().log("commsignia_layer::receive_data: duration=%04x", h.duration);
  memcpy((void*)&h.dst_addr, (unsigned short*)p, 6 * sizeof(unsigned char)); p += 6 * sizeof(unsigned char);
  memcpy((void*)&h.src_addr, (unsigned short*)p, 6 * sizeof(unsigned char)); p += 6 * sizeof(unsigned char);
  memcpy((void*)&h.bss_id, (unsigned short*)p, 6 * sizeof(unsigned char)); p += 6 * sizeof(unsigned char);
  memcpy((void*)&h.fragment_seq_num, (unsigned short*)p, sizeof(unsigned short)); p += sizeof(unsigned short);
  loggers::get_instance().log("commsignia_layer::receive_data: fragment_seq_num=%04x", h.fragment_seq_num);
  
  OCTETSTRING dst = OCTETSTRING(6, (const unsigned char*)&h.dst_addr);
  loggers::get_instance().log_msg("commsignia_layer::receive_data: dst: ", dst);
  loggers::get_instance().log_msg("commsignia_layer::receive_data: dst: ", dst);
  OCTETSTRING src = OCTETSTRING(6, (const unsigned char*)&h->src_addr);
  OCTETSTRING src = OCTETSTRING(6, (const unsigned char*)&h.src_addr);
  loggers::get_instance().log_msg("commsignia_layer::receive_data: src: ", src);
  loggers::get_instance().log_msg("commsignia_layer::receive_data: src: ", src);


  // Filtering on source MAC address of the packet
  // Filtering on source MAC address of the packet
@@ -148,23 +201,20 @@ void commsignia_layer::receive_data(OCTETSTRING& data, params& params) {
  } // else, continue
  } // else, continue
  const commsignia_layer::c2p_llc_hdr* l;
  const commsignia_layer::c2p_llc_hdr* l;
  int length;
  int length;
  if ((ntohs(h->frame_ctrl) & 0xf000) == 0x8000) {
  if (c2p_ver == 0x11) {
    l = (const commsignia_layer::c2p_llc_hdr*)(p + sizeof(commsignia_layer::c2p_s_v1_tx_t) - 1 + sizeof(commsignia_layer::c2p_802_11p_hdr) + sizeof(commsignia_layer::c2p_qos_ctrl));
    if ((ntohs(h.frame_ctrl) & 0xf000) == 0x8000) {
    length = sizeof(commsignia_layer::c2p_s_v1_tx_t) - 1 + sizeof(commsignia_layer::c2p_802_11p_hdr) + sizeof(commsignia_layer::c2p_qos_ctrl) + sizeof(commsignia_layer::c2p_llc_hdr);
      l = (const commsignia_layer::c2p_llc_hdr*)(static_cast<const unsigned char *>(data) + sizeof(commsignia_layer::c2p_s_v1_rx_t) + sizeof(commsignia_layer::c2p_802_11p_hdr) + sizeof(commsignia_layer::c2p_qos_ctrl));
      length = sizeof(commsignia_layer::c2p_s_v1_rx_t) + sizeof(commsignia_layer::c2p_802_11p_hdr) + sizeof(commsignia_layer::c2p_qos_ctrl) + sizeof(commsignia_layer::c2p_llc_hdr);
    } else {
    } else {
    l = (const commsignia_layer::c2p_llc_hdr*)(p + sizeof(commsignia_layer::c2p_s_v1_tx_t) - 1 + sizeof(commsignia_layer::c2p_802_11p_hdr));
      l = (const commsignia_layer::c2p_llc_hdr*)(p + sizeof(commsignia_layer::c2p_s_v1_rx_t) + sizeof(commsignia_layer::c2p_802_11p_hdr));
    length = sizeof(commsignia_layer::c2p_s_v1_tx_t) - 1 + sizeof(commsignia_layer::c2p_802_11p_hdr) + sizeof(commsignia_layer::c2p_llc_hdr);
      length = sizeof(commsignia_layer::c2p_s_v1_rx_t) + sizeof(commsignia_layer::c2p_802_11p_hdr) + sizeof(commsignia_layer::c2p_llc_hdr);
    }
    }
    loggers::get_instance().log("commsignia_layer::receive_data: dsap=%02x", l->dsap);
    loggers::get_instance().log("commsignia_layer::receive_data: dsap=%02x", l->dsap);
    loggers::get_instance().log("commsignia_layer::receive_data: ssap=%02x", l->ssap);
    loggers::get_instance().log("commsignia_layer::receive_data: ssap=%02x", l->ssap);
    loggers::get_instance().log("commsignia_layer::receive_data: ssap=%02x", l->ctrl);
    loggers::get_instance().log("commsignia_layer::receive_data: ssap=%02x", l->ctrl);
    loggers::get_instance().log("commsignia_layer::receive_data: type=%04x", l->type);
    loggers::get_instance().log("commsignia_layer::receive_data: type=%04x", l->type);

  } else {

  }
  
  length -= 4;
  

  
  
  // Check ether type
  // Check ether type
  //if ((_eth_type[1] == (unsigned char)((l->type & 0xff00) >> 8)) && (_eth_type[0] == (unsigned char)(l->type & 0xff))) { // Warning: Network ordered bytes
  //if ((_eth_type[1] == (unsigned char)((l->type & 0xff00) >> 8)) && (_eth_type[0] == (unsigned char)(l->type & 0xff))) { // Warning: Network ordered bytes
+40 −7
Original line number Original line Diff line number Diff line
@@ -30,7 +30,25 @@ class commsignia_layer : public layer {
    unsigned char u8_ver_type;
    unsigned char u8_ver_type;
    unsigned int u32_tst_sec;
    unsigned int u32_tst_sec;
    unsigned int u32_tst_msec;
    unsigned int u32_tst_msec;
  } c2p_s_header_t;
  } __attribute__((__packed__)) c2p_s_header_t;
  typedef struct {
    c2p_s_header_t s_header;
    unsigned char u8_primary_channel;
    unsigned char u8_secondary_channel;
    unsigned char u8_used_interface;
    unsigned char u8_data_rate;
    unsigned char u8_antenna;
    int s32_latitude;
    int s32_longitude;
    unsigned short u16_speed;
    unsigned short u16_heading;
    signed char s8_rssi_ant_1;
    signed char s8_rssi_ant_2;
    signed char s8_noise_ant_1;
    signed char s8_noise_ant_2;
    unsigned short u16_cbr_ant_1;
    unsigned short u16_cbr_ant_2;
  } __attribute__((__packed__)) c2p_s_v1_rx_t;
  typedef struct {
  typedef struct {
    c2p_s_header_t s_header;
    c2p_s_header_t s_header;
    unsigned char u8_primary_channel;
    unsigned char u8_primary_channel;
@@ -43,9 +61,27 @@ class commsignia_layer : public layer {
    unsigned short u16_speed;
    unsigned short u16_speed;
    unsigned short u16_heading;
    unsigned short u16_heading;
    signed char s8_txp;
    signed char s8_txp;
    signed char s8_tssi_ant_1;
    signed char s8_rssi_ant_1;
    signed char s8_tssi_ant_2;
    signed char s8_rssi_ant_2;
  } c2p_s_v1_tx_t;
  } __attribute__((__packed__)) c2p_s_v1_tx_t;
  typedef struct {
    c2p_s_header_t s_header;
    unsigned char u8_socket_index;
    unsigned short u16_ethertype;
    signed char s8_rssi;
    unsigned char u8_datarate_500kbps;
  } __attribute__((__packed__)) c2p_s_v1_rx_cv2x_t;
  typedef struct {
    c2p_s_header_t s_header;
    unsigned char u8_b_sps;
    unsigned short u16_sps_port;
    unsigned short u16_event_port;
    int s32_tx_pwr_dbm;
    int s32_bw_res_v2xid;
    int s32_bw_res_period_interval_ms;
    int s32_bw_res_tx_reservation_size_bytes;
    unsigned char u8_bw_res_tx_priority;
  } __attribute__((__packed__)) c2p_s_v1_tx_cv2x_t;


  /**
  /**
   * \struct Injected data header
   * \struct Injected data header
@@ -73,9 +109,6 @@ class commsignia_layer : public layer {
  } __attribute__((__packed__)) c2p_llc_hdr;
  } __attribute__((__packed__)) c2p_llc_hdr;


  params _params;                       //! Layer parameters
  params _params;                       //! Layer parameters
  c2p_s_v1_tx_t _c2p_recv;              //! \todo
  c2p_802_11p_hdr _802_11p_hdr;         //! \todo
  c2p_llc_hdr _c2p_llc_hdr;             //! \todo
  std::vector<unsigned char> _mac_src;  //! Used to optimize filtering on source mac address in \see commsignia_layer::receive_data method
  std::vector<unsigned char> _mac_src;  //! Used to optimize filtering on source mac address in \see commsignia_layer::receive_data method
  std::vector<unsigned char> _eth_type; //! Used to optimize filtering on ethernet type in \see commsignia_layer::receive_data method
  std::vector<unsigned char> _eth_type; //! Used to optimize filtering on ethernet type in \see commsignia_layer::receive_data method


+7 −6
Original line number Original line Diff line number Diff line
@@ -64,7 +64,7 @@ LogEventTypes:= Yes
#   mac_bc   :Broadcast address
#   mac_bc   :Broadcast address
#   eth_type : Ethernet type
#   eth_type : Ethernet type
# Commsignia layer
# Commsignia layer
#   mac_src     : Device MAC address, used to discard packets
#   mac_src     : IUT MAC address, used to discard packets
#                 To indicate no filering, use the value 000000000000
#                 To indicate no filering, use the value 000000000000
#   mac_bc      : Broadcast address
#   mac_bc      : Broadcast address
#   eth_type    : Ethernet type, used to discard packets
#   eth_type    : Ethernet type, used to discard packets
@@ -94,15 +94,16 @@ LogEventTypes:= Yes


#system.camPort.params := "CAM(next_header=btpB,header_type=tsb,header_sub_type=sh)/BTP/GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=1)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=tap0,filter=and ether proto 0x8947)" # Nordsys non secured
#system.camPort.params := "CAM(next_header=btpB,header_type=tsb,header_sub_type=sh)/BTP/GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=1)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=tap0,filter=and ether proto 0x8947)" # Nordsys non secured
#system.camPort.params := "CAM(next_header=btpB,header_type=tsb,header_sub_type=sh)/BTP/GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=1,secured_mode=1,sec_db_path=/home/vagrant/tmp/asn1c_cert)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=tap0,filter=and ether proto 0x8947)" # Nordsys secured
#system.camPort.params := "CAM(next_header=btpB,header_type=tsb,header_sub_type=sh)/BTP/GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=1,secured_mode=1,sec_db_path=/home/vagrant/tmp/asn1c_cert)/ETH(mac_src=e2b7b30429eb)/PCAP(mac_src=e2b7b30429eb,nic=tap0,filter=and ether proto 0x8947)" # Nordsys secured
system.camPort.params := "CAM(next_header=btpB,header_type=tsb,header_sub_type=sh)/BTP/GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=1,secured_mode=0,sec_db_path=/home/vagrant/tmp/asn1c_cert)/UDP(dst_ip=172.28.7.123,src_port=54915,dst_port=54915)" # Savary
#system.camPort.params := "CAM(next_header=btpB,header_type=tsb,header_sub_type=sh)/BTP/GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=1,secured_mode=0,sec_db_path=/home/vagrant/tmp/asn1c_cert)/UDP(dst_ip=172.28.7.123,src_port=54915,dst_port=54915)" # Savary
system.camPort.params := "CAM(next_header=btpB,header_type=tsb,header_sub_type=sh)/BTP/GN(ll_address=4C5E0C14D2EA,latitude=43551050,longitude=10298730,distanceA=1500,distanceB=1500,angle=0,device_mode=1,secured_mode=0,sec_db_path=/home/vagrant/tmp/asn1c_cert)/COMMSIGNIA(mac_src=080027F44E7D,interface_id=2,target_host=192.168.42.2)/UDP(dst_ip=192.168.42.2,src_port=7943,dst_port=6666)"


# CAM UpperTester port based on UDP
# CAM UpperTester port based on UDP
#system.utPort.params := "UT_CAM/UDP(dst_ip=192.168.2.3,dst_port=8000)"
system.utPort.params := "UT_CAM/UDP(dst_ip=192.168.1.250,src_port=12345)"
#system.utPort.params := "UT_CAM/UDP(dst_ip=172.23.0.1,dst_port=8000)" # Nordsys
#system.utPort.params := "UT_CAM/UDP(dst_ip=172.23.0.1,dst_port=8000)" # Nordsys
system.utPort.params := "UT_CAM/UDP(dst_ip=172.28.7.123,dst_port=1999)" # Savary
#system.utPort.params := "UT_CAM/UDP(dst_ip=172.28.7.123,dst_port=1999)" # Savary


[EXECUTE]
[EXECUTE]
ItsCam_TestCases.TC_CAM_MSD_FMT_BV_01
#ItsCam_TestCases.TC_CAM_MSD_FMT_BV_01
#ItsCam_TestCases.TC_CAM_MSD_FMT_BV_02
#ItsCam_TestCases.TC_CAM_MSD_FMT_BV_02
#ItsCam_TestCases.TC_CAM_MSD_FMT_BV_03
#ItsCam_TestCases.TC_CAM_MSD_FMT_BV_03
#ItsCam_TestCases.TC_CAM_MSD_FMT_BV_04
#ItsCam_TestCases.TC_CAM_MSD_FMT_BV_04
@@ -150,7 +151,7 @@ ItsCam_TestCases.TC_CAM_MSD_FMT_BV_01
#ItsCam_TestCases.TC_CAM_MSD_INA_BV_07
#ItsCam_TestCases.TC_CAM_MSD_INA_BV_07
#ItsCam_TestCases.TC_CAM_MSD_INA_BV_08
#ItsCam_TestCases.TC_CAM_MSD_INA_BV_08
#ItsCam_TestCases.TC_CAM_MSD_SSP_BO_02
#ItsCam_TestCases.TC_CAM_MSD_SSP_BO_02
#ItsCam_TestCases.TC_CAM_MSP_BV_01
ItsCam_TestCases.TC_CAM_MSP_BV_01


[MAIN_CONTROLLER]
[MAIN_CONTROLLER]
# The options herein control the behavior of MC.
# The options herein control the behavior of MC.
+6 −6
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ LibItsPki_Pics.PICS_ITS_S_CANONICAL_ID := '455453492D4954532D30303


LibItsPki_Pics.PICS_TS_EA_CERTIFICATE_ID             := "CERT_IDNOMIC_EA"
LibItsPki_Pics.PICS_TS_EA_CERTIFICATE_ID             := "CERT_IDNOMIC_EA"
LibItsPki_Pics.PICS_TS_AA_CERTIFICATE_ID             := "CERT_TS_A_AA"
LibItsPki_Pics.PICS_TS_AA_CERTIFICATE_ID             := "CERT_TS_A_AA"
LibItsPki_Pics.PICS_IUT_AA_CERTIFICATE_ID            := "CERT_IDNOMIC_AA2"
LibItsPki_Pics.PICS_IUT_AA_CERTIFICATE_ID            := "CERT_IDNOMIC_AA"
LibItsPki_Pics.PICS_TS_CA_CERTIFICATE_ID             := "CERT_IDNOMIC_RCA"
LibItsPki_Pics.PICS_TS_CA_CERTIFICATE_ID             := "CERT_IDNOMIC_RCA"


#LibItsPki_Pics.PICS_PKI_AUTH_POP                     := false # Do not use Signed for PoP in Authorization requet
#LibItsPki_Pics.PICS_PKI_AUTH_POP                     := false # Do not use Signed for PoP in Authorization requet
@@ -37,7 +37,7 @@ LibItsPki_Pics.PICS_TS_CA_CERTIFICATE_ID := "CERT_IDNOMIC_RCA"
#LibItsPki_Pixits.PX_EC_ALG_FOR_EC      := e_brainpool_p256_r1 # e_nist_p256, e_brainpool_p256_r1
#LibItsPki_Pixits.PX_EC_ALG_FOR_EC      := e_brainpool_p256_r1 # e_nist_p256, e_brainpool_p256_r1
#LibItsPki_Pixits.PX_EC_ALG_FOR_ATV     := e_brainpool_p256_r1 # e_nist_p256, e_brainpool_p256_r1
#LibItsPki_Pixits.PX_EC_ALG_FOR_ATV     := e_brainpool_p256_r1 # e_nist_p256, e_brainpool_p256_r1
#LibItsPki_Pixits.PX_EC_ALG_FOR_EC_SIGN := e_brainpool_p256_r1 # e_nist_p256, e_brainpool_p256_r1
#LibItsPki_Pixits.PX_EC_ALG_FOR_EC_SIGN := e_brainpool_p256_r1 # e_nist_p256, e_brainpool_p256_r1
LibItsPki_Pixits.PX_EC_ALG_FOR_AT       := e_brainpool_p256_r1 # e_nist_p256, e_brainpool_p256_r1
#LibItsPki_Pixits.PX_EC_ALG_FOR_AT       := e_brainpool_p256_r1 # e_nist_p256, e_brainpool_p256_r1


#LibItsPki_Pixits.PX_EC_PRIVATE_KEY     := '170D1EA638C300BD16F0025768C0F1FAA6BE23963E46AD10F79103914265D294'O
#LibItsPki_Pixits.PX_EC_PRIVATE_KEY     := '170D1EA638C300BD16F0025768C0F1FAA6BE23963E46AD10F79103914265D294'O
#LibItsPki_Pixits.PX_EC_HASH            := 'DFEFC2A74C8ADD0C8B74B958EE072229D25DEAAAE30D134193D091890E8F3C2C'O
#LibItsPki_Pixits.PX_EC_HASH            := 'DFEFC2A74C8ADD0C8B74B958EE072229D25DEAAAE30D134193D091890E8F3C2C'O
@@ -114,14 +114,14 @@ system.httpAtPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/
# If the responseCode is 0, the InnerECResponse shall also contain an (enrolment) certificate
# If the responseCode is 0, the InnerECResponse shall also contain an (enrolment) certificate
#ItsPki_TestCases.TC_SECPKI_EA_ENR_09_BV
#ItsPki_TestCases.TC_SECPKI_EA_ENR_09_BV
# If the responseCode is different than 0, the InnerECResponse shall not contain a certificate
# If the responseCode is different than 0, the InnerECResponse shall not contain a certificate
ItsPki_TestCases.TC_SECPKI_EA_ENR_10_BV
#ItsPki_TestCases.TC_SECPKI_EA_ENR_10_BV
# Check that signing of Enrolment response message is permitted by the EA certificate
# Check that signing of Enrolment response message is permitted by the EA certificate
#ItsPki_TestCases.TC_SECPKI_EA_ENR_11_BV
#ItsPki_TestCases.TC_SECPKI_EA_ENR_11_BV
# Check that generated EC certificate contains only allowed permissions
# Check that generated EC certificate contains only allowed permissions
#ItsPki_TestCases.TC_SECPKI_EA_ENR_12_BV
#ItsPki_TestCases.TC_SECPKI_EA_ENR_12_BV


# The AuthorizationValidationResponse message shall be sent by the EA to the AA across the interface at reference point S4 in response to a received AuthorizationValidationRequest message
# The AuthorizationValidationResponse message shall be sent by the EA to the AA across the interface at reference point S4 in response to a received AuthorizationValidationRequest message
ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_RCV_01_BV
#ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_RCV_01_BV
# Check that EA doesn't accept Authorization Validation Request when SharedAtRequest is signed with certificate without appropriate permissions
# Check that EA doesn't accept Authorization Validation Request when SharedAtRequest is signed with certificate without appropriate permissions
#ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_RCV_02_BI
#ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_RCV_02_BI


@@ -134,7 +134,7 @@ ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_RCV_01_BV
# If the responseCode is 0, the AuthorizationValidationResponse structure contains the component confirmedSubjectAttributes with the attributes the EA wishes to confirm, except for certIssuePermissions which is not allowed to be present
# If the responseCode is 0, the AuthorizationValidationResponse structure contains the component confirmedSubjectAttributes with the attributes the EA wishes to confirm, except for certIssuePermissions which is not allowed to be present
#ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_04_BV
#ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_04_BV
# If the responseCode is different than 0, the AuthorizationValidationResponse structure does not contain the component confirmedSubjectAttributes
# If the responseCode is different than 0, the AuthorizationValidationResponse structure does not contain the component confirmedSubjectAttributes
ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_05_BV
#ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_05_BV
# The component version of the EtsiTs102941Data structure is set to v1 (integer value set to 1)
# The component version of the EtsiTs102941Data structure is set to v1 (integer value set to 1)
#ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_06_BV
#ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_06_BV


@@ -172,7 +172,7 @@ ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_05_BV
#ItsPki_TestCases.TC_SECPKI_AA_AUTH_RCV_16_BI
#ItsPki_TestCases.TC_SECPKI_AA_AUTH_RCV_16_BI


# Check that the AA sends AuthorizationValidationRequest after receiving of the AuthorizationRequest
# Check that the AA sends AuthorizationValidationRequest after receiving of the AuthorizationRequest
#ItsPki_TestCases.TC_SECPKI_AA_AUTHVAL_01_BV
ItsPki_TestCases.TC_SECPKI_AA_AUTHVAL_01_BV


[MAIN_CONTROLLER]
[MAIN_CONTROLLER]
# The options herein control the behavior of MC.
# The options herein control the behavior of MC.
+4 −4
Original line number Original line Diff line number Diff line
@@ -246,8 +246,8 @@ then
    f_exit "Failed to generate ATS source code" 9
    f_exit "Failed to generate ATS source code" 9
fi
fi
../bin/Ats${ATS_NAME} -v
../bin/Ats${ATS_NAME} -v
if [ "$?" != "0" ]
#if [ "$?" != "0" ]
then
#then
    f_exit "Failed to executte binary file Ats${ATS_NAME}" 10
#    f_exit "Failed to executte binary file Ats${ATS_NAME}" 10
fi
#fi
f_exit "Build done successfully" 0
f_exit "Build done successfully" 0
Loading