00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
00033 # define RTPROT_OLSR 15
00034
00035
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
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
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
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
00065 # define HYST_THRESHOLD_HIGH 0.8
00066 # define HYST_THRESHOLD_LOW 0.3
00067 # define HYST_SCALING 0.5
00068 # endif
00069
00070
00071 # define VIRTUAL_MTU 1500
00072 # define VIRTUAL_SOCKNAME "/tmp/qolsrd.switch"
00073
00074
00075
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 }
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 }
00178
00179 # include "cst/params.hh"
00180
00181 #endif // ! QOLYESTER_CST_CONSTANTS_HH