Zelidrag Hornung | 3b12cdc | 2011-03-16 20:28:32 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 5 | #include <cstdio> |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 6 | #include <dlfcn.h> |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 7 | #include <string.h> |
Chris Masone | cc58f46 | 2010-08-20 23:53:00 | [diff] [blame] | 8 | #include <vector> |
| 9 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 10 | #include "base/basictypes.h" |
Dominic Mazzoni | a002001 | 2011-07-08 21:23:40 | [diff] [blame] | 11 | #include "base/values.h" |
Daniel Erat | 7537f1e | 2010-12-07 22:00:16 | [diff] [blame] | 12 | #include "chromeos_brightness.h" // NOLINT |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 13 | #include "chromeos_cros_api.h" // NOLINT |
Frank Swiderski | 06501a0 | 2010-05-27 00:35:43 | [diff] [blame] | 14 | #include "chromeos_cryptohome.h" // NOLINT |
Toni Barzic | a4a45a3 | 2010-08-20 21:01:57 | [diff] [blame] | 15 | #include "chromeos_imageburn.h" //NOLINT |
Kuan Tan | 9fb4a74 | 2011-01-27 22:03:10 | [diff] [blame] | 16 | #include "chromeos_libcros_service.h" // NOLINT |
Chris Masone | 2d1aa25 | 2010-02-05 22:06:05 | [diff] [blame] | 17 | #include "chromeos_login.h" // NOLINT |
dhg@google.com | 624040b | 2009-10-27 16:44:35 | [diff] [blame] | 18 | #include "chromeos_mount.h" // NOLINT |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 19 | #include "chromeos_network.h" // NOLINT |
Steven Bennetts | c78929b | 2011-02-14 18:15:43 | [diff] [blame] | 20 | #include "chromeos_network_deprecated.h" // NOLINT |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 21 | #include "chromeos_power.h" // NOLINT |
Denis Glotov | d44915a | 2011-02-14 17:59:12 | [diff] [blame] | 22 | #include "chromeos_resume.h" // NOLINT |
Mitsuru Oshima | f3f6835 | 2010-05-10 17:08:31 | [diff] [blame] | 23 | #include "chromeos_screen_lock.h" // NOLINT |
Chaitanya Gharpure | 8b42258 | 2010-04-21 23:54:20 | [diff] [blame] | 24 | #include "chromeos_speech_synthesis.h" // NOLINT |
Andrew de los Reyes | 9fe15e8 | 2010-06-07 23:41:54 | [diff] [blame] | 25 | #include "chromeos_update_engine.h" // NOLINT |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 26 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 27 | namespace chromeos { // NOLINT // |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 28 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 29 | namespace { |
| 30 | // If set, points to a function provided by Chrome to add a histogram. |
| 31 | LibcrosTimeHistogramFunc addHistogram = NULL; |
| 32 | // Pointer to libcros (from ::dlopen call). |
| 33 | void* dll_handle = NULL; |
| 34 | } |
| 35 | |
| 36 | class TimerInst { |
| 37 | public: |
| 38 | TimerInst(const char* name) { |
| 39 | if (addHistogram) { |
| 40 | name_ = std::string("Cros.") + name; |
| 41 | start_ = base::TimeTicks::Now(); |
| 42 | } |
| 43 | } |
| 44 | ~TimerInst() { |
| 45 | if (addHistogram) { |
| 46 | base::TimeDelta delta = base::TimeTicks::Now() - start_; |
| 47 | addHistogram(name_.c_str(), delta); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | private: |
| 52 | std::string name_; |
| 53 | base::TimeTicks start_; |
| 54 | }; |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 55 | |
| 56 | // Declare Function. These macros are used to define the imported functions |
| 57 | // from libcros. They will declare the proper type and define an exported |
| 58 | // variable to be used to call the function. |
| 59 | // |name| is the name of the function. |
| 60 | // |ret| is the return type. |
Yusuke Sato | 61ad7b7 | 2010-04-21 04:11:29 | [diff] [blame] | 61 | // |arg[1-5]| are the types are the arguments. |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 62 | // These are compile time declarations only. |
| 63 | // INIT_FUNC(name) needs to be called at runtime. |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 64 | #define DECL_FUNC_0(name, ret) \ |
| 65 | typedef ret (*name##Type)(); \ |
| 66 | name##Type name = 0; \ |
| 67 | ret WrapChromeOS##name() { \ |
| 68 | static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \ |
| 69 | TimerInst timer(#name); return func(); } |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 70 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 71 | #define DECL_FUNC_1(name, ret, arg1) \ |
| 72 | typedef ret (*name##Type)(arg1); \ |
| 73 | name##Type name = 0; \ |
| 74 | ret WrapChromeOS##name(arg1 a1) { \ |
| 75 | static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \ |
| 76 | TimerInst timer(#name); return func(a1); } |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 77 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 78 | #define DECL_FUNC_2(name, ret, arg1, arg2) \ |
| 79 | typedef ret (*name##Type)(arg1, arg2); \ |
| 80 | name##Type name = 0; \ |
| 81 | ret WrapChromeOS##name(arg1 a1, arg2 a2) { \ |
| 82 | static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \ |
| 83 | TimerInst timer(#name); return func(a1, a2); } |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 84 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 85 | #define DECL_FUNC_3(name, ret, arg1, arg2, arg3) \ |
| 86 | typedef ret (*name##Type)(arg1, arg2, arg3); \ |
| 87 | name##Type name = 0; \ |
| 88 | ret WrapChromeOS##name(arg1 a1, arg2 a2, arg3 a3) { \ |
| 89 | static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \ |
| 90 | TimerInst timer(#name); return func(a1, a2, a3); } |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 91 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 92 | #define DECL_FUNC_4(name, ret, arg1, arg2, arg3, arg4) \ |
| 93 | typedef ret (*name##Type)(arg1, arg2, arg3, arg4); \ |
| 94 | name##Type name = 0; \ |
| 95 | ret WrapChromeOS##name(arg1 a1, arg2 a2, arg3 a3, arg4 a4) { \ |
| 96 | static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \ |
| 97 | TimerInst timer(#name); return func(a1, a2, a3, a4); } |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 98 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 99 | #define DECL_FUNC_5(name, ret, arg1, arg2, arg3, arg4, arg5) \ |
| 100 | typedef ret (*name##Type)(arg1, arg2, arg3, arg4, arg5); \ |
| 101 | name##Type name = 0; \ |
| 102 | extern "C" ret ChromeOS##name(arg1, arg2, arg3, arg4, arg5); \ |
| 103 | ret WrapChromeOS##name( \ |
| 104 | arg1 a1, arg2 a2, arg3 a3, arg4 a4, arg5 a5) { \ |
| 105 | static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \ |
| 106 | TimerInst timer(#name); return func(a1, a2, a3, a4, a5); } |
Yusuke Sato | 61ad7b7 | 2010-04-21 04:11:29 | [diff] [blame] | 107 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 108 | #define DECL_FUNC_6(name, ret, arg1, arg2, arg3, arg4, arg5, arg6) \ |
| 109 | typedef ret (*name##Type)(arg1, arg2, arg3, arg4, arg5, arg6); \ |
| 110 | name##Type name = 0; \ |
| 111 | extern "C" ret ChromeOS##name(arg1, arg2, arg3, arg4, arg5, arg6); \ |
| 112 | ret WrapChromeOS##name( \ |
| 113 | arg1 a1, arg2 a2, arg3 a3, arg4 a4, arg5 a5, arg6 a6) { \ |
| 114 | static name##Type func = name##Type(::dlsym(dll_handle, "ChromeOS"#name)); \ |
| 115 | TimerInst timer(#name); return func(a1, a2, a3, a4, a5, a6); } |
Frank Swiderski | 692b1dd | 2010-09-27 22:46:46 | [diff] [blame] | 116 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 117 | // Version |
| 118 | DECL_FUNC_1(CrosVersionCheck, bool, chromeos::CrosAPIVersion); |
| 119 | |
| 120 | // Power |
| 121 | DECL_FUNC_2(MonitorPowerStatus, PowerStatusConnection, PowerMonitor, void*); |
| 122 | DECL_FUNC_1(DisconnectPowerStatus, void, PowerStatusConnection); |
| 123 | DECL_FUNC_1(RetrievePowerInformation, bool, PowerInformation*); |
xiyuan | aaba786 | 2010-10-05 19:08:32 | [diff] [blame] | 124 | DECL_FUNC_1(EnableScreenLock, void, bool); |
Satoru Takabayashi | 1b3a2ea | 2010-10-21 07:33:53 | [diff] [blame] | 125 | DECL_FUNC_0(RequestRestart, void); |
Satoru Takabayashi | 971cbbd | 2010-10-20 05:54:14 | [diff] [blame] | 126 | DECL_FUNC_0(RequestShutdown, void); |
Denis Glotov | d44915a | 2011-02-14 17:59:12 | [diff] [blame] | 127 | DECL_FUNC_2(MonitorResume, ResumeConnection, ResumeMonitor, void*); |
| 128 | DECL_FUNC_1(DisconnectResume, void, ResumeConnection); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 129 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 130 | // Mount |
Zelidrag Hornung | 3b12cdc | 2011-03-16 20:28:32 | [diff] [blame] | 131 | DECL_FUNC_3(MountRemovableDevice, void, |
| 132 | const char*, MountRequestCallback, void*); |
| 133 | DECL_FUNC_3(UnmountRemovableDevice, void, |
| 134 | const char*, MountRequestCallback, void*); |
| 135 | DECL_FUNC_3(GetDiskProperties, void, |
| 136 | const char*, GetDiskPropertiesCallback, void*); |
| 137 | DECL_FUNC_2(RequestMountInfo, void, |
| 138 | RequestMountInfoCallback, void*); |
| 139 | DECL_FUNC_2(MonitorMountEvents, MountEventConnection, MountEventMonitor, void*); |
| 140 | DECL_FUNC_1(DisconnectMountEventMonitor, void, MountEventConnection); |
| 141 | |
| 142 | // TODO(zelidrag): Remove this chunk after libcros package rev up: |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 143 | DECL_FUNC_2(MonitorMountStatus, MountStatusConnection, MountMonitor, void*); |
| 144 | DECL_FUNC_1(DisconnectMountStatus, void, MountStatusConnection); |
| 145 | DECL_FUNC_0(RetrieveMountInformation, MountStatus*); |
| 146 | DECL_FUNC_1(FreeMountStatus, void, MountStatus*); |
David Garcia | 47d71f0 | 2010-04-02 21:07:19 | [diff] [blame] | 147 | DECL_FUNC_1(MountDevicePath, bool, const char*); |
Toni Barzic | fabdef8 | 2010-08-14 01:00:01 | [diff] [blame] | 148 | DECL_FUNC_1(UnmountDevicePath, bool, const char*); |
Achuith Bhandarkar | a186acd | 2011-01-13 22:50:11 | [diff] [blame] | 149 | DECL_FUNC_1(IsBootDevicePath, bool, const char*); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 150 | |
| 151 | // Networking |
Charlie Lee | a167a2c | 2010-03-18 16:34:18 | [diff] [blame] | 152 | DECL_FUNC_0(GetSystemInfo, SystemInfo*); |
Charlie Lee | c1e74f9 | 2010-03-15 23:35:28 | [diff] [blame] | 153 | DECL_FUNC_1(RequestScan, void, ConnectionType); |
Charlie Lee | 210cd5a | 2010-03-13 00:23:01 | [diff] [blame] | 154 | DECL_FUNC_2(GetWifiService, ServiceInfo*, const char*, ConnectionSecurity); |
Charlie Lee | a6488bb | 2010-08-17 16:36:18 | [diff] [blame] | 155 | DECL_FUNC_2(ActivateCellularModem, bool, const char*, const char*); |
Nathan Williams | d3e90bd | 2010-08-02 18:51:06 | [diff] [blame] | 156 | DECL_FUNC_5(ConfigureWifiService, bool, const char*, ConnectionSecurity, |
| 157 | const char*, const char*, const char*); |
Nathan Williams | ad28b98 | 2011-03-03 19:08:39 | [diff] [blame] | 158 | DECL_FUNC_3(SetNetworkServiceProperty, void, const char*, const char*, |
Dominic Mazzoni | a002001 | 2011-07-08 21:23:40 | [diff] [blame] | 159 | const Value *); |
Nathan Williams | 836f149 | 2011-03-24 23:22:38 | [diff] [blame] | 160 | DECL_FUNC_2(ClearNetworkServiceProperty, void, const char*, const char*); |
Nathan Williams | c53083d | 2011-04-21 22:08:26 | [diff] [blame] | 161 | DECL_FUNC_3(SetNetworkDeviceProperty, void, const char*, const char*, |
Dominic Mazzoni | a002001 | 2011-07-08 21:23:40 | [diff] [blame] | 162 | const Value *); |
Nathan Williams | c53083d | 2011-04-21 22:08:26 | [diff] [blame] | 163 | DECL_FUNC_2(ClearNetworkDeviceProperty, void, const char*, const char*); |
Charlie Lee | 858ed67 | 2011-05-26 20:29:57 | [diff] [blame] | 164 | DECL_FUNC_3(SetNetworkIPConfigProperty, void, const char*, const char*, |
Dominic Mazzoni | a002001 | 2011-07-08 21:23:40 | [diff] [blame] | 165 | const Value *); |
Charlie Lee | 858ed67 | 2011-05-26 20:29:57 | [diff] [blame] | 166 | DECL_FUNC_2(ClearNetworkIPConfigProperty, void, const char*, const char*); |
Steven Bennetts | 284f9cf | 2011-05-11 23:20:16 | [diff] [blame] | 167 | DECL_FUNC_2(DeleteServiceFromProfile, void, const char*, const char*); |
Charlie Lee | b3dd8be | 2010-04-30 22:10:22 | [diff] [blame] | 168 | DECL_FUNC_1(DisconnectFromNetwork, bool, const char*); |
Charlie Lee | 3254aa9 | 2010-04-19 21:12:06 | [diff] [blame] | 169 | DECL_FUNC_1(DeleteRememberedService, bool, const char*); |
Charlie Lee | a167a2c | 2010-03-18 16:34:18 | [diff] [blame] | 170 | DECL_FUNC_1(FreeSystemInfo, void, SystemInfo*); |
Charlie Lee | 210cd5a | 2010-03-13 00:23:01 | [diff] [blame] | 171 | DECL_FUNC_1(FreeServiceInfo, void, ServiceInfo*); |
Eric Shienbrood | 882feba | 2010-11-19 04:27:00 | [diff] [blame] | 172 | // MonitorNetwork is deprecated: use MonitorNetworkManager |
| 173 | DECL_FUNC_2(MonitorNetwork, |
| 174 | MonitorNetworkConnection, MonitorNetworkCallback, void*); |
| 175 | // DisconnectMonitorNetwork is deprecated: use DisconnectPropertyChangeMonitor |
| 176 | DECL_FUNC_1(DisconnectMonitorNetwork, void, MonitorNetworkConnection); |
Eric Shienbrood | a4e3a77 | 2010-09-17 19:54:40 | [diff] [blame] | 177 | DECL_FUNC_2(MonitorNetworkManager, PropertyChangeMonitor, |
| 178 | MonitorPropertyCallback, void*); |
| 179 | DECL_FUNC_1(DisconnectPropertyChangeMonitor, void, PropertyChangeMonitor); |
| 180 | DECL_FUNC_3(MonitorNetworkService, PropertyChangeMonitor, |
| 181 | MonitorPropertyCallback, const char*, void*); |
Eric Shienbrood | 853fc8a | 2011-04-07 22:39:14 | [diff] [blame] | 182 | DECL_FUNC_3(MonitorNetworkDevice, PropertyChangeMonitor, |
| 183 | MonitorPropertyCallback, const char*, void*); |
Steven Bennetts | 81677aa | 2010-09-27 19:49:57 | [diff] [blame] | 184 | DECL_FUNC_2(MonitorCellularDataPlan, DataPlanUpdateMonitor, |
| 185 | MonitorDataPlanCallback, void*); |
| 186 | DECL_FUNC_1(DisconnectDataPlanUpdateMonitor, void, DataPlanUpdateMonitor); |
Zelidrag Hornung | d446570 | 2010-11-04 18:45:37 | [diff] [blame] | 187 | DECL_FUNC_1(RetrieveCellularDataPlans, CellularDataPlanList*, const char*); |
Steven Bennetts | 81677aa | 2010-09-27 19:49:57 | [diff] [blame] | 188 | DECL_FUNC_1(RequestCellularDataPlanUpdate, void, const char*); |
Zelidrag Hornung | d446570 | 2010-11-04 18:45:37 | [diff] [blame] | 189 | DECL_FUNC_1(FreeCellularDataPlanList, void, CellularDataPlanList*); |
Nathan Williams | f25299c | 2011-03-25 21:17:25 | [diff] [blame] | 190 | DECL_FUNC_3(MonitorSMS, SMSMonitor, const char*, MonitorSMSCallback, void*); |
| 191 | DECL_FUNC_1(DisconnectSMSMonitor, void, SMSMonitor); |
Nathan Williams | ad28b98 | 2011-03-03 19:08:39 | [diff] [blame] | 192 | DECL_FUNC_3(RequestNetworkServiceConnect, void, const char*, |
| 193 | NetworkActionCallback, void *); |
Steven Bennetts | c78929b | 2011-02-14 18:15:43 | [diff] [blame] | 194 | DECL_FUNC_2(RequestNetworkManagerInfo, void, |
| 195 | NetworkPropertiesCallback, void*); |
| 196 | DECL_FUNC_3(RequestNetworkServiceInfo, void, const char*, |
| 197 | NetworkPropertiesCallback, void*); |
| 198 | DECL_FUNC_3(RequestNetworkDeviceInfo, void, const char*, |
| 199 | NetworkPropertiesCallback, void*); |
| 200 | DECL_FUNC_3(RequestNetworkProfile, void, const char*, |
| 201 | NetworkPropertiesCallback, void*); |
| 202 | DECL_FUNC_4(RequestNetworkProfileEntry, void, const char*, const char*, |
| 203 | NetworkPropertiesCallback, void*); |
| 204 | DECL_FUNC_4(RequestWifiServicePath, void, const char*, ConnectionSecurity, |
| 205 | NetworkPropertiesCallback, void*); |
Steven Bennetts | fa0877f | 2011-03-03 23:21:19 | [diff] [blame] | 206 | DECL_FUNC_4(RequestHiddenWifiNetwork, void, const char*, const char*, |
| 207 | NetworkPropertiesCallback, void*); |
Steven Bennetts | 8897181 | 2011-03-25 17:21:40 | [diff] [blame] | 208 | DECL_FUNC_5(RequestVirtualNetwork, void, const char*, const char*, const char*, |
| 209 | NetworkPropertiesCallback, void*); |
Steven Bennetts | fa0877f | 2011-03-03 23:21:19 | [diff] [blame] | 210 | DECL_FUNC_1(RequestNetworkScan, void, const char*); |
| 211 | DECL_FUNC_2(RequestNetworkDeviceEnable, void, const char*, bool); |
Eric Shienbrood | 853fc8a | 2011-04-07 22:39:14 | [diff] [blame] | 212 | DECL_FUNC_5(RequestRequirePin, void, const char*, const char*, bool, |
| 213 | NetworkActionCallback, void*); |
| 214 | DECL_FUNC_4(RequestEnterPin, void, const char*, const char*, |
| 215 | NetworkActionCallback, void*); |
| 216 | DECL_FUNC_5(RequestUnblockPin, void, const char*, const char*, const char*, |
| 217 | NetworkActionCallback, void*); |
| 218 | DECL_FUNC_5(RequestChangePin, void, const char*, const char*, const char*, |
| 219 | NetworkActionCallback, void*); |
Dmitry Polukhin | 4d7c3bf | 2011-04-19 09:23:36 | [diff] [blame] | 220 | DECL_FUNC_1(ProposeScan, void, const char*); |
| 221 | DECL_FUNC_4(RequestCellularRegister, void, const char*, const char*, |
| 222 | NetworkActionCallback, void*); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 223 | DECL_FUNC_2(EnableNetworkDevice, bool, ConnectionType, bool); |
| 224 | DECL_FUNC_1(SetOfflineMode, bool, bool); |
Charlie Lee | 3254aa9 | 2010-04-19 21:12:06 | [diff] [blame] | 225 | DECL_FUNC_2(SetAutoConnect, bool, const char*, bool); |
Charlie Lee | b3dd8be | 2010-04-30 22:10:22 | [diff] [blame] | 226 | DECL_FUNC_2(SetPassphrase, bool, const char*, const char*); |
Nathan Williams | bfe0d72 | 2010-05-10 22:17:59 | [diff] [blame] | 227 | DECL_FUNC_2(SetIdentity, bool, const char*, const char*); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 228 | DECL_FUNC_1(ListIPConfigs, IPConfigStatus*, const char*); |
| 229 | DECL_FUNC_2(AddIPConfig, bool, const char*, IPConfigType); |
| 230 | DECL_FUNC_1(SaveIPConfig, bool, IPConfig*); |
| 231 | DECL_FUNC_1(RemoveIPConfig, bool, IPConfig*); |
| 232 | DECL_FUNC_1(FreeIPConfig, void, IPConfig*); |
| 233 | DECL_FUNC_1(FreeIPConfigStatus, void, IPConfigStatus*); |
Charlie Lee | cc1c63d | 2010-07-14 18:07:01 | [diff] [blame] | 234 | DECL_FUNC_0(GetDeviceNetworkList, DeviceNetworkList*); |
| 235 | DECL_FUNC_1(FreeDeviceNetworkList, void, DeviceNetworkList*); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 236 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 237 | // Login |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 238 | DECL_FUNC_0(EmitLoginPromptReady, bool); |
Chris Masone | 37e26dd | 2010-08-26 16:11:41 | [diff] [blame] | 239 | DECL_FUNC_2(RestartJob, bool, int, const char*); |
Ken Mixter | 82f15fd | 2010-11-23 21:57:32 | [diff] [blame] | 240 | DECL_FUNC_0(RestartEntd, bool); |
Chris Masone | c18251d | 2011-03-23 00:52:12 | [diff] [blame] | 241 | DECL_FUNC_2(RetrievePolicy, void, RetrievePolicyCallback, void*); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 242 | DECL_FUNC_2(StartSession, bool, const char*, const char*); |
| 243 | DECL_FUNC_1(StopSession, bool, const char*); |
Chris Masone | 4f6c04e | 2011-04-06 22:32:36 | [diff] [blame] | 244 | DECL_FUNC_4(StorePolicy, |
| 245 | void, |
| 246 | const char*, |
| 247 | const unsigned int, |
| 248 | StorePolicyCallback, |
| 249 | void*); |
Chris Masone | cc58f46 | 2010-08-20 23:53:00 | [diff] [blame] | 250 | DECL_FUNC_2(MonitorSession, SessionConnection, SessionMonitor, void*); |
| 251 | DECL_FUNC_1(DisconnectSession, void, SessionConnection); |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 252 | |
Nathan Williams | bfe0d72 | 2010-05-10 22:17:59 | [diff] [blame] | 253 | // Screen Lock |
Mitsuru Oshima | f3f6835 | 2010-05-10 17:08:31 | [diff] [blame] | 254 | DECL_FUNC_2(MonitorScreenLock, |
| 255 | ScreenLockConnection, ScreenLockMonitor, void*); |
| 256 | DECL_FUNC_1(DisconnectScreenLock, void, ScreenLockConnection); |
| 257 | DECL_FUNC_0(NotifyScreenLockCompleted, void); |
| 258 | DECL_FUNC_0(NotifyScreenLockRequested, void); |
Mitsuru Oshima | f4d424d | 2010-05-14 08:46:22 | [diff] [blame] | 259 | DECL_FUNC_0(NotifyScreenUnlockRequested, void); |
Mitsuru Oshima | 6b6dc2a | 2010-05-19 04:31:26 | [diff] [blame] | 260 | DECL_FUNC_0(NotifyScreenUnlockCompleted, void); |
Mitsuru Oshima | f3f6835 | 2010-05-10 17:08:31 | [diff] [blame] | 261 | |
Chris Masone | e9d48f2 | 2010-03-08 19:18:58 | [diff] [blame] | 262 | // Cryptohome |
| 263 | DECL_FUNC_2(CryptohomeCheckKey, bool, const char*, const char*); |
Frank Swiderski | c317de6 | 2010-08-31 18:08:58 | [diff] [blame] | 264 | DECL_FUNC_2(CryptohomeAsyncCheckKey, int, const char*, const char*); |
Frank Swiderski | 06501a0 | 2010-05-27 00:35:43 | [diff] [blame] | 265 | DECL_FUNC_3(CryptohomeMigrateKey, bool, const char*, const char*, const char*); |
Frank Swiderski | c317de6 | 2010-08-31 18:08:58 | [diff] [blame] | 266 | DECL_FUNC_3(CryptohomeAsyncMigrateKey, |
| 267 | int, |
| 268 | const char*, |
| 269 | const char*, |
| 270 | const char*); |
Frank Swiderski | 06501a0 | 2010-05-27 00:35:43 | [diff] [blame] | 271 | DECL_FUNC_1(CryptohomeRemove, bool, const char*); |
Frank Swiderski | ce16404 | 2010-09-10 21:54:37 | [diff] [blame] | 272 | DECL_FUNC_1(CryptohomeAsyncRemove, int, const char*); |
Frank Swiderski | 06501a0 | 2010-05-27 00:35:43 | [diff] [blame] | 273 | DECL_FUNC_0(CryptohomeGetSystemSalt, CryptohomeBlob); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 274 | DECL_FUNC_2(CryptohomeGetSystemSaltSafe, bool, char**, int*); |
Chris Masone | e9d48f2 | 2010-03-08 19:18:58 | [diff] [blame] | 275 | DECL_FUNC_0(CryptohomeIsMounted, bool); |
Frank Swiderski | 13dd104 | 2010-06-11 19:36:00 | [diff] [blame] | 276 | DECL_FUNC_3(CryptohomeMountAllowFail, bool, const char*, const char*, int*); |
Frank Swiderski | 692b1dd | 2010-09-27 22:46:46 | [diff] [blame] | 277 | DECL_FUNC_6(CryptohomeMount, bool, const char*, const char*, bool, bool, |
| 278 | const std::vector<std::string>&, int*); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 279 | DECL_FUNC_6(CryptohomeMountSafe, bool, const char*, const char*, bool, bool, |
| 280 | const char**, int*); |
Frank Swiderski | 692b1dd | 2010-09-27 22:46:46 | [diff] [blame] | 281 | DECL_FUNC_5(CryptohomeAsyncMount, int, const char*, const char*, bool, bool, |
| 282 | const std::vector<std::string>&); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 283 | DECL_FUNC_5(CryptohomeAsyncMountSafe, int, const char*, const char*, bool, bool, |
| 284 | const char**); |
Frank Swiderski | 13dd104 | 2010-06-11 19:36:00 | [diff] [blame] | 285 | DECL_FUNC_1(CryptohomeMountGuest, bool, int*); |
Frank Swiderski | c317de6 | 2010-08-31 18:08:58 | [diff] [blame] | 286 | DECL_FUNC_0(CryptohomeAsyncMountGuest, int); |
Chris Masone | e9d48f2 | 2010-03-08 19:18:58 | [diff] [blame] | 287 | DECL_FUNC_0(CryptohomeUnmount, bool); |
Frank Swiderski | 692b1dd | 2010-09-27 22:46:46 | [diff] [blame] | 288 | DECL_FUNC_0(CryptohomeRemoveTrackedSubdirectories, bool); |
| 289 | DECL_FUNC_0(CryptohomeAsyncRemoveTrackedSubdirectories, int); |
Denis Glotov | a7f3eec | 2011-03-04 15:11:38 | [diff] [blame] | 290 | DECL_FUNC_0(CryptohomeDoAutomaticFreeDiskSpaceControl, bool); |
| 291 | DECL_FUNC_0(CryptohomeAsyncDoAutomaticFreeDiskSpaceControl, int); |
Denis Glotov | 4f3db48 | 2011-04-20 16:35:57 | [diff] [blame] | 292 | DECL_FUNC_1(CryptohomeAsyncSetOwnerUser, int, const char*); |
Frank Swiderski | 6e238ab | 2010-08-06 20:37:06 | [diff] [blame] | 293 | DECL_FUNC_0(CryptohomeTpmIsReady, bool); |
| 294 | DECL_FUNC_0(CryptohomeTpmIsEnabled, bool); |
Frank Swiderski | df0f40d | 2010-09-01 22:43:08 | [diff] [blame] | 295 | DECL_FUNC_0(CryptohomeTpmIsOwned, bool); |
| 296 | DECL_FUNC_0(CryptohomeTpmIsBeingOwned, bool); |
Frank Swiderski | 6e238ab | 2010-08-06 20:37:06 | [diff] [blame] | 297 | DECL_FUNC_1(CryptohomeTpmGetPassword, bool, std::string*); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 298 | DECL_FUNC_1(CryptohomeTpmGetPasswordSafe, bool, char**); |
Frank Swiderski | 3928185 | 2010-10-04 22:16:28 | [diff] [blame] | 299 | DECL_FUNC_0(CryptohomeTpmCanAttemptOwnership, void); |
| 300 | DECL_FUNC_0(CryptohomeTpmClearStoredPassword, void); |
Ken Mixter | 77ef50e | 2011-04-12 20:36:41 | [diff] [blame] | 301 | DECL_FUNC_0(CryptohomePkcs11IsTpmTokenReady, bool); |
| 302 | DECL_FUNC_2(CryptohomePkcs11GetTpmTokenInfo, void, std::string*, std::string*); |
Frank Swiderski | df0f40d | 2010-09-01 22:43:08 | [diff] [blame] | 303 | DECL_FUNC_1(CryptohomeGetStatusString, bool, std::string*); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 304 | DECL_FUNC_1(CryptohomeGetStatusStringSafe, bool, char**); |
Julian Pastarmov | 1081ddb | 2011-04-15 12:19:38 | [diff] [blame] | 305 | DECL_FUNC_2(CryptohomeInstallAttributesGet, bool, const char*, char**); |
| 306 | DECL_FUNC_2(CryptohomeInstallAttributesSet, bool, const char*, const char*); |
| 307 | DECL_FUNC_0(CryptohomeInstallAttributesCount, int); |
| 308 | DECL_FUNC_0(CryptohomeInstallAttributesFinalize, bool); |
| 309 | DECL_FUNC_0(CryptohomeInstallAttributesIsReady, bool); |
| 310 | DECL_FUNC_0(CryptohomeInstallAttributesIsSecure, bool); |
| 311 | DECL_FUNC_0(CryptohomeInstallAttributesIsInvalid, bool); |
| 312 | DECL_FUNC_0(CryptohomeInstallAttributesIsFirstInstall, bool); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 313 | DECL_FUNC_1(CryptohomeFreeString, void, char*); |
| 314 | DECL_FUNC_1(CryptohomeFreeBlob, void, char*); |
Frank Swiderski | c317de6 | 2010-08-31 18:08:58 | [diff] [blame] | 315 | DECL_FUNC_2(CryptohomeMonitorSession, void*, CryptohomeSignalCallback, void*); |
| 316 | DECL_FUNC_1(CryptohomeDisconnectSession, void, void*); |
Chris Masone | e9d48f2 | 2010-03-08 19:18:58 | [diff] [blame] | 317 | |
Toni Barzic | a4a45a3 | 2010-08-20 21:01:57 | [diff] [blame] | 318 | // Imageburn |
| 319 | DECL_FUNC_2(MonitorBurnStatus, BurnStatusConnection, BurnMonitor, void*); |
| 320 | DECL_FUNC_1(DisconnectBurnStatus, void, BurnStatusConnection); |
| 321 | DECL_FUNC_3(StartBurn, void, const char*, const char*, BurnStatusConnection); |
tbarzic | 160d795 | 2011-05-14 02:15:40 | [diff] [blame] | 322 | DECL_FUNC_4(RequestBurn, void, const char*, const char*, BurnMonitor, void*); |
Toni Barzic | a4a45a3 | 2010-08-20 21:01:57 | [diff] [blame] | 323 | |
Andrew de los Reyes | 9fe15e8 | 2010-06-07 23:41:54 | [diff] [blame] | 324 | // Update Engine (replacing Update library) |
| 325 | DECL_FUNC_2(MonitorUpdateStatus, UpdateStatusConnection, UpdateMonitor, void*); |
| 326 | DECL_FUNC_1(DisconnectUpdateProgress, void, UpdateStatusConnection); |
| 327 | DECL_FUNC_1(RetrieveUpdateProgress, bool, UpdateProgress*); |
| 328 | DECL_FUNC_0(InitiateUpdateCheck, bool); |
Darin Petkov | 69c5c26 | 2010-07-27 18:05:55 | [diff] [blame] | 329 | DECL_FUNC_0(RebootIfUpdated, bool); |
Satoru Takabayashi | 9d2a287 | 2010-10-27 04:49:08 | [diff] [blame] | 330 | DECL_FUNC_1(SetTrack, bool, const std::string&); |
| 331 | DECL_FUNC_0(GetTrack, std::string); |
James Cook | 8cab720 | 2011-05-09 17:42:46 | [diff] [blame] | 332 | DECL_FUNC_2(RequestUpdateStatus, void, UpdateMonitor, void*); |
Steven Bennetts | 82fea48 | 2011-03-16 16:57:15 | [diff] [blame] | 333 | DECL_FUNC_2(RequestUpdateCheck, void, UpdateCallback, void*); |
| 334 | DECL_FUNC_1(SetUpdateTrack, void, const std::string&); |
| 335 | DECL_FUNC_2(RequestUpdateTrack, void, UpdateTrackCallback, void*); |
Andrew de los Reyes | 9fe15e8 | 2010-06-07 23:41:54 | [diff] [blame] | 336 | |
Steven Bennetts | 82fea48 | 2011-03-16 16:57:15 | [diff] [blame] | 337 | // Speech Synthesis |
Chaitanya Gharpure | 8b42258 | 2010-04-21 23:54:20 | [diff] [blame] | 338 | DECL_FUNC_1(Speak, bool, const char*); |
| 339 | DECL_FUNC_1(SetSpeakProperties, bool, const char*); |
| 340 | DECL_FUNC_0(StopSpeaking, bool); |
| 341 | DECL_FUNC_0(IsSpeaking, bool); |
Chaitanya Gharpure | 8d763fc | 2010-06-08 17:38:31 | [diff] [blame] | 342 | DECL_FUNC_1(InitTts, void, InitStatusCallback); |
Chaitanya Gharpure | 8b42258 | 2010-04-21 23:54:20 | [diff] [blame] | 343 | |
Daniel Erat | 7537f1e | 2010-12-07 22:00:16 | [diff] [blame] | 344 | // Brightness |
Chris Wolfe | c8b0c12 | 2011-05-02 20:35:04 | [diff] [blame] | 345 | DECL_FUNC_1(DecreaseScreenBrightness, void, bool); |
| 346 | DECL_FUNC_0(IncreaseScreenBrightness, void); |
Daniel Erat | ccea53b | 2011-03-11 21:39:31 | [diff] [blame] | 347 | DECL_FUNC_2(MonitorBrightnessV2, |
| 348 | BrightnessConnection, |
| 349 | BrightnessMonitorFunctionV2, |
| 350 | void*); |
Daniel Erat | 7537f1e | 2010-12-07 22:00:16 | [diff] [blame] | 351 | DECL_FUNC_2(MonitorBrightness, |
| 352 | BrightnessConnection, |
| 353 | BrightnessMonitorFunction, |
| 354 | void*); |
| 355 | DECL_FUNC_1(DisconnectBrightness, void, BrightnessConnection); |
| 356 | |
Kuan Tan | 9fb4a74 | 2011-01-27 22:03:10 | [diff] [blame] | 357 | // LibCros Service |
| 358 | DECL_FUNC_0(StartLibCrosService, LibCrosServiceConnection); |
| 359 | DECL_FUNC_1(StopLibCrosService, void, LibCrosServiceConnection); |
| 360 | DECL_FUNC_3(SetNetworkProxyResolver, void, |
| 361 | NetworkProxyResolver, void*, LibCrosServiceConnection); |
| 362 | DECL_FUNC_4(NotifyNetworkProxyResolved, bool, const char*, const char*, |
| 363 | const char*, LibCrosServiceConnection); |
Rahul Chaturvedi | e295bfb | 2010-05-12 23:08:51 | [diff] [blame] | 364 | |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 365 | char const * const kCrosDefaultPath = "/opt/google/chrome/chromeos/libcros.so"; |
| 366 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 367 | // Initializes the variable by looking up the function by |name|. |
| 368 | // This macro uses the variable 'handle' and 'error_string'. |
| 369 | #define INIT_FUNC(name) \ |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 370 | name = WrapChromeOS##name; \ |
| 371 | if (!::dlsym(dll_handle, "ChromeOS"#name)) { \ |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 372 | error_string += "Couldn't load: "#name","; \ |
| 373 | } |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 374 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 375 | bool LoadLibcros(const char* path_to_libcros, std::string& error_string) { |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 376 | error_string.clear(); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 377 | |
| 378 | if (!path_to_libcros) { |
| 379 | error_string = "path_to_libcros can't be NULL"; |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 380 | return false; |
dhg@google.com | 624040b | 2009-10-27 16:44:35 | [diff] [blame] | 381 | } |
chocobo@google.com | 30c5437 | 2009-10-21 19:47:06 | [diff] [blame] | 382 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 383 | dll_handle = ::dlopen(path_to_libcros, RTLD_NOW); |
| 384 | if (dll_handle == NULL) { |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 385 | error_string = "Couldn't load libcros from: "; |
| 386 | error_string += path_to_libcros; |
| 387 | error_string += " error: "; |
| 388 | error_string += dlerror(); |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 389 | return false; |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 390 | } |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 391 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 392 | INIT_FUNC(CrosVersionCheck); |
| 393 | if (!CrosVersionCheck) { |
| 394 | // error_string will already be set. |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 395 | return false; |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 396 | } |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 397 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 398 | if (!CrosVersionCheck(chromeos::kCrosAPIVersion)) { |
| 399 | const int buf_size = sizeof(int)*8+1; |
| 400 | char buf[buf_size]; |
| 401 | typedef int (*VersionFuncType)(); |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 402 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 403 | // These weren't exported from older copies of the library. It's not an |
| 404 | // error so we don't use INIT_FUNC() |
| 405 | VersionFuncType GetMinCrosVersion = |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 406 | VersionFuncType(::dlsym(dll_handle, "ChromeOSGetMinCrosVersion")); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 407 | VersionFuncType GetCrosVersion = |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 408 | VersionFuncType(::dlsym(dll_handle, "ChromeOSGetCrosVersion")); |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 409 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 410 | error_string = "Incompatible libcros version. Client: "; |
| 411 | snprintf(buf, buf_size, "%d", chromeos::kCrosAPIVersion); |
| 412 | error_string += buf; |
| 413 | if (GetMinCrosVersion && GetCrosVersion) { |
| 414 | snprintf(buf, buf_size, "%d", GetMinCrosVersion()); |
| 415 | error_string += " Min: "; |
| 416 | error_string += buf; |
| 417 | snprintf(buf, buf_size, "%d", GetCrosVersion()); |
| 418 | error_string += " Max: "; |
| 419 | error_string += buf; |
| 420 | } |
| 421 | return false; |
| 422 | } |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 423 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 424 | // Power |
| 425 | INIT_FUNC(MonitorPowerStatus); |
| 426 | INIT_FUNC(DisconnectPowerStatus); |
| 427 | INIT_FUNC(RetrievePowerInformation); |
Yusuke Sato | fe3e265 | 2010-10-22 01:25:11 | [diff] [blame] | 428 | INIT_FUNC(EnableScreenLock); |
| 429 | INIT_FUNC(RequestRestart); |
| 430 | INIT_FUNC(RequestShutdown); |
Denis Glotov | d44915a | 2011-02-14 17:59:12 | [diff] [blame] | 431 | INIT_FUNC(MonitorResume); |
| 432 | INIT_FUNC(DisconnectResume); |
Yusuke Sato | d78e7be | 2009-12-15 01:54:58 | [diff] [blame] | 433 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 434 | // Mount |
Zelidrag Hornung | 3b12cdc | 2011-03-16 20:28:32 | [diff] [blame] | 435 | INIT_FUNC(MountRemovableDevice); |
| 436 | INIT_FUNC(UnmountRemovableDevice); |
| 437 | INIT_FUNC(GetDiskProperties); |
| 438 | INIT_FUNC(RequestMountInfo); |
| 439 | INIT_FUNC(MonitorMountEvents); |
| 440 | INIT_FUNC(DisconnectMountEventMonitor); |
| 441 | // TODO(zelidrag): Remove these once libcro revs up. |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 442 | INIT_FUNC(MonitorMountStatus); |
| 443 | INIT_FUNC(DisconnectMountStatus); |
| 444 | INIT_FUNC(RetrieveMountInformation); |
| 445 | INIT_FUNC(FreeMountStatus); |
David Garcia | 47d71f0 | 2010-04-02 21:07:19 | [diff] [blame] | 446 | INIT_FUNC(MountDevicePath); |
Toni Barzic | fabdef8 | 2010-08-14 01:00:01 | [diff] [blame] | 447 | INIT_FUNC(UnmountDevicePath); |
Achuith Bhandarkar | a186acd | 2011-01-13 22:50:11 | [diff] [blame] | 448 | INIT_FUNC(IsBootDevicePath); |
dhg@google.com | 624040b | 2009-10-27 16:44:35 | [diff] [blame] | 449 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 450 | // Networking |
Charlie Lee | a167a2c | 2010-03-18 16:34:18 | [diff] [blame] | 451 | INIT_FUNC(GetSystemInfo); |
Charlie Lee | c1e74f9 | 2010-03-15 23:35:28 | [diff] [blame] | 452 | INIT_FUNC(RequestScan); |
Charlie Lee | 210cd5a | 2010-03-13 00:23:01 | [diff] [blame] | 453 | INIT_FUNC(GetWifiService); |
Charlie Lee | a6488bb | 2010-08-17 16:36:18 | [diff] [blame] | 454 | INIT_FUNC(ActivateCellularModem); |
Nathan Williams | d3e90bd | 2010-08-02 18:51:06 | [diff] [blame] | 455 | INIT_FUNC(ConfigureWifiService); |
Nathan Williams | ad28b98 | 2011-03-03 19:08:39 | [diff] [blame] | 456 | INIT_FUNC(SetNetworkServiceProperty); |
Nathan Williams | 836f149 | 2011-03-24 23:22:38 | [diff] [blame] | 457 | INIT_FUNC(ClearNetworkServiceProperty); |
Nathan Williams | c53083d | 2011-04-21 22:08:26 | [diff] [blame] | 458 | INIT_FUNC(SetNetworkDeviceProperty); |
| 459 | INIT_FUNC(ClearNetworkDeviceProperty); |
Charlie Lee | 858ed67 | 2011-05-26 20:29:57 | [diff] [blame] | 460 | INIT_FUNC(SetNetworkIPConfigProperty); |
| 461 | INIT_FUNC(ClearNetworkIPConfigProperty); |
Steven Bennetts | 284f9cf | 2011-05-11 23:20:16 | [diff] [blame] | 462 | INIT_FUNC(DeleteServiceFromProfile); |
Charlie Lee | b3dd8be | 2010-04-30 22:10:22 | [diff] [blame] | 463 | INIT_FUNC(DisconnectFromNetwork); |
Charlie Lee | 3254aa9 | 2010-04-19 21:12:06 | [diff] [blame] | 464 | INIT_FUNC(DeleteRememberedService); |
Charlie Lee | a167a2c | 2010-03-18 16:34:18 | [diff] [blame] | 465 | INIT_FUNC(FreeSystemInfo); |
Charlie Lee | 210cd5a | 2010-03-13 00:23:01 | [diff] [blame] | 466 | INIT_FUNC(FreeServiceInfo); |
Eric Shienbrood | 882feba | 2010-11-19 04:27:00 | [diff] [blame] | 467 | // MonitorNetwork is deprecated: use MonitorNetworkManager |
| 468 | INIT_FUNC(MonitorNetwork); |
| 469 | // DisconnectMonitorNetwork is deprecated: |
| 470 | // use DisconnectPropertyChangeMonitor |
| 471 | INIT_FUNC(DisconnectMonitorNetwork); |
Eric Shienbrood | a4e3a77 | 2010-09-17 19:54:40 | [diff] [blame] | 472 | INIT_FUNC(MonitorNetworkManager); |
| 473 | INIT_FUNC(DisconnectPropertyChangeMonitor); |
| 474 | INIT_FUNC(MonitorNetworkService); |
Eric Shienbrood | 853fc8a | 2011-04-07 22:39:14 | [diff] [blame] | 475 | INIT_FUNC(MonitorNetworkDevice); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 476 | INIT_FUNC(EnableNetworkDevice); |
| 477 | INIT_FUNC(SetOfflineMode); |
Charlie Lee | 3254aa9 | 2010-04-19 21:12:06 | [diff] [blame] | 478 | INIT_FUNC(SetAutoConnect); |
Charlie Lee | b3dd8be | 2010-04-30 22:10:22 | [diff] [blame] | 479 | INIT_FUNC(SetPassphrase); |
Nathan Williams | bfe0d72 | 2010-05-10 22:17:59 | [diff] [blame] | 480 | INIT_FUNC(SetIdentity); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 481 | INIT_FUNC(ListIPConfigs); |
| 482 | INIT_FUNC(AddIPConfig); |
| 483 | INIT_FUNC(SaveIPConfig); |
| 484 | INIT_FUNC(RemoveIPConfig); |
| 485 | INIT_FUNC(FreeIPConfig); |
| 486 | INIT_FUNC(FreeIPConfigStatus); |
Charlie Lee | cc1c63d | 2010-07-14 18:07:01 | [diff] [blame] | 487 | INIT_FUNC(GetDeviceNetworkList); |
| 488 | INIT_FUNC(FreeDeviceNetworkList); |
Steven Bennetts | 81677aa | 2010-09-27 19:49:57 | [diff] [blame] | 489 | INIT_FUNC(MonitorCellularDataPlan); |
| 490 | INIT_FUNC(DisconnectDataPlanUpdateMonitor); |
| 491 | INIT_FUNC(RetrieveCellularDataPlans); |
| 492 | INIT_FUNC(RequestCellularDataPlanUpdate); |
Zelidrag Hornung | d446570 | 2010-11-04 18:45:37 | [diff] [blame] | 493 | INIT_FUNC(FreeCellularDataPlanList); |
Nathan Williams | f25299c | 2011-03-25 21:17:25 | [diff] [blame] | 494 | INIT_FUNC(MonitorSMS); |
| 495 | INIT_FUNC(DisconnectSMSMonitor); |
Nathan Williams | ad28b98 | 2011-03-03 19:08:39 | [diff] [blame] | 496 | INIT_FUNC(RequestNetworkServiceConnect); |
Steven Bennetts | c78929b | 2011-02-14 18:15:43 | [diff] [blame] | 497 | INIT_FUNC(RequestNetworkManagerInfo); |
| 498 | INIT_FUNC(RequestNetworkServiceInfo); |
| 499 | INIT_FUNC(RequestNetworkDeviceInfo); |
| 500 | INIT_FUNC(RequestNetworkProfile); |
| 501 | INIT_FUNC(RequestNetworkProfileEntry); |
| 502 | INIT_FUNC(RequestWifiServicePath); |
Steven Bennetts | fa0877f | 2011-03-03 23:21:19 | [diff] [blame] | 503 | INIT_FUNC(RequestHiddenWifiNetwork); |
Steven Bennetts | 8897181 | 2011-03-25 17:21:40 | [diff] [blame] | 504 | INIT_FUNC(RequestVirtualNetwork); |
Steven Bennetts | fa0877f | 2011-03-03 23:21:19 | [diff] [blame] | 505 | INIT_FUNC(RequestNetworkScan); |
| 506 | INIT_FUNC(RequestNetworkDeviceEnable); |
Eric Shienbrood | 853fc8a | 2011-04-07 22:39:14 | [diff] [blame] | 507 | INIT_FUNC(RequestRequirePin); |
| 508 | INIT_FUNC(RequestEnterPin); |
| 509 | INIT_FUNC(RequestUnblockPin); |
| 510 | INIT_FUNC(RequestChangePin); |
Dmitry Polukhin | 4d7c3bf | 2011-04-19 09:23:36 | [diff] [blame] | 511 | INIT_FUNC(ProposeScan); |
| 512 | INIT_FUNC(RequestCellularRegister); |
dhg@google.com | 624040b | 2009-10-27 16:44:35 | [diff] [blame] | 513 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 514 | // Login |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 515 | INIT_FUNC(EmitLoginPromptReady); |
Chris Masone | 37e26dd | 2010-08-26 16:11:41 | [diff] [blame] | 516 | INIT_FUNC(RestartJob); |
Ken Mixter | 82f15fd | 2010-11-23 21:57:32 | [diff] [blame] | 517 | INIT_FUNC(RestartEntd); |
Chris Masone | c18251d | 2011-03-23 00:52:12 | [diff] [blame] | 518 | INIT_FUNC(RetrievePolicy); |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 519 | INIT_FUNC(StartSession); |
| 520 | INIT_FUNC(StopSession); |
Chris Masone | c18251d | 2011-03-23 00:52:12 | [diff] [blame] | 521 | INIT_FUNC(StorePolicy); |
Chris Masone | cc58f46 | 2010-08-20 23:53:00 | [diff] [blame] | 522 | INIT_FUNC(MonitorSession); |
| 523 | INIT_FUNC(DisconnectSession); |
dhg@google.com | 624040b | 2009-10-27 16:44:35 | [diff] [blame] | 524 | |
Mitsuru Oshima | f3f6835 | 2010-05-10 17:08:31 | [diff] [blame] | 525 | // Screen Lock |
| 526 | INIT_FUNC(MonitorScreenLock); |
| 527 | INIT_FUNC(DisconnectScreenLock); |
| 528 | INIT_FUNC(NotifyScreenLockCompleted); |
| 529 | INIT_FUNC(NotifyScreenLockRequested); |
Mitsuru Oshima | f4d424d | 2010-05-14 08:46:22 | [diff] [blame] | 530 | INIT_FUNC(NotifyScreenUnlockRequested); |
Mitsuru Oshima | 6b6dc2a | 2010-05-19 04:31:26 | [diff] [blame] | 531 | INIT_FUNC(NotifyScreenUnlockCompleted); |
Mitsuru Oshima | f3f6835 | 2010-05-10 17:08:31 | [diff] [blame] | 532 | |
Chris Masone | e9d48f2 | 2010-03-08 19:18:58 | [diff] [blame] | 533 | // Cryptohome |
| 534 | INIT_FUNC(CryptohomeCheckKey); |
Frank Swiderski | c317de6 | 2010-08-31 18:08:58 | [diff] [blame] | 535 | INIT_FUNC(CryptohomeAsyncCheckKey); |
Frank Swiderski | 06501a0 | 2010-05-27 00:35:43 | [diff] [blame] | 536 | INIT_FUNC(CryptohomeMigrateKey); |
Frank Swiderski | c317de6 | 2010-08-31 18:08:58 | [diff] [blame] | 537 | INIT_FUNC(CryptohomeAsyncMigrateKey); |
Frank Swiderski | 06501a0 | 2010-05-27 00:35:43 | [diff] [blame] | 538 | INIT_FUNC(CryptohomeRemove); |
Frank Swiderski | ce16404 | 2010-09-10 21:54:37 | [diff] [blame] | 539 | INIT_FUNC(CryptohomeAsyncRemove); |
Frank Swiderski | 06501a0 | 2010-05-27 00:35:43 | [diff] [blame] | 540 | INIT_FUNC(CryptohomeGetSystemSalt); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 541 | INIT_FUNC(CryptohomeGetSystemSaltSafe); |
Chris Masone | e9d48f2 | 2010-03-08 19:18:58 | [diff] [blame] | 542 | INIT_FUNC(CryptohomeIsMounted); |
Frank Swiderski | 13dd104 | 2010-06-11 19:36:00 | [diff] [blame] | 543 | INIT_FUNC(CryptohomeMountAllowFail); |
Chris Masone | e9d48f2 | 2010-03-08 19:18:58 | [diff] [blame] | 544 | INIT_FUNC(CryptohomeMount); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 545 | INIT_FUNC(CryptohomeMountSafe); |
Frank Swiderski | c317de6 | 2010-08-31 18:08:58 | [diff] [blame] | 546 | INIT_FUNC(CryptohomeAsyncMount); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 547 | INIT_FUNC(CryptohomeAsyncMountSafe); |
Frank Swiderski | 13dd104 | 2010-06-11 19:36:00 | [diff] [blame] | 548 | INIT_FUNC(CryptohomeMountGuest); |
Frank Swiderski | c317de6 | 2010-08-31 18:08:58 | [diff] [blame] | 549 | INIT_FUNC(CryptohomeAsyncMountGuest); |
Chris Masone | e9d48f2 | 2010-03-08 19:18:58 | [diff] [blame] | 550 | INIT_FUNC(CryptohomeUnmount); |
Frank Swiderski | 692b1dd | 2010-09-27 22:46:46 | [diff] [blame] | 551 | INIT_FUNC(CryptohomeRemoveTrackedSubdirectories); |
| 552 | INIT_FUNC(CryptohomeAsyncRemoveTrackedSubdirectories); |
Denis Glotov | a7f3eec | 2011-03-04 15:11:38 | [diff] [blame] | 553 | INIT_FUNC(CryptohomeDoAutomaticFreeDiskSpaceControl); |
| 554 | INIT_FUNC(CryptohomeAsyncDoAutomaticFreeDiskSpaceControl); |
Denis Glotov | 4f3db48 | 2011-04-20 16:35:57 | [diff] [blame] | 555 | INIT_FUNC(CryptohomeAsyncSetOwnerUser); |
Frank Swiderski | 6e238ab | 2010-08-06 20:37:06 | [diff] [blame] | 556 | INIT_FUNC(CryptohomeTpmIsReady); |
| 557 | INIT_FUNC(CryptohomeTpmIsEnabled); |
Frank Swiderski | df0f40d | 2010-09-01 22:43:08 | [diff] [blame] | 558 | INIT_FUNC(CryptohomeTpmIsOwned); |
| 559 | INIT_FUNC(CryptohomeTpmIsBeingOwned); |
Frank Swiderski | 6e238ab | 2010-08-06 20:37:06 | [diff] [blame] | 560 | INIT_FUNC(CryptohomeTpmGetPassword); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 561 | INIT_FUNC(CryptohomeTpmGetPasswordSafe); |
Frank Swiderski | 3928185 | 2010-10-04 22:16:28 | [diff] [blame] | 562 | INIT_FUNC(CryptohomeTpmCanAttemptOwnership); |
| 563 | INIT_FUNC(CryptohomeTpmClearStoredPassword); |
Ken Mixter | 77ef50e | 2011-04-12 20:36:41 | [diff] [blame] | 564 | INIT_FUNC(CryptohomePkcs11IsTpmTokenReady); |
| 565 | INIT_FUNC(CryptohomePkcs11GetTpmTokenInfo); |
Frank Swiderski | df0f40d | 2010-09-01 22:43:08 | [diff] [blame] | 566 | INIT_FUNC(CryptohomeGetStatusString); |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 567 | INIT_FUNC(CryptohomeGetStatusStringSafe); |
Julian Pastarmov | 1081ddb | 2011-04-15 12:19:38 | [diff] [blame] | 568 | INIT_FUNC(CryptohomeInstallAttributesGet); |
| 569 | INIT_FUNC(CryptohomeInstallAttributesSet); |
| 570 | INIT_FUNC(CryptohomeInstallAttributesCount); |
| 571 | INIT_FUNC(CryptohomeInstallAttributesFinalize); |
| 572 | INIT_FUNC(CryptohomeInstallAttributesIsReady); |
| 573 | INIT_FUNC(CryptohomeInstallAttributesIsSecure); |
| 574 | INIT_FUNC(CryptohomeInstallAttributesIsInvalid); |
| 575 | INIT_FUNC(CryptohomeInstallAttributesIsFirstInstall); |
| 576 | |
Frank Swiderski | 880db71 | 2011-01-18 21:46:33 | [diff] [blame] | 577 | INIT_FUNC(CryptohomeFreeString); |
| 578 | INIT_FUNC(CryptohomeFreeBlob); |
Frank Swiderski | c317de6 | 2010-08-31 18:08:58 | [diff] [blame] | 579 | INIT_FUNC(CryptohomeMonitorSession); |
| 580 | INIT_FUNC(CryptohomeDisconnectSession); |
Chris Masone | e9d48f2 | 2010-03-08 19:18:58 | [diff] [blame] | 581 | |
Toni Barzic | a4a45a3 | 2010-08-20 21:01:57 | [diff] [blame] | 582 | // Imageburn |
| 583 | INIT_FUNC(MonitorBurnStatus); |
| 584 | INIT_FUNC(DisconnectBurnStatus); |
| 585 | INIT_FUNC(StartBurn); |
tbarzic | 160d795 | 2011-05-14 02:15:40 | [diff] [blame] | 586 | INIT_FUNC(RequestBurn); |
Chris Masone | cc58f46 | 2010-08-20 23:53:00 | [diff] [blame] | 587 | |
Andrew de los Reyes | 9fe15e8 | 2010-06-07 23:41:54 | [diff] [blame] | 588 | // Update Engine |
| 589 | INIT_FUNC(MonitorUpdateStatus); |
| 590 | INIT_FUNC(DisconnectUpdateProgress); |
| 591 | INIT_FUNC(RetrieveUpdateProgress); |
| 592 | INIT_FUNC(InitiateUpdateCheck); |
Darin Petkov | 69c5c26 | 2010-07-27 18:05:55 | [diff] [blame] | 593 | INIT_FUNC(RebootIfUpdated); |
Satoru Takabayashi | 9d2a287 | 2010-10-27 04:49:08 | [diff] [blame] | 594 | INIT_FUNC(SetTrack); |
| 595 | INIT_FUNC(GetTrack); |
James Cook | 8cab720 | 2011-05-09 17:42:46 | [diff] [blame] | 596 | INIT_FUNC(RequestUpdateStatus); |
Steven Bennetts | 82fea48 | 2011-03-16 16:57:15 | [diff] [blame] | 597 | INIT_FUNC(RequestUpdateCheck); |
| 598 | INIT_FUNC(SetUpdateTrack); |
| 599 | INIT_FUNC(RequestUpdateTrack); |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 600 | |
Satoru Takabayashi | 9d2a287 | 2010-10-27 04:49:08 | [diff] [blame] | 601 | // Speech Synthesis |
Chaitanya Gharpure | 8b42258 | 2010-04-21 23:54:20 | [diff] [blame] | 602 | INIT_FUNC(Speak); |
| 603 | INIT_FUNC(SetSpeakProperties); |
| 604 | INIT_FUNC(StopSpeaking); |
| 605 | INIT_FUNC(IsSpeaking); |
Chaitanya Gharpure | 8d763fc | 2010-06-08 17:38:31 | [diff] [blame] | 606 | INIT_FUNC(InitTts); |
Chaitanya Gharpure | 8b42258 | 2010-04-21 23:54:20 | [diff] [blame] | 607 | |
Daniel Erat | 7537f1e | 2010-12-07 22:00:16 | [diff] [blame] | 608 | // Brightness |
Chris Wolfe | c8b0c12 | 2011-05-02 20:35:04 | [diff] [blame] | 609 | INIT_FUNC(DecreaseScreenBrightness); |
| 610 | INIT_FUNC(IncreaseScreenBrightness); |
Daniel Erat | ccea53b | 2011-03-11 21:39:31 | [diff] [blame] | 611 | INIT_FUNC(MonitorBrightnessV2); |
Daniel Erat | 7537f1e | 2010-12-07 22:00:16 | [diff] [blame] | 612 | INIT_FUNC(MonitorBrightness); |
| 613 | INIT_FUNC(DisconnectBrightness); |
| 614 | |
Kuan Tan | 9fb4a74 | 2011-01-27 22:03:10 | [diff] [blame] | 615 | // LibCros Service |
| 616 | INIT_FUNC(StartLibCrosService); |
| 617 | INIT_FUNC(StopLibCrosService); |
| 618 | INIT_FUNC(SetNetworkProxyResolver); |
| 619 | INIT_FUNC(NotifyNetworkProxyResolved); |
| 620 | |
David Moore | 363c95e | 2010-02-23 00:41:34 | [diff] [blame] | 621 | return error_string.empty(); |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 622 | } |
| 623 | |
Steven Bennetts | 11ac049 | 2011-02-24 23:01:15 | [diff] [blame] | 624 | void SetLibcrosTimeHistogramFunction(LibcrosTimeHistogramFunc func) { |
| 625 | addHistogram = func; |
| 626 | } |
| 627 | |
rspangler@google.com | abb66d2 | 2009-10-10 00:23:49 | [diff] [blame] | 628 | } // namespace chromeos |