blob: d5e5ff7e38db3557a92de3de955d997820aa5782 [file] [log] [blame]
Andrew de los Reyesd57d1472010-10-21 13:34:08 -07001// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_FLIMFLAM_PROXY_H__
6#define CHROMEOS_PLATFORM_UPDATE_ENGINE_FLIMFLAM_PROXY_H__
7
8// This class interfaces with FlimFlam to find out data about connectivity.
9
10#include <base/basictypes.h>
11
12#include "update_engine/dbus_interface.h"
13
14namespace chromeos_update_engine {
15
16extern const char* kFlimFlamDbusService;
17extern const char* kFlimFlamDbusManagerInterface;
18extern const char* kFlimFlamDbusManagerPath;
19extern const char* kFlimFlamDbusServiceInterface;
20
21extern const char* kFlimFlamNetTypeEthernet;
22extern const char* kFlimFlamNetTypeWifi;
23extern const char* kFlimFlamNetTypeWimax;
24extern const char* kFlimFlamNetTypeBluetooth;
25extern const char* kFlimFlamNetTypeCellular;
26
27enum NetworkConnectionType {
28 kNetEthernet = 0,
29 kNetWifi,
30 kNetWimax,
31 kNetBluetooth,
32 kNetCellular,
33 kNetUnknown
34};
35
36class FlimFlamProxy {
37 public:
38 static bool GetConnectionType(DbusGlibInterface* dbus_iface,
39 NetworkConnectionType* out_type);
40
41 static bool IsExpensiveConnectionType(NetworkConnectionType type) {
42 return type == kNetWimax || type == kNetBluetooth || type == kNetCellular;
43 }
44 static const char* StringForConnectionType(NetworkConnectionType type);
45
46 private:
47 // Should never be allocated
48 DISALLOW_IMPLICIT_CONSTRUCTORS(FlimFlamProxy);
49};
50
51} // namespace chromeos_update_engine
52
53#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_FLIMFLAM_PROXY_H__