Add a ``force-scripts'' option for using chat scripts with -direct and

-dedicated links.

Submitted by:	Maksim Yevmenkin <myevmenk@exodus.net>
This commit is contained in:
Brian Somers 2003-03-26 02:03:08 +00:00
parent 66fe5468f7
commit 9603d5b40d
4 changed files with 40 additions and 20 deletions

View File

@ -33,22 +33,23 @@
#define PHASE_TERMINATE 4 /* Terminating link */
/* cfg.opt bit settings */
#define OPT_FILTERDECAP 0x0001
#define OPT_IDCHECK 0x0002
#define OPT_IFACEALIAS 0x0004
#define OPT_FILTERDECAP 0x0001
#define OPT_FORCE_SCRIPTS 0x0002 /* force chat scripts */
#define OPT_IDCHECK 0x0004
#define OPT_IFACEALIAS 0x0008
#ifndef NOINET6
#define OPT_IPCP 0x0008
#define OPT_IPV6CP 0x0010
#define OPT_IPCP 0x0010
#define OPT_IPV6CP 0x0020
#endif
#define OPT_KEEPSESSION 0x0020
#define OPT_LOOPBACK 0x0040
#define OPT_PASSWDAUTH 0x0080
#define OPT_PROXY 0x0100
#define OPT_PROXYALL 0x0200
#define OPT_SROUTES 0x0400
#define OPT_TCPMSSFIXUP 0x0800
#define OPT_THROUGHPUT 0x1000
#define OPT_UTMP 0x2000
#define OPT_KEEPSESSION 0x0040
#define OPT_LOOPBACK 0x0080
#define OPT_PASSWDAUTH 0x0100
#define OPT_PROXY 0x0200
#define OPT_PROXYALL 0x0400
#define OPT_SROUTES 0x0800
#define OPT_TCPMSSFIXUP 0x1000
#define OPT_THROUGHPUT 0x2000
#define OPT_UTMP 0x4000
#define MAX_ENDDISC_CLASS 5

View File

@ -2835,6 +2835,9 @@ static struct cmdtab const NegotiateCommands[] = {
{"filter-decapsulation", NULL, OptSet, LOCAL_AUTH,
"filter on PPPoUDP payloads", "disable|enable",
(const void *)OPT_FILTERDECAP},
{"force-scripts", NULL, OptSet, LOCAL_AUTH,
"Force execution of the configured chat scripts", "disable|enable",
(const void *)OPT_FORCE_SCRIPTS},
{"idcheck", NULL, OptSet, LOCAL_AUTH, "Check FSM reply ids",
"disable|enable", (const void *)OPT_IDCHECK},
{"iface-alias", NULL, IfaceAliasOptSet, LOCAL_AUTH,
@ -2866,9 +2869,9 @@ static struct cmdtab const NegotiateCommands[] = {
"disable|enable", (const void *)OPT_UTMP},
#ifndef NOINET6
#define OPT_MAX 13 /* accept/deny allowed below and not above */
#define OPT_MAX 14 /* accept/deny allowed below and not above */
#else
#define OPT_MAX 11
#define OPT_MAX 12
#endif
{"acfcomp", NULL, NegotiateSet, LOCAL_AUTH | LOCAL_CX,

View File

@ -961,7 +961,8 @@ datalink_Destroy(struct datalink *dl)
void
datalink_Up(struct datalink *dl, int runscripts, int packetmode)
{
if (dl->physical->type & (PHYS_DIRECT|PHYS_DEDICATED))
if (!Enabled(dl->bundle, OPT_FORCE_SCRIPTS) &&
(dl->physical->type & (PHYS_DIRECT|PHYS_DEDICATED)))
/* Ignore scripts */
runscripts = 0;

View File

@ -154,11 +154,17 @@ This is useful if you wish to control
.Nm Ns No 's
invocation from another process.
.It Fl direct
This is used for receiving incoming connections.
This is used for communicating over an already established connection,
usually when receiving incoming connections accepted by
.Xr getty 8 .
.Nm
ignores the
.Dq set device
line and uses descriptor 0 as the link.
.Nm
will also ignore any configured chat scripts unless the
.Dq force-scripts
option has been enabled.
.Pp
If callback is configured,
.Nm
@ -169,8 +175,10 @@ information when dialing back.
This option is designed for machines connected with a dedicated
wire.
.Nm
will always keep the device open and will never use any configured
chat scripts.
will always keep the device open and will ignore any configured
chat scripts unless the
.Dq force-scripts
option has been enabled.
.It Fl ddial
This mode is equivalent to
.Fl auto
@ -2936,6 +2944,13 @@ and
in the configuration for the
.Nm
invocation with the udp link.
.It force-scripts
Default: Disabled.
Forces execution of the configured chat scripts in
.Dv direct
and
.Dv dedicated
modes.
.It idcheck
Default: Enabled.
When