Hi guys, I have a problem about how to use TTL info in RED code segment.Like this: //modify file: red.c ... /* * Make uniform instead of geometric interdrop periods. */ double REDQueue::modify_p(double p, int count, int count_bytes, int bytes, int mean_pktsize, int wait, int size) { double count1 = (double) count; if (bytes) count1 = (double) (count_bytes/mean_pktsize); if (wait) { if (count1 * p < 1.0) p = 0.0; else if (count1 * p < 2.0) p /= (2 - count1 * p); else p = 1.0; } else { if (count1 * p < 1.0) { //modification!!! //========================= p * = (double) ttl() /(double) TTL_START; //========================= p /= (1.0 - count1 * p); } else p = 1.0; } if (bytes && p < 1.0) { p = p * size / mean_pktsize; } if (p > 1.0) p = 1.0; return p; }
/* * */ ... The modification is failed.How to solve this problem? Thanks! LuoWeiDong 2006-11-28