Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Add a new ioctl SPPPGETSTATUSNCP to query the PPP ph...



details:   https://anonhg.NetBSD.org/src/rev/ca41cb37b3db
branches:  trunk
changeset: 556774:ca41cb37b3db
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Dec 26 23:39:23 2003 +0000

description:
Add a new ioctl SPPPGETSTATUSNCP to query the PPP phase and check wether
any NCP is UP.

diffstat:

 sys/net/if_sppp.h     |  11 ++++++++++-
 sys/net/if_spppsubr.c |  12 ++++++++++--
 2 files changed, 20 insertions(+), 3 deletions(-)

diffs (69 lines):

diff -r ae8a800d3984 -r ca41cb37b3db sys/net/if_sppp.h
--- a/sys/net/if_sppp.h Fri Dec 26 23:22:31 2003 +0000
+++ b/sys/net/if_sppp.h Fri Dec 26 23:39:23 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sppp.h,v 1.22 2003/11/28 08:56:48 keihan Exp $      */
+/*     $NetBSD: if_sppp.h,v 1.23 2003/12/26 23:39:23 martin Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -91,6 +91,14 @@
 
 #define        SPPPGETSTATUS   _IOWR('i', 124, struct spppstatus)
 
+struct spppstatusncp {
+       char    ifname[IFNAMSIZ];       /* pppoe interface name */
+       int     phase;                  /* one of SPPP_PHASE_* above */
+       int     ncpup;                  /* != 0 if at least on NCP is up */
+};
+
+#define        SPPPGETSTATUSNCP        _IOWR('i', 134, struct spppstatusncp)
+
 struct spppidletimeout {
        char    ifname[IFNAMSIZ];       /* pppoe interface name */
        time_t  idle_seconds;           /* number of seconds idle before
@@ -140,3 +148,4 @@
 #define        SPPPSETKEEPALIVE        _IOW('i', 132, struct spppkeepalivesettings)
 #define        SPPPGETKEEPALIVE        _IOWR('i', 133, struct spppkeepalivesettings)
 
+/* 134 already used! */
diff -r ae8a800d3984 -r ca41cb37b3db sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Fri Dec 26 23:22:31 2003 +0000
+++ b/sys/net/if_spppsubr.c     Fri Dec 26 23:39:23 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.74 2003/11/10 08:51:52 wiz Exp $      */
+/*     $NetBSD: if_spppsubr.c,v 1.75 2003/12/26 23:39:23 martin Exp $   */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.74 2003/11/10 08:51:52 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.75 2003/12/26 23:39:23 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipx.h"
@@ -1159,6 +1159,7 @@
        case SPPPGETAUTHCFG:
        case SPPPGETLCPCFG:
        case SPPPGETSTATUS:
+       case SPPPGETSTATUSNCP:
        case SPPPGETIDLETO:
        case SPPPGETAUTHFAILURES:
        case SPPPGETDNSOPTS:
@@ -5131,6 +5132,13 @@
                status->phase = sp->pp_phase;
            }
            break;
+       case SPPPGETSTATUSNCP:
+           {
+               struct spppstatusncp *status = (struct spppstatusncp *)data;
+               status->phase = sp->pp_phase;
+               status->ncpup = sppp_ncp_check(sp);
+           }
+           break;
        case SPPPGETIDLETO:
            {
                struct spppidletimeout *to = (struct spppidletimeout *)data;



Home | Main Index | Thread Index | Old Index