2 * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
4 * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 *---------------------------------------------------------------------------
30 * i4b_isppp.c - isdn4bsd kernel SyncPPP driver
31 * --------------------------------------------
33 * Uses Serge Vakulenko's sppp backend (originally contributed with
34 * the "cx" driver for Cronyx's HDLC-in-hardware device). This driver
35 * is only the glue between sppp and i4b.
37 * $Id: i4b_isppp.c,v 1.44 2000/08/31 07:07:26 hm Exp $
39 * $FreeBSD: src/sys/i4b/driver/i4b_isppp.c,v 1.7.2.3 2003/02/06 14:50:53 gj Exp $
40 * $DragonFly: src/sys/net/i4b/driver/i4b_isppp.c,v 1.10 2004/09/16 04:36:30 dillon Exp $
42 * last edit-date: [Thu Aug 31 09:02:27 2000]
44 *---------------------------------------------------------------------------*/
49 #include "use_i4bisppp.h"
53 # error "You need to define `device sppp <N>' with options ISPPP"
57 #include <sys/param.h>
58 #include <sys/systm.h>
60 #include <sys/socket.h>
61 #include <sys/errno.h>
62 #include <sys/ioccom.h>
63 #include <sys/sockio.h>
64 #include <sys/kernel.h>
67 #include <net/if_arp.h>
68 #include <net/if_types.h>
69 #include <net/sppp/if_sppp.h>
72 #if defined(__DragonFly__) || (defined(__FreeBSD_version) && __FreeBSD_version >= 400008)
77 #if NBPFILTER > 0 || NBPF > 0
82 #if defined(__DragonFly__) || defined(__FreeBSD__)
83 #include <net/i4b/include/machine/i4b_debug.h>
84 #include <net/i4b/include/machine/i4b_ioctl.h>
86 #include <i4b/i4b_ioctl.h>
87 #include <i4b/i4b_cause.h>
88 #include <i4b/i4b_debug.h>
91 #include "../include/i4b_global.h"
92 #include "../include/i4b_l3l4.h"
93 #include "../layer4/i4b_l4.h"
95 #if defined(__DragonFly__) || defined(__FreeBSD__)
96 #define PDEVSTATIC static
99 #define ISPPP_FMT "%s: "
100 #define ISPPP_ARG(sc) ((sc)->sc_if.if_xname)
101 #define IFP2UNIT(ifp) ((struct i4bisppp_softc *)ifp->if_softc)->sc_unit
103 #define ISPPP_FMT "isp%d: "
104 #define ISPPP_ARG(sc) ((sc)->sc_if.if_unit)
105 #define IFP2UNIT(ifp) (ifp)->if_unit
108 # if defined(__DragonFly__) || __FreeBSD_version >= 300001
109 # define IOCTL_CMD_T u_long
111 # define IOCTL_CMD_T int
114 #elif defined __NetBSD__ || defined __OpenBSD__
115 #define ISPPP_FMT "%s: "
116 #define ISPPP_ARG(sc) ((sc)->sc_if.if_xname)
117 #define PDEVSTATIC /* not static */
118 #define IOCTL_CMD_T u_long
119 #define IFP2UNIT(ifp) ((struct i4bisppp_softc *)ifp->if_softc)->sc_unit
121 # error "What system are you using?"
124 #if defined(__DragonFly__) || defined(__FreeBSD__)
125 PDEVSTATIC void i4bispppattach(void *);
126 PSEUDO_SET(i4bispppattach, i4b_isppp);
128 PDEVSTATIC void i4bispppattach(void);
131 #define I4BISPPPACCT 1 /* enable accounting messages */
132 #define I4BISPPPACCTINTVL 2 /* accounting msg interval in secs */
133 #define I4BISPPPDISCDEBUG 1
135 #define PPP_HDRLEN 4 /* 4 octetts PPP header length */
137 struct i4bisppp_softc {
139 * struct sppp starts with a struct ifnet, but we gotta allocate
140 * more space for it. NB: do not relocate this union, it must
141 * be first in isppp_softc. The tls and tlf hooks below want to
142 * convert a ``struct sppp *'' into a ``struct isppp_softc *''.
148 #define sc_if sc_if_un.scu_if
150 int sc_state; /* state of the interface */
152 #if !defined(__FreeBSD__) || defined(__DragonFly__)
153 int sc_unit; /* unit number for Net/OpenBSD */
156 call_desc_t *sc_cdp; /* ptr to call descriptor */
159 int sc_iinb; /* isdn driver # of inbytes */
160 int sc_ioutb; /* isdn driver # of outbytes */
161 int sc_inb; /* # of bytes rx'd */
162 int sc_outb; /* # of bytes tx'd */
163 int sc_linb; /* last # of bytes rx'd */
164 int sc_loutb; /* last # of bytes tx'd */
165 int sc_fn; /* flag, first null acct */
168 #if defined(__DragonFly__) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300001)
169 struct callout sc_timeout;
172 } i4bisppp_softc[NI4BISPPP];
174 static void i4bisppp_init_linktab(int unit);
175 static int i4bisppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data,
179 static void i4bisppp_send(struct ifnet *ifp);
182 static void i4bisppp_start(struct ifnet *ifp);
184 #if 0 /* never used ??? */
185 static void i4bisppp_timeout(void *cookie);
188 static void i4bisppp_tls(struct sppp *sp);
189 static void i4bisppp_tlf(struct sppp *sp);
190 static void i4bisppp_state_changed(struct sppp *sp, int new_state);
191 static void i4bisppp_negotiation_complete(struct sppp *sp);
192 static void i4bisppp_watchdog(struct ifnet *ifp);
193 time_t i4bisppp_idletime(int unit);
195 /* initialized by L4 */
197 static drvr_link_t i4bisppp_drvr_linktab[NI4BISPPP];
198 static isdn_link_t *isdn_linktab[NI4BISPPP];
200 enum i4bisppp_states {
201 ST_IDLE, /* initialized, ready, idle */
202 ST_DIALING, /* dialling out to remote */
203 ST_CONNECTED, /* connected to remote */
206 /*===========================================================================*
207 * DEVICE DRIVER ROUTINES
208 *===========================================================================*/
210 /*---------------------------------------------------------------------------*
211 * interface attach routine at kernel boot time
212 *---------------------------------------------------------------------------*/
214 #if defined(__DragonFly__) || defined(__FreeBSD__)
215 i4bispppattach(void *dummy)
220 struct i4bisppp_softc *sc = i4bisppp_softc;
223 #ifndef HACK_NO_PSEUDO_ATTACH_MSG
225 printf("i4bisppp: %d ISDN SyncPPP device(s) attached (VJ header compression)\n", NI4BISPPP);
227 printf("i4bisppp: %d ISDN SyncPPP device(s) attached\n", NI4BISPPP);
231 for(i = 0; i < NI4BISPPP; sc++, i++) {
232 i4bisppp_init_linktab(i);
234 sc->sc_if.if_softc = sc;
237 if_initname(&(sc->sc_if), "isp", i);
238 #elif defined(__FreeBSD__)
239 sc->sc_if.if_name = "isp";
240 #if defined(__FreeBSD_version) && __FreeBSD_version < 300001
241 sc->sc_if.if_next = NULL;
243 sc->sc_if.if_unit = i;
245 sprintf(sc->sc_if.if_xname, "isp%d", i);
249 sc->sc_if.if_mtu = PP_MTU;
252 sc->sc_if.if_flags = IFF_SIMPLEX | IFF_POINTOPOINT |
255 sc->sc_if.if_flags = IFF_SIMPLEX | IFF_POINTOPOINT;
258 sc->sc_if.if_type = IFT_ISDNBASIC;
259 sc->sc_state = ST_IDLE;
261 sc->sc_if.if_ioctl = i4bisppp_ioctl;
263 /* actually initialized by sppp_attach() */
264 /* sc->sc_if.if_output = sppp_output; */
266 sc->sc_if.if_start = i4bisppp_start;
268 sc->sc_if.if_hdrlen = 0;
269 sc->sc_if.if_addrlen = 0;
270 sc->sc_if.if_snd.ifq_maxlen = IFQ_MAXLEN;
272 sc->sc_if.if_ipackets = 0;
273 sc->sc_if.if_ierrors = 0;
274 sc->sc_if.if_opackets = 0;
275 sc->sc_if.if_oerrors = 0;
276 sc->sc_if.if_collisions = 0;
277 sc->sc_if.if_ibytes = 0;
278 sc->sc_if.if_obytes = 0;
279 sc->sc_if.if_imcasts = 0;
280 sc->sc_if.if_omcasts = 0;
281 sc->sc_if.if_iqdrops = 0;
282 sc->sc_if.if_noproto = 0;
285 sc->sc_if.if_timer = 0;
286 sc->sc_if.if_watchdog = i4bisppp_watchdog;
296 sc->sc_if_un.scu_sp.pp_tls = i4bisppp_tls;
297 sc->sc_if_un.scu_sp.pp_tlf = i4bisppp_tlf;
298 sc->sc_if_un.scu_sp.pp_con = i4bisppp_negotiation_complete;
299 sc->sc_if_un.scu_sp.pp_chg = i4bisppp_state_changed;
301 sppp_attach(&sc->sc_if);
302 /* XXX: validate / add proper code */
303 ether_ifattach_bpf(&sc->sc_if, ((struct arpcom*)sc)->ac_enaddr,
304 DLT_PPP, PPP_HDRLEN);
305 callout_init(&sc->sc_timeout);
309 /*---------------------------------------------------------------------------*
311 *---------------------------------------------------------------------------*/
313 i4bisppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data,
316 struct i4bisppp_softc *sc = ifp->if_softc;
318 struct sppp *sp = (struct sppp *)sc;
319 struct ifaddr *ifa = (struct ifaddr *) data;
320 struct ifreq *ifr = (struct ifreq *) data;
325 error = sppp_ioctl(&sc->sc_if, cmd, data);
331 #if 0 /* never used ??? */
333 if ((ifp->if_flags & IFF_UP) == 0)
334 callout_stop(&sc->sc_timeout);
343 /*---------------------------------------------------------------------------*
344 * start output to ISDN B-channel
345 *---------------------------------------------------------------------------*/
347 i4bisppp_start(struct ifnet *ifp)
349 struct i4bisppp_softc *sc = ifp->if_softc;
352 int unit = IFP2UNIT(ifp);
354 if (sppp_isempty(ifp))
357 if(sc->sc_state != ST_CONNECTED)
362 * ifp->if_flags |= IFF_OACTIVE; // - need to clear this somewhere
366 while ((m = sppp_dequeue(&sc->sc_if)) != NULL)
369 #if NBPFILTER > 0 || NBPF > 0
370 #if defined(__DragonFly__) || defined(__FreeBSD__)
373 #endif /* __FreeBSD__ */
377 bpf_mtap(ifp->if_bpf, m);
379 #endif /* NBPFILTER > 0 || NBPF > 0 */
381 microtime(&ifp->if_lastchange);
383 IF_LOCK(isdn_linktab[unit]->tx_queue);
384 if(_IF_QFULL(isdn_linktab[unit]->tx_queue))
386 NDBGL4(L4_ISPDBG, "isp%d, tx queue full!", unit);
392 sc->sc_if.if_obytes += m->m_pkthdr.len;
394 sc->sc_outb += m->m_pkthdr.len;
395 sc->sc_if.if_opackets++;
397 _IF_ENQUEUE(isdn_linktab[unit]->tx_queue, m);
399 IF_UNLOCK(isdn_linktab[unit]->tx_queue);
401 isdn_linktab[unit]->bch_tx_start(isdn_linktab[unit]->unit,
402 isdn_linktab[unit]->channel);
406 /*---------------------------------------------------------------------------*
408 *---------------------------------------------------------------------------*/
410 i4bisppp_watchdog(struct ifnet *ifp)
412 struct i4bisppp_softc *sc = ifp->if_softc;
413 int unit = IFP2UNIT(ifp);
414 bchan_statistics_t bs;
416 (*isdn_linktab[unit]->bch_stat)
417 (isdn_linktab[unit]->unit, isdn_linktab[unit]->channel, &bs);
419 sc->sc_ioutb += bs.outbytes;
420 sc->sc_iinb += bs.inbytes;
422 if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn)
424 int ri = (sc->sc_iinb - sc->sc_linb)/I4BISPPPACCTINTVL;
425 int ro = (sc->sc_ioutb - sc->sc_loutb)/I4BISPPPACCTINTVL;
427 if((sc->sc_iinb == sc->sc_linb) && (sc->sc_ioutb == sc->sc_loutb))
432 sc->sc_linb = sc->sc_iinb;
433 sc->sc_loutb = sc->sc_ioutb;
435 i4b_l4_accounting(BDRV_ISPPP, unit, ACCT_DURING,
436 sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_outb, sc->sc_inb);
438 sc->sc_if.if_timer = I4BISPPPACCTINTVL;
440 #if 0 /* old stuff, keep it around */
441 printf(ISPPP_FMT "transmit timeout\n", ISPPP_ARG(sc));
445 #endif /* I4BISPPPACCT */
448 *===========================================================================*
449 * SyncPPP layer interface routines
450 *===========================================================================*
453 #if 0 /* never used ??? */
454 /*---------------------------------------------------------------------------*
455 * just an alias for i4bisppp_tls, but of type timeout_t
456 *---------------------------------------------------------------------------*/
458 i4bisppp_timeout(void *cookie)
460 i4bisppp_tls((struct sppp *)cookie);
464 /*---------------------------------------------------------------------------*
465 * PPP this-layer-started action
466 *---------------------------------------------------------------------------*
469 i4bisppp_tls(struct sppp *sp)
471 struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
472 struct ifnet *ifp = (struct ifnet *)sp;
474 if(sc->sc_state == ST_CONNECTED)
477 i4b_l4_dialout(BDRV_ISPPP, IFP2UNIT(ifp));
480 /*---------------------------------------------------------------------------*
481 * PPP this-layer-finished action
482 *---------------------------------------------------------------------------*
485 i4bisppp_tlf(struct sppp *sp)
487 struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
488 /* call_desc_t *cd = sc->sc_cdp; */
489 struct ifnet *ifp = (struct ifnet *)sp;
491 if(sc->sc_state != ST_CONNECTED)
494 #if 0 /* never used ??? */
495 callout_stop(&sc->sc_timeout);
498 i4b_l4_drvrdisc(BDRV_ISPPP, IFP2UNIT(ifp));
500 /*---------------------------------------------------------------------------*
501 * PPP interface phase change
502 *---------------------------------------------------------------------------*
505 i4bisppp_state_changed(struct sppp *sp, int new_state)
507 struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
509 i4b_l4_ifstate_changed(sc->sc_cdp, new_state);
512 /*---------------------------------------------------------------------------*
513 * PPP control protocol negotiation complete (run ip-up script now)
514 *---------------------------------------------------------------------------*
517 i4bisppp_negotiation_complete(struct sppp *sp)
519 struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
521 i4b_l4_negcomplete(sc->sc_cdp);
524 /*===========================================================================*
525 * ISDN INTERFACE ROUTINES
526 *===========================================================================*/
528 /*---------------------------------------------------------------------------*
529 * this routine is called from L4 handler at connect time
530 *---------------------------------------------------------------------------*/
532 i4bisppp_connect(int unit, void *cdp)
534 struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
535 struct sppp *sp = &sc->sc_if_un.scu_sp;
538 sc->sc_cdp = (call_desc_t *)cdp;
539 sc->sc_state = ST_CONNECTED;
548 sc->sc_if.if_timer = I4BISPPPACCTINTVL;
551 #if 0 /* never used ??? */
552 callout_stop(&sc->sc_timeout);
555 sp->pp_up(sp); /* tell PPP we are ready */
557 sp->pp_last_sent = sp->pp_last_recv = SECOND;
562 /*---------------------------------------------------------------------------*
563 * this routine is called from L4 handler at disconnect time
564 *---------------------------------------------------------------------------*/
566 i4bisppp_disconnect(int unit, void *cdp)
568 call_desc_t *cd = (call_desc_t *)cdp;
569 struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
570 struct sppp *sp = &sc->sc_if_un.scu_sp;
574 /* new stuff to check that the active channel is being closed */
575 if (cd != sc->sc_cdp)
577 NDBGL4(L4_ISPDBG, "isp%d, channel%d not active!", unit, cd->channelid);
583 sc->sc_if.if_timer = 0;
586 i4b_l4_accounting(BDRV_ISPPP, unit, ACCT_FINAL,
587 sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_outb, sc->sc_inb);
589 if (sc->sc_state == ST_CONNECTED)
591 #if 0 /* never used ??? */
592 callout_stop(&sc->sc_timeout);
594 sc->sc_cdp = (call_desc_t *)0;
595 /* do this here because pp_down calls i4bisppp_tlf */
596 sc->sc_state = ST_IDLE;
597 sp->pp_down(sp); /* tell PPP we have hung up */
603 /*---------------------------------------------------------------------------*
604 * this routine is used to give a feedback from userland demon
605 * in case of dial problems
606 *---------------------------------------------------------------------------*/
608 i4bisppp_dialresponse(int unit, int status, cause_t cause)
610 struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
611 struct sppp *sp = &sc->sc_if_un.scu_sp;
613 NDBGL4(L4_ISPDBG, "isp%d: status=%d, cause=%d", unit, status, cause);
615 if(status != DSTAT_NONE)
619 NDBGL4(L4_ISPDBG, "isp%d: clearing queues", unit);
621 if(!(sppp_isempty(&sc->sc_if)))
623 while((m = sppp_dequeue(&sc->sc_if)) != NULL)
627 sc->sc_cdp = (call_desc_t *)0;
628 /* do this here because pp_down calls i4bisppp_tlf */
629 sc->sc_state = ST_IDLE;
631 * Ahh, sppp doesn't like to get a down event when
632 * dialing fails. So first tell it that we are up
633 * (doesn't hurt us since sc_state != ST_CONNECTED)
641 /*---------------------------------------------------------------------------*
643 *---------------------------------------------------------------------------*/
645 i4bisppp_updown(int unit, int updown)
647 /* could probably do something useful here */
650 /*---------------------------------------------------------------------------*
651 * this routine is called from the HSCX interrupt handler
652 * when a new frame (mbuf) has been received and was put on
654 *---------------------------------------------------------------------------*/
656 i4bisppp_rx_data_rdy(int unit)
658 struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
662 if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
665 m->m_pkthdr.rcvif = &sc->sc_if;
666 m->m_pkthdr.len = m->m_len;
668 microtime(&sc->sc_if.if_lastchange);
670 sc->sc_if.if_ipackets++;
672 sc->sc_if.if_ibytes += m->m_pkthdr.len;
676 sc->sc_inb += m->m_pkthdr.len;
680 printf("i4bisppp_rx_data_ready: received packet!\n");
683 #if NBPFILTER > 0 || NBPF > 0
685 #if defined(__DragonFly__) || defined(__FreeBSD__)
687 bpf_mtap(&sc->sc_if, m);
688 #endif /* __FreeBSD__ */
692 bpf_mtap(sc->sc_if.if_bpf, m);
695 #endif /* NBPFILTER > 0 || NBPF > 0 */
699 sppp_input(&sc->sc_if, m);
704 /*---------------------------------------------------------------------------*
705 * this routine is called from the HSCX interrupt handler
706 * when the last frame has been sent out and there is no
707 * further frame (mbuf) in the tx queue.
708 *---------------------------------------------------------------------------*/
710 i4bisppp_tx_queue_empty(int unit)
712 i4bisppp_start(&i4bisppp_softc[unit].sc_if);
715 /*---------------------------------------------------------------------------*
716 * THIS should be used instead of last_active_time to implement
717 * an activity timeout mechanism.
719 * Sending back the time difference unneccessarily complicates the
720 * idletime checks in i4b_l4.c. Return the largest time instead.
721 * That way the code in i4b_l4.c needs only minimal changes.
722 *---------------------------------------------------------------------------*/
724 i4bisppp_idletime(int unit)
727 return(i4bisppp_softc[unit].sc_cdp->last_active_time);
730 sp = (struct sppp *) &i4bisppp_softc[unit];
732 return((sp->pp_last_recv < sp->pp_last_sent) ?
733 sp->pp_last_sent : sp->pp_last_recv);
737 /*---------------------------------------------------------------------------*
738 * this routine is called from the HSCX interrupt handler
739 * each time a packet is received or transmitted. It should
740 * be used to implement an activity timeout mechanism.
741 *---------------------------------------------------------------------------*/
743 i4bisppp_activity(int unit, int rxtx)
745 i4bisppp_softc[unit].sc_cdp->last_active_time = SECOND;
748 /*---------------------------------------------------------------------------*
749 * return this drivers linktab address
750 *---------------------------------------------------------------------------*/
752 i4bisppp_ret_linktab(int unit)
754 return(&i4bisppp_drvr_linktab[unit]);
757 /*---------------------------------------------------------------------------*
758 * setup the isdn_linktab for this driver
759 *---------------------------------------------------------------------------*/
761 i4bisppp_set_linktab(int unit, isdn_link_t *ilt)
763 isdn_linktab[unit] = ilt;
766 /*---------------------------------------------------------------------------*
767 * initialize this drivers linktab
768 *---------------------------------------------------------------------------*/
770 i4bisppp_init_linktab(int unit)
772 i4bisppp_drvr_linktab[unit].unit = unit;
773 i4bisppp_drvr_linktab[unit].bch_rx_data_ready = i4bisppp_rx_data_rdy;
774 i4bisppp_drvr_linktab[unit].bch_tx_queue_empty = i4bisppp_tx_queue_empty;
775 i4bisppp_drvr_linktab[unit].bch_activity = i4bisppp_activity;
776 i4bisppp_drvr_linktab[unit].line_connected = i4bisppp_connect;
777 i4bisppp_drvr_linktab[unit].line_disconnected = i4bisppp_disconnect;
778 i4bisppp_drvr_linktab[unit].dial_response = i4bisppp_dialresponse;
779 i4bisppp_drvr_linktab[unit].updown_ind = i4bisppp_updown;
782 /*===========================================================================*/