More...
#include "../../str.h"
#include "../../flags.h"
#include "../../trie/dtrie.h"


Go to the source code of this file.
Data Structures | |
| struct | domain_data_t |
Functions | |
| int | add_failure_route_to_tree (struct dtrie_node_t *failure_node, const str *scan_prefix, const str *full_prefix, const str *host, const str *reply_code, const flag_t flags, const flag_t mask, const int next_domain, const str *comment) |
| int | add_route_to_tree (struct dtrie_node_t *node, const str *scan_prefix, flag_t flags, flag_t mask, const str *full_prefix, int max_targets, double prob, const str *rewrite_hostpart, int strip, const str *rewrite_local_prefix, const str *rewrite_local_suffix, int status, int hash_index, int backup, int *backed_up, const str *comment) |
| int | compare_domain_data (const void *v1, const void *v2) |
| struct domain_data_t * | create_domain_data (int id, str *domain) |
| void | destroy_domain_data (struct domain_data_t *domain_data) |
Definition in file cr_domain.h.
| int add_failure_route_to_tree | ( | struct dtrie_node_t * | failure_node, | |
| const str * | scan_prefix, | |||
| const str * | full_prefix, | |||
| const str * | host, | |||
| const str * | reply_code, | |||
| const flag_t | flags, | |||
| const flag_t | mask, | |||
| const int | next_domain, | |||
| const str * | comment | |||
| ) |
Adds the given failure route information to the failure prefix tree identified by failure_node. scan_prefix, host, reply_code, flags identifies the number for which the information is and the next_domain parameters defines where to continue routing in case of a match.
| failure_node | the root of the failure routing tree | |
| scan_prefix | the prefix for which to add the rule (must not contain non-digits) | |
| full_prefix | the whole scan prefix | |
| host | the hostname last tried | |
| reply_code | the reply code | |
| flags | user defined flags | |
| mask | mask for user defined flags | |
| next_domain | continue routing with this domain id | |
| comment | a comment for the route rule |
Definition at line 200 of file cr_domain.c.
References add_failure_route_rule(), cr_match_mode, _str::len, LM_ERR, NULL, and _str::s.
Referenced by add_failure_route().
| int add_route_to_tree | ( | struct dtrie_node_t * | node, | |
| const str * | scan_prefix, | |||
| flag_t | flags, | |||
| flag_t | mask, | |||
| const str * | full_prefix, | |||
| int | max_targets, | |||
| double | prob, | |||
| const str * | rewrite_hostpart, | |||
| int | strip, | |||
| const str * | rewrite_local_prefix, | |||
| const str * | rewrite_local_suffix, | |||
| int | status, | |||
| int | hash_index, | |||
| int | backup, | |||
| int * | backed_up, | |||
| const str * | comment | |||
| ) |
Adds the given route information to the prefix tree identified by node. scan_prefix identifies the number for which the information is. The rewrite_* parameters define what to do in case of a match. prob gives the probability with which this rule applies if there are more than one for a given prefix.
| node | the root of the routing tree | |
| scan_prefix | the prefix for which to add the rule (must not contain non-digits) | |
| flags | user defined flags | |
| mask | mask for user defined flags | |
| full_prefix | the whole scan prefix | |
| max_targets | the number of targets | |
| prob | the weight of the rule | |
| rewrite_hostpart | the rewrite_host of the rule | |
| strip | the number of digits to be stripped off userpart before prepending prefix | |
| rewrite_local_prefix | the rewrite prefix | |
| rewrite_local_suffix | the rewrite suffix | |
| status | the status of the rule | |
| hash_index | the hash index of the rule | |
| backup | indicates if the route is backed up by another. only useful if status==0, if set, it is the hash value of another rule | |
| backed_up | an -1-termintated array of hash indices of the route for which this route is backup | |
| comment | a comment for the route rule |
Definition at line 149 of file cr_domain.c.
References add_route_flags(), add_route_rule(), cr_match_mode, _str::len, LM_ERR, NULL, and _str::s.
Referenced by add_route().
| int compare_domain_data | ( | const void * | v1, | |
| const void * | v2 | |||
| ) |
Compares the IDs of two domain data structures. A NULL pointer is always greater than any ID.
Definition at line 232 of file cr_domain.c.
References domain_data_t::id, and NULL.
Referenced by get_domain_data(), get_domain_data_or_add(), and reload_route_data().
| struct domain_data_t* create_domain_data | ( | int | domain_id, | |
| str * | domain_name | |||
| ) | [read] |
Create a new domain in shared memory and set it up.
| domain_id | the id of the domain | |
| domain_name | the name of the domain |
Definition at line 81 of file cr_domain.c.
References cr_match_mode, domain_data_t::failure_tree, domain_data_t::id, domain_data_t::name, NULL, shm_free, shm_malloc(), SHM_MEM_ERROR, and domain_data_t::tree.
Referenced by get_domain_data_or_add().
| void destroy_domain_data | ( | struct domain_data_t * | domain_data | ) |
Destroys the given domain and frees the used memory.
| domain_data | the to the structure to be destroyed. |
| domain_data | the structure to be destroyed. |
Definition at line 108 of file cr_domain.c.
References cr_match_mode, destroy_failure_route_rule_list(), destroy_route_flags_list(), domain_data_t::failure_tree, shm_free, and domain_data_t::tree.
Referenced by destroy_carrier_data(), and get_domain_data_or_add().
1.5.6