diff options
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/Makefile.am | 1 | ||||
-rw-r--r-- | isisd/isis_bpf.c | 13 | ||||
-rw-r--r-- | isisd/isis_main.c | 25 | ||||
-rw-r--r-- | isisd/isis_pdu.c | 2 | ||||
-rw-r--r-- | isisd/topology/Makefile.am | 3 |
5 files changed, 31 insertions, 13 deletions
diff --git a/isisd/Makefile.am b/isisd/Makefile.am index 9c303390..a7117fd6 100644 --- a/isisd/Makefile.am +++ b/isisd/Makefile.am @@ -2,7 +2,6 @@ INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib \ @ISIS_TOPOLOGY_INCLUDES@ -DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" INSTALL_SDATA=@INSTALL@ -m 600 LIBS = @LIBS@ diff --git a/isisd/isis_bpf.c b/isisd/isis_bpf.c index e66ac98a..8c3602db 100644 --- a/isisd/isis_bpf.c +++ b/isisd/isis_bpf.c @@ -56,7 +56,7 @@ struct bpf_insn llcfilter[] = { BPF_STMT (BPF_RET + BPF_K, (u_int) - 1), BPF_STMT (BPF_RET + BPF_K, 0) }; -int readblen = 0; +u_int readblen = 0; u_char *readbuff = NULL; /* @@ -77,8 +77,7 @@ open_bpf_dev (struct isis_circuit *circuit) int i = 0, fd; char bpfdev[128]; struct ifreq ifr; - u_int16_t blen; - int true = 1, false = 0; + u_int blen, immediate, seesent; struct timeval timeout; struct bpf_program bpf_prog; @@ -123,7 +122,8 @@ open_bpf_dev (struct isis_circuit *circuit) * Otherwise, a read will block until either the kernel * buffer becomes full or a timeout occurs. */ - if (ioctl (fd, BIOCIMMEDIATE, (caddr_t) & true) < 0) + immediate = 1; + if (ioctl (fd, BIOCIMMEDIATE, (caddr_t) & immediate) < 0) { zlog_warn ("failed to set BPF dev to immediate mode"); } @@ -132,7 +132,8 @@ open_bpf_dev (struct isis_circuit *circuit) /* * We want to see only incoming packets */ - if (ioctl (fd, BIOCSSEESENT, (caddr_t) & false) < 0) + seesent = 0; + if (ioctl (fd, BIOCSSEESENT, (caddr_t) & seesent) < 0) { zlog_warn ("failed to set BPF dev to incoming only mode"); } @@ -141,7 +142,7 @@ open_bpf_dev (struct isis_circuit *circuit) /* * ...but all of them */ - if (ioctl (fd, BIOCPROMISC, (caddr_t) & true) < 0) + if (ioctl (fd, BIOCPROMISC) < 0) { zlog_warn ("failed to set BPF dev to promiscuous mode"); } diff --git a/isisd/isis_main.c b/isisd/isis_main.c index c5e824c1..d457d25e 100644 --- a/isisd/isis_main.c +++ b/isisd/isis_main.c @@ -34,6 +34,7 @@ #include "privs.h" #include "sigevent.h" #include "filter.h" +#include "paths.h" #include "isisd/dict.h" #include "include-netbsd/iso.h" @@ -45,7 +46,10 @@ #include "isisd/isis_dynhn.h" /* Default configuration file name */ -#define ISISD_DEFAULT_CONFIG "isisd.conf" +#define ISISD_CONFIG_NAME "isisd.conf" +#define ISISD_PID_NAME "isisd.pid" +#define ISISD_VTY_NAME "isisd.vty" + /* Default vty port */ #define ISISD_VTY_PORT 2608 @@ -73,6 +77,7 @@ struct zebra_privs_t isisd_privs = { /* isisd options */ 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'}, {"vty_addr", required_argument, NULL, 'A'}, @@ -86,7 +91,7 @@ struct option longopts[] = { }; /* Configuration file and directory. */ -char config_default[] = SYSCONFDIR ISISD_DEFAULT_CONFIG; +char config_default[MAXPATHLEN]; char *config_file = NULL; /* isisd program name. */ @@ -97,8 +102,11 @@ int daemon_mode = 0; /* 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_ISISD_PID; +const char *pid_file = pid_file_default; /* for reload */ char _cwd[MAXPATHLEN]; @@ -128,6 +136,7 @@ usage (int status) printf ("Usage : %s [OPTION...]\n\n\ Daemon which manages IS-IS routing\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\ @@ -246,7 +255,7 @@ main (int argc, char **argv, char **envp) /* Command line argument treatment. */ while (1) { - opt = getopt_long (argc, argv, "df:i:hA:p:P:u:g:vC", longopts, 0); + opt = getopt_long (argc, argv, "dN:f:i:hA:p:P:u:g:vC", longopts, 0); if (opt == EOF) break; @@ -258,6 +267,9 @@ main (int argc, char **argv, char **envp) case 'd': daemon_mode = 1; break; + case 'N': + path_set_namespace (optarg); + break; case 'f': config_file = optarg; break; @@ -303,6 +315,9 @@ main (int argc, char **argv, char **envp) } } + strcpy (config_default, path_config (ISISD_CONFIG_NAME)); + strcpy (pid_file_default, path_state (ISISD_PID_NAME)); + /* thread master */ master = thread_master_create (); @@ -343,7 +358,7 @@ main (int argc, char **argv, char **envp) pid_output (pid_file); /* Make isis vty socket. */ - vty_serv_sock (vty_addr, vty_port, ISIS_VTYSH_PATH); + vty_serv_sock (vty_addr, vty_port, path_state (ISISD_VTY_NAME)); /* Print banner. */ zlog_notice ("Quagga-ISISd %s starting: vty@%d", QUAGGA_VERSION, vty_port); diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index 4311a905..a2ab0649 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -64,7 +64,7 @@ extern struct isis *isis; #endif /* PNBBY */ /* Utility mask array. */ -static u_char maskbit[] = { +static const u_char maskbit[] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff }; diff --git a/isisd/topology/Makefile.am b/isisd/topology/Makefile.am index 2515b38b..b25497cb 100644 --- a/isisd/topology/Makefile.am +++ b/isisd/topology/Makefile.am @@ -3,6 +3,9 @@ INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" +AM_CFLAGS = $(PICFLAGS) +AM_LDFLAGS = $(PILDFLAGS) + noinst_LIBRARIES = libtopology.a libtopology_a_SOURCES = \ |