[shill] Use flimflam-esque storage ids
Devices:
device_<MAC>
IPConfig:
ipconfig_<MAC of associated device>_0
Services:
ethernet_<MAC of associated device>
wifi_<MAC of associated device>_<SSID>_<mode>_<security>
cellular_<MAC of associated device>_<Network_name>
BUG=chromium-os:17744
TEST=unit
Change-Id: Ibf061f9c184e7c86f5afcf97d48e321fc74bde1c
Reviewed-on: http://gerrit.chromium.org/gerrit/6412
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/ipconfig.h b/ipconfig.h
index 9e6b2e3..db0bc17 100644
--- a/ipconfig.h
+++ b/ipconfig.h
@@ -57,7 +57,6 @@
uint serial() const { return serial_; }
std::string GetRpcIdentifier();
- std::string GetStorageIdentifier();
// Registers a callback that's executed every time the configuration
// properties change. Takes ownership of |callback|. Pass NULL to remove a
@@ -79,14 +78,20 @@
PropertyStore *store() { return &store_; }
- bool Load(StoreInterface *storage);
- bool Save(StoreInterface *storage);
+ // |id_suffix| is used to generate a storage ID that binds this instance
+ // to its associated device.
+ virtual bool Load(StoreInterface *storage, const std::string &id_suffix);
+ virtual bool Save(StoreInterface *storage, const std::string &id_suffix);
protected:
// Updates the IP configuration properties and notifies registered listeners
// about the event. |success| is set to false if the IP configuration failed.
void UpdateProperties(const Properties &properties, bool success);
+ // |id_suffix| is appended to the storage id, intended to bind this instance
+ // to its associated device.
+ std::string GetStorageIdentifier(const std::string &id_suffix);
+
PropertyStore store_;
private: