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