Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: ipsec_manager.h

Issue 6508016: vpn-manager: Add l2tp/ipsec vpn manager (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vpn-manager.git@master
Patch Set: tweak Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 _VPN_MANAGER_IPSEC_MANAGER_H_
6 #define _VPN_MANAGER_IPSEC_MANAGER_H_
7
8 #include <string>
9
10 #include "base/scoped_ptr.h"
11 #include "gtest/gtest_prod.h" // for FRIEND_TEST
12 #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.
13
14 class FilePath;
15 namespace chromeos {
16 class Process;
17 }
18
19 class IpsecManager : public ServiceManager {
20 public:
21 IpsecManager();
22
23 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
24 const std::string& remote,
25 const std::string& psk_file,
26 const std::string& server_ca_file,
27 const std::string& client_key_file,
28 const std::string& client_cert_file);
29
30 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.
31 void Stop();
32
33 int Poll();
petkov 2011/03/04 18:42:56 docstrings (throughout)
kmixter1 2011/03/05 02:48:59 Done.
34 void HandleChild(pid_t pid, int signal);
35
36 int output_fd() const { return output_fd_; }
37
38 protected:
39 friend class IpsecManagerTest;
40 FRIEND_TEST(IpsecManagerTest, FormatPsk);
41 FRIEND_TEST(IpsecManagerTest, FormatStarterConfigFile);
42 FRIEND_TEST(IpsecManagerTest, StartStarter);
43 FRIEND_TEST(IpsecManagerTest, WriteConfigFiles);
44
45 bool FormatPsk(const FilePath& input_file, std::string* formatted);
46 void KillCurrentlyRunning();
47 bool WriteConfigFiles();
48 std::string FormatStarterConfigFile();
49 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
50 bool SetIpsecGroup(const FilePath& file_path);
51
52 int output_fd_;
53 int ike_version_;
54 gid_t ipsec_group_;
55 std::string stateful_container_;
56 std::string starter_pid_file_;
57 std::string remote_;
58 std::string psk_file_;
59 std::string server_ca_file_;
60 std::string client_key_file_;
61 std::string client_cert_file_;
62 scoped_ptr<chromeos::Process> starter_;
63 };
64
65 #endif // _VPN_MANAGER_IPSEC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698