]> git.proxmox.com Git - mirror_frr.git/blob - lib/sigevent.h
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / sigevent.h
1 /*
2 * Quagga Signal handling header.
3 *
4 * Copyright (C) 2004 Paul Jakma.
5 *
6 * This file is part of Quagga.
7 *
8 * Quagga is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * Quagga is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #ifndef _QUAGGA_SIGNAL_H
24 #define _QUAGGA_SIGNAL_H
25
26 #include <thread.h>
27
28 #define QUAGGA_SIGNAL_TIMER_INTERVAL 2L
29
30 struct quagga_signal_t {
31 int signal; /* signal number */
32 void (*handler)(void); /* handler to call */
33
34 volatile sig_atomic_t caught; /* private member */
35 };
36
37 /* initialise sigevent system
38 * takes:
39 * - pointer to valid struct thread_master
40 * - number of elements in passed in signals array
41 * - array of quagga_signal_t's describing signals to handle
42 * and handlers to use for each signal
43 */
44 extern void signal_init(struct thread_master *m, int sigc,
45 struct quagga_signal_t *signals);
46
47 /* check whether there are signals to handle, process any found */
48 extern int quagga_sigevent_process(void);
49
50 #endif /* _QUAGGA_SIGNAL_H */