X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fsflow_sampler.c;h=280d54df7fdc387ac79be6b8ed74419e7296765f;hb=7507ec485f72c2ec56731ee5c9790a20d6d694fd;hp=c2b4556cf6ee505ce242781abab64a05be6420a6;hpb=a0bc29a541fc7dc6e20137d5558e2094d614e6ab;p=sliver-openvswitch.git diff --git a/lib/sflow_sampler.c b/lib/sflow_sampler.c index c2b4556cf..280d54df7 100644 --- a/lib/sflow_sampler.c +++ b/lib/sflow_sampler.c @@ -20,18 +20,18 @@ void sfl_sampler_init(SFLSampler *sampler, SFLAgent *agent, SFLDataSource_instan and to Andy Kitchingman for pointing out that it applies to the hash_nxt ptr too) */ SFLSampler *nxtPtr = sampler->nxt; SFLSampler *hashPtr = sampler->hash_nxt; - + /* clear everything */ memset(sampler, 0, sizeof(*sampler)); - + /* restore the linked list and hash-table ptr */ sampler->nxt = nxtPtr; sampler->hash_nxt = hashPtr; - + /* now copy in the parameters */ sampler->agent = agent; sampler->dsi = dsi; - + /* set defaults */ sampler->sFlowFsMaximumHeaderSize = SFL_DEFAULT_HEADER_SIZE; sampler->sFlowFsPacketSamplingRate = SFL_DEFAULT_SAMPLING_RATE; @@ -157,7 +157,7 @@ inline static u_int32_t nextRandomSkip(u_int32_t mean) { if(mean == 0 || mean == 1) return 1; return ((random() % ((2 * mean) - 1)) + 1); -} +} /*_________________---------------------------__________________ _________________ sfl_sampler_takeSample __________________