Vanetza
Loading...
Searching...
No Matches
location_checker.hpp
1#pragma once
2#include <vanetza/asn1/security/Certificate.h>
3#include <vanetza/security/v3/asn1_types.hpp>
4
5
6namespace vanetza
7{
8
9// forward declaration
10struct PositionFix;
11
12namespace security
13{
14namespace v3
15{
16
17/**
18 * LocationChecker Interface
19 * Abstract base class defining the interface for location validation.
20 */
22{
23 public:
24 // Returns true if the given PositionFix lies within the specified GeographicRegion.
25 virtual bool valid_at_location(const asn1::EtsiTs103097Certificate& cert, const PositionFix& location) const = 0;
26 virtual ~LocationChecker() = default;
27};
28
29/**
30 * Always allow all the requests
31 */
33{
34 public:
35 bool valid_at_location(const asn1::EtsiTs103097Certificate& cert, const PositionFix& location) const override;
36};
37
38/**
39 * Always deny all the requests
40 */
42{
43 public:
44 bool valid_at_location(const asn1::EtsiTs103097Certificate& cert, const PositionFix& location) const override;
45};
46
47/**
48 * Default implementation that uses basic logic to check if a position is inside a region.
49 * It supports a few region types (e.g., None, Circular, Rectangular) and defaults to false for others.
50 */
52{
53 public:
54 bool valid_at_location(const asn1::EtsiTs103097Certificate& cert, const PositionFix& location) const override;
55};
56
57} // namespace v3
58} // namespace security
59} // namespace vanetza