N-sim
Emulation and simulation of
Wireless Sensor Networks



   Home


   Project Page


   Download


   CVS



   Installation


   Configuration


   Plug-ins




 Hosted by
SourceForge.net Logo

/home/brennan/n-sim/Vaike/linux/system-addons/networking/mesh_ipc.h

Go 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 #ifndef _MESH_IPC_H_
00036 #define _MESH_IPC_H_
00037 
00038 #ifdef MESH_IPC_SERVER
00039 # include <syslog.h>
00040 
00041 # define p_error(k, f) do {                     \
00042     syslog(LOG_ERR, "%s: %s: %m", k, f);        \
00043   } while (0);
00044 
00045 # define h_error(k, f) do {                                     \
00046     syslog(LOG_ERR, "%s: %s: %s", k, f, hstrerror(h_errno));    \
00047   } while (0);
00048 
00049 #else  // not MESH_IPC_SERVER
00050 # define MESH_LIBRARY       "libsensormesh"
00051 
00052 # define p_error(k, f)  do {                            \
00053     fprintf(stderr, "%s  %s: %s: %s.\n",                \
00054             MESH_LIBRARY, k, f, strerror(errno));       \
00055   } while (0);
00056 
00057 # define h_error(k, f)  do {                            \
00058     fprintf(stderr, "%s  %s: %s: %s.\n",                \
00059             MESH_LIBRARY, k, f, hstrerror(h_errno));    \
00060   } while (0);
00061 
00062 #endif  // MESH_IPC_SERVER
00063 
00064 #define MESH_CONTROL_PORT       1007
00065 
00069 #define MESH_IOREDISCVR  0x8300
00070 #define MESH_IOGSNDQ     0x8301
00071 #define MESH_IOSSNDQ     0x8302
00072 #define MESH_IOGMTU      0x8303
00073 #define MESH_IOSMTU      0x8304
00074 #define MESH_IOGSNDTMO   0x8305
00075 #define MESH_IOSSNDTMO   0x8306
00076 #define MESH_IOGRTMTR    0x8307
00077 #define MESH_IOGLNKMTR   0x8308
00078 #define MESH_IOGNGHADDR  0x8309
00079 #define MESH_IOGNGHPOS   0x8310
00080 #define MESH_IOSOCKET    0x8311
00081 #define MESH_IOSENDSEQ   0x8312
00082 #define MESH_IORECVSEQ   0x8313
00083 #define MESH_IOSENDRAW   0x8314
00084 #define MESH_IORECVRAW   0x8315
00085 #define MESH_IOSENDNEAR  0x8316
00086 #define MESH_IORECVNEAR  0x8317
00087 
00088 
00089 #ifdef MESH_IPC_SERVER
00090 
00091 struct _self;
00092 int mesh_ioserv(struct _self *self);
00093 
00094 #else
00095 
00096 int mesh_ipc_init(void);
00097 int mesh_ioctl(int request, ...);
00098 
00099 #endif
00100 
00101 
00102 #endif  //  _MESH_IPC_H_


© 2007, Los Alamos National Security, LLC.