Remove obsolete file.
[connman] / scripts / pppd-plugin.c
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2009  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <netinet/in.h>
27 #include <arpa/inet.h>
28
29 #include <pppd/pppd.h>
30 #include <pppd/fsm.h>
31 #include <pppd/ipcp.h>
32
33 static void notifier_phasechange(void *data, int arg)
34 {
35         printf("phasechange: data %p arg %d\n", data, arg);
36 }
37
38 static void notifier_exit(void *data, int arg)
39 {
40         printf("exitnotify: data %p arg %d\n", data, arg);
41 }
42
43 static void notifier_ipup(void *data, int arg)
44 {
45         ipcp_options opts = ipcp_gotoptions[0];
46         ipcp_options peer = ipcp_hisoptions[0];
47
48         printf("ipup: data %p arg %d\n", data, arg);
49
50         printf("%s: %s -> %s\n", ifname,
51                                 inet_ntoa(*((struct in_addr *) &opts.ouraddr)),
52                                 inet_ntoa(*((struct in_addr *) &peer.hisaddr)));
53
54         script_unsetenv("USEPEERDNS");
55         script_unsetenv("DNS1");
56         script_unsetenv("DNS2");
57 }
58
59 static void notifier_ipdown(void *data, int arg)
60 {
61         printf("ipdown: data %p arg %d\n", data, arg);
62 }
63
64 char pppd_version[] = VERSION;
65
66 int plugin_init(void);
67
68 int plugin_init(void)
69 {
70 #if 0
71         path_ipup[0] = '\0';
72         path_ipdown[0] = '\0';
73 #endif
74
75         add_notifier(&phasechange, notifier_phasechange, NULL);
76         add_notifier(&exitnotify, notifier_exit, NULL);
77
78         add_notifier(&ip_up_notifier, notifier_ipup, NULL);
79         add_notifier(&ip_down_notifier, notifier_ipdown, NULL);
80
81         return 0;
82 }