buffet: Move privetd sources into buffet
No functional changes, only renaming, fixed include paths and include
guards to avoid resubmit warnings.
BUG=brillo:1161
CQ-DEPEND=CL:276521
TEST=none
Change-Id: Icacff92aef47fdd46542bc96eba3ffbb4df6241a
Reviewed-on: https://chromium-review.googlesource.com/276319
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/buffet/privet/wifi_ssid_generator.h b/buffet/privet/wifi_ssid_generator.h
new file mode 100644
index 0000000..33e9628
--- /dev/null
+++ b/buffet/privet/wifi_ssid_generator.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BUFFET_PRIVET_WIFI_SSID_GENERATOR_H_
+#define BUFFET_PRIVET_WIFI_SSID_GENERATOR_H_
+
+#include <string>
+
+#include <base/callback.h>
+
+namespace privetd {
+
+class CloudDelegate;
+class WifiDelegate;
+
+class WifiSsidGenerator final {
+ public:
+ WifiSsidGenerator(const CloudDelegate* gcd, const WifiDelegate* wifi);
+ ~WifiSsidGenerator() = default;
+
+ std::string GenerateFlags() const;
+
+ // Can return empty string if CloudDelegate is not ready.
+ std::string GenerateSsid() const;
+
+ private:
+ friend class WifiSsidGeneratorTest;
+
+ // Sets object to use |n| instead of random number for SSID generation.
+ void SetRandomForTests(int n);
+
+ const CloudDelegate* gcd_{nullptr};
+ const WifiDelegate* wifi_{nullptr};
+
+ base::Callback<int(void)> get_random_;
+
+ DISALLOW_COPY_AND_ASSIGN(WifiSsidGenerator);
+};
+
+} // namespace privetd
+
+#endif // BUFFET_PRIVET_WIFI_SSID_GENERATOR_H_