obu-firmware builds against the vanetza-idf C-ITS library, which until now came from the colleague's microbu-esp32c5 tree beside the repository and was not tracked here, so a clone of this repository could not build the firmware it ships. The library alone is now part of obu-firmware, as obu-firmware/external/vanetza-idf: their external/vanetza-idf at commit cf4b99f, unchanged (9775 files; see its PROVENANCE.md). CMake takes it from there by default; -DVANETZA_IDF_DIR still points the build elsewhere. The rest of the colleague's tree (their own VAM firmware, PKI tooling, station-link Python tools, the V2X2MAP bridge) stays out of this repository and gitignored; nothing is pushed to their repository. NOTES.md, docs/06, TODO.md and the pcap verifier's usage line point at the new location.
60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
#ifndef BASIC_HEADER_HPP_8QS7WLG3
|
|
#define BASIC_HEADER_HPP_8QS7WLG3
|
|
|
|
#include <vanetza/common/bit_number.hpp>
|
|
#include <vanetza/geonet/lifetime.hpp>
|
|
#include <vanetza/geonet/mib.hpp>
|
|
#include <vanetza/geonet/serialization.hpp>
|
|
|
|
namespace vanetza
|
|
{
|
|
namespace geonet
|
|
{
|
|
|
|
struct DataRequest;
|
|
struct ShbDataRequest;
|
|
|
|
/// NextHeaderBasic specified in ETSI EN 302 636-4-1 v1.2.1, section 8.6.3
|
|
enum class NextHeaderBasic : uint8_t
|
|
{
|
|
Any = 0,
|
|
Common = 1,
|
|
Secured = 2,
|
|
};
|
|
|
|
/// BasicHeader specified in ETSI EN 302 636-4-1 v1.2.1, section 8.6
|
|
struct BasicHeader
|
|
{
|
|
BasicHeader();
|
|
BasicHeader(const MIB&);
|
|
BasicHeader(const DataRequest&, const MIB&);
|
|
BasicHeader(const ShbDataRequest&, const MIB&);
|
|
|
|
static constexpr std::size_t length_bytes = 3 + sizeof(Lifetime);
|
|
|
|
BitNumber<unsigned, 4> version;
|
|
NextHeaderBasic next_header; // 4 bit
|
|
uint8_t reserved;
|
|
Lifetime lifetime;
|
|
uint8_t hop_limit;
|
|
};
|
|
|
|
/**
|
|
* \brief Serializes a BasicHeader into a binary archive
|
|
* \param basic to serialize
|
|
* \param ar to serialize in
|
|
*/
|
|
void serialize(const BasicHeader&, OutputArchive&);
|
|
|
|
/**
|
|
* \brief Deserializes a BasicHeader from a binary archive
|
|
* \param basic to deserialize
|
|
* \param ar with a serialized BasicHeader at the beginning
|
|
*/
|
|
void deserialize(BasicHeader&, InputArchive&);
|
|
|
|
} // namespace geonet
|
|
} // namespace vanetza
|
|
|
|
#endif /* BASIC_HEADER_HPP_8QS7WLG3 */
|