2005-09-29 Alain Ritoux <alain.ritoux@6wind.com>
* lib/filer.c: show protocol name in filter_show()
* lib/plist.c: show protocol name in vty_show_prefix_entry()
* routemap.c: show protocol name in vty_show_route_map_entry()
* lib/vty.c: in vty_command(), show protocol name if command unknown
* zebra/zserv.c: Always provide distance fo route add
* ripd/rip_snmp.c: rip2IfConfReceive() sends values in conformance
with RFC. Also PeerDomain is now set to a STRING type.
* ripd/ripd.h: rip_redistribute_add() API includes metric and distance
* ripd/ripd.c: rip_redistribute_add() API i.e. stores metric and distance
Now allows a RIP-route to overcome a redistributed route coming
from a protocol with worse (higher) administrative distance
Metrics from redistribution are shown in show ip rip
* ripd/rip_zebra.c: adapt to the rip_redistribute_add() API, i.e.
provide distance and metric
* ripd/rip_interface.c: adapt to the rip_redistribute_add() API
* ripd/rip_routemap.c: no RMAP_COMPILE_ERROR on (metric > 16) usage
rather a CMD_WARNING, because set metric ius shared with other
protocols using larger values (such as OSPF)
The match metric action takes first external metric if present
(from redistribution) then RIP metric.
diff --git a/lib/vty.c b/lib/vty.c
index 540f7b9..2f0bd3f 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -388,6 +388,7 @@
{
int ret;
vector vline;
+ const char *protocolname;
/* Split readline string up into the vector */
vline = cmd_make_strvec (buf);
@@ -406,6 +407,12 @@
ret = cmd_execute_command (vline, vty, NULL, 0);
+ /* Get the name of the protocol if any */
+ if (zlog_default)
+ protocolname = zlog_proto_names[zlog_default->protocol];
+ else
+ protocolname = zlog_proto_names[ZLOG_NONE];
+
#ifdef CONSUMED_TIME_CHECK
GETRUSAGE(&after);
if ((realtime = thread_consumed_time(&after, &before, &cputime)) >
@@ -427,7 +434,7 @@
vty_out (vty, "%% Ambiguous command.%s", VTY_NEWLINE);
break;
case CMD_ERR_NO_MATCH:
- vty_out (vty, "%% Unknown command.%s", VTY_NEWLINE);
+ vty_out (vty, "%% [%s] Unknown command: %s%s", protocolname, buf, VTY_NEWLINE);
break;
case CMD_ERR_INCOMPLETE:
vty_out (vty, "%% Command incomplete.%s", VTY_NEWLINE);