diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ChangeLog | 7 | ||||
-rw-r--r-- | lib/filter.c | 6 | ||||
-rw-r--r-- | lib/plist.c | 5 | ||||
-rw-r--r-- | lib/routemap.c | 5 | ||||
-rw-r--r-- | lib/vty.c | 9 |
5 files changed, 31 insertions, 1 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 8a92df33..e0605022 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2005-09-29 Alain Ritoux <alain.ritoux@6wind.com> + + * filer.c: show protocol name in filter_show() + * plist.c: show protocol name in vty_show_prefix_entry() + * routemap.c: show protocol name in vty_show_route_map_entry() + * vty.c: in vty_command(), show protocol name if command unknown + 2005-09-28 Alain Ritoux <alain.ritoux@6wind.com> * md5-gnu.h: removed diff --git a/lib/filter.c b/lib/filter.c index 55bcdf4b..069919bb 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -27,6 +27,7 @@ #include "command.h" #include "sockunion.h" #include "buffer.h" +#include "log.h" struct filter_cisco { @@ -1580,6 +1581,11 @@ filter_show (struct vty *vty, const char *name, afi_t afi) if (master == NULL) return 0; + /* Print the name of the protocol */ + if (zlog_default) + vty_out (vty, "%s:%s", + zlog_proto_names[zlog_default->protocol], VTY_NEWLINE); + for (access = master->num.head; access; access = access->next) { if (name && strcmp (access->name, name) != 0) diff --git a/lib/plist.c b/lib/plist.c index 97d254f4..83c5aa0c 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -28,6 +28,7 @@ #include "sockunion.h" #include "buffer.h" #include "stream.h" +#include "log.h" /* Each prefix-list's entry. */ struct prefix_list_entry @@ -918,6 +919,10 @@ vty_show_prefix_entry (struct vty *vty, afi_t afi, struct prefix_list *plist, { struct prefix_list_entry *pentry; + /* Print the name of the protocol */ + if (zlog_default) + vty_out (vty, "%s: ", zlog_proto_names[zlog_default->protocol]); + if (dtype == normal_display) { vty_out (vty, "ip%s prefix-list %s: %d entries%s", diff --git a/lib/routemap.c b/lib/routemap.c index 0a4eeb99..a9d94f27 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -205,6 +205,11 @@ vty_show_route_map_entry (struct vty *vty, struct route_map *map) struct route_map_index *index; struct route_map_rule *rule; + /* Print the name of the protocol */ + if (zlog_default) + vty_out (vty, "%s:%s", zlog_proto_names[zlog_default->protocol], + VTY_NEWLINE); + for (index = map->head; index; index = index->next) { vty_out (vty, "route-map %s, %s, sequence %d%s", @@ -388,6 +388,7 @@ vty_command (struct vty *vty, char *buf) { int ret; vector vline; + const char *protocolname; /* Split readline string up into the vector */ vline = cmd_make_strvec (buf); @@ -406,6 +407,12 @@ vty_command (struct vty *vty, char *buf) 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_command (struct vty *vty, char *buf) 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); |