| 1 |
/* eurephiafw_helpers.h -- Helper functions, shared between main module and |
| 2 |
* firewall module. Setting up Posix MQ and semaphores |
| 3 |
* |
| 4 |
* GPLv2 only - Copyright (C) 2008 - 2012 |
| 5 |
* David Sommerseth <[email protected]> |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU General Public License |
| 9 |
* as published by the Free Software Foundation; version 2 |
| 10 |
* of the License. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 20 |
* |
| 21 |
*/ |
| 22 |
|
| 23 |
/** |
| 24 |
* @file eurephiafw_helpers.h |
| 25 |
* @author David Sommerseth <[email protected]> |
| 26 |
* @date 2009-08-14 |
| 27 |
* |
| 28 |
* @brief Helper functions which is shared between the main eurephia-auth module and |
| 29 |
* the firewall module. It takes care of preparing POSIX MQ queues and semaphores. |
| 30 |
* |
| 31 |
*/ |
| 32 |
|
| 33 |
#ifndef EUREPHIAFW_HELPERS_H_ |
| 34 |
#define EUREPHIAFW_HELPERS_H_ |
| 35 |
|
| 36 |
#define EFW_MSG_SIZE sizeof(eFWupdateRequest) /**< Maximum size of a message in the POSIX MQ queue */ |
| 37 |
#define MQUEUE_NAME "/eurephiaFW" /**< Name of the MQ queue */ |
| 38 |
#define SEMPH_MASTER "eurephiafw_master" /**< Name of the semaphore the main openvpn process uses */ |
| 39 |
#define SEMPH_WORKER "eurephiafw_worker" /**< Name of the semaphore the firewall process uses */ |
| 40 |
|
| 41 |
int efwSetupSemaphores(eurephiaCTX *, efw_threaddata *); |
| 42 |
int efwRemoveSemaphores(eurephiaCTX *, efw_threaddata *); |
| 43 |
|
| 44 |
int efwSetupMessageQueue(eurephiaCTX *, efw_threaddata *); |
| 45 |
int efwRemoveMessageQueue(eurephiaCTX *, efw_threaddata *); |
| 46 |
|
| 47 |
#endif /* !EUREPHIAFW_HELPERS_H_ */ |