Chromium Code Reviews| Index: ipsec_manager.h |
| diff --git a/ipsec_manager.h b/ipsec_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..012c3ceb6935aca204c7f9cf012d2832e1527874 |
| --- /dev/null |
| +++ b/ipsec_manager.h |
| @@ -0,0 +1,65 @@ |
| +// Copyright (c) 2011 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 _VPN_MANAGER_IPSEC_MANAGER_H_ |
| +#define _VPN_MANAGER_IPSEC_MANAGER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/scoped_ptr.h" |
| +#include "gtest/gtest_prod.h" // for FRIEND_TEST |
| +#include "vpn-manager/service_manager.h" |
|
petkov
2011/03/04 18:42:56
add a blank line before this project headers?
kmixter1
2011/03/05 02:48:59
Done.
|
| + |
| +class FilePath; |
| +namespace chromeos { |
| +class Process; |
| +} |
| + |
| +class IpsecManager : public ServiceManager { |
| + public: |
| + IpsecManager(); |
| + |
| + bool Initialize(int ike_version, |
|
petkov
2011/03/04 18:42:56
seems evil -- you're overloading the method name f
kmixter1
2011/03/05 02:48:59
Yikes, I was once told not to be, so fixing this w
|
| + const std::string& remote, |
| + const std::string& psk_file, |
| + const std::string& server_ca_file, |
| + const std::string& client_key_file, |
| + const std::string& client_cert_file); |
| + |
| + bool Start(); |
|
petkov
2011/03/04 18:42:56
add virtual keyword for all inherited virtual meth
kmixter1
2011/03/05 02:48:59
Is this style guide thing? I'll add them assuming
petkov
2011/03/11 19:12:53
yes, style says so.
|
| + void Stop(); |
| + |
| + int Poll(); |
|
petkov
2011/03/04 18:42:56
docstrings (throughout)
kmixter1
2011/03/05 02:48:59
Done.
|
| + void HandleChild(pid_t pid, int signal); |
| + |
| + int output_fd() const { return output_fd_; } |
| + |
| + protected: |
| + friend class IpsecManagerTest; |
| + FRIEND_TEST(IpsecManagerTest, FormatPsk); |
| + FRIEND_TEST(IpsecManagerTest, FormatStarterConfigFile); |
| + FRIEND_TEST(IpsecManagerTest, StartStarter); |
| + FRIEND_TEST(IpsecManagerTest, WriteConfigFiles); |
| + |
| + bool FormatPsk(const FilePath& input_file, std::string* formatted); |
| + void KillCurrentlyRunning(); |
| + bool WriteConfigFiles(); |
| + std::string FormatStarterConfigFile(); |
| + bool StartStarter(); |
|
petkov
2011/03/04 18:42:56
StartStarter?
kmixter1
2011/03/05 02:48:59
Yeah, the ipsec executable we start is called "sta
|
| + bool SetIpsecGroup(const FilePath& file_path); |
| + |
| + int output_fd_; |
| + int ike_version_; |
| + gid_t ipsec_group_; |
| + std::string stateful_container_; |
| + std::string starter_pid_file_; |
| + std::string remote_; |
| + std::string psk_file_; |
| + std::string server_ca_file_; |
| + std::string client_key_file_; |
| + std::string client_cert_file_; |
| + scoped_ptr<chromeos::Process> starter_; |
| +}; |
| + |
| +#endif // _VPN_MANAGER_IPSEC_MANAGER_H_ |