Skip to content

Commit

Permalink
*: Convert quagga_signal_X to frr_signal_X
Browse files Browse the repository at this point in the history
Naming functions/data structures more appropriately for
the project we are actually in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
  • Loading branch information
donaldsharp committed Nov 11, 2021
1 parent 7347a48 commit 7cc91e6
Show file tree
Hide file tree
Showing 29 changed files with 63 additions and 63 deletions.
2 changes: 1 addition & 1 deletion babeld/babel_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ babel_sigusr1 (void)
zlog_rotate ();
}

static struct quagga_signal_t babel_signals[] =
static struct frr_signal_t babel_signals[] =
{
{
.signal = SIGUSR1,
Expand Down
2 changes: 1 addition & 1 deletion bfdd/bfdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static void sighup_handler(void)
vty_read_config(NULL, bfdd_di.config_file, config_default);
}

static struct quagga_signal_t bfd_signals[] = {
static struct frr_signal_t bfd_signals[] = {
{
.signal = SIGUSR1,
.handler = &sigusr1_handler,
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void sigusr1(void);
static void bgp_exit(int);
static void bgp_vrf_terminate(void);

static struct quagga_signal_t bgp_signals[] = {
static struct frr_signal_t bgp_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion eigrpd/eigrp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t eigrp_signals[] = {
struct frr_signal_t eigrp_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion isisd/isis_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t isisd_signals[] = {
struct frr_signal_t isisd_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion ldpd/lde.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ sigint(void)
lde_shutdown();
}

static struct quagga_signal_t lde_signals[] =
static struct frr_signal_t lde_signals[] =
{
{
.signal = SIGHUP,
Expand Down
2 changes: 1 addition & 1 deletion ldpd/ldpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ sigusr1(void)
zlog_rotate();
}

static struct quagga_signal_t ldp_signals[] =
static struct frr_signal_t ldp_signals[] =
{
{
.signal = SIGHUP,
Expand Down
2 changes: 1 addition & 1 deletion ldpd/ldpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ sigint(void)
ldpe_shutdown();
}

static struct quagga_signal_t ldpe_signals[] =
static struct frr_signal_t ldpe_signals[] =
{
{
.signal = SIGHUP,
Expand Down
2 changes: 1 addition & 1 deletion lib/libfrr.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct frr_daemon_info {
const char *copyright;
char startinfo[128];

struct quagga_signal_t *signals;
struct frr_signal_t *signals;
size_t n_signals;

struct zebra_privs_t *privs;
Expand Down
34 changes: 17 additions & 17 deletions lib/sigevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@


/* master signals descriptor struct */
static struct quagga_sigevent_master_t {
static struct frr_sigevent_master_t {
struct thread *t;

struct quagga_signal_t *signals;
struct frr_signal_t *signals;
int sigc;

volatile sig_atomic_t caught;
Expand All @@ -48,10 +48,10 @@ static struct quagga_sigevent_master_t {
/* Generic signal handler
* Schedules signal event thread
*/
static void quagga_signal_handler(int signo)
static void frr_signal_handler(int signo)
{
int i;
struct quagga_signal_t *sig;
struct frr_signal_t *sig;

for (i = 0; i < sigmaster.sigc; i++) {
sig = &(sigmaster.signals[i]);
Expand Down Expand Up @@ -91,9 +91,9 @@ bool frr_sigevent_check(sigset_t *setp)
}

/* check if signals have been caught and run appropriate handlers */
int quagga_sigevent_process(void)
int frr_sigevent_process(void)
{
struct quagga_signal_t *sig;
struct frr_signal_t *sig;
int i;
#ifdef SIGEVENT_BLOCK_SIGNALS
/* shouldn't need to block signals, but potentially may be needed */
Expand All @@ -110,7 +110,7 @@ int quagga_sigevent_process(void)

if ((sigprocmask(SIG_BLOCK, &newmask, &oldmask)) < 0) {
flog_err_sys(EC_LIB_SYSTEM_CALL,
"quagga_signal_timer: couldnt block signals!");
"frr_signal_timer: couldnt block signals!");
return -1;
}
#endif /* SIGEVENT_BLOCK_SIGNALS */
Expand Down Expand Up @@ -143,15 +143,15 @@ int quagga_sigevent_process(void)

#ifdef SIGEVENT_SCHEDULE_THREAD
/* timer thread to check signals. shouldn't be needed */
int quagga_signal_timer(struct thread *t)
int frr_signal_timer(struct thread *t)
{
struct quagga_sigevent_master_t *sigm;
struct frr_sigevent_master_t *sigm;

sigm = THREAD_ARG(t);
sigm->t = NULL;
thread_add_timer(sigm->t->master, quagga_signal_timer, &sigmaster,
QUAGGA_SIGNAL_TIMER_INTERVAL, &sigm->t);
return quagga_sigevent_process();
thread_add_timer(sigm->t->master, frr_signal_timer, &sigmaster,
FRR_SIGNAL_TIMER_INTERVAL, &sigm->t);
return frr_sigevent_process();
}
#endif /* SIGEVENT_SCHEDULE_THREAD */

Expand All @@ -163,7 +163,7 @@ static int signal_set(int signo)
struct sigaction sig;
struct sigaction osig;

sig.sa_handler = &quagga_signal_handler;
sig.sa_handler = &frr_signal_handler;
sigfillset(&sig.sa_mask);
sig.sa_flags = 0;
if (signo == SIGALRM) {
Expand Down Expand Up @@ -348,11 +348,11 @@ static void trap_default_signals(void)
}

void signal_init(struct thread_master *m, int sigc,
struct quagga_signal_t signals[])
struct frr_signal_t signals[])
{

int i = 0;
struct quagga_signal_t *sig;
struct frr_signal_t *sig;

/* First establish some default handlers that can be overridden by
the application. */
Expand All @@ -370,7 +370,7 @@ void signal_init(struct thread_master *m, int sigc,

#ifdef SIGEVENT_SCHEDULE_THREAD
sigmaster.t = NULL;
thread_add_timer(m, quagga_signal_timer, &sigmaster,
QUAGGA_SIGNAL_TIMER_INTERVAL, &sigmaster.t);
thread_add_timer(m, frr_signal_timer, &sigmaster,
FRR_SIGNAL_TIMER_INTERVAL, &sigmaster.t);
#endif /* SIGEVENT_SCHEDULE_THREAD */
}
16 changes: 8 additions & 8 deletions lib/sigevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef _QUAGGA_SIGNAL_H
#define _QUAGGA_SIGNAL_H
#ifndef _FRR_SIGNAL_H
#define _FRR_SIGNAL_H

#include <thread.h>

#ifdef __cplusplus
extern "C" {
#endif

#define QUAGGA_SIGNAL_TIMER_INTERVAL 2L
#define FRR_SIGNAL_TIMER_INTERVAL 2L

struct quagga_signal_t {
struct frr_signal_t {
int signal; /* signal number */
void (*handler)(void); /* handler to call */

Expand All @@ -42,11 +42,11 @@ struct quagga_signal_t {
* takes:
* - pointer to valid struct thread_master
* - number of elements in passed in signals array
* - array of quagga_signal_t's describing signals to handle
* - array of frr_signal_t's describing signals to handle
* and handlers to use for each signal
*/
extern void signal_init(struct thread_master *m, int sigc,
struct quagga_signal_t *signals);
struct frr_signal_t *signals);


/*
Expand All @@ -58,10 +58,10 @@ extern void signal_init(struct thread_master *m, int sigc,
bool frr_sigevent_check(sigset_t *setp);

/* check whether there are signals to handle, process any found */
extern int quagga_sigevent_process(void);
extern int frr_sigevent_process(void);

#ifdef __cplusplus
}
#endif

#endif /* _QUAGGA_SIGNAL_H */
#endif /* _FRR_SIGNAL_H */
2 changes: 1 addition & 1 deletion lib/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ struct thread *thread_fetch(struct thread_master *m, struct thread *fetch)
do {
/* Handle signals if any */
if (m->handle_signals)
quagga_sigevent_process();
frr_sigevent_process();

pthread_mutex_lock(&m->mtx);

Expand Down
2 changes: 1 addition & 1 deletion nhrpd/nhrp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void nhrp_request_stop(void)
exit(0);
}

static struct quagga_signal_t sighandlers[] = {
static struct frr_signal_t sighandlers[] = {
{
.signal = SIGUSR1,
.handler = &nhrp_sigusr1,
Expand Down
2 changes: 1 addition & 1 deletion ospf6d/ospf6_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t ospf6_signals[] = {
struct frr_signal_t ospf6_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion ospfd/ospf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t ospf_signals[] = {
struct frr_signal_t ospf_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion pathd/path_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t path_signals[] = {
struct frr_signal_t path_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion pbrd/pbr_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t pbr_signals[] = {
struct frr_signal_t pbr_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion pimd/pim_signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void pim_sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t pimd_signals[] = {
struct frr_signal_t pimd_signals[] = {
{
.signal = SIGHUP,
.handler = &pim_sighup,
Expand Down
2 changes: 1 addition & 1 deletion pimd/pim_signals.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
#define PIM_SIGNALS_H

#include "sigevent.h"
extern struct quagga_signal_t pimd_signals[];
extern struct frr_signal_t pimd_signals[];

#endif /* PIM_SIGNALS_H */
2 changes: 1 addition & 1 deletion ripd/rip_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void sigusr1(void)
zlog_rotate();
}

static struct quagga_signal_t ripd_signals[] = {
static struct frr_signal_t ripd_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion ripngd/ripng_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t ripng_signals[] = {
struct frr_signal_t ripng_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion sharpd/sharp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t sharp_signals[] = {
struct frr_signal_t sharp_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion staticd/static_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t static_signals[] = {
struct frr_signal_t static_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/test_segv.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "lib/log.h"
#include "lib/memory.h"

struct quagga_signal_t sigs[] = {};
struct frr_signal_t sigs[] = {};

struct thread_master *master;

Expand Down
24 changes: 12 additions & 12 deletions tests/lib/test_sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ static void sigusr2(void)
printf("processed usr2\n");
}

struct quagga_signal_t sigs[] = {{
.signal = SIGHUP,
.handler = &sighup,
},
{
.signal = SIGUSR1,
.handler = &sigusr1,
},
{
.signal = SIGUSR2,
.handler = &sigusr2,
}};
struct frr_signal_t sigs[] = {{
.signal = SIGHUP,
.handler = &sighup,
},
{
.signal = SIGUSR1,
.handler = &sigusr1,
},
{
.signal = SIGUSR2,
.handler = &sigusr2,
}};

struct thread_master *master;
struct thread t;
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/test_zmq.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static void sigchld(void)
frrzmq_thread_cancel(&cb, &cb->write);
}

static struct quagga_signal_t sigs[] = {
static struct frr_signal_t sigs[] = {
{
.signal = SIGCHLD,
.handler = sigchld,
Expand Down
2 changes: 1 addition & 1 deletion vrrpd/vrrp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void sigusr1(void)
zlog_rotate();
}

struct quagga_signal_t vrrp_signals[] = {
struct frr_signal_t vrrp_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
Expand Down
Loading

0 comments on commit 7cc91e6

Please sign in to comment.