Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 1 | /*! |
Michal Vasko | 30aa382 | 2015-11-25 10:41:54 +0100 | [diff] [blame] | 2 | * \file notification_server.h |
Michal Vasko | c314678 | 2015-11-04 14:46:41 +0100 | [diff] [blame] | 3 | * \brief |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 4 | * \author Tomas Cejka <cejkat@cesnet.cz> |
| 5 | * \date 2013 |
| 6 | */ |
| 7 | /* |
| 8 | * Copyright (C) 2013 CESNET |
| 9 | * |
| 10 | * LICENSE TERMS |
| 11 | * |
| 12 | * Redistribution and use in source and binary forms, with or without |
| 13 | * modification, are permitted provided that the following conditions |
| 14 | * are met: |
| 15 | * 1. Redistributions of source code must retain the above copyright |
| 16 | * notice, this list of conditions and the following disclaimer. |
| 17 | * 2. Redistributions in binary form must reproduce the above copyright |
| 18 | * notice, this list of conditions and the following disclaimer in |
| 19 | * the documentation and/or other materials provided with the |
| 20 | * distribution. |
| 21 | * 3. Neither the name of the Company nor the names of its contributors |
| 22 | * may be used to endorse or promote products derived from this |
| 23 | * software without specific prior written permission. |
| 24 | * |
| 25 | * ALTERNATIVELY, provided that this notice is retained in full, this |
| 26 | * product may be distributed under the terms of the GNU General Public |
| 27 | * License (GPL) version 2 or later, in which case the provisions |
| 28 | * of the GPL apply INSTEAD OF those given above. |
| 29 | * |
| 30 | * This software is provided ``as is'', and any express or implied |
| 31 | * warranties, including, but not limited to, the implied warranties of |
| 32 | * merchantability and fitness for a particular purpose are disclaimed. |
| 33 | * In no event shall the company or contributors be liable for any |
| 34 | * direct, indirect, incidental, special, exemplary, or consequential |
| 35 | * damages (including, but not limited to, procurement of substitute |
| 36 | * goods or services; loss of use, data, or profits; or business |
| 37 | * interruption) however caused and on any theory of liability, whether |
| 38 | * in contract, strict liability, or tort (including negligence or |
| 39 | * otherwise) arising in any way out of the use of this software, even |
| 40 | * if advised of the possibility of such damage. |
| 41 | * |
| 42 | */ |
| 43 | #ifndef __NOTIFICATION_MODULE_H |
| 44 | #define __NOTIFICATION_MODULE_H |
Tomas Cejka | ba21b38 | 2013-04-13 02:37:32 +0200 | [diff] [blame] | 45 | #include <libwebsockets.h> |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 46 | |
Michal Vasko | c314678 | 2015-11-04 14:46:41 +0100 | [diff] [blame] | 47 | #ifdef TEST_NOTIFICATION_SERVER |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 48 | typedef struct s {} server_rec; |
| 49 | #endif |
| 50 | |
Tomas Cejka | 04a98cb | 2013-07-05 09:59:20 +0200 | [diff] [blame] | 51 | #ifndef NOTIFICATION_SERVER_PORT |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 52 | #define NOTIFICATION_SERVER_PORT 8080 |
Tomas Cejka | 04a98cb | 2013-07-05 09:59:20 +0200 | [diff] [blame] | 53 | #endif |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 54 | |
Tomas Cejka | ba21b38 | 2013-04-13 02:37:32 +0200 | [diff] [blame] | 55 | /** |
| 56 | * \brief Notification module initialization |
Tomas Cejka | ba21b38 | 2013-04-13 02:37:32 +0200 | [diff] [blame] | 57 | * \return 0 on success |
| 58 | */ |
Michal Vasko | c314678 | 2015-11-04 14:46:41 +0100 | [diff] [blame] | 59 | int notification_init(); |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 60 | |
Tomas Cejka | ba21b38 | 2013-04-13 02:37:32 +0200 | [diff] [blame] | 61 | /** |
| 62 | * \brief Handle method - passes execution into the libwebsocket library |
| 63 | * \return 0 on success |
| 64 | */ |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 65 | int notification_handle(); |
| 66 | |
Tomas Cejka | ba21b38 | 2013-04-13 02:37:32 +0200 | [diff] [blame] | 67 | /** |
| 68 | * \brief Notification module finalization |
| 69 | */ |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 70 | void notification_close(); |
| 71 | |
| 72 | #endif |
| 73 | |