mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 00:31:32 +00:00
Merge pull request #263 from opensourcerouting/assorted-20170308
assorted bits
This commit is contained in:
commit
17791cc09a
@ -89,35 +89,15 @@ struct option longopts[] = {
|
||||
/* Master of threads. */
|
||||
struct thread_master *master;
|
||||
|
||||
/* for reload */
|
||||
char _cwd[MAXPATHLEN];
|
||||
char _progpath[MAXPATHLEN];
|
||||
int _argc;
|
||||
char **_argv;
|
||||
char **_envp;
|
||||
|
||||
/*
|
||||
* Prototypes.
|
||||
*/
|
||||
void reload(void);
|
||||
void sighup(void);
|
||||
void sigint(void);
|
||||
void sigterm(void);
|
||||
void sigusr1(void);
|
||||
|
||||
|
||||
void
|
||||
reload ()
|
||||
{
|
||||
zlog_debug ("Reload");
|
||||
/* FIXME: Clean up func call here */
|
||||
vty_reset ();
|
||||
(void) isisd_privs.change (ZPRIVS_RAISE);
|
||||
execve (_progpath, _argv, _envp);
|
||||
zlog_err ("Reload failed: cannot exec %s: %s", _progpath,
|
||||
safe_strerror (errno));
|
||||
}
|
||||
|
||||
static __attribute__((__noreturn__)) void
|
||||
terminate (int i)
|
||||
{
|
||||
@ -131,9 +111,7 @@ terminate (int i)
|
||||
void
|
||||
sighup (void)
|
||||
{
|
||||
zlog_debug ("SIGHUP received");
|
||||
reload ();
|
||||
|
||||
zlog_err ("SIGHUP/reload is not implemented for isisd");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -199,21 +177,6 @@ main (int argc, char **argv, char **envp)
|
||||
{
|
||||
int opt;
|
||||
|
||||
/* for reload */
|
||||
_argc = argc;
|
||||
_argv = argv;
|
||||
_envp = envp;
|
||||
if (getcwd (_cwd, sizeof (_cwd)) == NULL)
|
||||
{
|
||||
zlog_err ("ISISd: Unable to determine CWD: %d", errno);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if (*argv[0] == '.')
|
||||
snprintf (_progpath, sizeof (_progpath), "%s/%s", _cwd, _argv[0]);
|
||||
else
|
||||
snprintf (_progpath, sizeof (_progpath), "%s", argv[0]);
|
||||
|
||||
frr_preinit (&isisd_di, argc, argv);
|
||||
frr_opt_add ("", longopts, "");
|
||||
|
||||
|
@ -153,8 +153,6 @@ struct timestamp_control {
|
||||
char buf[QUAGGA_TIMESTAMP_LEN]; /* will contain the rendered timestamp */
|
||||
};
|
||||
|
||||
#define LOG_DEFAULT_FILENAME "/var/log/quagga/Quagga.log"
|
||||
|
||||
/* Defines for use in command construction: */
|
||||
|
||||
#define LOG_LEVEL_DESC \
|
||||
|
@ -93,21 +93,6 @@ struct thread_master *master;
|
||||
extern int ospf_apiserver_enable;
|
||||
#endif /* SUPPORT_OSPF_API */
|
||||
|
||||
/* Help information display. */
|
||||
static void __attribute__ ((noreturn))
|
||||
usage (char *progname, int status)
|
||||
{
|
||||
if (status != 0)
|
||||
fprintf (stderr, "Try `%s --help' for more information.\n", progname);
|
||||
else
|
||||
{
|
||||
printf ("Usage : %s [OPTION...]\n\
|
||||
\n\
|
||||
Report bugs to %s\n", progname, FRR_BUG_ADDRESS);
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
/* SIGHUP handler. */
|
||||
static void
|
||||
sighup (void)
|
||||
|
@ -113,9 +113,6 @@ int main(int argc, char** argv, char** envp) {
|
||||
|
||||
master = frr_init();
|
||||
|
||||
zlog_notice("Quagga %s " PIMD_PROGNAME " %s starting",
|
||||
FRR_VERSION, PIMD_VERSION);
|
||||
|
||||
/*
|
||||
* Initializations
|
||||
*/
|
||||
|
@ -174,7 +174,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, struct interface *ifp,
|
||||
|
||||
/* Set router alert (RFC 2113) for all IGMP messages (RFC 3376 4. Message Formats)*/
|
||||
if (protocol == IPPROTO_IGMP) {
|
||||
char ra[4];
|
||||
uint8_t ra[4];
|
||||
ra[0] = 148;
|
||||
ra[1] = 4;
|
||||
ra[2] = 0;
|
||||
|
@ -174,6 +174,9 @@ struct daemon {
|
||||
struct restart_info restart;
|
||||
};
|
||||
|
||||
#define OPTION_MINRESTART 2000
|
||||
#define OPTION_MAXRESTART 2001
|
||||
|
||||
static const struct option longopts[] = {
|
||||
{"daemon", no_argument, NULL, 'd'},
|
||||
{"statedir", required_argument, NULL, 'S'},
|
||||
@ -189,8 +192,8 @@ static const struct option longopts[] = {
|
||||
{"all-restart", no_argument, NULL, 'a'},
|
||||
{"always-all-restart", no_argument, NULL, 'A'},
|
||||
{"unresponsive-restart", no_argument, NULL, 'z'},
|
||||
{"min-restart-interval", required_argument, NULL, 'm'},
|
||||
{"max-restart-interval", required_argument, NULL, 'M'},
|
||||
{"min-restart-interval", required_argument, NULL, OPTION_MINRESTART },
|
||||
{"max-restart-interval", required_argument, NULL, OPTION_MAXRESTART },
|
||||
{"pid-file", required_argument, NULL, 'p'},
|
||||
{"blank-string", required_argument, NULL, 'b'},
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
@ -263,10 +266,10 @@ Otherwise, the interval is doubled (but capped at the -M value).\n\n", progname,
|
||||
The value should range from %d (LOG_EMERG) to %d (LOG_DEBUG),\n\
|
||||
but it can be set higher than %d if extra-verbose debugging\n\
|
||||
messages are desired.\n\
|
||||
-m, --min-restart-interval\n\
|
||||
--min-restart-interval\n\
|
||||
Set the minimum seconds to wait between invocations of daemon\n\
|
||||
restart commands (default is %d).\n\
|
||||
-M, --max-restart-interval\n\
|
||||
--max-restart-interval\n\
|
||||
Set the maximum seconds to wait between invocations of daemon\n\
|
||||
restart commands (default is %d).\n\
|
||||
-i, --interval Set the status polling interval in seconds (default is %d)\n\
|
||||
@ -1044,7 +1047,7 @@ int main(int argc, char **argv)
|
||||
frr_preinit(&watchfrr_di, argc, argv);
|
||||
progname = watchfrr_di.progname;
|
||||
|
||||
frr_opt_add("aAb:dek:l:m:M:i:p:r:R:S:s:t:T:z", longopts, "");
|
||||
frr_opt_add("aAb:dek:l:i:p:r:R:S:s:t:T:z", longopts, "");
|
||||
|
||||
gs.restart.name = "all";
|
||||
while ((opt = frr_getopt(argc, argv, NULL)) != EOF) {
|
||||
@ -1098,7 +1101,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
case OPTION_MINRESTART:
|
||||
{
|
||||
char garbage[3];
|
||||
if ((sscanf(optarg, "%ld%1s",
|
||||
@ -1112,7 +1115,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'M':
|
||||
case OPTION_MAXRESTART:
|
||||
{
|
||||
char garbage[3];
|
||||
if ((sscanf(optarg, "%ld%1s",
|
||||
|
@ -229,7 +229,7 @@ main (int argc, char **argv)
|
||||
#endif
|
||||
, longopts,
|
||||
" -b, --batch Runs in batch mode\n"
|
||||
" -a, --allow_delete Allow other processes to delete Quagga Routes\n"
|
||||
" -a, --allow_delete Allow other processes to delete zebra routes\n"
|
||||
" -F, --fpm_format Set fpm format to 'netlink' or 'protobuf'\n"
|
||||
" -z, --socket Set path of zebra socket\n"
|
||||
" -e, --ecmp Specify ECMP to use.\n"
|
||||
|
@ -100,7 +100,7 @@ usage (char *progname, int status)
|
||||
"redistribution between different routing protocols.\n\n"\
|
||||
"-b, --batch Runs in batch mode\n"\
|
||||
"-d, --daemon Runs in daemon mode\n"\
|
||||
"-a, --allow_delete Allow other processes to delete Quagga Routes\n" \
|
||||
"-a, --allow_delete Allow other processes to delete zebra routes\n" \
|
||||
"-f, --config_file Set configuration file name\n"\
|
||||
"-A, --vty_addr Set vty's bind address\n"\
|
||||
"-P, --vty_port Set vty's port number\n"\
|
||||
|
@ -3825,7 +3825,7 @@ static_config_ipv6 (struct vty *vty)
|
||||
DEFUN (allow_external_route_update,
|
||||
allow_external_route_update_cmd,
|
||||
"allow-external-route-update",
|
||||
"Allow Quagga routes to be overwritten by external processes")
|
||||
"Allow FRR routes to be overwritten by external processes")
|
||||
{
|
||||
allow_delete = 1;
|
||||
|
||||
@ -3835,7 +3835,7 @@ DEFUN (allow_external_route_update,
|
||||
DEFUN (no_allow_external_route_update,
|
||||
no_allow_external_route_update_cmd,
|
||||
"no allow-external-route-update",
|
||||
"Allow Quagga routes to be overwritten by external processes")
|
||||
"Allow FRR routes to be overwritten by external processes")
|
||||
{
|
||||
allow_delete = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user