summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-10-25 12:05:21 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-10-25 12:05:21 +0000
commit8ea72b3e38f73b6f51d365676e11b883cf28d99b (patch)
tree12c284e4944df5a7ba66176df682b6d582553e54
parentf400a62f7595cb26a7d18dd09c3222c6e4a362a8 (diff)
Support -D makro=value like bgpd and ripd. OK norby@
-rw-r--r--usr.sbin/ospf6d/ospf6d.816
-rw-r--r--usr.sbin/ospf6d/ospf6d.c12
2 files changed, 23 insertions, 5 deletions
diff --git a/usr.sbin/ospf6d/ospf6d.8 b/usr.sbin/ospf6d/ospf6d.8
index 09f064bf035..af2717485e9 100644
--- a/usr.sbin/ospf6d/ospf6d.8
+++ b/usr.sbin/ospf6d/ospf6d.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ospf6d.8,v 1.4 2007/10/14 12:27:35 krw Exp $
+.\" $OpenBSD: ospf6d.8,v 1.5 2007/10/25 12:05:20 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 OSPF6D 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
@@ -121,6 +124,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/ospf6d/ospf6d.c b/usr.sbin/ospf6d/ospf6d.c
index a2797779cd3..ea5f66a2171 100644
--- a/usr.sbin/ospf6d/ospf6d.c
+++ b/usr.sbin/ospf6d/ospf6d.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospf6d.c,v 1.6 2007/10/20 13:26:50 pyr Exp $ */
+/* $OpenBSD: ospf6d.c,v 1.7 2007/10/25 12:05:20 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;