Files
MicrOBU/microbu-esp32c5/external/vanetza-idf/vanetza/security/encap_service.hpp
T
Ashin Walpola 0e9525162d Keep the colleague's microbu-esp32c5 tree in this repository
obu-firmware builds against vanetza-idf from microbu-esp32c5/external, but
that tree was gitignored, so a clone of this repository could not build the
firmware it ships. It is now committed here as ordinary files in its own
folder, microbu-esp32c5/: the colleague's commit cf4b99f plus the V2X2MAP
bridge's signature verification (--trust) used on the bench. Nothing is
fetched from or pushed to the colleague's repository; this repository and
its remotes carry everything. The folder's own .gitignore keeps build output,
downloaded components and private key material out, as it did there; the
committed file set is identical to that repository's tracked files.

The ESP32-C5 is still flashed from obu-firmware/, which only takes
vanetza-idf from microbu-esp32c5/, so the two stay separate folders.
FLASHING.md says how to take a newer version of the colleague's tree (copy
it over the folder, rebuild, test, commit).
2026-09-23 17:46:40 +02:00

55 lines
1.5 KiB
C++

#ifndef FD3D1A69_8B8D_4DC1_8975_9FEB7A791B56
#define FD3D1A69_8B8D_4DC1_8975_9FEB7A791B56
#include <vanetza/security/secured_message.hpp>
#include <vanetza/security/sign_service.hpp>
#include <boost/variant/variant.hpp>
namespace vanetza
{
namespace security
{
/**
* Input data for encapsulating a packet in a secured message.
*
* According to TS 102 723-8 V1.1.1, SN-ENCAP.request offers the very same
* functionality as SN-SIGN.request and SN-ENCRYPT.request.
*
* Since encryption is not yet implemented, so only SignRequest is included.
*/
using EncapRequest = boost::variant<SignRequest>;
/**
* Confirmation of the encapsulation process (SN-ENCAP.confirm).
*
* TS 102 723-8 V1.1.1 includes only sec_packet but cannot report any errors.
* Instead of throwing exceptions, the variant may convey an error code instead
* of a SecuredMessage.
*/
struct EncapConfirm : public boost::variant<SecuredMessage, SignConfirmError>
{
public:
static EncapConfirm from(SignConfirm&&);
const SecuredMessage* secured_message() const;
SecuredMessage* secured_message();
private:
using variant::variant;
};
/**
* Dispatch an encapsulation request to the responsible service.
*
* \param encap_request SN-ENCAP.request data
* \param sign_service service handling signing requests
* \return SN-ENCAP.confirm
*/
EncapConfirm dispatch(EncapRequest&& encap_request, SignService* sign_service);
} // namespace security
} // namespace vanetza
#endif /* FD3D1A69_8B8D_4DC1_8975_9FEB7A791B56 */