Jocelyn Bohr | 185432c | 2015-08-13 14:16:09 -0700 | [diff] [blame] | 1 | // Copyright 2015 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 | |
Yi Chou | 9d24b46 | 2020-12-04 01:12:57 +0800 | [diff] [blame^] | 5 | #include "tpm2-simulator/simulator.h" |
Jocelyn Bohr | 185432c | 2015-08-13 14:16:09 -0700 | [diff] [blame] | 6 | |
Yi Chou | 9d24b46 | 2020-12-04 01:12:57 +0800 | [diff] [blame^] | 7 | #include <base/command_line.h> |
| 8 | #include <base/logging.h> |
| 9 | #include <brillo/syslog_logging.h> |
Jocelyn Bohr | 185432c | 2015-08-13 14:16:09 -0700 | [diff] [blame] | 10 | |
Yi Chou | 9d24b46 | 2020-12-04 01:12:57 +0800 | [diff] [blame^] | 11 | int main(int argc, char* argv[]) { |
| 12 | // Initialize command line configuration early, as logging will require |
| 13 | // command line to be initialized |
| 14 | base::CommandLine::Init(argc, argv); |
| 15 | brillo::InitLog(brillo::kLogToSyslog | brillo::kLogToStderrIfTty); |
Jocelyn Bohr | 185432c | 2015-08-13 14:16:09 -0700 | [diff] [blame] | 16 | |
Yi Chou | 9d24b46 | 2020-12-04 01:12:57 +0800 | [diff] [blame^] | 17 | if (argc != 1) { |
| 18 | LOG(ERROR) << "Program accepts no command line arguments"; |
| 19 | return EXIT_FAILURE; |
Jocelyn Bohr | 185432c | 2015-08-13 14:16:09 -0700 | [diff] [blame] | 20 | } |
Yi Chou | 9d24b46 | 2020-12-04 01:12:57 +0800 | [diff] [blame^] | 21 | |
| 22 | tpm2_simulator::SimulatorDaemon daemon; |
| 23 | daemon.Run(); |
Jocelyn Bohr | 185432c | 2015-08-13 14:16:09 -0700 | [diff] [blame] | 24 | } |