2 * Copyright (C) 2012 Martin Willi
3 * Copyright (C) 2012 revosec AG
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * @defgroup error_notify_socket error_notify_socket
18 * @{ @ingroup error_notify
21 #ifndef ERROR_NOTIFY_SOCKET_H_
22 #define ERROR_NOTIFY_SOCKET_H_
24 typedef struct error_notify_socket_t error_notify_socket_t
;
26 #include "error_notify_listener.h"
27 #include "error_notify_msg.h"
30 * Error notification socket.
32 struct error_notify_socket_t
{
35 * Send an error notification message to all registered listeners.
37 * @param msg msg to send
39 void (*notify
)(error_notify_socket_t
*this, error_notify_msg_t
*msg
);
42 * Check if we have active listeners on the socket.
44 * @return TRUE if listeners active
46 bool (*has_listeners
)(error_notify_socket_t
*this);
49 * Destroy a error_notify_socket_t.
51 void (*destroy
)(error_notify_socket_t
*this);
55 * Create a error_notify_socket instance.
57 error_notify_socket_t
*error_notify_socket_create();
59 #endif /** ERROR_NOTIFY_SOCKET_H_ @}*/