| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pppoectl.c,v 1.23 2011/08/27 18:44:44 joerg Exp $ */ | | 1 | /* $NetBSD: pppoectl.c,v 1.24 2011/08/28 08:43:02 mbalmer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1997 Joerg Wunsch | | 4 | * Copyright (c) 1997 Joerg Wunsch |
5 | * | | 5 | * |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | * | | 27 | * |
28 | * From: spppcontrol.c,v 1.3 1998/01/07 07:55:26 charnier Exp | | 28 | * From: spppcontrol.c,v 1.3 1998/01/07 07:55:26 charnier Exp |
29 | * From: ispppcontrol | | 29 | * From: ispppcontrol |
30 | */ | | 30 | */ |
31 | #include <sys/cdefs.h> | | 31 | #include <sys/cdefs.h> |
32 | | | 32 | |
33 | #ifndef lint | | 33 | #ifndef lint |
34 | __RCSID("$NetBSD: pppoectl.c,v 1.23 2011/08/27 18:44:44 joerg Exp $"); | | 34 | __RCSID("$NetBSD: pppoectl.c,v 1.24 2011/08/28 08:43:02 mbalmer Exp $"); |
35 | #endif | | 35 | #endif |
36 | | | 36 | |
37 | | | 37 | |
38 | #include <sys/param.h> | | 38 | #include <sys/param.h> |
39 | #include <sys/callout.h> | | 39 | #include <sys/callout.h> |
40 | #include <sys/ioctl.h> | | 40 | #include <sys/ioctl.h> |
41 | #include <sys/mbuf.h> | | 41 | #include <sys/mbuf.h> |
42 | #include <sys/socket.h> | | 42 | #include <sys/socket.h> |
43 | #include <sys/time.h> | | 43 | #include <sys/time.h> |
44 | #include <sys/sysctl.h> | | 44 | #include <sys/sysctl.h> |
45 | #include <net/if.h> | | 45 | #include <net/if.h> |
46 | #include <net/if_sppp.h> | | 46 | #include <net/if_sppp.h> |
47 | #include <net/if_pppoe.h> | | 47 | #include <net/if_pppoe.h> |
| @@ -50,27 +50,27 @@ __RCSID("$NetBSD: pppoectl.c,v 1.23 2011 | | | @@ -50,27 +50,27 @@ __RCSID("$NetBSD: pppoectl.c,v 1.23 2011 |
50 | #include <stdlib.h> | | 50 | #include <stdlib.h> |
51 | #include <string.h> | | 51 | #include <string.h> |
52 | #include <sysexits.h> | | 52 | #include <sysexits.h> |
53 | #include <unistd.h> | | 53 | #include <unistd.h> |
54 | | | 54 | |
55 | __dead static void usage(void); | | 55 | __dead static void usage(void); |
56 | __dead static void print_error(const char *ifname, int error, const char * str); | | 56 | __dead static void print_error(const char *ifname, int error, const char * str); |
57 | static void print_vals(const char *ifname, int phase, struct spppauthcfg *sp, | | 57 | static void print_vals(const char *ifname, int phase, struct spppauthcfg *sp, |
58 | int lcp_timeout, time_t idle_timeout, int authfailures, | | 58 | int lcp_timeout, time_t idle_timeout, int authfailures, |
59 | int max_auth_failures, u_int maxalive, time_t max_noreceive); | | 59 | int max_auth_failures, u_int maxalive, time_t max_noreceive); |
60 | static const char *phase_name(int phase); | | 60 | static const char *phase_name(int phase); |
61 | static const char *proto_name(int proto); | | 61 | static const char *proto_name(int proto); |
62 | static const char *authflags(int flags); | | 62 | static const char *authflags(int flags); |
63 | static static void pppoectl_argument(char *arg); | | 63 | static void pppoectl_argument(char *arg); |
64 | | | 64 | |
65 | static int hz = 0; | | 65 | static int hz = 0; |
66 | | | 66 | |
67 | static int set_auth, set_lcp, set_idle_to, set_auth_failure, set_dns, | | 67 | static int set_auth, set_lcp, set_idle_to, set_auth_failure, set_dns, |
68 | clear_auth_failure_count, set_keepalive; | | 68 | clear_auth_failure_count, set_keepalive; |
69 | static int maxalive = -1; | | 69 | static int maxalive = -1; |
70 | static int max_noreceive = -1; | | 70 | static int max_noreceive = -1; |
71 | static struct spppauthcfg spr; | | 71 | static struct spppauthcfg spr; |
72 | static struct sppplcpcfg lcp; | | 72 | static struct sppplcpcfg lcp; |
73 | static struct spppstatus status; | | 73 | static struct spppstatus status; |
74 | static struct spppidletimeout timeout; | | 74 | static struct spppidletimeout timeout; |
75 | static struct spppauthfailurestats authfailstats; | | 75 | static struct spppauthfailurestats authfailstats; |
76 | static struct spppauthfailuresettings authfailset; | | 76 | static struct spppauthfailuresettings authfailset; |