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/imagerepository.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 void completeInstall();
38 bool putMetadata(
const Metadata& metadata);
41 bool hasPendingUpdate() {
return storage_->hasPendingInstall(); }
42 bool doFullVerification(
const Metadata& metadata);
43 void uptaneInitialize();
44 void initPendingTargetIfAny();
53 std::shared_ptr<INvStorage> storage_;
54 std::shared_ptr<KeyManager> keys_;
55 Uptane::ManifestIssuer::Ptr manifest_issuer_;
60 std::shared_ptr<UpdateAgent> update_agent_;
63 #endif // AKTUALIZR_SECONDARY_H