Revision 176b8de8 src/PeerSampler/ncast.c

View differences:

src/PeerSampler/ncast.c
18 18
#include "../Cache/topocache.h"
19 19
#include "../Cache/ncast_proto.h"
20 20
#include "../Cache/proto.h"
21
#include "config.h"
21
#include "grapes_config.h"
22 22
#include "grapes_msg_types.h"
23 23

  
24 24
#define DEFAULT_CACHE_SIZE 10
......
101 101
  context = ncast_context_init();
102 102
  if (!context) return NULL;
103 103

  
104
  cfg_tags = config_parse(config);
105
  res = config_value_int_default(cfg_tags, "cache_size", &context->cache_size, DEFAULT_CACHE_SIZE);
106
  res = config_value_int_default(cfg_tags, "max_timestamp", &max_timestamp, DEFAULT_MAX_TIMESTAMP);
107
  res = config_value_int_default(cfg_tags, "period", &context->period, DEFAULT_PERIOD);
108
  res = config_value_int_default(cfg_tags, "bootstrap_period", &context->bootstrap_period, DEFAULT_BOOTSTRAP_PERIOD);
109
  res = config_value_int_default(cfg_tags, "bootstrap_cycles", &context->bootstrap_cycles, DEFAULT_BOOTSTRAP_CYCLES);
110
  res = config_value_int_default(cfg_tags, "adaptive", &context->adaptive, plus_features);
111
  res = config_value_int_default(cfg_tags, "restart", &context->restart, plus_features);
112
  res = config_value_int_default(cfg_tags, "randomize", &context->randomize, plus_features);
113
  res = config_value_int_default(cfg_tags, "slowstart", &context->slowstart, plus_features);
104
  cfg_tags = grapes_config_parse(config);
105
  res = grapes_config_value_int_default(cfg_tags, "cache_size", &context->cache_size, DEFAULT_CACHE_SIZE);
106
  res = grapes_config_value_int_default(cfg_tags, "max_timestamp", &max_timestamp, DEFAULT_MAX_TIMESTAMP);
107
  res = grapes_config_value_int_default(cfg_tags, "period", &context->period, DEFAULT_PERIOD);
108
  res = grapes_config_value_int_default(cfg_tags, "bootstrap_period", &context->bootstrap_period, DEFAULT_BOOTSTRAP_PERIOD);
109
  res = grapes_config_value_int_default(cfg_tags, "bootstrap_cycles", &context->bootstrap_cycles, DEFAULT_BOOTSTRAP_CYCLES);
110
  res = grapes_config_value_int_default(cfg_tags, "adaptive", &context->adaptive, plus_features);
111
  res = grapes_config_value_int_default(cfg_tags, "restart", &context->restart, plus_features);
112
  res = grapes_config_value_int_default(cfg_tags, "randomize", &context->randomize, plus_features);
113
  res = grapes_config_value_int_default(cfg_tags, "slowstart", &context->slowstart, plus_features);
114 114
  free(cfg_tags);
115 115

  
116 116
  context->local_cache = cache_init(context->cache_size, metadata_size, max_timestamp);

Also available in: Unified diff