LCOV - code coverage report
Current view: top level - src/protocol2/rabin - rconf.c (source / functions) Hit Total Coverage
Test: burp-coverage-clean.info Lines: 14 14 100.0 %
Date: 2015-11-30 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #include "../../burp.h"
       2             : #include "rconf.h"
       3             : #include "../../log.h"
       4             : 
       5           6 : static uint64_t get_multiplier(uint32_t win, uint64_t prime)
       6             : {
       7             :         unsigned int i;
       8           6 :         uint64_t multiplier=1;
       9             : 
      10           6 :         for(i=0; i < win; i++) multiplier*=prime;
      11             : 
      12           6 :         return multiplier;
      13             : }
      14             : 
      15             : // Hey you. Probably best not fuck with these.
      16           6 : void rconf_init(struct rconf *rconf)
      17             : {
      18           6 :         rconf->prime=3;              // Not configurable.
      19             : 
      20           6 :         rconf->win_min=17;   // Not configurable.
      21           6 :         rconf->win_size=31;  // Sliding window size.
      22           6 :         rconf->win_max=63;   // Not configurable.
      23             : 
      24           6 :         rconf->blk_min=RABIN_MIN; // Minimum block size.
      25           6 :         rconf->blk_avg=RABIN_AVG; // Average block size.
      26           6 :         rconf->blk_max=RABIN_MAX; // Maximum block size.
      27             : 
      28           6 :         rconf->multiplier=get_multiplier(rconf->win_size, rconf->prime);
      29           6 : }

Generated by: LCOV version 1.10