-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
facilities: add support for Release 2 CAMs
- Loading branch information
Showing
9 changed files
with
740 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM alpine:3 AS base | ||
|
||
FROM base AS build | ||
ARG ASN1C_REPO=https://github.com/mouse07410/asn1c.git | ||
ARG ASN1C_VERSION=18e5650 | ||
RUN apk add --no-cache autoconf automake bison build-base flex gcc git libtool | ||
RUN git clone $ASN1C_REPO /asn1c-source && cd /asn1c-source && git checkout ${ASN1C_VERSION} | ||
WORKDIR /asn1c-source | ||
RUN autoreconf -iv && ./configure --prefix /asn1c && make -j $(nproc) install | ||
|
||
FROM base AS runtime | ||
ENV ASN1C_FLAGS="-fcompound-names -fincludes-quoted -no-gen-example" | ||
COPY --from=build /asn1c /asn1c |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,27 @@ | |
|
||
#include <vanetza/asn1/its/AltitudeConfidence.h> | ||
#include <vanetza/asn1/its/AltitudeValue.h> | ||
#include <vanetza/asn1/its/Heading.h> | ||
#include <vanetza/asn1/its/ReferencePosition.h> | ||
#include <vanetza/common/position_fix.hpp> | ||
#include <vanetza/security/cam_ssp.hpp> | ||
#include <vanetza/units/angle.hpp> | ||
#include <vanetza/units/length.hpp> | ||
|
||
// forward declaration of asn1c generated struct | ||
struct BasicVehicleContainerLowFrequency; | ||
struct Heading; | ||
struct ReferencePosition; | ||
struct Vanetza_ITS2_BasicVehicleContainerLowFrequency; | ||
struct Vanetza_ITS2_Heading; | ||
struct Vanetza_ITS2_ReferencePosition; | ||
|
||
namespace vanetza | ||
{ | ||
|
||
// forward declaration of CAM message wrapper | ||
namespace asn1 { class Cam; } | ||
// forward declaration of CAM message wrappers | ||
namespace asn1 { | ||
namespace r1 { class Cam; } | ||
namespace r2 { class Cam; } | ||
} | ||
|
||
namespace facilities | ||
{ | ||
|
@@ -30,6 +36,7 @@ class PathHistory; | |
* \param ASN.1 CAM container (destination) | ||
*/ | ||
void copy(const PathHistory&, BasicVehicleContainerLowFrequency&); | ||
void copy(const PathHistory&, Vanetza_ITS2_BasicVehicleContainerLowFrequency&); | ||
|
||
/** | ||
* Check if difference of two given heading values is within a limit | ||
|
@@ -40,6 +47,8 @@ void copy(const PathHistory&, BasicVehicleContainerLowFrequency&); | |
*/ | ||
bool similar_heading(const Heading& a, const Heading& b, units::Angle limit); | ||
bool similar_heading(const Heading& a, units::Angle b, units::Angle limit); | ||
bool similar_heading(const Vanetza_ITS2_Heading& a, const Vanetza_ITS2_Heading&b, units::Angle limit); | ||
bool similar_heading(const Vanetza_ITS2_Heading& a, units::Angle b, units::Angle limit); | ||
bool similar_heading(units::Angle a, units::Angle b, units::Angle limit); | ||
|
||
/** | ||
|
@@ -48,28 +57,37 @@ bool similar_heading(units::Angle a, units::Angle b, units::Angle limit); | |
* \param b another position | ||
* \return distance between given positions (or NaN if some position is unavailable) | ||
*/ | ||
units::Length distance(const ReferencePosition_t& a, const ReferencePosition_t& b); | ||
units::Length distance(const ReferencePosition_t& a, units::GeoAngle lat, units::GeoAngle lon); | ||
units::Length distance(const ReferencePosition& a, const ReferencePosition& b); | ||
units::Length distance(const ReferencePosition& a, units::GeoAngle lat, units::GeoAngle lon); | ||
units::Length distance(const Vanetza_ITS2_ReferencePosition& a, const Vanetza_ITS2_ReferencePosition& b); | ||
units::Length distance(const Vanetza_ITS2_ReferencePosition& a, units::GeoAngle lat, units::GeoAngle lon); | ||
|
||
/** | ||
* Check if ASN.1 data element indicates unavailable value | ||
* \return true if value is available | ||
*/ | ||
bool is_available(const Heading&); | ||
bool is_available(const ReferencePosition_t&); | ||
bool is_available(const Vanetza_ITS2_Heading&); | ||
bool is_available(const ReferencePosition&); | ||
bool is_available(const Vanetza_ITS2_ReferencePosition&); | ||
|
||
/** | ||
* Copy position information into a ReferencePosition structure from CDD | ||
*/ | ||
void copy(const PositionFix&, ReferencePosition&); | ||
void copy(const PositionFix&, Vanetza_ITS2_ReferencePosition&); | ||
|
||
/** | ||
* Convert altitude to AltitudeValue from CDD | ||
* | ||
* It is safe to cast AltitudeValue_t to Vanetza_ITS2_AltitudeValue_t. | ||
*/ | ||
AltitudeValue_t to_altitude_value(units::Length); | ||
|
||
/** | ||
* Convert altitude confidence to AltitudeConfidence from CDD | ||
* | ||
* It is safe to cast AltitudeConfidence_t to Vanetza_ITS2_AltitudeConfidence_t. | ||
*/ | ||
AltitudeConfidence_t to_altitude_confidence(units::Length); | ||
|
||
|
@@ -79,7 +97,8 @@ AltitudeConfidence_t to_altitude_confidence(units::Length); | |
* \param ssp CA service specific permissions | ||
* \return true if no forbidden data elements are included | ||
*/ | ||
bool check_service_specific_permissions(const asn1::Cam& cam, security::CamPermissions ssp); | ||
bool check_service_specific_permissions(const asn1::r1::Cam& cam, security::CamPermissions ssp); | ||
bool check_service_specific_permissions(const asn1::r2::Cam& cam, security::CamPermissions ssp); | ||
|
||
/** | ||
* Print CAM content with indentation of nested fields | ||
|
@@ -91,7 +110,8 @@ bool check_service_specific_permissions(const asn1::Cam& cam, security::CamPermi | |
* This function is an idea of Erik de Britto e Silva (erikbritto@github) | ||
* from University of Antwerp - [email protected] | ||
*/ | ||
void print_indented(std::ostream& os, const asn1::Cam& cam, const std::string& indent = "\t", unsigned start = 0); | ||
void print_indented(std::ostream& os, const asn1::r1::Cam& cam, const std::string& indent = "\t", unsigned start = 0); | ||
void print_indented(std::ostream& os, const asn1::r2::Cam& cam, const std::string& indent = "\t", unsigned start = 0); | ||
|
||
} // namespace facilities | ||
} // namespace vanetza | ||
|
Oops, something went wrong.