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/device_delegate.h b/buffet/privet/device_delegate.h
new file mode 100644
index 0000000..9888dfd
--- /dev/null
+++ b/buffet/privet/device_delegate.h
@@ -0,0 +1,45 @@
+// 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_DEVICE_DELEGATE_H_
+#define BUFFET_PRIVET_DEVICE_DELEGATE_H_
+
+#include <memory>
+#include <utility>
+
+#include <base/time/time.h>
+
+namespace privetd {
+
+// Interface to provide access to general information about device.
+class DeviceDelegate {
+ public:
+  DeviceDelegate();
+  virtual ~DeviceDelegate();
+
+  // Returns HTTP ports for Privet. The first one is the primary port,
+  // the second is the port for a pooling updates requests. The second value
+  // could be 0. In this case the first port would be use for regular and for
+  // updates requests.
+  virtual std::pair<uint16_t, uint16_t> GetHttpEnpoint() const = 0;
+
+  // The same |GetHttpEnpoint| but for HTTPS.
+  virtual std::pair<uint16_t, uint16_t> GetHttpsEnpoint() const = 0;
+
+  // Returns device update.
+  virtual base::TimeDelta GetUptime() const = 0;
+
+  // Updates the HTTP port value.
+  virtual void SetHttpPort(uint16_t port) = 0;
+
+  // Updates the HTTPS port value.
+  virtual void SetHttpsPort(uint16_t port) = 0;
+
+  // Create default instance.
+  static std::unique_ptr<DeviceDelegate> CreateDefault();
+};
+
+}  // namespace privetd
+
+#endif  // BUFFET_PRIVET_DEVICE_DELEGATE_H_