blob: 5c03bfdd5f7e9dbdd0d1079e97b0f37aa6a013f6 [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// pppd.h declares a field member called |class| which forces this file to be C.
6#include <pppd/pppd.h>
7
8#include "shill/shims/c_ppp.h"
9
10char pppd_version[] = VERSION;
11
12static void PPPOnUp(void *data, int arg) {
13 PPPOnConnect(ifname);
14}
15
16static void PPPOnPhaseChange(void *data, int arg) {
17 if (arg == PHASE_DISCONNECT || arg == PHASE_DEAD) {
18 PPPOnDisconnect();
19 }
20}
21
22int plugin_init() {
23 PPPInit();
24
25 chap_check_hook = PPPHasSecret;
26 pap_check_hook = PPPHasSecret;
27
28 pap_passwd_hook = PPPGetSecret;
29 chap_passwd_hook = PPPGetSecret;
30
31 add_notifier(&ip_up_notifier, PPPOnUp, NULL);
32 add_notifier(&phasechange, PPPOnPhaseChange, NULL);
33 add_notifier(&exitnotify, PPPOnExit, NULL);
34
35 return 0;
36}