Darin Petkov | e6ca320 | 2012-10-19 14:49:56 +0200 | [diff] [blame] | 1 | // 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 | |
| 10 | char pppd_version[] = VERSION; |
| 11 | |
| 12 | static void PPPOnUp(void *data, int arg) { |
| 13 | PPPOnConnect(ifname); |
| 14 | } |
| 15 | |
| 16 | static void PPPOnPhaseChange(void *data, int arg) { |
| 17 | if (arg == PHASE_DISCONNECT || arg == PHASE_DEAD) { |
| 18 | PPPOnDisconnect(); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | int 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 | } |