Vanetza
Loading...
Searching...
No Matches
basic_elements.hpp
1#ifndef BASIC_ELEMENTS_HPP_RALCTYHI
2#define BASIC_ELEMENTS_HPP_RALCTYHI
3
4#include <vanetza/common/clock.hpp>
5#include <vanetza/security/hashed_id.hpp>
6#include <cstdint>
7
8namespace vanetza
9{
10namespace security
11{
12namespace v2
13{
14
15using Time64 = uint64_t;
16using Time32 = uint32_t;
17
18/// Time64WithStandardDeviation specified in TS 103 097 v1.2.1, section 4.2.16
20{
21 Time64 time64;
22 uint8_t log_std_dev;
23};
24
25/**
26 * Convert time point to time stamp
27 * \param tp time point
28 * \return time stamp with second accuracy
29 */
30Time32 convert_time32(const Clock::time_point& tp);
31
32/**
33 * Convert time point to time stamp
34 * \param tp time point
35 * \return time stamp with microsecond accuracy
36 */
37Time64 convert_time64(const Clock::time_point& tp);
38
39} // namespace v2
40} // namespace security
41} // namespace vanetza
42
43#endif /* BASIC_ELEMENTS_HPP_RALCTYHI */
ChunckPacket is a packet consisting of several memory chunks.
ByteBufferConvertible & operator[](OsiLayer ol)
ChunkPacket & merge(ChunkPacket &packet, OsiLayer from, OsiLayer to)
std::size_t size() const
const ByteBufferConvertible & layer(OsiLayer ol) const
const ByteBufferConvertible & operator[](OsiLayer ol) const
ByteBufferConvertible & layer(OsiLayer ol)
std::size_t size(OsiLayer from, OsiLayer to) const
ChunkPacket extract(OsiLayer from, OsiLayer to)
std::size_t size(OsiLayer from, OsiLayer to) const
buffer_const_range operator[](OsiLayer layer) const
std::size_t size() const
void set_boundary(OsiLayer, unsigned bytes)
const ByteBuffer & buffer() const
CohesivePacket(const ByteBuffer &buffer, OsiLayer layer)
void trim(OsiLayer from, unsigned bytes)
std::size_t size(OsiLayer single_layer) const
value_type operator[](size_type) const
Definition byte_view.cpp:48
byte_view_range(ByteBuffer &&)
Definition byte_view.cpp:37
byte_view_range(const ByteBuffer::const_iterator &, const ByteBuffer::const_iterator &)
Definition byte_view.cpp:27
ByteBuffer::const_pointer data() const
Definition byte_view.cpp:42
void encode(units::Duration)
Definition lifetime.cpp:45
units::Duration decode() const
Definition lifetime.cpp:59
bool after(const Timestamp &other) const
Definition timestamp.cpp:76
bool before(const Timestamp &other) const
Definition timestamp.cpp:71
static CertificateValidity valid()
Create CertificateValidity signalling a valid certificate This method is equivalent to default constr...
CertificateValidity(CertificateInvalidReason reason)
CertificateInvalidReason reason() const
Get reason for certificate invalidity This call is only safe if reason is available,...
IntX specified in TS 103 097 v1.2.1, section 4.2.1.
Definition int_x.hpp:21
static DecapConfirm from(VerifyConfirm &&verify_confirm, const SecuredMessageView &msg_view)
Input data for decapsulating a secured message.
Payload specified in TS 103 097 v1.2.1, section 5.2.
Definition payload.hpp:28
SecuredMessage as specified in TS 103 097 v1.2.1, section 5.1.
HeaderField * header_field(HeaderFieldType)
const TrailerField * trailer_field(TrailerFieldType type) const
const HeaderField * header_field(HeaderFieldType type) const
TrailerField * trailer_field(TrailerFieldType)
ThreeDLocation specified in TS 103 097 v1.2.1, section 4.2.19.
Definition region.hpp:21
Time64WithStandardDeviation specified in TS 103 097 v1.2.1, section 4.2.16.
resolve type for matching HeaderFieldType
resolve type for matching TrailerFieldType