diff options
Diffstat (limited to 'ripd')
-rw-r--r-- | ripd/Makefile.am | 1 | ||||
-rw-r--r-- | ripd/rip_interface.c | 19 | ||||
-rw-r--r-- | ripd/rip_main.c | 22 | ||||
-rw-r--r-- | ripd/rip_zebra.c | 2 | ||||
-rw-r--r-- | ripd/ripd.c | 2 | ||||
-rw-r--r-- | ripd/ripd.h | 6 |
6 files changed, 37 insertions, 15 deletions
diff --git a/ripd/Makefile.am b/ripd/Makefile.am index 2fa26659..a6d3d398 100644 --- a/ripd/Makefile.am +++ b/ripd/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to produce Makefile.in. INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib @SNMP_INCLUDES@ -DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" INSTALL_SDATA=@INSTALL@ -m 600 AM_CFLAGS = $(PICFLAGS) diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 4f80bf42..d3b55fc0 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -239,6 +239,7 @@ rip_request_interface (struct interface *ifp) } } +#if 0 /* Send RIP request to the neighbor. */ static void rip_request_neighbor (struct in_addr addr) @@ -269,6 +270,7 @@ rip_request_neighbor_all (void) if (rp->info) rip_request_neighbor (rp->p.u.prefix4); } +#endif /* Multicast packet receive socket. */ static int @@ -423,8 +425,9 @@ rip_interface_up (int command, struct zclient *zclient, zebra_size_t length) return 0; if (IS_RIP_DEBUG_ZEBRA) - zlog_debug ("interface %s index %d flags %lld metric %d mtu %d is up", - ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu); + zlog_debug ("interface %s index %d flags %#llx metric %d mtu %d is up", + ifp->name, ifp->ifindex, (unsigned long long) ifp->flags, + ifp->metric, ifp->mtu); /* Check if this interface is RIP enabled or not.*/ rip_enable_apply (ifp); @@ -447,8 +450,9 @@ rip_interface_add (int command, struct zclient *zclient, zebra_size_t length) ifp = zebra_interface_add_read (zclient->ibuf); if (IS_RIP_DEBUG_ZEBRA) - zlog_debug ("interface add %s index %d flags %lld metric %d mtu %d", - ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu); + zlog_debug ("interface add %s index %d flags %#llx metric %d mtu %d", + ifp->name, ifp->ifindex, (unsigned long long) ifp->flags, + ifp->metric, ifp->mtu); /* Check if this interface is RIP enabled or not.*/ rip_enable_apply (ifp); @@ -486,8 +490,9 @@ rip_interface_delete (int command, struct zclient *zclient, rip_if_down(ifp); } - zlog_info("interface delete %s index %d flags %lld metric %d mtu %d", - ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu); + zlog_info("interface delete %s index %d flags %#llx metric %d mtu %d", + ifp->name, ifp->ifindex, (unsigned long long) ifp->flags, + ifp->metric, ifp->mtu); /* To support pseudo interface do not free interface structure. */ /* if_delete(ifp); */ @@ -947,8 +952,6 @@ rip_interface_wakeup (struct thread *t) return 0; } -int rip_redistribute_check (int); - static void rip_connect_set (struct interface *ifp, int set) { diff --git a/ripd/rip_main.c b/ripd/rip_main.c index 57b5f3af..72348a04 100644 --- a/ripd/rip_main.c +++ b/ripd/rip_main.c @@ -32,6 +32,7 @@ #include "log.h" #include "privs.h" #include "sigevent.h" +#include "paths.h" #include "ripd/ripd.h" @@ -39,6 +40,7 @@ static struct option longopts[] = { { "daemon", no_argument, NULL, 'd'}, + { "namespace", required_argument, NULL, 'N'}, { "config_file", required_argument, NULL, 'f'}, { "pid_file", required_argument, NULL, 'i'}, { "help", no_argument, NULL, 'h'}, @@ -76,7 +78,7 @@ struct zebra_privs_t ripd_privs = }; /* Configuration file and directory. */ -char config_default[] = SYSCONFDIR RIPD_DEFAULT_CONFIG; +char config_default[MAXPATHLEN]; char *config_file = NULL; /* ripd program name */ @@ -93,8 +95,11 @@ int vty_port = RIP_VTY_PORT; /* Master of threads. */ struct thread_master *master; +/* pid_file default value */ +static char pid_file_default[MAXPATHLEN]; + /* Process ID saved for use by init system */ -const char *pid_file = PATH_RIPD_PID; +const char *pid_file = pid_file_default; /* Help information display. */ static void @@ -107,6 +112,7 @@ usage (char *progname, int status) printf ("Usage : %s [OPTION...]\n\ Daemon which manages RIP version 1 and 2.\n\n\ -d, --daemon Runs in daemon mode\n\ +-N, --namespace Insert argument into all paths\n\ -f, --config_file Set configuration file name\n\ -i, --pid_file Set process identifier file name\n\ -A, --vty_addr Set vty's bind address\n\ @@ -137,7 +143,7 @@ sighup (void) vty_read_config (config_file, config_default); /* Create VTY's socket */ - vty_serv_sock (vty_addr, vty_port, RIP_VTYSH_PATH); + vty_serv_sock (vty_addr, vty_port, path_state (RIPD_VTY_NAME)); /* Try to return to normal operation. */ } @@ -206,7 +212,7 @@ main (int argc, char **argv) { int opt; - opt = getopt_long (argc, argv, "df:i:hA:P:u:g:rvC", longopts, 0); + opt = getopt_long (argc, argv, "dN:f:i:hA:P:u:g:rvC", longopts, 0); if (opt == EOF) break; @@ -218,6 +224,9 @@ main (int argc, char **argv) case 'd': daemon_mode = 1; break; + case 'N': + path_set_namespace (optarg); + break; case 'f': config_file = optarg; break; @@ -264,6 +273,9 @@ main (int argc, char **argv) } } + strcpy (config_default, path_config (RIPD_CONFIG_NAME)); + strcpy (pid_file_default, path_state (RIPD_PID_NAME)); + /* Prepare master thread. */ master = thread_master_create (); @@ -302,7 +314,7 @@ main (int argc, char **argv) pid_output (pid_file); /* Create VTY's socket */ - vty_serv_sock (vty_addr, vty_port, RIP_VTYSH_PATH); + vty_serv_sock (vty_addr, vty_port, path_state (RIPD_VTY_NAME)); /* Print banner. */ zlog_notice ("RIPd %s starting: vty@%d", QUAGGA_VERSION, vty_port); diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c index 7729d9b4..c476d8f4 100644 --- a/ripd/rip_zebra.c +++ b/ripd/rip_zebra.c @@ -233,6 +233,7 @@ DEFUN (no_router_zebra, return CMD_SUCCESS; } +#if 0 static int rip_redistribute_set (int type) { @@ -246,6 +247,7 @@ rip_redistribute_set (int type) return CMD_SUCCESS; } +#endif static int rip_redistribute_unset (int type) diff --git a/ripd/ripd.c b/ripd/ripd.c index 2d5a8560..5a6dbc8c 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -2976,6 +2976,7 @@ DEFUN (no_rip_route, return CMD_SUCCESS; } +#if 0 static void rip_update_default_metric (void) { @@ -2987,6 +2988,7 @@ rip_update_default_metric (void) if (rinfo->type != ZEBRA_ROUTE_RIP && rinfo->type != ZEBRA_ROUTE_CONNECT) rinfo->metric = rip->default_metric; } +#endif DEFUN (rip_default_metric, rip_default_metric_cmd, diff --git a/ripd/ripd.h b/ripd/ripd.h index 4d0c04e2..01ca562e 100644 --- a/ripd/ripd.h +++ b/ripd/ripd.h @@ -69,7 +69,9 @@ #define RIP_VTY_PORT 2602 /* Default configuration file name. */ -#define RIPD_DEFAULT_CONFIG "ripd.conf" +#define RIPD_CONFIG_NAME "ripd.conf" +#define RIPD_PID_NAME "ripd.pid" +#define RIPD_VTY_NAME "ripd.vty" /* RIP route types. */ #define RIP_ROUTE_RTE 0 @@ -395,6 +397,8 @@ extern int if_check_address (struct in_addr addr); extern int rip_request_send (struct sockaddr_in *, struct interface *, u_char, struct connected *); extern int rip_neighbor_lookup (struct sockaddr_in *); + +extern int rip_redistribute_check (int); extern void rip_redistribute_add (int, int, struct prefix_ipv4 *, unsigned int, struct in_addr *, unsigned int, unsigned char); extern void rip_redistribute_delete (int, int, struct prefix_ipv4 *, unsigned int); |