00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _PROPHET_PARAMS_H_
00018 #define _PROPHET_PARAMS_H_
00019
00020 #include <sys/types.h>
00021 #include "Node.h"
00022 #include "FwdStrategy.h"
00023 #include "QueuePolicy.h"
00024
00025 namespace prophet
00026 {
00027
00032 class ProphetParams : public NodeParams
00033 {
00034 public:
00038 static const u_int8_t HELLO_INTERVAL = 20;
00039
00043 static const u_int HELLO_DEAD = 20;
00044
00048 static const u_int DEFAULT_NUM_F_MAX = 5;
00049
00053 static const u_int DEFAULT_NUM_F_MIN = 3;
00054
00058 static const u_int AGE_PERIOD = 180;
00059
00063 static const u_int8_t PROPHET_VERSION = 0x01;
00064
00068 static const u_int MAX_TABLE_SIZE = 1024;
00069
00073 ProphetParams()
00074 : NodeParams(),
00075 fs_(FwdStrategy::GRTR),
00076 qp_(QueuePolicy::FIFO),
00077 hello_interval_(HELLO_INTERVAL),
00078 hello_dead_(HELLO_DEAD),
00079 max_forward_(DEFAULT_NUM_F_MAX),
00080 min_forward_(DEFAULT_NUM_F_MIN),
00081 age_period_(AGE_PERIOD),
00082 max_table_size_(MAX_TABLE_SIZE),
00083 epsilon_(0.0039),
00084 relay_node_(true),
00085 internet_gw_(false)
00086 {}
00087
00089 FwdStrategy::fwd_strategy_t fs() const { return fs_; }
00090 QueuePolicy::q_policy_t qp() const { return qp_; }
00091 u_int8_t hello_interval() const { return hello_interval_; }
00092 u_int hello_dead() const { return hello_dead_; }
00093 u_int max_forward() const { return max_forward_; }
00094 u_int min_forward() const { return min_forward_; }
00095 u_int age_period() const { return age_period_; }
00096 double epsilon() const { return epsilon_; }
00097 bool relay_node() const { return relay_node_; }
00098 bool internet_gw() const { return internet_gw_; }
00100
00101 FwdStrategy::fwd_strategy_t fs_;
00102 QueuePolicy::q_policy_t qp_;
00103
00104 u_int8_t hello_interval_;
00105 u_int hello_dead_;
00106
00107 u_int max_forward_;
00108 u_int min_forward_;
00109
00110 u_int age_period_;
00111
00112 u_int max_table_size_;
00113
00114 double epsilon_;
00115
00116 bool relay_node_;
00117 bool internet_gw_;
00118 };
00119
00120 };
00121
00122 #endif // _PROPHET_PARAMS_H_