Contains the functions to manage routing domains. More...
#include "../../str.h"#include "../../flags.h"#include "../../lib/trie/dtrie.h"

Go to the source code of this file.
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 | |||
| ) |
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(), dtrie_contains(), dtrie_insert(), _str::len, 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 | |||
| ) |
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(), dtrie_contains(), dtrie_insert(), _str::len, and _str::s.
Referenced by add_route().


| int compare_domain_data | ( | const void * | v1, | |
| const void * | v2 | |||
| ) |
A NULL pointer is always greater than any ID.
Definition at line 232 of file cr_domain.c.
References domain_data_t::id.
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] |
| domain_id | the id of the domain | |
| domain_name | the name of the domain |
Definition at line 81 of file cr_domain.c.
References dtrie_destroy(), dtrie_init(), domain_data_t::failure_tree, domain_data_t::id, domain_data_t::name, and domain_data_t::tree.
Referenced by get_domain_data_or_add().


| void destroy_domain_data | ( | struct domain_data_t * | domain_data | ) |
| 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 destroy_failure_route_rule_list(), destroy_route_flags_list(), dtrie_destroy(), domain_data_t::failure_tree, and domain_data_t::tree.
Referenced by destroy_carrier_data(), and get_domain_data_or_add().


1.7.1