| 46 | |
| 47 | |
| 48 | int hash_func (struct sip_msg * msg, |
| 49 | enum hash_source source, int denominator) { |
| 50 | int ret; |
| 51 | unsigned int hash; |
| 52 | str source_string; |
| 53 | |
| 54 | if(determine_source (msg, source, &source_string) == -1) { |
| 55 | return -1; |
| 56 | } |
| 57 | crc32_uint(&source_string, &hash); |
| 58 | |
| 59 | ret = hash % denominator; |
| 60 | LM_DBG("hash: %u %% %i = %i\n", hash, denominator, ret); |
| 61 | return ret; |
| 62 | } |
| 63 | |
| 64 | int prime_hash_func(struct sip_msg * msg, |
| 65 | enum hash_source source, int denominator) { |
no test coverage detected