summaryrefslogtreecommitdiff
path: root/sbin/routed/rtquery
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-10-02 06:51:50 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-10-02 06:51:50 +0000
commit5858b0f0fdcc8c3e53139bf50214ba36dd81620f (patch)
tree670b117c58fb0de32035646045de69b8b6f7c369 /sbin/routed/rtquery
parent2d0181727eae9dd33e29514e34e5985fd08af1e5 (diff)
update to the latest version from Sep 12.
Diffstat (limited to 'sbin/routed/rtquery')
-rw-r--r--sbin/routed/rtquery/rtquery.88
-rw-r--r--sbin/routed/rtquery/rtquery.c19
2 files changed, 18 insertions, 9 deletions
diff --git a/sbin/routed/rtquery/rtquery.8 b/sbin/routed/rtquery/rtquery.8
index 1afb8b9478b..d77ca30b9c8 100644
--- a/sbin/routed/rtquery/rtquery.8
+++ b/sbin/routed/rtquery/rtquery.8
@@ -79,18 +79,20 @@ change tracing, where
.Em op
is one of the following.
Requests from processes not running with UID 0 or on distant networks
-are generally ignored.
+are generally ignored by the daemon except for a message in the system log.
.El
.Bl -tag -width Ds -offset indent-two
-.It Em on=filename
+.It Em on=tracefile
turn tracing on into the specified file. That file must usually
have been specified when the daemon was started or be the same
as a fixed name, often
-.Pa /tmp/routed.log .
+.Pa /etc/routed.trace .
.It Em more
increases the debugging level.
.It Em off
turns off tracing.
+.It Em dump
+dumps the daemon's routing table to the current tracefile.
.El
.Sh SEE ALSO
.Xr routed 8 ,
diff --git a/sbin/routed/rtquery/rtquery.c b/sbin/routed/rtquery/rtquery.c
index 33053b41992..64fddb212b7 100644
--- a/sbin/routed/rtquery/rtquery.c
+++ b/sbin/routed/rtquery/rtquery.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtquery.c,v 1.2 1996/09/22 20:48:10 millert Exp $ */
+/* $OpenBSD: rtquery.c,v 1.3 1996/10/02 06:51:49 mickey Exp $ */
/*-
* Copyright (c) 1982, 1986, 1993
@@ -170,6 +170,8 @@ main(int argc,
"more",
# define TRACE_OFF 2
"off",
+# define TRACE_DUMP 3
+ "dump",
0
};
switch (getsubopt(&options,traceopts,&value)) {
@@ -178,25 +180,30 @@ main(int argc,
if (!value
|| strlen(value) > MAXPATHLEN)
goto usage;
- strcpy((char*)OMSG.rip_tracefile,value);
- omsg_len += (strlen(value)
- - sizeof(OMSG.ripun));
break;
case TRACE_MORE:
if (value)
goto usage;
OMSG.rip_cmd = RIPCMD_TRACEON;
- OMSG.rip_tracefile[0] = '\0';
+ value = "";
break;
case TRACE_OFF:
if (value)
goto usage;
OMSG.rip_cmd = RIPCMD_TRACEOFF;
- OMSG.rip_tracefile[0] = '\0';
+ value = "";
+ break;
+ case TRACE_DUMP:
+ if (value)
+ goto usage;
+ OMSG.rip_cmd = RIPCMD_TRACEON;
+ value = "dump/../table";
break;
default:
goto usage;
}
+ strcpy((char*)OMSG.rip_tracefile, value);
+ omsg_len += strlen(value) - sizeof(OMSG.ripun);
}
break;