OLD | NEW |
1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 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 | 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 #include "vpn-manager/l2tp_manager.h" | 5 #include "vpn-manager/l2tp_manager.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chromeos/process.h" | 10 #include "chromeos/process.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 AddBool(&l2tpd_config, "require authentication", | 71 AddBool(&l2tpd_config, "require authentication", |
72 FLAGS_require_authentication); | 72 FLAGS_require_authentication); |
73 AddString(&l2tpd_config, "name", FLAGS_user); | 73 AddString(&l2tpd_config, "name", FLAGS_user); |
74 AddBool(&l2tpd_config, "ppp debug", FLAGS_ppp_debug); | 74 AddBool(&l2tpd_config, "ppp debug", FLAGS_ppp_debug); |
75 AddString(&l2tpd_config, "pppoptfile", ppp_config_path); | 75 AddString(&l2tpd_config, "pppoptfile", ppp_config_path); |
76 AddBool(&l2tpd_config, "length bit", FLAGS_length_bit); | 76 AddBool(&l2tpd_config, "length bit", FLAGS_length_bit); |
77 return l2tpd_config; | 77 return l2tpd_config; |
78 } | 78 } |
79 | 79 |
80 std::string L2tpManager::FormatPppdConfiguration() { | 80 std::string L2tpManager::FormatPppdConfiguration() { |
81 std::string pppd_config = StringPrintf( | 81 std::string pppd_config( |
82 "ipcp-accept-local\n" | 82 "ipcp-accept-local\n" |
83 "ipcp-accept-remote\n" | 83 "ipcp-accept-remote\n" |
84 "refuse-eap\n" | 84 "refuse-eap\n" |
85 "noccp\n" | 85 "noccp\n" |
86 "noauth\n" | 86 "noauth\n" |
87 "crtscts\n" | 87 "crtscts\n" |
88 "idle 1800\n" | 88 "idle 1800\n" |
89 "mtu 1410\n" | 89 "mtu 1410\n" |
90 "mru 1410\n" | 90 "mru 1410\n" |
91 "nodefaultroute\n" | 91 "nodefaultroute\n" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 return pid == l2tpd_->pid(); | 203 return pid == l2tpd_->pid(); |
204 } | 204 } |
205 | 205 |
206 void L2tpManager::Stop() { | 206 void L2tpManager::Stop() { |
207 if (l2tpd_->pid()) { | 207 if (l2tpd_->pid()) { |
208 LOG(INFO) << "Shutting down L2TP"; | 208 LOG(INFO) << "Shutting down L2TP"; |
209 Terminate(); | 209 Terminate(); |
210 } | 210 } |
211 OnStopped(false); | 211 OnStopped(false); |
212 } | 212 } |
OLD | NEW |