1 #ifndef AKTUALIZR_SECONDARY_H
2 #define AKTUALIZR_SECONDARY_H
4 #include "aktualizr_secondary_config.h"
5 #include "aktualizr_secondary_metadata.h"
6 #include "uptane/secondaryinterface.h"
8 #include "uptane/directorrepository.h"
9 #include "uptane/imagesrepository.h"
10 #include "uptane/manifest.h"
18 using Ptr = std::shared_ptr<AktualizrSecondary>;
22 std::shared_ptr<KeyManager> key_mngr, std::shared_ptr<UpdateAgent> update_agent);
24 std::string Type()
const override {
return ""; }
30 bool ping()
const override {
return true; }
32 int32_t getRootVersion(
bool director)
const override;
33 bool putRoot(
const std::string& root,
bool director)
override;
34 bool sendFirmware(
const std::string& firmware)
override;
37 bool putMetadata(
const Metadata& metadata);
40 bool hasPendingUpdate() {
return storage_->hasPendingInstall(); }
41 bool doFullVerification(
const Metadata& metadata);
42 void uptaneInitialize();
43 void initPendingTargetIfAny();
52 std::shared_ptr<INvStorage> storage_;
53 std::shared_ptr<KeyManager> keys_;
54 Uptane::ManifestIssuer::Ptr manifest_issuer_;
59 std::shared_ptr<UpdateAgent> update_agent_;
62 #endif // AKTUALIZR_SECONDARY_H