libosmocore 1.13.1.1-afb4 Osmocom core library

signal.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
12#define OSMO_SIGNAL_SS_APPS 0
13#define OSMO_SIGNAL_SS_RESERVED 2147483648u
14
16 enum {
17 SS_L_GLOBAL = OSMO_SIGNAL_SS_RESERVED,
18 SS_L_INPUT,
19 SS_L_NS,
20 SS_L_VTY,
21};
22
23/* application-defined signal types. */
24#define OSMO_SIGNAL_T_APPS 0
25#define OSMO_SIGNAL_T_RESERVED 2147483648u
26
28 enum {
29 S_L_GLOBAL_SHUTDOWN = OSMO_SIGNAL_T_RESERVED,
30};
31
33 typedef int osmo_signal_cbfn(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data);
34
35
36/* Management */
37 void *osmo_signal_talloc_ctx_init(void *root_ctx);
38 int osmo_signal_register_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data);
39 void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data);
40
41/* Dispatch */
42 void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data);
43
data
uint8_t data[0]
OSMO_SIGNAL_T_RESERVED
#define OSMO_SIGNAL_T_RESERVED
Definition: signal.h:25
osmo_signal_register_handler
int osmo_signal_register_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data)
Register a new signal handler.
Definition: signal.c:62
osmo_signal_unregister_handler
void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data)
Unregister signal handler.
Definition: signal.c:87
osmo_signal_dispatch
void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data)
dispatch (deliver) a new signal to all registered handlers
Definition: signal.c:107
osmo_signal_talloc_ctx_init
void * osmo_signal_talloc_ctx_init(void *root_ctx)
Initialize a signal_handler talloc context for osmo_signal_register_handler.
Definition: signal.c:51
osmo_signal_cbfn
int osmo_signal_cbfn(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data)
signal callback function type
Definition: signal.h:33
OSMO_SIGNAL_SS_RESERVED
#define OSMO_SIGNAL_SS_RESERVED
Definition: signal.h:13
SS_L_INPUT
@ SS_L_INPUT
Definition: signal.h:18
SS_L_GLOBAL
@ SS_L_GLOBAL
Definition: signal.h:17
SS_L_VTY
@ SS_L_VTY
Definition: signal.h:20
SS_L_NS
@ SS_L_NS
Definition: signal.h:19
S_L_GLOBAL_SHUTDOWN
@ S_L_GLOBAL_SHUTDOWN
Definition: signal.h:29
subsys
char subsys[16]
logging sub-system
Definition: gsmtap.h:9