summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>2000-07-19 11:06:38 +0000
committerbrian <brian@cvs.openbsd.org>2000-07-19 11:06:38 +0000
commit2360300617ea8449b99c75e71e99e881c40ed085 (patch)
tree13b617d5e11280d73274799e0b80bcf443e52faa /usr.sbin
parent95e5668693c7f774aa2f93825ad52c79cd663b74 (diff)
Support link identification from rfc1570
Add VERSION and COMPILATIONDATE macros Two new commands are available; ``ident'' and ``sendident''.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/ppp/acf.c4
-rw-r--r--usr.sbin/ppp/ppp/cbcp.c4
-rw-r--r--usr.sbin/ppp/ppp/ccp.c6
-rw-r--r--usr.sbin/ppp/ppp/chap.c4
-rw-r--r--usr.sbin/ppp/ppp/command.c35
-rw-r--r--usr.sbin/ppp/ppp/datalink.c4
-rw-r--r--usr.sbin/ppp/ppp/deflate.c4
-rw-r--r--usr.sbin/ppp/ppp/fsm.c42
-rw-r--r--usr.sbin/ppp/ppp/ipcp.c4
-rw-r--r--usr.sbin/ppp/ppp/lcp.c42
-rw-r--r--usr.sbin/ppp/ppp/lcp.h7
-rw-r--r--usr.sbin/ppp/ppp/lqr.c4
-rw-r--r--usr.sbin/ppp/ppp/pap.c4
-rw-r--r--usr.sbin/ppp/ppp/ppp.847
-rw-r--r--usr.sbin/ppp/ppp/prompt.c4
-rw-r--r--usr.sbin/ppp/ppp/proto.c4
16 files changed, 178 insertions, 41 deletions
diff --git a/usr.sbin/ppp/ppp/acf.c b/usr.sbin/ppp/ppp/acf.c
index 4256249a704..f209f78cab8 100644
--- a/usr.sbin/ppp/ppp/acf.c
+++ b/usr.sbin/ppp/ppp/acf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: acf.c,v 1.4 2000/02/27 01:38:24 brian Exp $
+ * $OpenBSD: acf.c,v 1.5 2000/07/19 11:06:30 brian Exp $
*/
#include <sys/types.h>
@@ -39,10 +39,10 @@
#include "mbuf.h"
#include "acf.h"
#include "proto.h"
-#include "lcp.h"
#include "throughput.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "ccp.h"
#include "link.h"
#include "descriptor.h"
diff --git a/usr.sbin/ppp/ppp/cbcp.c b/usr.sbin/ppp/ppp/cbcp.c
index 6f7ff2bdb39..20af6606ec5 100644
--- a/usr.sbin/ppp/ppp/cbcp.c
+++ b/usr.sbin/ppp/ppp/cbcp.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: cbcp.c,v 1.13 2000/02/27 01:38:24 brian Exp $
+ * $OpenBSD: cbcp.c,v 1.14 2000/07/19 11:06:31 brian Exp $
*/
#include <sys/param.h>
@@ -41,9 +41,9 @@
#include "lqr.h"
#include "mbuf.h"
#include "fsm.h"
-#include "lcp.h"
#include "throughput.h"
#include "hdlc.h"
+#include "lcp.h"
#include "ccp.h"
#include "link.h"
#include "async.h"
diff --git a/usr.sbin/ppp/ppp/ccp.c b/usr.sbin/ppp/ppp/ccp.c
index 7f39bb0e2ad..31baf74edc9 100644
--- a/usr.sbin/ppp/ppp/ccp.c
+++ b/usr.sbin/ppp/ppp/ccp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: ccp.c,v 1.13 2000/02/27 01:38:25 brian Exp $
+ * $OpenBSD: ccp.c,v 1.14 2000/07/19 11:06:31 brian Exp $
*
* TODO:
* o Support other compression protocols
@@ -41,8 +41,6 @@
#include "timer.h"
#include "fsm.h"
#include "proto.h"
-#include "lcp.h"
-#include "ccp.h"
#include "pred.h"
#include "deflate.h"
#include "throughput.h"
@@ -50,6 +48,8 @@
#include "slcompress.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
+#include "ccp.h"
#include "ipcp.h"
#include "filter.h"
#include "descriptor.h"
diff --git a/usr.sbin/ppp/ppp/chap.c b/usr.sbin/ppp/ppp/chap.c
index c5ecf5b8ba8..29a6b3b16b1 100644
--- a/usr.sbin/ppp/ppp/chap.c
+++ b/usr.sbin/ppp/ppp/chap.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: chap.c,v 1.20 2000/02/27 01:38:25 brian Exp $
+ * $OpenBSD: chap.c,v 1.21 2000/07/19 11:06:31 brian Exp $
*
* TODO:
*/
@@ -49,9 +49,9 @@
#include "timer.h"
#include "fsm.h"
#include "proto.h"
-#include "lcp.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "auth.h"
#include "async.h"
#include "throughput.h"
diff --git a/usr.sbin/ppp/ppp/command.c b/usr.sbin/ppp/ppp/command.c
index 74a0d164a2e..8183eccdc68 100644
--- a/usr.sbin/ppp/ppp/command.c
+++ b/usr.sbin/ppp/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: command.c,v 1.44 2000/07/07 14:47:54 brian Exp $
+ * $OpenBSD: command.c,v 1.45 2000/07/19 11:06:32 brian Exp $
*
*/
#include <sys/param.h>
@@ -61,12 +61,12 @@
#include "log.h"
#include "timer.h"
#include "fsm.h"
-#include "lcp.h"
#include "iplist.h"
#include "throughput.h"
#include "slcompress.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "ipcp.h"
#ifndef NONAT
#include "nat_cmd.h"
@@ -242,6 +242,31 @@ HelpCommand(struct cmdargs const *arg)
}
static int
+IdentCommand(struct cmdargs const *arg)
+{
+ int f, pos;
+
+ *arg->cx->physical->link.lcp.cfg.ident = '\0';
+
+ for (pos = 0, f = arg->argn; f < arg->argc; f++)
+ pos += snprintf(arg->cx->physical->link.lcp.cfg.ident + pos,
+ sizeof arg->cx->physical->link.lcp.cfg.ident - pos, "%s%s",
+ f == arg->argn ? "" : " ", arg->argv[f]);
+
+ return 0;
+}
+
+static int
+SendIdentification(struct cmdargs const *arg)
+{
+ if (arg->cx->state < DATALINK_LCP) {
+ log_Printf(LogWARN, "sendident: link has not reached LCP\n");
+ return 2;
+ }
+ return lcp_SendIdentification(&arg->cx->physical->link.lcp) ? 0 : 1;
+}
+
+static int
CloneCommand(struct cmdargs const *arg)
{
char namelist[LINE_LEN];
@@ -441,6 +466,8 @@ command_Expand(char **nargv, int argc, char const *const *oargv,
inet_ntoa(bundle->ncp.ipcp.ns.dns[0]));
nargv[arg] = subst(nargv[arg], "DNS1",
inet_ntoa(bundle->ncp.ipcp.ns.dns[1]));
+ nargv[arg] = subst(nargv[arg], "VERSION", Version);
+ nargv[arg] = subst(nargv[arg], "COMPILATIONDATE", __DATE__);
}
nargv[arg] = NULL;
}
@@ -681,6 +708,8 @@ static struct cmdtab const Commands[] = {
"Generate a down event", "down [ccp|lcp]"},
{"enable", NULL, NegotiateCommand, LOCAL_AUTH | LOCAL_CX_OPT,
"Enable option", "enable option .."},
+ {"ident", NULL, IdentCommand, LOCAL_AUTH | LOCAL_CX,
+ "Set the link identity", "ident text..."},
{"iface", "interface", RunListCommand, LOCAL_AUTH,
"interface control", "iface option ...", IfaceCommands},
{"link", "datalink", LinkCommand, LOCAL_AUTH,
@@ -705,6 +734,8 @@ static struct cmdtab const Commands[] = {
"Manipulate resolv.conf", "resolv readonly|reload|restore|rewrite|writable"},
{"save", NULL, SaveCommand, LOCAL_AUTH,
"Save settings", "save"},
+ {"sendident", NULL, SendIdentification, LOCAL_AUTH | LOCAL_CX,
+ "Transmit the link identity", "sendident"},
{"set", "setup", SetCommand, LOCAL_AUTH | LOCAL_CX_OPT,
"Set parameters", "set[up] var value"},
{"shell", "!", FgShellCommand, LOCAL_AUTH,
diff --git a/usr.sbin/ppp/ppp/datalink.c b/usr.sbin/ppp/ppp/datalink.c
index f97d71848da..f69314cab05 100644
--- a/usr.sbin/ppp/ppp/datalink.c
+++ b/usr.sbin/ppp/ppp/datalink.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: datalink.c,v 1.31 2000/06/13 09:57:51 brian Exp $
+ * $OpenBSD: datalink.c,v 1.32 2000/07/19 11:06:32 brian Exp $
*/
#include <sys/param.h>
@@ -45,10 +45,10 @@
#include "defs.h"
#include "timer.h"
#include "fsm.h"
-#include "lcp.h"
#include "descriptor.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "async.h"
#include "throughput.h"
#include "ccp.h"
diff --git a/usr.sbin/ppp/ppp/deflate.c b/usr.sbin/ppp/ppp/deflate.c
index ec0e5d35803..8e98ccdfb7f 100644
--- a/usr.sbin/ppp/ppp/deflate.c
+++ b/usr.sbin/ppp/ppp/deflate.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: deflate.c,v 1.9 2000/02/27 01:38:25 brian Exp $
+ * $OpenBSD: deflate.c,v 1.10 2000/07/19 11:06:33 brian Exp $
*/
#include <sys/types.h>
@@ -38,6 +38,8 @@
#include "log.h"
#include "timer.h"
#include "fsm.h"
+#include "lqr.h"
+#include "hdlc.h"
#include "lcp.h"
#include "ccp.h"
#include "deflate.h"
diff --git a/usr.sbin/ppp/ppp/fsm.c b/usr.sbin/ppp/ppp/fsm.c
index 7949f2f6d36..fc258a65d32 100644
--- a/usr.sbin/ppp/ppp/fsm.c
+++ b/usr.sbin/ppp/ppp/fsm.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: fsm.c,v 1.14 2000/06/13 09:57:51 brian Exp $
+ * $OpenBSD: fsm.c,v 1.15 2000/07/19 11:06:33 brian Exp $
*
* TODO:
*/
@@ -86,7 +86,7 @@ static const struct fsmcodedesc {
{ FsmRecvEchoReq, 0, 0, "EchoRequest" },
{ FsmRecvEchoRep, 0, 0, "EchoReply" },
{ FsmRecvDiscReq, 0, 0, "DiscardReq" },
- { FsmRecvIdent, 0, 0, "Ident" },
+ { FsmRecvIdent, 0, 1, "Ident" },
{ FsmRecvTimeRemain,0, 0, "TimeRemain" },
{ FsmRecvResetReq, 0, 0, "ResetReq" },
{ FsmRecvResetAck, 0, 1, "ResetAck" }
@@ -208,6 +208,9 @@ fsm_Output(struct fsm *fp, u_int code, u_int id, u_char *ptr, int count,
log_DumpBp(LogDEBUG, "fsm_Output", bp);
link_PushPacket(fp->link, bp, fp->bundle, LINK_QUEUES(fp->link) - 1,
fp->proto);
+
+ if (code == CODE_CONFIGREJ)
+ lcp_SendIdentification(&fp->link->lcp);
}
static void
@@ -374,6 +377,7 @@ FsmSendConfigReq(struct fsm *fp)
if (fp->more.reqs < 0)
log_Printf(LogPHASE, "%s: Too many %s REQs sent - abandoning "
"negotiation\n", fp->link->name, fp->name);
+ lcp_SendIdentification(&fp->link->lcp);
fsm_Close(fp);
}
}
@@ -562,6 +566,7 @@ FsmRecvConfigReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
FsmInitRestartCounter(fp, FSM_TRM_TIMER);
FsmSendTerminateReq(fp);
NewState(fp, ST_CLOSING);
+ lcp_SendIdentification(&fp->link->lcp);
}
}
break;
@@ -575,12 +580,14 @@ FsmRecvConfigReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
if (dec.rejend != dec.rej && --fp->more.rejs <= 0) {
log_Printf(LogPHASE, "%s: Too many %s REJs sent - abandoning negotiation\n",
fp->link->name, fp->name);
+ lcp_SendIdentification(&fp->link->lcp);
fsm_Close(fp);
}
if (dec.nakend != dec.nak && --fp->more.naks <= 0) {
log_Printf(LogPHASE, "%s: Too many %s NAKs sent - abandoning negotiation\n",
fp->link->name, fp->name);
+ lcp_SendIdentification(&fp->link->lcp);
fsm_Close(fp);
}
}
@@ -615,6 +622,7 @@ FsmRecvConfigAck(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
FsmInitRestartCounter(fp, FSM_TRM_TIMER);
FsmSendTerminateReq(fp);
NewState(fp, ST_CLOSING);
+ lcp_SendIdentification(&fp->link->lcp);
}
break;
case ST_OPENED:
@@ -769,6 +777,8 @@ FsmRecvConfigRej(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
return;
}
+ lcp_SendIdentification(&fp->link->lcp);
+
/*
* Check and process easy case
*/
@@ -932,6 +942,22 @@ FsmRecvDiscReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
static void
FsmRecvIdent(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
{
+ u_int32_t magic;
+ u_short len;
+ u_char *cp;
+
+ len = ntohs(lhp->length) - sizeof *lhp;
+ if (len >= 4) {
+ bp = m_pullup(m_append(bp, "", 1));
+ cp = MBUF_CTOP(bp);
+ ua_ntohl(cp, &magic);
+ if (magic != fp->link->lcp.his_magic)
+ log_Printf(fp->LogLevel, "%s: RecvIdent: magic 0x%08lx is wrong,"
+ " expecting 0x%08lx\n", fp->link->name, (u_long)magic,
+ (u_long)fp->link->lcp.his_magic);
+ cp[len] = '\0';
+ lcp_RecvIdentification(&fp->link->lcp, cp + 4);
+ }
m_freem(bp);
}
@@ -976,13 +1002,11 @@ fsm_Input(struct fsm *fp, struct mbuf *bp)
}
bp = mbuf_Read(bp, &lh, sizeof lh);
- if (ntohs(lh.length) != len) {
- if (ntohs(lh.length) > len) {
- log_Printf(LogWARN, "%s: Oops: Got %d bytes but %d byte payload "
- "- dropped\n", fp->link->name, len, (int)ntohs(lh.length));
- m_freem(bp);
- return;
- }
+ if (ntohs(lh.length) > len) {
+ log_Printf(LogWARN, "%s: Oops: Got %d bytes but %d byte payload "
+ "- dropped\n", fp->link->name, len, (int)ntohs(lh.length));
+ m_freem(bp);
+ return;
}
if (lh.code < fp->min_code || lh.code > fp->max_code ||
diff --git a/usr.sbin/ppp/ppp/ipcp.c b/usr.sbin/ppp/ppp/ipcp.c
index 85cc8228d0e..108bbc143b9 100644
--- a/usr.sbin/ppp/ppp/ipcp.c
+++ b/usr.sbin/ppp/ppp/ipcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: ipcp.c,v 1.24 2000/06/13 09:57:51 brian Exp $
+ * $OpenBSD: ipcp.c,v 1.25 2000/07/19 11:06:34 brian Exp $
*
* TODO:
* o Support IPADDRS properly
@@ -59,12 +59,12 @@
#include "timer.h"
#include "fsm.h"
#include "proto.h"
-#include "lcp.h"
#include "iplist.h"
#include "throughput.h"
#include "slcompress.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "ipcp.h"
#include "filter.h"
#include "descriptor.h"
diff --git a/usr.sbin/ppp/ppp/lcp.c b/usr.sbin/ppp/ppp/lcp.c
index e911e2a207b..abee7f34121 100644
--- a/usr.sbin/ppp/ppp/lcp.c
+++ b/usr.sbin/ppp/ppp/lcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: lcp.c,v 1.20 2000/06/24 23:38:30 brian Exp $
+ * $OpenBSD: lcp.c,v 1.21 2000/07/19 11:06:34 brian Exp $
*
*/
@@ -43,12 +43,12 @@
#include "timer.h"
#include "fsm.h"
#include "iplist.h"
-#include "lcp.h"
#include "throughput.h"
#include "proto.h"
#include "descriptor.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "ccp.h"
#include "async.h"
#include "link.h"
@@ -182,6 +182,7 @@ lcp_ReportStatus(struct cmdargs const *arg)
" REQ%s, %u Term REQ%s\n", lcp->cfg.fsm.timeout,
lcp->cfg.fsm.maxreq, lcp->cfg.fsm.maxreq == 1 ? "" : "s",
lcp->cfg.fsm.maxtrm, lcp->cfg.fsm.maxtrm == 1 ? "" : "s");
+ prompt_Printf(arg->prompt, " Ident: %s\n", lcp->cfg.ident);
prompt_Printf(arg->prompt, "\n Negotiation:\n");
prompt_Printf(arg->prompt, " ACFCOMP = %s\n",
command_ShowNegval(lcp->cfg.acfcomp));
@@ -247,6 +248,7 @@ lcp_Init(struct lcp *lcp, struct bundle *bundle, struct link *l,
lcp->cfg.lqr = NEG_ACCEPTED;
lcp->cfg.pap = NEG_ACCEPTED;
lcp->cfg.protocomp = NEG_ENABLED|NEG_ACCEPTED;
+ *lcp->cfg.ident = '\0';
lcp_Setup(lcp, lcp->cfg.openmode);
}
@@ -451,6 +453,40 @@ lcp_SendProtoRej(struct lcp *lcp, u_char *option, int count)
MB_LCPOUT);
}
+int
+lcp_SendIdentification(struct lcp *lcp)
+{
+ static u_char id; /* Use a private id */
+ u_char msg[DEF_MRU - 3];
+ const char *argv[2];
+ char *exp[2];
+
+ if (*lcp->cfg.ident == '\0')
+ return 0;
+
+ argv[0] = lcp->cfg.ident;
+ argv[1] = NULL;
+
+ command_Expand(exp, 1, argv, lcp->fsm.bundle, 1, getpid());
+
+ ua_htonl(&lcp->want_magic, msg);
+ strncpy(msg + 4, exp[0], sizeof msg - 5);
+ msg[sizeof msg - 1] = '\0';
+
+ log_Printf(LogLCP, "Sending ident magic %08x text %s\n", lcp->want_magic,
+ msg + 4);
+ fsm_Output(&lcp->fsm, CODE_IDENT, id++, msg, 4 + strlen(msg + 4), MB_LCPOUT);
+
+ free(exp[0]);
+ return 1;
+}
+
+void
+lcp_RecvIdentification(struct lcp *lcp, char *data)
+{
+ log_Printf(LogLCP, "Received ident: %s\n", data);
+}
+
static void
LcpSentTerminateReq(struct fsm *fp)
{
@@ -500,6 +536,8 @@ LcpLayerUp(struct fsm *fp)
hdlc_StartTimer(&p->hdlc);
fp->more.reqs = fp->more.naks = fp->more.rejs = lcp->cfg.fsm.maxreq * 3;
+ lcp_SendIdentification(lcp);
+
return 1;
}
diff --git a/usr.sbin/ppp/ppp/lcp.h b/usr.sbin/ppp/ppp/lcp.h
index dfa6b3b95ba..b3b2eac9a50 100644
--- a/usr.sbin/ppp/ppp/lcp.h
+++ b/usr.sbin/ppp/ppp/lcp.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: lcp.h,v 1.6 2000/02/27 01:38:27 brian Exp $
+ * $OpenBSD: lcp.h,v 1.7 2000/07/19 11:06:35 brian Exp $
*
* TODO:
*/
@@ -87,10 +87,11 @@ struct lcp {
unsigned lqr : 2; /* Link Quality Report */
unsigned pap : 2; /* Password Authentication protocol */
unsigned protocomp : 2; /* Protocol field compression */
+ char ident[DEF_MRU - 7]; /* SendIdentification() data */
} cfg;
};
-#define LCP_MAXCODE CODE_DISCREQ
+#define LCP_MAXCODE CODE_IDENT
#define LCP_MINMPCODE CODE_CODEREJ
#define TY_MRU 1 /* Maximum-Receive-Unit */
@@ -135,6 +136,8 @@ extern void lcp_Init(struct lcp *, struct bundle *, struct link *,
extern void lcp_Setup(struct lcp *, int);
extern void lcp_SendProtoRej(struct lcp *, u_char *, int);
+extern int lcp_SendIdentification(struct lcp *);
+extern void lcp_RecvIdentification(struct lcp *, char *);
extern int lcp_ReportStatus(struct cmdargs const *);
extern struct mbuf *lcp_Input(struct bundle *, struct link *, struct mbuf *);
extern void lcp_SetupCallbacks(struct lcp *);
diff --git a/usr.sbin/ppp/ppp/lqr.c b/usr.sbin/ppp/ppp/lqr.c
index 172c99797a0..80ef3107a3f 100644
--- a/usr.sbin/ppp/ppp/lqr.c
+++ b/usr.sbin/ppp/ppp/lqr.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: lqr.c,v 1.10 2000/06/20 09:13:31 brian Exp $
+ * $OpenBSD: lqr.c,v 1.11 2000/07/19 11:06:35 brian Exp $
*
* o LQR based on RFC1333
*
@@ -40,9 +40,9 @@
#include "fsm.h"
#include "acf.h"
#include "proto.h"
-#include "lcp.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "async.h"
#include "throughput.h"
#include "ccp.h"
diff --git a/usr.sbin/ppp/ppp/pap.c b/usr.sbin/ppp/ppp/pap.c
index 49229506b5f..495e3f7d56b 100644
--- a/usr.sbin/ppp/ppp/pap.c
+++ b/usr.sbin/ppp/ppp/pap.c
@@ -18,7 +18,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: pap.c,v 1.13 2000/02/27 01:38:27 brian Exp $
+ * $OpenBSD: pap.c,v 1.14 2000/07/19 11:06:35 brian Exp $
*
* TODO:
*/
@@ -38,11 +38,11 @@
#include "defs.h"
#include "timer.h"
#include "fsm.h"
-#include "lcp.h"
#include "auth.h"
#include "pap.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "proto.h"
#include "async.h"
#include "throughput.h"
diff --git a/usr.sbin/ppp/ppp/ppp.8 b/usr.sbin/ppp/ppp/ppp.8
index b4d4a2c7d86..e0d2c73043a 100644
--- a/usr.sbin/ppp/ppp/ppp.8
+++ b/usr.sbin/ppp/ppp/ppp.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ppp.8,v 1.89 2000/07/12 23:14:31 brian Exp $
+.\" $OpenBSD: ppp.8,v 1.90 2000/07/19 11:06:36 brian Exp $
.Dd 20 September 1995
.nr XX \w'\fC00'
.Dt PPP 8
@@ -3244,6 +3244,13 @@ value.
See the
.Dq set authname
command below.
+.It Li COMPILATIONDATE
+This is replaced with the date on which
+.Nm
+was compiled.
+.It Li DNS0 No " & " Li DNS1
+These are replaced with the primary and secondary nameserver IP numbers.
+If nameservers are negotiated by IPCP, the values of these macros will change.
.It Li ENDDISC
This is replaced with the local endpoint discriminator value.
See the
@@ -3270,14 +3277,14 @@ This is replaced with the IP number assigned to the local interface.
This is replaced with the value of the peers endpoint discriminator.
.It Li PROCESSID
This is replaced with the current process id.
+.It Li VERSION
+This is replaced with the current version number of
+.Nm ppp .
.It Li USER
This is replaced with the username that has been authenticated with PAP or
CHAP.
Normally, this variable is assigned only in -direct mode.
This value is available irrespective of whether utmp logging is enabled.
-.It Li DNS0 No " & " Li DNS1
-These are replaced with the primary and secondary nameserver IP numbers.
-If nameservers are negotiated by IPCP, the values of these macros will change.
.El
.Pp
These substitutions are also done by the
@@ -3404,6 +3411,20 @@ Show a list of available commands.
If
.Ar command
is specified, show the usage string for that command.
+.It ident Op Ar text Ns No ...
+Identify the link to the peer using
+.Ar text .
+If
+.Ar text
+is empty, link identification is disabled.
+It is possible to use any of the words described for the
+.Ic bg
+command above.
+Refer to the
+.Ic sendident
+command for details of when
+.Nm
+identifies itself to the peer.
.It iface Ar command Op args
This command is used to control the interface used by
.Nm ppp .
@@ -3697,6 +3718,24 @@ command.
.El
.It save
This option is not (yet) implemented.
+.It sendident
+This command tells
+.Nm
+to identify itself to the peer. The link must be in LCP state or higher.
+If no identity has been set (via the
+.Ic ident
+command),
+.Ic sendident
+will fail.
+.Pp
+When an identity has been set,
+.Nm
+will automatically identify itself when it sends or receives a configure
+reject, when negotiation fails or when LCP reaches the opened state.
+.Pp
+Received identification packets are logged to the LCP log (see
+.Ic set log
+for details) and are never responded to.
.It set Ns Xo
.No Op up
.Ar var value
diff --git a/usr.sbin/ppp/ppp/prompt.c b/usr.sbin/ppp/ppp/prompt.c
index c34327e2969..ee9a9bfeb4b 100644
--- a/usr.sbin/ppp/ppp/prompt.c
+++ b/usr.sbin/ppp/ppp/prompt.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: prompt.c,v 1.7 2000/02/27 01:38:28 brian Exp $
+ * $OpenBSD: prompt.c,v 1.8 2000/07/19 11:06:37 brian Exp $
*/
#include <sys/param.h>
@@ -49,7 +49,6 @@
#include "descriptor.h"
#include "prompt.h"
#include "fsm.h"
-#include "lcp.h"
#include "auth.h"
#include "iplist.h"
#include "throughput.h"
@@ -57,6 +56,7 @@
#include "mbuf.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "ipcp.h"
#include "filter.h"
#include "async.h"
diff --git a/usr.sbin/ppp/ppp/proto.c b/usr.sbin/ppp/ppp/proto.c
index 7e774d06a7a..e7924a6808a 100644
--- a/usr.sbin/ppp/ppp/proto.c
+++ b/usr.sbin/ppp/ppp/proto.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: proto.c,v 1.5 2000/02/27 01:38:28 brian Exp $
+ * $OpenBSD: proto.c,v 1.6 2000/07/19 11:06:37 brian Exp $
*/
#include <sys/types.h>
@@ -39,10 +39,10 @@
#include "fsm.h"
#include "mbuf.h"
#include "proto.h"
-#include "lcp.h"
#include "throughput.h"
#include "lqr.h"
#include "hdlc.h"
+#include "lcp.h"
#include "ccp.h"
#include "link.h"