#include "../../sr_module.h"
#include "../../parser/parse_uri.h"
#include "../../parser/parse_to.h"
#include "../../parser/parse_from.h"
#include "../../crc.h"
#include <ctype.h>
#include "prime_hash.h"

Go to the source code of this file.
Functions | |
| static int | determine_call_id (struct sip_msg *msg, str *source_string) |
| static int | determine_fromto_uri (struct to_body *fromto, str *source_string) |
| static int | determine_fromto_user (struct to_body *fromto, str *source_string) |
| static int | determine_source (struct sip_msg *msg, enum hash_source source, str *source_string) |
| static int | first_token (str *source_string) |
| int | hash_func (struct sip_msg *msg, enum hash_source source, int denominator) |
| CRC32 hash function Returns an integer number between 0 and denominator - 1 based on the hash source from the msg. The hash algorith is CRC32. | |
| int | prime_hash_func (struct sip_msg *msg, enum hash_source source, int denominator) |
| prime hash function Returns an integer number between 0 and denominator - 1 based on the hash source from the msg. Use the prime number algorithm. | |
| static int | validate_msg (struct sip_msg *msg) |
Definition in file prime_hash.c.
Definition at line 160 of file prime_hash.c.
References hdr_field::body, sip_msg::callid, first_token(), _str::len, and _str::s.
Referenced by determine_source().
Definition at line 167 of file prime_hash.c.
References _str::len, LM_ERR, NULL, _str::s, and to_body::uri.
Referenced by determine_source().
Definition at line 177 of file prime_hash.c.
References _str::len, LM_ERR, NULL, parse_uri(), _str::s, to_body::uri, and sip_uri::user.
Referenced by determine_source().
| static int determine_source | ( | struct sip_msg * | msg, | |
| enum hash_source | source, | |||
| str * | source_string | |||
| ) | [static] |
Definition at line 111 of file prime_hash.c.
References determine_call_id(), determine_fromto_uri(), determine_fromto_user(), get_from, get_to, _str::len, LM_ERR, NULL, _str::s, shs_call_id, shs_from_uri, shs_from_user, shs_to_uri, shs_to_user, and validate_msg().
Referenced by hash_func(), and prime_hash_func().
| static int first_token | ( | str * | source_string | ) | [static] |
Definition at line 193 of file prime_hash.c.
References _str::len, len, NULL, and _str::s.
Referenced by determine_call_id().
| int hash_func | ( | struct sip_msg * | msg, | |
| enum hash_source | source, | |||
| int | denominator | |||
| ) |
CRC32 hash function Returns an integer number between 0 and denominator - 1 based on the hash source from the msg. The hash algorith is CRC32.
Definition at line 50 of file prime_hash.c.
References crc32_uint(), determine_source(), hash, and LM_DBG.
Referenced by rewrite_on_rule().
| int prime_hash_func | ( | struct sip_msg * | msg, | |
| enum hash_source | source, | |||
| int | denominator | |||
| ) |
prime hash function Returns an integer number between 0 and denominator - 1 based on the hash source from the msg. Use the prime number algorithm.
Definition at line 66 of file prime_hash.c.
References determine_source(), _str::len, LM_DBG, LM_ERR, _str::s, shs_from_user, and shs_to_user.
Referenced by rewrite_on_rule().
| static int validate_msg | ( | struct sip_msg * | msg | ) | [static] |
Definition at line 138 of file prime_hash.c.
References sip_msg::callid, sip_msg::from, HDR_CALLID_F, HDR_FROM_F, HDR_TO_F, LM_ERR, parse_from_header(), parse_headers(), and sip_msg::to.
Referenced by determine_source().
1.5.6