| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ENTD_ENTD_H_ | 5 #ifndef ENTD_ENTD_H_ |
| 6 #define ENTD_ENTD_H_ | 6 #define ENTD_ENTD_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 policy_filename_ = filename; | 68 policy_filename_ = filename; |
| 69 } | 69 } |
| 70 | 70 |
| 71 // Determines how the pkcs11 module will be setup. | 71 // Determines how the pkcs11 module will be setup. |
| 72 // See ConstructEntd() for details. | 72 // See ConstructEntd() for details. |
| 73 void SetPkcs11Mode(const std::string& mode) { | 73 void SetPkcs11Mode(const std::string& mode) { |
| 74 LOG(INFO) << "PKCS11 Mode: '" << mode << "'"; | 74 LOG(INFO) << "PKCS11 Mode: '" << mode << "'"; |
| 75 pkcs11_mode_ = mode; | 75 pkcs11_mode_ = mode; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Used to set the opsnssl configuration file. | |
| 79 void SetPkcs11OpenSSLConfig(const std::string& config_file) { | |
| 80 LOG(INFO) << "PKCS11 OpenSSL config: '" << config_file << "'"; | |
| 81 pkcs11_config_filename_ = config_file; | |
| 82 } | |
| 83 | |
| 84 bool SetHostname(const std::string& hostname) { | 78 bool SetHostname(const std::string& hostname) { |
| 85 if (!CheckHostname(hostname)) { | 79 if (!CheckHostname(hostname)) { |
| 86 LOG(ERROR) << "Invalid hostname: " << hostname; | 80 LOG(ERROR) << "Invalid hostname: " << hostname; |
| 87 return false; | 81 return false; |
| 88 } | 82 } |
| 89 | 83 |
| 90 LOG(INFO) << "Hostname set to: " << hostname; | 84 LOG(INFO) << "Hostname set to: " << hostname; |
| 91 hostname_ = hostname; | 85 hostname_ = hostname; |
| 92 return true; | 86 return true; |
| 93 } | 87 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 184 |
| 191 // Invoke some method on the global JSON object. | 185 // Invoke some method on the global JSON object. |
| 192 bool CallJson(std::string method_name, v8::Handle<v8::Value> arg, | 186 bool CallJson(std::string method_name, v8::Handle<v8::Value> arg, |
| 193 v8::Handle<v8::Value>* result); | 187 v8::Handle<v8::Value>* result); |
| 194 | 188 |
| 195 std::string pkcs11_mode_; | 189 std::string pkcs11_mode_; |
| 196 | 190 |
| 197 std::string utility_filename_; | 191 std::string utility_filename_; |
| 198 std::string manifest_filename_; | 192 std::string manifest_filename_; |
| 199 std::string policy_filename_; | 193 std::string policy_filename_; |
| 200 std::string pkcs11_config_filename_; | |
| 201 | 194 |
| 202 // Starts out as just the hostname portion of the username, but may be | 195 // Starts out as just the hostname portion of the username, but may be |
| 203 // set to a subdomain of that by the manifest file. | 196 // set to a subdomain of that by the manifest file. |
| 204 std::string hostname_; | 197 std::string hostname_; |
| 205 // The entire username: user@example.com | 198 // The entire username: user@example.com |
| 206 std::string username_; | 199 std::string username_; |
| 207 | 200 |
| 208 // Exiting happens asynchronously. This is where the exit code is stashed | 201 // Exiting happens asynchronously. This is where the exit code is stashed |
| 209 // until the daemon has finished shutting down. | 202 // until the daemon has finished shutting down. |
| 210 int exit_code_; | 203 int exit_code_; |
| 211 | 204 |
| 212 uint32_t timeout_sequence_; | 205 uint32_t timeout_sequence_; |
| 213 std::vector<Timeout*> timeout_list_; | 206 std::vector<Timeout*> timeout_list_; |
| 214 std::map<uint32_t, NativeTimeout*> native_timeouts_; | 207 std::map<uint32_t, NativeTimeout*> native_timeouts_; |
| 215 | 208 |
| 216 scoped_ptr<CallbackServer> callback_server_; | 209 scoped_ptr<CallbackServer> callback_server_; |
| 217 scoped_ptr<Flimflam> flimflam_; | 210 scoped_ptr<Flimflam> flimflam_; |
| 218 scoped_ptr<Http> http_; | 211 scoped_ptr<Http> http_; |
| 219 scoped_ptr<Syslog> syslog_; | 212 scoped_ptr<Syslog> syslog_; |
| 220 scoped_ptr<Pkcs11> pkcs11_; | 213 scoped_ptr<Pkcs11> pkcs11_; |
| 221 v8::Persistent<v8::Context> context_; | 214 v8::Persistent<v8::Context> context_; |
| 222 | 215 |
| 223 DISALLOW_COPY_AND_ASSIGN(Entd); | 216 DISALLOW_COPY_AND_ASSIGN(Entd); |
| 224 }; | 217 }; |
| 225 | 218 |
| 226 } // namespace entd | 219 } // namespace entd |
| 227 | 220 |
| 228 #endif // ENTD_ENTD_H_ | 221 #endif // ENTD_ENTD_H_ |
| OLD | NEW |