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.
43 lines
1.0 KiB
C++
43 lines
1.0 KiB
C++
#include "router_fuzzing_context.hpp"
|
|
#include <iostream>
|
|
#include <fstream>
|
|
|
|
vanetza::ByteBuffer readFileIntoBuffer(const std::string &filename)
|
|
{
|
|
std::ifstream file(filename, std::ios::binary | std::ios::ate);
|
|
if (!file.is_open()) {
|
|
std::cerr << "Error opening file: " << filename << std::endl;
|
|
return {};
|
|
}
|
|
|
|
const std::streamsize size = file.tellg();
|
|
file.seekg(0, std::ios::beg);
|
|
|
|
vanetza::ByteBuffer buffer(size);
|
|
if (!file.read(reinterpret_cast<char *>(buffer.data()), size)) {
|
|
std::cerr << "Error reading file: " << filename << std::endl;
|
|
return {};
|
|
}
|
|
|
|
return buffer;
|
|
}
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
if (argc != 2) {
|
|
std::cerr << "Usage: " << argv[0] << " <filepath>" << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
const std::string filename = argv[1];
|
|
vanetza::ByteBuffer buffer = readFileIntoBuffer(filename);
|
|
|
|
if (buffer.empty()) {
|
|
return 1;
|
|
}
|
|
|
|
vanetza::RouterFuzzingContext context;
|
|
context.indicate(std::move(buffer));
|
|
return 0;
|
|
}
|