blob: 5c51b44315e0a987e90efdfdcd4c9e50eef8890f [file] [log] [blame]
Darin Petkove6ca3202012-10-19 14:49:56 +02001// Copyright (c) 2012 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#include "shill/shims/c_ppp.h"
6
7#include "shill/shims/ppp.h"
8
9using shill::shims::PPP;
10using std::string;
11
12void PPPInit() {
13 PPP().Start();
14}
15
16int PPPHasSecret() {
17 return 1;
18}
19
20int PPPGetSecret(char *username, char *password) {
21 string user, pass;
22 if (!PPP().GetSecret(&user, &pass)) {
23 return -1;
24 }
25 if (username) {
26 strcpy(username, user.c_str());
27 }
28 if (password) {
29 strcpy(password, pass.c_str());
30 }
31 return 1;
32}
33
34void PPPOnConnect(const char *ifname) {
35 PPP().OnConnect(ifname);
36}
37
38void PPPOnDisconnect() {
39 PPP().OnDisconnect();
40}
41
42void PPPOnExit(void */*data*/, int /*arg*/) {
43 PPP().Stop();
44}