|
|
/home/brennan/n-sim/Vaike/linux/system-addons/networking/mesh_metrics.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 #ifndef _MESH_METRICS_H_ 00036 #define _MESH_METRICS_H_ 00037 00038 struct _self; 00039 struct _protocol; 00040 00041 #define MESH_METRICS_PORT 1009 00042 00045 #define MESH_METRICS_INTERVAL 180 /* seconds before (re)measuring metrics */ 00046 #define MESH_METRICS_PACKETS 10 00047 #define MESH_METRICS_ROUND 3 /* seconds between metrics txs */ 00048 00049 00050 enum mesh_metric { RELIABILITY = 0, GOODPUT, ENERGY }; 00051 int metric_by_name(char *name); 00052 00053 typedef struct { 00054 double reliability; /* 1.0 is perfect */ 00055 double goodput; 00056 double energy; 00057 } metric_t; 00058 00059 double compile_mesh_metrics(struct _protocol *proto, enum mesh_metric m, 00060 char *destination); 00061 void init_metrics(metric_t *metrics); 00062 int echo_statistics(struct _self *self); 00063 int gather_statistics(struct _self *self); 00064 00065 00066 #endif // _MESH_METRICS_H_ |