00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifdef HAVE_CONFIG_H
00018 #include <dtn-config.h>
00019 #endif
00020
00021 #include "DTLSRConfig.h"
00022
00023 namespace dtn {
00024
00025
00026 template <>
00027 DTLSRConfig* oasys::Singleton<DTLSRConfig>::instance_ = NULL;
00028
00029
00030 DTLSRConfig::DTLSRConfig()
00031 : area_(""),
00032 weight_fn_(ESTIMATED_DELAY),
00033 weight_shift_(0),
00034 uptime_factor_(10.0),
00035 keep_down_links_(true),
00036 recompute_delay_(1),
00037 aging_interval_(5),
00038 lsa_interval_(3600),
00039 min_lsa_interval_(5),
00040 lsa_lifetime_(24 * 3600)
00041 {
00042 }
00043
00044
00045 const char*
00046 DTLSRConfig::weight_fn_to_str(weight_fn_t fn)
00047 {
00048 switch(fn) {
00049 case COST: return "COST";
00050 case DELAY: return "DELAY";
00051 case ESTIMATED_DELAY: return "ESTIMATED_DELAY";
00052 }
00053 return "INVALID_WEIGHT_FN";
00054 }
00055
00056
00057 oasys::EnumOpt::Case
00058 DTLSRConfig::weight_opts_[] =
00059 {
00060 {"cost", COST},
00061 {"delay", DELAY},
00062 {"estimated_delay", ESTIMATED_DELAY},
00063 {"estdelay", ESTIMATED_DELAY},
00064 {NULL, 0},
00065 };
00066
00067 }