Don't bring the modem offline or hangup when ``down lcp''

is done.  Instead, behave like ``close lcp''.
This commit is contained in:
Brian Somers 1998-06-16 19:40:28 +00:00
parent 9ef0938e40
commit 899011c4eb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37018
6 changed files with 45 additions and 27 deletions

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bundle.c,v 1.16 1998/06/15 19:05:10 brian Exp $
* $Id: bundle.c,v 1.17 1998/06/15 19:06:01 brian Exp $
*/
#include <sys/param.h>
@ -513,12 +513,12 @@ bundle_Close(struct bundle *bundle, const char *name, int how)
}
void
bundle_Down(struct bundle *bundle)
bundle_Down(struct bundle *bundle, int how)
{
struct datalink *dl;
for (dl = bundle->links; dl; dl = dl->next)
datalink_Down(dl, CLOSE_STAYDOWN);
datalink_Down(dl, how);
}
static int

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bundle.h,v 1.6 1998/06/06 20:50:56 brian Exp $
* $Id: bundle.h,v 1.7 1998/06/12 17:45:04 brian Exp $
*/
#define PHASE_DEAD 0 /* Link is dead */
@ -140,7 +140,7 @@ extern int bundle_LinkIsUp(const struct bundle *);
extern int bundle_SetRoute(struct bundle *, int, struct in_addr,
struct in_addr, struct in_addr, int);
extern void bundle_Close(struct bundle *, const char *, int);
extern void bundle_Down(struct bundle *);
extern void bundle_Down(struct bundle *, int);
extern void bundle_Open(struct bundle *, const char *, int);
extern void bundle_LinkClosed(struct bundle *, struct datalink *);

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: command.c,v 1.143 1998/06/15 19:05:40 brian Exp $
* $Id: command.c,v 1.144 1998/06/15 19:06:04 brian Exp $
*
*/
#include <sys/types.h>
@ -124,7 +124,7 @@
#define NEG_DNS 50
const char Version[] = "2.0-beta";
const char VersionDate[] = "$Date: 1998/06/15 19:05:40 $";
const char VersionDate[] = "$Date: 1998/06/15 19:06:04 $";
static int ShowCommand(struct cmdargs const *);
static int TerminalCommand(struct cmdargs const *);
@ -902,18 +902,24 @@ CloseCommand(struct cmdargs const *arg)
static int
DownCommand(struct cmdargs const *arg)
{
if (arg->argc == arg->argn ||
(arg->argc == arg->argn+1 && !strcasecmp(arg->argv[arg->argn], "lcp"))) {
if (arg->cx)
datalink_Down(arg->cx, CLOSE_STAYDOWN);
else
bundle_Down(arg->bundle);
} else if (arg->argc == arg->argn+1 &&
!strcasecmp(arg->argv[arg->argn], "ccp")) {
struct fsm *fp = arg->cx ? &arg->cx->physical->link.ccp.fsm :
&arg->bundle->ncp.mp.link.ccp.fsm;
fsm_Down(fp);
fsm_Close(fp);
if (arg->argc == arg->argn) {
if (arg->cx)
datalink_Down(arg->cx, CLOSE_STAYDOWN);
else
bundle_Down(arg->bundle, CLOSE_STAYDOWN);
} else if (arg->argc == arg->argn + 1) {
if (!strcasecmp(arg->argv[arg->argn], "lcp")) {
if (arg->cx)
datalink_Down(arg->cx, CLOSE_LCP);
else
bundle_Down(arg->bundle, CLOSE_LCP);
} else if (!strcasecmp(arg->argv[arg->argn], "ccp")) {
struct fsm *fp = arg->cx ? &arg->cx->physical->link.ccp.fsm :
&arg->bundle->ncp.mp.link.ccp.fsm;
fsm_Down(fp);
fsm_Close(fp);
} else
return -1;
} else
return -1;

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: main.c,v 1.132 1998/06/15 19:05:46 brian Exp $
* $Id: main.c,v 1.133 1998/06/15 19:06:50 brian Exp $
*
* TODO:
*/
@ -110,7 +110,7 @@ CloseConnection(int signo)
/* NOTE, these are manual, we've done a setsid() */
sig_signal(SIGINT, SIG_IGN);
log_Printf(LogPHASE, "Caught signal %d, abort connection(s)\n", signo);
bundle_Down(SignalBundle);
bundle_Down(SignalBundle, CLOSE_STAYDOWN);
sig_signal(SIGINT, CloseConnection);
}

View File

@ -1,4 +1,4 @@
.\" $Id: ppp.8,v 1.104 1998/06/12 20:12:26 brian Exp $
.\" $Id: ppp.8,v 1.105 1998/06/15 19:05:27 brian Exp $
.Dd 20 September 1995
.Os FreeBSD
.Dt PPP 8
@ -2382,9 +2382,15 @@ the connection, and all closed links are brought up.
Bring the relevant layer down ungracefully, as if the underlying layer
had become unavailable. It's not considered polite to use this command on
a Finite State Machine that's in the OPEN state. If no arguments are
supplied,
supplied, the entire link is closed (or if no context is given, all links
are terminated). If
.Sq lcp
is assumed.
is specified, the
.Em LCP
layer is terminated but the modem is not brought offline and the link
is not closed. If
.Sq ccp
is specified, only the relevant compression layer(s) are terminated.
.It help|? Op Ar command
Show a list of available commands. If
.Ar command

View File

@ -1,4 +1,4 @@
.\" $Id: ppp.8,v 1.104 1998/06/12 20:12:26 brian Exp $
.\" $Id: ppp.8,v 1.105 1998/06/15 19:05:27 brian Exp $
.Dd 20 September 1995
.Os FreeBSD
.Dt PPP 8
@ -2382,9 +2382,15 @@ the connection, and all closed links are brought up.
Bring the relevant layer down ungracefully, as if the underlying layer
had become unavailable. It's not considered polite to use this command on
a Finite State Machine that's in the OPEN state. If no arguments are
supplied,
supplied, the entire link is closed (or if no context is given, all links
are terminated). If
.Sq lcp
is assumed.
is specified, the
.Em LCP
layer is terminated but the modem is not brought offline and the link
is not closed. If
.Sq ccp
is specified, only the relevant compression layer(s) are terminated.
.It help|? Op Ar command
Show a list of available commands. If
.Ar command