|
|
/home/brennan/n-sim/Vaike/linux/system-addons/system/soap/sensor_ipc.hGo to the documentation of this file.00001 00014 /* 00015 * Copyright 2007. Los Alamos National Security, LLC. This material 00016 * was produced under U.S. Government contract DE-AC52-06NA25396 for 00017 * Los Alamos National Laboratory (LANL), which is operated by Los 00018 * Alamos National Security, LLC, for the Department of Energy. The 00019 * U.S. Government has rights to use, reproduce, and distribute this 00020 * software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, 00021 * LLC, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL 00022 * LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to 00023 * produce derivative works, such modified software should be clearly 00024 * marked, so as not to confuse it with the version available from LANL. 00025 * 00026 * Additionally, this program is free software; you can redistribute 00027 * it and/or modify it under the terms of the GNU General Public 00028 * License as published by the Free Software Foundation; version 2 of 00029 * the License. Accordingly, this program is distributed in the hope 00030 * it will be useful, but WITHOUT ANY WARRANTY; without even the 00031 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00032 * PURPOSE. See the GNU General Public License for more details. 00033 */ 00034 00035 #include <pthread.h> 00036 #include <minisoap.h> 00037 00038 #ifndef _IPC_H_ 00039 #define _IPC_H_ 00040 00041 00042 #define IPC_DATA_PORT 4353 00043 #define IPC_CMD_PORT 4354 00044 00045 #define DEFAULT_DATA_LEN 1024 00046 #define DEFAULT_CMD_LEN 1024 00047 00048 #define SENSOR_ADDR_ANY "255.255.255.255" 00049 00050 #ifndef _ipc_impl_ 00051 extern pthread_t data_thread, cmd_thread; 00052 #endif 00053 00054 int quitting(void); 00055 00056 long long get_time(void); 00057 00058 int initialize_ipc(int data_recv_port); 00059 00060 int ipc_data_send(SoapEvent *evt); 00061 int ipc_cmd_send(SoapEvent *evt); 00062 00063 /* blocking recvs; env->msg must malloc'ed and freed */ 00064 int ipc_data_recv(SoapEvent *evt); 00065 int ipc_cmd_recv(SoapEvent *evt); 00066 00067 00068 typedef int(*ipc_recv_t)(SoapEvent *evt); 00069 00070 /* optional threads */ 00071 int register_data_handler(int recv_port, ipc_recv_t h); 00072 int register_cmd_handler(int recv_port, ipc_recv_t h); 00073 00074 00075 #endif // _IPC_H_ |