summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpctl
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-09-01 13:59:18 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-09-01 13:59:18 +0000
commit2cd229f3a8d23bb50ebba9ede3b77eff1b0561a0 (patch)
treeb618adaf08f7a7f4f97fa8bb375fe602356eac5f /usr.sbin/ldpctl
parent31ee4580c97a8106349c27092b402ec9514510b0 (diff)
s/lfib/fib/ for more consistency with the other routing ctl tools.
While I also made the code more consistent the most noticable change is the rename of the commandline arguments for fib coupling and viewing. OK michele@
Diffstat (limited to 'usr.sbin/ldpctl')
-rw-r--r--usr.sbin/ldpctl/ldpctl.810
-rw-r--r--usr.sbin/ldpctl/ldpctl.c46
-rw-r--r--usr.sbin/ldpctl/parser.c24
-rw-r--r--usr.sbin/ldpctl/parser.h12
4 files changed, 46 insertions, 46 deletions
diff --git a/usr.sbin/ldpctl/ldpctl.8 b/usr.sbin/ldpctl/ldpctl.8
index 99f4916d615..552db6f59d7 100644
--- a/usr.sbin/ldpctl/ldpctl.8
+++ b/usr.sbin/ldpctl/ldpctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ldpctl.8,v 1.5 2010/05/10 18:46:07 sthen Exp $
+.\" $OpenBSD: ldpctl.8,v 1.6 2010/09/01 13:59:17 claudio Exp $
.\"
.\" Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
.\" Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -15,7 +15,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: May 10 2010 $
+.Dd $Mdocdate: September 1 2010 $
.Dt LDPCTL 8
.Os
.Sh NAME
@@ -38,17 +38,17 @@ for
.Pp
The following commands are available:
.Bl -tag -width Ds
-.It Cm lfib couple
+.It Cm fib couple
Insert the learned routes into the Label Forwarding Information Base a.k.a.
the kernel routing table.
-.It Cm lfib decouple
+.It Cm fib decouple
Remove the learned routes from the Label Forwarding Information Base a.k.a.
the kernel routing table.
.It Cm log brief
Disable verbose debug logging.
.It Cm log verbose
Enable verbose debug logging.
-.It Cm show lfib Op Ar destination | filter
+.It Cm show fib Op Ar destination | filter
Show the Label Forwarding Information Base.
.Ar destination
can be specified to show the route matching a destination IP address.
diff --git a/usr.sbin/ldpctl/ldpctl.c b/usr.sbin/ldpctl/ldpctl.c
index a2fde8099d8..5fbfe856628 100644
--- a/usr.sbin/ldpctl/ldpctl.c
+++ b/usr.sbin/ldpctl/ldpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpctl.c,v 1.11 2010/07/08 09:42:32 claudio Exp $
+/* $OpenBSD: ldpctl.c,v 1.12 2010/09/01 13:59:17 claudio Exp $
*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -45,10 +45,10 @@ int show_interface_msg(struct imsg *);
int get_ifms_type(int);
int show_lib_msg(struct imsg *);
int show_nbr_msg(struct imsg *);
-void show_lfib_head(void);
-int show_lfib_msg(struct imsg *);
+void show_fib_head(void);
+int show_fib_msg(struct imsg *);
void show_interface_head(void);
-int show_lfib_interface_msg(struct imsg *);
+int show_fib_interface_msg(struct imsg *);
const char *get_media_descr(int);
void print_baudrate(u_int64_t);
@@ -121,16 +121,16 @@ main(int argc, char *argv[])
"Nexthop", "Local Label", "Remote Label", "In Use");
imsg_compose(ibuf, IMSG_CTL_SHOW_LIB, 0, 0, -1, NULL, 0);
break;
- case SHOW_LFIB:
+ case SHOW_FIB:
if (!res->addr.s_addr)
imsg_compose(ibuf, IMSG_CTL_KROUTE, 0, 0, -1,
&res->flags, sizeof(res->flags));
else
imsg_compose(ibuf, IMSG_CTL_KROUTE_ADDR, 0, 0, -1,
&res->addr, sizeof(res->addr));
- show_lfib_head();
+ show_fib_head();
break;
- case SHOW_LFIB_IFACE:
+ case SHOW_FIB_IFACE:
if (*res->ifname)
imsg_compose(ibuf, IMSG_CTL_IFINFO, 0, 0, -1,
res->ifname, sizeof(res->ifname));
@@ -138,16 +138,16 @@ main(int argc, char *argv[])
imsg_compose(ibuf, IMSG_CTL_IFINFO, 0, 0, -1, NULL, 0);
show_interface_head();
break;
- case LFIB:
- errx(1, "lfib couple|decouple");
+ case FIB:
+ errx(1, "fib couple|decouple");
break;
- case LFIB_COUPLE:
- imsg_compose(ibuf, IMSG_CTL_LFIB_COUPLE, 0, 0, -1, NULL, 0);
+ case FIB_COUPLE:
+ imsg_compose(ibuf, IMSG_CTL_FIB_COUPLE, 0, 0, -1, NULL, 0);
printf("couple request sent.\n");
done = 1;
break;
- case LFIB_DECOUPLE:
- imsg_compose(ibuf, IMSG_CTL_LFIB_DECOUPLE, 0, 0, -1, NULL, 0);
+ case FIB_DECOUPLE:
+ imsg_compose(ibuf, IMSG_CTL_FIB_DECOUPLE, 0, 0, -1, NULL, 0);
printf("decouple request sent.\n");
done = 1;
break;
@@ -193,16 +193,16 @@ main(int argc, char *argv[])
case SHOW_LIB:
done = show_lib_msg(&imsg);
break;
- case SHOW_LFIB:
- done = show_lfib_msg(&imsg);
+ case SHOW_FIB:
+ done = show_fib_msg(&imsg);
break;
- case SHOW_LFIB_IFACE:
- done = show_lfib_interface_msg(&imsg);
+ case SHOW_FIB_IFACE:
+ done = show_fib_interface_msg(&imsg);
break;
case NONE:
- case LFIB:
- case LFIB_COUPLE:
- case LFIB_DECOUPLE:
+ case FIB:
+ case FIB_COUPLE:
+ case FIB_DECOUPLE:
case LOG_VERBOSE:
case LOG_BRIEF:
case RELOAD:
@@ -388,7 +388,7 @@ show_nbr_msg(struct imsg *imsg)
}
void
-show_lfib_head(void)
+show_fib_head(void)
{
printf("Flags: C = Connected, S = Static\n");
printf(" %-4s %-20s %-17s %-17s %s\n", "Prio", "Destination",
@@ -396,7 +396,7 @@ show_lfib_head(void)
}
int
-show_lfib_msg(struct imsg *imsg)
+show_fib_msg(struct imsg *imsg)
{
struct kroute *k;
char *p;
@@ -462,7 +462,7 @@ show_interface_head(void)
}
int
-show_lfib_interface_msg(struct imsg *imsg)
+show_fib_interface_msg(struct imsg *imsg)
{
struct kif *k;
int ifms_type;
diff --git a/usr.sbin/ldpctl/parser.c b/usr.sbin/ldpctl/parser.c
index db9d8e16a3d..662c7e9a06a 100644
--- a/usr.sbin/ldpctl/parser.c
+++ b/usr.sbin/ldpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.3 2010/01/13 11:33:12 jsg Exp $ */
+/* $OpenBSD: parser.c,v 1.4 2010/09/01 13:59:17 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -51,27 +51,27 @@ struct token {
};
static const struct token t_main[];
-static const struct token t_lfib[];
+static const struct token t_fib[];
static const struct token t_show[];
static const struct token t_show_iface[];
static const struct token t_show_db[];
static const struct token t_show_area[];
static const struct token t_show_nbr[];
static const struct token t_show_lib[];
-static const struct token t_show_lfib[];
+static const struct token t_show_fib[];
static const struct token t_log[];
static const struct token t_main[] = {
/* {KEYWORD, "reload", RELOAD, NULL}, */
- {KEYWORD, "lfib", LFIB, t_lfib},
+ {KEYWORD, "fib", FIB, t_fib},
{KEYWORD, "show", SHOW, t_show},
{KEYWORD, "log", NONE, t_log},
{ENDTOKEN, "", NONE, NULL}
};
-static const struct token t_lfib[] = {
- { KEYWORD, "couple", LFIB_COUPLE, NULL},
- { KEYWORD, "decouple", LFIB_DECOUPLE, NULL},
+static const struct token t_fib[] = {
+ { KEYWORD, "couple", FIB_COUPLE, NULL},
+ { KEYWORD, "decouple", FIB_DECOUPLE, NULL},
{ ENDTOKEN, "", NONE, NULL}
};
@@ -80,7 +80,7 @@ static const struct token t_show[] = {
{KEYWORD, "interfaces", SHOW_IFACE, t_show_iface},
{KEYWORD, "neighbor", SHOW_NBR, t_show_nbr},
{KEYWORD, "lib", SHOW_LIB, t_show_lib},
- {KEYWORD, "lfib", SHOW_LFIB, t_show_lfib},
+ {KEYWORD, "fib", SHOW_FIB, t_show_fib},
{ENDTOKEN, "", NONE, NULL}
};
@@ -105,11 +105,11 @@ static const struct token t_log[] = {
{ENDTOKEN, "", NONE, NULL}
};
-static const struct token t_show_lfib[] = {
+static const struct token t_show_fib[] = {
{NOTOKEN, "", NONE, NULL},
- {KEYWORD, "interface", SHOW_LFIB_IFACE, t_show_iface},
- {FLAG, "connected", F_CONNECTED, t_show_lfib},
- {FLAG, "static", F_STATIC, t_show_lfib},
+ {KEYWORD, "interface", SHOW_FIB_IFACE, t_show_iface},
+ {FLAG, "connected", F_CONNECTED, t_show_fib},
+ {FLAG, "static", F_STATIC, t_show_fib},
{ADDRESS, "", NONE, NULL},
{ENDTOKEN, "", NONE, NULL}
};
diff --git a/usr.sbin/ldpctl/parser.h b/usr.sbin/ldpctl/parser.h
index b54b179fbbe..69d94ea410b 100644
--- a/usr.sbin/ldpctl/parser.h
+++ b/usr.sbin/ldpctl/parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.h,v 1.3 2010/01/13 11:33:12 jsg Exp $ */
+/* $OpenBSD: parser.h,v 1.4 2010/09/01 13:59:17 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -27,17 +27,17 @@
enum actions {
NONE,
- LFIB,
- LFIB_COUPLE,
- LFIB_DECOUPLE,
+ FIB,
+ FIB_COUPLE,
+ FIB_DECOUPLE,
LOG_VERBOSE,
LOG_BRIEF,
SHOW,
SHOW_IFACE,
SHOW_NBR,
SHOW_LIB,
- SHOW_LFIB,
- SHOW_LFIB_IFACE,
+ SHOW_FIB,
+ SHOW_FIB_IFACE,
RELOAD
};