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/sensor_self.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 _SENSOR_SELF_H_
00036 #define _SENSOR_SELF_H_
00037 
00038 #include <limits.h>
00039 
00040 #include "avl.h"
00041 #include "mesh_ipc.h"
00042 #include "mesh_protocol.h"
00043 #include "mesh_analysis.h"
00044 #include "mesh_net.h"
00045 
00046 #define MAX_PROTOCOLS  16
00047 #define MAX_ANALYSIS  16
00048 
00049 typedef struct {
00050   char file[PATH_MAX];
00051   int buf_size;
00052   char parse_string[512];
00053 } battery_t;
00054     
00055 
00056 typedef struct _self {
00057   char *interface;
00058   char mac_addr[MAC_ADDR_LEN];
00059 
00060   protocol_t *protocols, *last_p;
00061   analysis_t *analyses, *last_a;
00062 
00063   char ip_addr[NET_ADDR_LEN];
00064   char broadcast[NET_ADDR_LEN];
00065   char netmask[NET_ADDR_LEN];
00066 
00067   struct avltree neighbors;
00068   struct avlnode *n_iter;
00069 
00070   unsigned char battery_enabled;
00071   battery_t battery;
00072 
00073   double latitude, longitude, altitude;
00074 
00075   unsigned char isa_gateway;
00076   volatile unsigned int shutdown;
00077 } self_t;
00078 
00079 
00080 double get_discharge_rate(self_t *self);
00081 void init_self(self_t *self);
00082 size_t max_ctl_size(self_t *self);
00083 
00084 
00085 #endif  //  _SENSOR_SELF_H_


© 2007, Los Alamos National Security, LLC.