Index: l2tp_manager.h |
diff --git a/l2tp_manager.h b/l2tp_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c3eb9ae763f35e4f2c741dc81c97e2995fccbea |
--- /dev/null |
+++ b/l2tp_manager.h |
@@ -0,0 +1,53 @@ |
+// 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_L2TP_MANAGER_H_ |
+#define _VPN_MANAGER_L2TP_MANAGER_H_ |
+ |
+#include "base/file_util.h" |
+#include "base/scoped_ptr.h" |
+#include "base/time.h" |
+#include "gtest/gtest_prod.h" // for FRIEND_TEST |
+#include "vpn-manager/service_manager.h" |
petkov
2011/03/04 18:42:56
add blank line
kmixter1
2011/03/05 02:48:59
Done.
|
+ |
+namespace chromeos { |
+class Process; |
+} |
+ |
+// Manages the L2TP daemon |
+class L2tpManager : public ServiceManager { |
+ public: |
+ L2tpManager(); |
+ |
+ bool Initialize(const std::string& remote); |
petkov
2011/03/04 18:42:56
overloading (of static)
kmixter1
2011/03/05 02:48:59
Done.
|
+ |
+ bool Start(); |
petkov
2011/03/04 18:42:56
virtual for inherited methods
kmixter1
2011/03/05 02:48:59
Done.
|
+ |
+ void Stop(); |
+ |
+ int Poll(); |
+ void HandleChild(pid_t pid, int signal); |
+ |
+ int output_fd() const { return output_fd_; } |
+ |
+ protected: |
+ friend class L2tpManagerTest; |
+ FRIEND_TEST(L2tpManagerTest, FormatL2tpdConfiguration); |
+ FRIEND_TEST(L2tpManagerTest, FormatPppdConfiguration); |
+ FRIEND_TEST(L2tpManagerTest, Initiate); |
+ FRIEND_TEST(L2tpManagerTest, Terminate); |
+ |
+ std::string FormatL2tpdConfiguration(const std::string& ppp_config_path); |
+ std::string FormatPppdConfiguration(); |
+ bool Initiate(); |
+ bool Terminate(); |
+ |
+ int output_fd_; |
+ base::TimeTicks start_ticks_; |
+ std::string remote_; |
+ FilePath l2tpd_control_path_; |
+ scoped_ptr<chromeos::Process> l2tpd_; |
+}; |
+ |
+#endif // _VPN_MANAGER_L2TP_MANAGER_H_ |