blob: 5c03bfdd5f7e9dbdd0d1079e97b0f37aa6a013f6 [file] [log] [blame]
// Copyright (c) 2012 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.
// pppd.h declares a field member called |class| which forces this file to be C.
#include <pppd/pppd.h>
#include "shill/shims/c_ppp.h"
char pppd_version[] = VERSION;
static void PPPOnUp(void *data, int arg) {
PPPOnConnect(ifname);
}
static void PPPOnPhaseChange(void *data, int arg) {
if (arg == PHASE_DISCONNECT || arg == PHASE_DEAD) {
PPPOnDisconnect();
}
}
int plugin_init() {
PPPInit();
chap_check_hook = PPPHasSecret;
pap_check_hook = PPPHasSecret;
pap_passwd_hook = PPPGetSecret;
chap_passwd_hook = PPPGetSecret;
add_notifier(&ip_up_notifier, PPPOnUp, NULL);
add_notifier(&phasechange, PPPOnPhaseChange, NULL);
add_notifier(&exitnotify, PPPOnExit, NULL);
return 0;
}