The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
signal.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /**
19  * $Id: f108e7af2f3f99ad74f63dc6c6ff8bfbda320bce $
20  *
21  * @file lib/server/signal.h
22  * @brief Signals that can be sent to a request.
23  *
24  * @copyright 2018 The FreeRADIUS server project
25  * @copyright 2018 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
26  */
27 RCSIDH(signal_h, "$Id: f108e7af2f3f99ad74f63dc6c6ff8bfbda320bce $")
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /** Signals that can be generated/processed by request signal handlers
34  *
35  * This is a bitfield so that it can be used to specify signal masks.
36  */
37 DIAG_OFF(attributes) /* Stupid GCC */
38 typedef enum CC_HINT(flag_enum) { /* server action */
39  FR_SIGNAL_INVALID = 0x00,
40  FR_SIGNAL_CANCEL = 0x01, //!< Request has been cancelled.
41  ///< If a module is signalled with this, the module
42  ///< should stop processing the request and cleanup
43  ///< anything it's done.
44  FR_SIGNAL_DUP = 0x02, //!< A duplicate request was received.
45  FR_SIGNAL_DETACH = 0x04, //!< Request is being detached from its parent.
46  FR_SIGNAL_RETRY = 0x08, //!< a retry timer has hit
47  FR_SIGNAL_TIMEOUT = 0x10 //!< a retry timeout or max count has hit
49 DIAG_ON(attributes)
50 
51 #define fr_signal_is_cancel(_signal) (_signal & FR_SIGNAL_CANCEL)
52 #define fr_signal_is_dup(_signal) (_signal & FR_SIGNAL_DUP)
53 #define fr_signal_is_detach(_signal) (_signal & FR_SIGNAL_DETACH)
54 #define fr_signal_is_retry(_signal) (_signal & FR_SIGNAL_RETRY)
55 #define fr_signal_is_timeout(_signal) (_signal & FR_SIGNAL_TIMEOUT)
56 
57 #ifdef __cplusplus
58 }
59 #endif
#define DIAG_ON(_x)
Definition: build.h:419
#define RCSIDH(h, id)
Definition: build.h:445
fr_signal_t
Definition: signal.h:48
DIAG_OFF(attributes) typedef enum
Signals that can be generated/processed by request signal handlers.
Definition: signal.h:37