LCOV - code coverage report
Current view: top level - src/protocol2/rabin - rconf.c (source / functions) Hit Total Coverage
Test: burp-coverage-clean.info Lines: 12 12 100.0 %
Date: 2016-01-03 Functions: 1 1 100.0 %

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

Generated by: LCOV version 1.10