Commit a5eef39b authored by Håvard Moås's avatar Håvard Moås
Browse files

Update IPFIXLIB for the last update to bitrate calculation, EVER, havard.mork@gmail.com

git-svn-id: file:///home/svn/mapi/branches/haavardm-mapi@55 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 3b81ec3b
......@@ -426,10 +426,9 @@ static void calculateBitrate(u_int divisor, u_int64_t stamp, u_int64_t *lastupda
//
// In case of no-force, then break if a MAX_UINT32 is found.
// This is because we are observing the beginning of a flow
if(!force) {
if(!force)
sum = MAX_UINT32;
break;
}
break;
} else
sum += averager[i];
}
......@@ -785,6 +784,12 @@ void addPktToHash(np_ctxt_t *npctxt,
bkt->dst2srcBitrateLastUpdate1sec = stamp;
bkt->dst2srcBitrateLastUpdate100ms = stamp;
bkt->dst2srcBitrateLastUpdate10ms = stamp;
bkt->src2dstBitrateAverager1sec[0] = 0;
bkt->src2dstBitrateAverager100ms[0] = 0;
bkt->src2dstBitrateAverager10ms[0] = 0;
bkt->dst2srcBitrateAverager1sec[0] = 0;
bkt->dst2srcBitrateAverager100ms[0] = 0;
bkt->dst2srcBitrateAverager10ms[0] = 0;
}
bkt->src2dstRateMax1sec = 0;
......@@ -801,12 +806,12 @@ void addPktToHash(np_ctxt_t *npctxt,
bkt->dst2srcRateMax10ms = 0;
bkt->dst2srcRateMin10ms = MAX_UINT32;
bkt->src2dstBitrateAverager1secPos = BITRATE_AVERAGER_SLOTS;
bkt->dst2srcBitrateAverager1secPos = BITRATE_AVERAGER_SLOTS;
bkt->src2dstBitrateAverager100msPos = BITRATE_AVERAGER_SLOTS;
bkt->dst2srcBitrateAverager100msPos = BITRATE_AVERAGER_SLOTS;
bkt->src2dstBitrateAverager10msPos = BITRATE_AVERAGER_SLOTS;
bkt->dst2srcBitrateAverager10msPos = BITRATE_AVERAGER_SLOTS;
bkt->src2dstBitrateAverager1secPos = 0;
bkt->dst2srcBitrateAverager1secPos = 0;
bkt->src2dstBitrateAverager100msPos = 0;
bkt->dst2srcBitrateAverager100msPos = 0;
bkt->src2dstBitrateAverager10msPos = 0;
bkt->dst2srcBitrateAverager10msPos = 0;
bkt->src2dstMinPktSize = bkt->dst2srcMinPktSize = 0xFFFF;
......@@ -1052,6 +1057,7 @@ void walkHash(np_ctxt_t *npctxt, int flushHash) {
if(npctxt->bitrateCalcEnabled!=0) {
// Force update of the bitrate calculation at the end.
updateBitrateCalculation(npctxt, myBucket, 0, 0,0,1);
updateBitrateCalculation(npctxt, myBucket, 0, 0,1,1);
}
queueBucketToExport(npctxt, myBucket);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment