.read("EWMA", _ewma) // if rates averaged through EWMA; otherwise, average on 1000/_alpha last measurements
.read("ALPHA_EWMA_PLC", _alpha_ewma_plc) // alpha for EWMA for rates in per 1000; if no EWMA, gives number of measurements to average on by 1000/_alpha
click_chatter("[Neighbors] Configure done. I have %d interfaces.\n", _nr_interfaces);
}
return 0;
}
int Neighbors::initialize(ErrorHandler *errh){
if(_debug)
click_chatter("[Neighbors] Initializing...\n");
Element::initialize(errh);
if(_eth_addr2_present && _addr2_is_plc)
set_plc_neighbor_groups();
_hello_timer.initialize(this);
_hello_timer.schedule_after_sec(1);
_frame_timer.initialize(this);
int wait_time_empty_frame = 60; // begin to send frames only after 60 seconds (to get all hellos)
_frame_timer.schedule_after_msec(click_random(wait_time_empty_frame*1000,15*wait_time_empty_frame*100)); //between 1* and 1.5* of wait_time_empty_frame
if(_debug) click_chatter("[Neighbors]: Neighbor (%s) has been silent for more than %d seconds. adding to remove list...", it.key().unparse().c_str(), _timeout_duration);
VERB_DEBUG_CHATTER("[Neighbors] For eth %s, MCS %d, has %d packets (was %d)", eth.unparse().c_str(), mcs_idx, nb_packets, _last_packets[eth][mcs_idx]);
}
else {
_now.assign_now();
uint32_t capa = 0;
if(is_in_hash_table(_neighbors, eth))
capa = _neighbors[eth].capa;
click_chatter("[Neighbors %s] WARNING: for %s (capa %d), mcs index %d, nb_packets=%d, last_packets=%d", _now.unparse().c_str(),