From 6cf0cf0ca400062a03c10a92d60ec3013569a383 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Thu, 30 Mar 2006 14:43:17 +0000 Subject: [lib] Mark most arguments in DEFUN_CMD_FUNC_TEXT as potentially unused 2006-03-30 Paul Jakma * command.h: (DEFUN_CMD_FUNC_TEXT) Annotate arguments as potentially being unused. --- lib/command.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/command.h') diff --git a/lib/command.h b/lib/command.h index fbe6a0a1..26013e22 100644 --- a/lib/command.h +++ b/lib/command.h @@ -183,7 +183,10 @@ struct desc #define DEFUN_CMD_FUNC_TEXT(funcname) \ static int funcname \ - (struct cmd_element *self, struct vty *vty, int argc, const char *argv[]) + (struct cmd_element *self __attribute__ ((unused)), \ + struct vty *vty __attribute__ ((unused)), \ + int argc __attribute__ ((unused)), \ + const char *argv[] __attribute__ ((unused)) ) /* DEFUN for vty command interafce. Little bit hacky ;-). */ #define DEFUN(funcname, cmdname, cmdstr, helpstr) \ -- cgit v1.2.3 From 86228fde807f4a13313e9828b8438f18a045a6ba Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Thu, 30 Mar 2006 15:00:30 +0000 Subject: [lib] command.c exports host global, add it to header. 2006-03-14 Paul Jakma * privs.c: (zprivs_caps_init) Change user IDs before lowering privileges, while this seems to work on Linux, on Solaris it rightfully refuses due to PRIV_PROC_SETID having been dropped. * command.h: Add the struct host global exported from command.c --- lib/command.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/command.h') diff --git a/lib/command.h b/lib/command.h index 26013e22..99aec332 100644 --- a/lib/command.h +++ b/lib/command.h @@ -354,5 +354,7 @@ extern char *host_config_file (void); extern void host_config_set (char *); extern void print_version (const char *); - + +/* struct host global, ick */ +extern struct host host; #endif /* _ZEBRA_COMMAND_H */ -- cgit v1.2.3 From 9c42a6ebbc103a0a4be6af782388ad26e6c03556 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Tue, 27 Jun 2006 07:52:03 +0000 Subject: [lib] Centralise Zserv route type information, auto-generate redist strings 2006-05-23 Paul Jakma * route_types.txt: New file, table of ZEBRA_ROUTE definitions. * route_types.awk: New script, to parse previous and generate (for now) redistribute string defines. * Makefile.am: build route_types.h using previous two, ala memtypes.h, include the script and table file in EXTRA_DIST. * command.h: pull in route_types.h, add a REDIST_STR define. --- lib/command.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/command.h') diff --git a/lib/command.h b/lib/command.h index 99aec332..ce18731e 100644 --- a/lib/command.h +++ b/lib/command.h @@ -25,6 +25,7 @@ #include "vector.h" #include "vty.h" +#include "lib/route_types.h" /* Host configuration variable */ struct host @@ -271,6 +272,7 @@ struct desc #define IP_STR "IP information\n" #define IPV6_STR "IPv6 information\n" #define NO_STR "Negate a command or set its defaults\n" +#define REDIST_STR "Redistribute information from another routing protocol\n" #define CLEAR_STR "Reset functions\n" #define RIP_STR "RIP information\n" #define BGP_STR "BGP information\n" -- cgit v1.2.3 From 7514fb7739f74311830e9ddd1381d0d228224f61 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Wed, 2 May 2007 16:05:35 +0000 Subject: [zebra] Routemap support on received routes, with 'set src' command (linux) 2007-05-01 David L Stevens * (general) These changes collectively add route-map and prefix-list support to zebra and fix a bug in "show route-map" (with no argument). * doc/main.texi: added route-map, prefix-list, ip protocol and set src documentation * lib/command.h: added PROTOCOL_NODE type * lib/log.c: (proto_name2num) new function, protocol name to number translation. * lib/routemap.c: (vty_show_route_map) fixed "show route-map" without route-map name * lib/routemap.h: added RMAP_ZEBRA type * lib/zebra.h: added proto_name2num() prototype * vtysh/extract.pl.in: added VTYSH_ZEBRA flag for route-map and plist * vtysh/Makefile.am: added zebra_routemap.c * vtysh/vtysh.h: added VTYSH_ZEBRA flag to VTYSH_RMAP * zebra/connected.c: (connected_up_ipv4) added src preference argument to rib_add_ipv4() * zebra/kernel_socket.c: (rtm_read) ditto * zebra/main.c: added prefix list initialization * zebra/Makefile.am: added zebra_routemap.c source file * zebra/rib.h: added generic address union "g_addr" and use in existing places that had an explicit union. Added "src" to struct nexthop. Added preferred src arg to nexthop_ipv4_add and rib_add_ipv4. * zebra/rt_netlink.c: (netlink_routing_table) set preferred source on netlink messages. (netlink_route_change) ditto (netlink_route_multipath) ditto. * zebra/rtread_getmsg.c: (handle_route_entry) added (NULL) src to rib_add_ipv4() call. * zebra/rtread_proc.c: (proc_route_read) ditto * zebra/zebra_rib.c: (nexthop_ipv4_add) add src argument. (nexthop_ipv4_ifindex_add) ditto (rib_add_ipv4) ditto (nexthop_active_check) Add route-map processing. * zebra/zebra_routemap.c: new file for zebra route-map commands. * zebra/zebra_vty.c: (ip_protocol_cmd) Apply route-map to protocol (vty_show_ip_route_detail) added "src" printing (vty_show_ip_route) ditto (show_ip_protocol_cmd) new command, list routemaps. (config_write_protocol) write out routemap protocl config. (zebra_vty_init) Install the new routemap protocol commands. * zebra/zserv.c: (zread_ipv4_add) added (NULL) src arg (zebra_init) init zebra route-maps. * zebra/zserv.h: add zebra_route_map_init --- lib/command.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/command.h') diff --git a/lib/command.h b/lib/command.h index ce18731e..a7253788 100644 --- a/lib/command.h +++ b/lib/command.h @@ -99,6 +99,7 @@ enum node_type SMUX_NODE, /* SNMP configuration node. */ DUMP_NODE, /* Packet dump node. */ FORWARDING_NODE, /* IP forwarding node. */ + PROTOCOL_NODE, /* protocol filtering node */ VTY_NODE /* Vty node. */ }; -- cgit v1.2.3 From 62687ff1cd3d4460cdbd4b0fbf1e3298fe277ad2 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Sat, 23 Aug 2008 14:27:06 +0100 Subject: [vty] Add support for a 'restricted mode' with anonymous vty connections * lib/command.h: Add a RESTRICTED_NODE, intended for use with anonymous, 'no login' vtys, to provide a subset of 'view' mode commands. * lib/command.c: Add RESTRICTED_NODE bits, nothing special, just following VIEW_NODE. * lib/vty.c: (vty_auth) enable authentication should fall back to restricted/view node as appropriate. (vty_create) init vty's to restricted/view node as appropriate, for the 'no login' case. (vty_{no_,}restricted_mode_cmd) config commands to enable 'anonymous restricted' in vty configuration. (vty_config_write) 'anonymous restricted' config. (vty_init) Install some commands to restricted mode, and the 'anonymous restricted' config commands into VTY_NODE. * bgpd/*.c: Install some of the safe(r) BGP commands into 'restricted mode', i.e. lookup commands of non-sensitive data. Useful with looking-glass route-servers. --- lib/command.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/command.h') diff --git a/lib/command.h b/lib/command.h index a7253788..d093df3c 100644 --- a/lib/command.h +++ b/lib/command.h @@ -63,6 +63,7 @@ struct host enum node_type { AUTH_NODE, /* Authentication mode of vty interface. */ + RESTRICTED_NODE, /* Restricted view mode */ VIEW_NODE, /* View node. Default mode of vty interface. */ AUTH_ENABLE_NODE, /* Authentication mode for change enable. */ ENABLE_NODE, /* Enable node. */ @@ -100,7 +101,7 @@ enum node_type DUMP_NODE, /* Packet dump node. */ FORWARDING_NODE, /* IP forwarding node. */ PROTOCOL_NODE, /* protocol filtering node */ - VTY_NODE /* Vty node. */ + VTY_NODE, /* Vty node. */ }; /* Node which has some commands and prompt string and configuration -- cgit v1.2.3