Commit dd1b6ac5 authored by YannGarcia's avatar YannGarcia
Browse files

Reorganize code due to new version of TITAN. No backward compatibility

parent 2458eed8
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -12,11 +12,12 @@ ETSI ITS protocols project supports:
- EN 302 636-4-1: "Intelligent Transport Systems (ITS); Vehicular Communications; GeoNetworking; Part 4: Geographical addressing and forwarding for point-to-point and point-to-multipoint communications; Sub-part 1: Media-Independent Functionality"

In addition, it also support ITS Security as define by:
- ETSI TS 103 940: "Intelligent Transport Systems (ITS); Security; Security Architecture and Management".
- ETSI TS 103 097: "Intelligent Transport Systems (ITS); Security; Security header and certificate formats".
- ETSI TS 102 941: "Intelligent Transport Systems (ITS); Security; Trust and Privacy Management technical specification"
- IEEE Std 1609.2™-2016: "IEEE Standard for Wireless Access in Vehicular Environments –Security Services for Applications and Management Messages"
- IEEE Std 1609.2a™-2017: "Standard for Wireless Access In Vehicular Environments – Security Services for Applications and Management Messages Amendment 1".
- ETSI TS 103 097: "Intelligent Transport Systems (ITS); Security; Security header and certificate formats".
- ETSI TS 103 940: "Intelligent Transport Systems (ITS); Security; Security Architecture and Management".
- ETSI TS 103 759: "Intelligent Transport Systems (ITS); Security; isbehaviour Reporting service; Release 2"
- P1609.2™/D13: "Draft Standard for Wireless Access in Vehicular Environments – Security Services for Application and Management Messages"
- P1609.2.1™/D7: "Draft Standard for Wireless Access in Vehicular Environments (WAVE) – Certificate Management Interfaces for End Entities"

Contact information
Email at cti_support at etsi dot org
@@ -26,7 +27,7 @@ Unless specified otherwise, the content of this repository and the files contain
See the attached LICENSE file or visit
https://forge.etsi.org/etsi-software-license

## STFs
## STFs / TTFs

The following STFs were or are currently involved in the evolutions of the ETSI ITS protocols project:
- STF 405, STF 422, STF 424, STF 455, STF 462, STF 481, STF 484, STF 507, STF 517, STF 525, STF 538, STF 545, STF 594, TTF T002, TTF T011, TTF T024
@@ -63,7 +64,7 @@ Vagrant requires a virtual machine. You can use either VirtualBox or WMware.
Docker does not need a virtual machine, so it is the more efficant way.


#### Using Vagrant
### Using Vagrant

Pre-requisites on your host machine:
- Install [Virtualbox](https://www.virtualbox.org/manual/ch01.html)
@@ -141,7 +142,7 @@ $ ./virtualization/docker/run-container.sh
- Switch to the next clause (Usage)


#### From scratch
### From scratch

Pre-requisites:
- Install Virtualbox
@@ -220,17 +221,17 @@ $ cp ./ttcn/patch_lib_common/ttcn/* ./ttcn/LibCommon/ttcn
- Switch to the next clause (Usage)


#### Using Eclipse TITAN
### Using Eclipse TITAN

When cloning the ETSI ITS project, you can find two specific files:
- TTF011.tpd
- TTF011_Linux.tpd
- TS.ITS.tpd
- TS.ITS_Linux.tpd

These two files are used create the ETSI ITS project workspace on Eclipse TITAN. To do it, please follow the steps below:
- Start eclipse using a new workspace, (e.g. with the name workspace_titan)
- Select the menu option File/import
- In the Dialog box,select TITAN/Project from .tpd file
- Select the correct TTF011.tpd file and follow the instructions
- Select the correct TS.ITS.tpd file and follow the instructions

NOTE: When the Eclipse TITAN workspace is created, you have to build manually the librairy 'libasn1c.so' following the commands below:
```sh
+253 −253
Original line number Diff line number Diff line
@@ -163,27 +163,27 @@ namespace LibItsCam__EncdecDeclarations {
    return 0;
  }

  BITSTRING fx__enc__CAM(const CAM__PDU__Descriptions::CAM &p_cam) {
    loggers::get_instance().log_msg(">>> fx__enc__CAM: ", p_cam);

    cam_codec   codec;
    OCTETSTRING os;
    codec.encode(p_cam, os);
    return oct2bit(os);
  }

  INTEGER fx__dec__CAM(BITSTRING &b, CAM__PDU__Descriptions::CAM &p) {
    loggers::get_instance().log(">>> fx__dec__CAM");
    cam_codec   codec;
    OCTETSTRING is = bit2oct(b);

    if (codec.decode(OCTETSTRING(is.lengthof(), static_cast<const unsigned char *>(is)), p) == -1) {
      loggers::get_instance().warning("fx__dec__CAM: -1 result code was returned");
      return -1;
    }

    return 0;
  }
  // BITSTRING fx__enc__CAM(const CAM__PDU__Descriptions::CAM &p_cam) {
  //   loggers::get_instance().log_msg(">>> fx__enc__CAM: ", p_cam);

  //   cam_codec   codec;
  //   OCTETSTRING os;
  //   codec.encode(p_cam, os);
  //   return oct2bit(os);
  // }

  // INTEGER fx__dec__CAM(BITSTRING &b, CAM__PDU__Descriptions::CAM &p) {
  //   loggers::get_instance().log(">>> fx__dec__CAM");
  //   cam_codec   codec;
  //   OCTETSTRING is = bit2oct(b);

  //   if (codec.decode(OCTETSTRING(is.lengthof(), static_cast<const unsigned char *>(is)), p) == -1) {
  //     loggers::get_instance().warning("fx__dec__CAM: -1 result code was returned");
  //     return -1;
  //   }

  //   return 0;
  // }

  BITSTRING fx__enc__UtCamInitialize(const LibItsCam__TypesAndValues::UtCamInitialize &p_utCamInitialize) {
    loggers::get_instance().log_msg(">>> fx__enc__UtCamInitialize: ", p_utCamInitialize);
+257 −279
Original line number Diff line number Diff line
@@ -162,28 +162,6 @@ namespace LibItsDenm__EncdecDeclarations {
    return 0;
  }

  BITSTRING fx__enc__DENM(const DENM__PDU__Descriptions::DENM &p_denm) {
    loggers::get_instance().log_msg(">>> fx__enc__DENM: ", p_denm);

    denm_codec  codec;
    OCTETSTRING os;
    codec.encode(p_denm, os);
    return oct2bit(os);
  }

  INTEGER fx__dec__DENM(BITSTRING &b, DENM__PDU__Descriptions::DENM &p) {
    loggers::get_instance().log(">>> fx__dec__DENM");
    denm_codec  codec;
    OCTETSTRING is = bit2oct(b);

    if (codec.decode(OCTETSTRING(is.lengthof(), static_cast<const unsigned char *>(is)), p) == -1) {
      loggers::get_instance().warning("fx__dec__DENM: -1 result code was returned");
      return -1;
    }

    return 0;
  }

  BITSTRING fx__enc__UtDenmInitialize(const LibItsDenm__TypesAndValues::UtDenmInitialize &p_utDenmInitialize) {
    loggers::get_instance().log_msg(">>> fx__enc__UtDenmInitialize: ", p_utDenmInitialize);

+0 −22
Original line number Diff line number Diff line
@@ -163,28 +163,6 @@ namespace LibItsIvim__EncdecDeclarations {
    return 0;
  }

  BITSTRING fx__enc__IVIM(const IVIM__PDU__Descriptions::IVIM &p_ivim) {
    loggers::get_instance().log_msg(">>> fx__enc__IVIM: ", p_ivim);

    ivim_codec  codec;
    OCTETSTRING os;
    codec.encode(p_ivim, os);
    return oct2bit(os);
  }

  INTEGER fx__dec__IVIM(BITSTRING &b, IVIM__PDU__Descriptions::IVIM &p) {
    loggers::get_instance().log(">>> fx__dec__IVIM");
    ivim_codec  codec;
    OCTETSTRING is = bit2oct(b);

    if (codec.decode(OCTETSTRING(is.lengthof(), static_cast<const unsigned char *>(is)), p) == -1) {
      loggers::get_instance().warning("fx__dec__IVIM: -1 result code was returned");
      return -1;
    }

    return 0;
  }

  BITSTRING fx__enc__UtIvimInitialize(const LibItsIvim__TypesAndValues::UtIvimInitialize &p_utIvimInitialize) {
    loggers::get_instance().log_msg(">>> fx__enc__UtIvimInitialize: ", p_utIvimInitialize);

+0 −45
Original line number Diff line number Diff line
@@ -164,28 +164,6 @@ namespace LibItsMapemSpatem__EncdecDeclarations {
    return 0;
  }

  BITSTRING fx__enc__MAPEM(const MAPEM__PDU__Descriptions::MAPEM &p_mapem) {
    loggers::get_instance().log_msg(">>> fx__enc__Mapem: ", p_mapem);

    mapem_codec codec;
    OCTETSTRING os;
    codec.encode(p_mapem, os);
    return oct2bit(os);
  }

  INTEGER fx__dec__MAPEM(BITSTRING &b, MAPEM__PDU__Descriptions::MAPEM &p) {
    loggers::get_instance().log(">>> fx__dec__Mapem");
    mapem_codec codec;
    OCTETSTRING is = bit2oct(b);

    if (codec.decode(OCTETSTRING(is.lengthof(), static_cast<const unsigned char *>(is)), p) == -1) {
      loggers::get_instance().warning("fx__dec__Mapem: -1 result code was returned");
      return -1;
    }

    return 0;
  }

  /****************************************************
   * @desc    External function to encode a SpatemReq type
   * @param   value to encode
@@ -342,29 +320,6 @@ namespace LibItsMapemSpatem__EncdecDeclarations {
    return 0;
  }

  BITSTRING fx__enc__SPATEM(const SPATEM__PDU__Descriptions::SPATEM &p_spatem) {
    loggers::get_instance().log_msg(">>> fx__enc__Spatem: ", p_spatem);

    spatem_codec codec;
    OCTETSTRING  os;
    codec.encode(p_spatem, os);
    return oct2bit(os);
  }

  INTEGER fx__dec__SPATEM(BITSTRING &b, SPATEM__PDU__Descriptions::SPATEM &p_spatem) {
    loggers::get_instance().log(">>> fx__dec__Spatem");

    spatem_codec codec;
    OCTETSTRING  is = bit2oct(b);

    if (codec.decode(OCTETSTRING(is.lengthof(), static_cast<const unsigned char *>(is)), p_spatem) == -1) {
      loggers::get_instance().warning("fx__dec__Spatem: -1 result code was returned");
      return -1;
    }

    return 0;
  }

  BITSTRING fx__enc__UtMapemSpatemInitialize(const LibItsMapemSpatem__TypesAndValues::UtMapemSpatemInitialize &p_utMapemSpatemInitialize) {
    loggers::get_instance().log_msg(">>> fx__enc__UtMapemSpatemInitialize: ", p_utMapemSpatemInitialize);

Loading