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 36 : uint64_t multiplier=1;
9 :
10 36 : for(i=0; i < win; i++) multiplier*=prime;
11 :
12 : return multiplier;
13 : }
14 :
15 : // Hey you. Probably best not fuck with these.
16 36 : void rconf_init(struct rconf *rconf)
17 : {
18 36 : rconf->prime=3; // Not configurable.
19 :
20 36 : rconf->win_min=17; // Not configurable.
21 36 : rconf->win_size=31; // Sliding window size.
22 36 : rconf->win_max=63; // Not configurable.
23 :
24 36 : rconf->blk_min=RABIN_MIN; // Minimum block size.
25 36 : rconf->blk_avg=RABIN_AVG; // Average block size.
26 36 : rconf->blk_max=RABIN_MAX; // Maximum block size.
27 :
28 72 : rconf->multiplier=get_multiplier(rconf->win_size, rconf->prime);
29 36 : }
|