Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

constants.hh

Go to the documentation of this file.
00001 // Copyright (C) 2003, 2004, 2005 Laboratoire de Recherche en Informatique
00002 
00003 // This file is part of Qolyester.
00004 
00005 // Qolyester is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 
00010 // Qolyester is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018 
00019 #ifndef QOLYESTER_CST_CONSTANTS_HH
00020 # define QOLYESTER_CST_CONSTANTS_HH 1
00021 
00022 # include "config.hh"
00023 # include "utl/timeval.hh"
00024 
00025 namespace olsr {
00026 
00027   namespace cst {
00028 
00029 # define OLSR_PORT_NUMBER       698
00030 # define C_CONSTANT             .0625f
00031 
00032 // Protocol constant for rtnetlink, should be standardized
00033 # define RTPROT_OLSR            15
00034 
00035 // MPR Willingness
00036 # define WILL_NEVER     0
00037 # define WILL_LOW       1
00038 # define WILL_DEFAULT   3
00039 # define WILL_HIGH      6
00040 # define WILL_ALWAYS    7
00041 
00042 // Link status
00043 # define UNSPEC_LINK    0
00044 # define ASYM_LINK      1
00045 # define SYM_LINK       2
00046 # define LOST_LINK      3
00047 # define LOWEST_LINK    UNSPEC_LINK
00048 # define HIGHEST_LINK   LOST_LINK
00049 
00050 // Neighbor status
00051 # define NOT_NEIGH      0
00052 # define SYM_NEIGH      1
00053 # define MPR_NEIGH      2
00054 # define LOWEST_NEIGH   NOT_NEIGH
00055 # define HIGHEST_NEIGH  MPR_NEIGH
00056 
00057 // Message types
00058 # define HELLO_MESSAGE  1
00059 # define TC_MESSAGE     2
00060 # define MID_MESSAGE    3
00061 # define HNA_MESSAGE    4
00062 
00063 # ifdef QOLYESTER_ENABLE_LINKHYS
00064 // Link hysteresis
00065 #  define HYST_THRESHOLD_HIGH   0.8
00066 #  define HYST_THRESHOLD_LOW    0.3
00067 #  define HYST_SCALING          0.5
00068 # endif
00069 
00070 // Virtual interface
00071 # define VIRTUAL_MTU            1500
00072 # define VIRTUAL_SOCKNAME       "/tmp/qolsrd.switch"
00073 
00074     // Constants definitions.  See the OLSR draft for more
00075     // information.
00076 
00077 # ifdef QOLYESTER_HELLO_INTERVAL
00078     const timeval_t     def_hello_interval   = QOLYESTER_HELLO_INTERVAL;
00079 # else
00080     const timeval_t     def_hello_interval   = 2000;
00081 # endif
00082 
00083 # ifdef QOLYESTER_REFRESH_INTERVAL
00084     const timeval_t     def_refresh_interval = QOLYESTER_REFRESH_INTERVAL;
00085 # else
00086     const timeval_t     def_refresh_interval = 2000;
00087 # endif
00088 
00089 # ifdef QOLYESTER_TC_INTERVAL
00090     const timeval_t     def_tc_interval      = QOLYESTER_TC_INTERVAL;
00091 # else
00092     const timeval_t     def_tc_interval      = 5000;
00093 # endif
00094 
00095 # ifdef QOLYESTER_ENABLE_MID
00096 #  ifdef QOLYESTER_MID_INTERVAL
00097     const timeval_t     def_mid_interval     = QOLYESTER_MID_INTERVAL;
00098 #  else
00099     const timeval_t     def_mid_interval     = def_tc_interval;
00100 #  endif
00101 
00102 #  ifdef QOLYESTER_MID_HOLD_TIME
00103     const timeval_t     def_mid_hold_time    = QOLYESTER_MID_HOLD_TIME;
00104 #  else
00105     const timeval_t     def_mid_hold_time    = def_mid_interval * 3;
00106 #  endif
00107 # endif
00108 
00109 # ifdef QOLYESTER_ENABLE_HNA
00110 #  ifdef QOLYESTER_HNA_INTERVAL
00111     const timeval_t     def_hna_interval     = QOLYESTER_HNA_INTERVAL;
00112 #  else
00113     const timeval_t     def_hna_interval     = def_tc_interval;
00114 #  endif
00115 
00116 #  ifdef QOLYESTER_HNA_HOLD_TIME
00117     const timeval_t     def_hna_hold_time    = QOLYESTER_HNA_HOLD_TIME;
00118 #  else
00119     const timeval_t     def_hna_hold_time    = def_hna_interval * 3;
00120 #  endif
00121 # endif
00122 
00123 # ifdef QOLYESTER_NEIGHB_HOLD_TIME
00124     const timeval_t     def_neighb_hold_time = QOLYESTER_NEIGHB_HOLD_TIME;
00125 # else
00126     const timeval_t     def_neighb_hold_time = def_refresh_interval * 3;
00127 # endif
00128 
00129 # ifdef QOLYESTER_TOP_HOLD_TIME
00130     const timeval_t     def_top_hold_time    = QOLYESTER_TOP_HOLD_TIME;
00131 # else
00132     const timeval_t     def_top_hold_time    = def_tc_interval * 3;
00133 # endif
00134 
00135 # ifdef QOLYESTER_DUP_HOLD_TIME
00136     const timeval_t     def_dup_hold_time    = QOLYESTER_DUP_HOLD_TIME;
00137 # else
00138     const timeval_t     def_dup_hold_time    = 30000;
00139 # endif
00140 
00141 # ifdef QOLYESTER_MAX_JITTER_TIME
00142     const timeval_t     def_maxjitter        = QOLYESTER_MAX_JITTER_TIME;
00143 # else
00144     const timeval_t     def_maxjitter        = def_hello_interval / 4;
00145 # endif
00146 
00147 # ifdef QOLYESTER_GC_INTERVAL
00148     const timeval_t     def_gc_interval      = QOLYESTER_GC_INTERVAL;
00149 # else
00150     const timeval_t     def_gc_interval      = 5000;
00151 # endif
00152 
00153 # ifdef QOLYESTER_DUMP_INTERVAL
00154     const timeval_t     def_dump_interval    = QOLYESTER_DUMP_INTERVAL;
00155 # else
00156     const timeval_t     def_dump_interval    = 1000;
00157 # endif
00158 
00159   } // namespace cst
00160 
00161 # ifdef QOLYESTER_ENABLE_TCRED
00162   enum TCRedundancy {
00163     mprselset        = 0,
00164     mprselset_mprset = 1,
00165     wholeset         = 2
00166   };
00167 
00168   const TCRedundancy    def_tc_redundancy = QOLYESTER_TC_DEFAULT_REDUNDANCY;
00169 # endif
00170 
00171   const unsigned        def_willingness = QOLYESTER_DEFAULT_WILLINGNESS;
00172 
00173 # ifdef QOLYESTER_ENABLE_MPRRED
00174   const unsigned        def_mprcoverage = QOLYESTER_MPR_DEFAULT_COVERAGE;
00175 # endif
00176 
00177 } // namespace olsr
00178 
00179 # include "cst/params.hh"
00180 
00181 #endif // ! QOLYESTER_CST_CONSTANTS_HH

Generated on Thu Jul 28 21:21:46 2005 for Qolyester daemon by  doxygen 1.4.1