summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-10-25 12:06:31 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-10-25 12:06:31 +0000
commitfe678bf717148c09c6226d4468909c84d23e2a15 (patch)
tree6be79debacad3ad08de638ab16b82f42c4ae2cfb /usr.sbin
parent8ea72b3e38f73b6f51d365676e11b883cf28d99b (diff)
Add -D makro=value as well so that all routing daemons are in sync.
OK norby@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospfd/ospfd.816
-rw-r--r--usr.sbin/ospfd/ospfd.c12
2 files changed, 23 insertions, 5 deletions
diff --git a/usr.sbin/ospfd/ospfd.8 b/usr.sbin/ospfd/ospfd.8
index 38ec3330c36..fdc21e94dcb 100644
--- a/usr.sbin/ospfd/ospfd.8
+++ b/usr.sbin/ospfd/ospfd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ospfd.8,v 1.19 2007/10/14 12:27:35 krw Exp $
+.\" $OpenBSD: ospfd.8,v 1.20 2007/10/25 12:06:30 claudio Exp $
.\"
.\" Copyright (c) 2004, 2005, 2007 Esben Norby <norby@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 14 2007 $
+.Dd $Mdocdate: October 25 2007 $
.Dt OSPFD 8
.Os
.Sh NAME
@@ -23,6 +23,9 @@
.Sh SYNOPSIS
.Nm
.Op Fl dnv
+.Oo Xo
+.Fl D Ar macro Ns = Ns Ar value Oc
+.Xc
.Op Fl f Ar file
.Sh DESCRIPTION
.Nm
@@ -120,6 +123,15 @@ utility.
.Pp
The options are as follows:
.Bl -tag -width Ds
+.It Fl D Ar macro Ns = Ns Ar value
+Define
+.Ar macro
+to be set to
+.Ar value
+on the command line.
+Overrides the definition of
+.Ar macro
+in the configuration file.
.It Fl d
Do not daemonize.
If this option is specified,
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c
index 5ccd10f12e4..be69cab999f 100644
--- a/usr.sbin/ospfd/ospfd.c
+++ b/usr.sbin/ospfd/ospfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfd.c,v 1.55 2007/10/20 13:29:44 pyr Exp $ */
+/* $OpenBSD: ospfd.c,v 1.56 2007/10/25 12:06:30 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -118,7 +118,8 @@ usage(void)
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-cdnv] [-f file]\n", __progname);
+ fprintf(stderr, "usage: %s [-cdnv] [-D macro=value] [-f file]\n",
+ __progname);
exit(1);
}
@@ -138,7 +139,7 @@ main(int argc, char *argv[])
log_init(1); /* log to stderr until daemonized */
- while ((ch = getopt(argc, argv, "cdf:nv")) != -1) {
+ while ((ch = getopt(argc, argv, "cdD:f:nv")) != -1) {
switch (ch) {
case 'c':
opts |= OSPFD_OPT_FORCE_DEMOTE;
@@ -146,6 +147,11 @@ main(int argc, char *argv[])
case 'd':
debug = 1;
break;
+ case 'D':
+ if (cmdline_symset(optarg) < 0)
+ log_warnx("could not parse macro definition %s",
+ optarg);
+ break;
case 'f':
conffile = optarg;
break;