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


Go to the source code of this file.
Data Structures | |
| struct | failure_route_rule |
| struct | route_flags |
| struct | route_rule |
| struct | route_rule_p_list |
Functions | |
| int | add_backup_rule (struct route_rule *rule, struct route_rule *backup) |
| struct failure_route_rule * | add_failure_route_rule (struct failure_route_rule **frr_head, const str *prefix, const str *host, const str *reply_code, flag_t flags, flag_t mask, const int next_domain, const str *comment) |
| struct route_flags * | add_route_flags (struct route_flags **rf_head, const flag_t flags, const flag_t mask) |
| int | add_route_rule (struct route_flags *rf, const str *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) |
| void | destroy_failure_route_rule (struct failure_route_rule *frr) |
| void | destroy_route_flags (struct route_flags *rf) |
| void | destroy_route_rule (struct route_rule *rr) |
| struct route_rule * | find_auto_backup (struct route_flags *rf, struct route_rule *rule) |
| struct route_rule * | find_rule_by_hash (struct route_flags *rf, int hash) |
| struct route_rule * | find_rule_by_host (struct route_flags *rf, str *host) |
| int | remove_backed_up (struct route_rule *rule) |
Definition in file cr_rule.h.
| int add_backup_rule | ( | struct route_rule * | rule, | |
| struct route_rule * | backup | |||
| ) |
Definition at line 444 of file cr_rule.c.
References route_rule::backed_up, route_rule::backup, route_rule::hash_index, route_rule_p_list::hash_index, LM_ERR, route_rule_p_list::next, NULL, route_rule_p_list::rr, shm_malloc(), SHM_MEM_ERROR, and route_rule::status.
Referenced by update_route_data_recursor().
| struct failure_route_rule* add_failure_route_rule | ( | struct failure_route_rule ** | frr_head, | |
| const str * | prefix, | |||
| const str * | host, | |||
| const str * | reply_code, | |||
| flag_t | flags, | |||
| flag_t | mask, | |||
| const int | next_domain, | |||
| const str * | comment | |||
| ) | [read] |
Adds a failure route rule to rule list. prefix, host, reply_code, and comment must not contain NULL pointers.
| frr_head | pointer to the head of the failure route rule list, might be changed during insert | |
| 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 | |
| comment | a comment for the route rule |
Definition at line 339 of file cr_rule.c.
References failure_route_rule::comment, destroy_failure_route_rule(), failure_rule_prio_cmp(), failure_route_rule::flags, failure_route_rule::host, failure_route_rule::mask, failure_route_rule::next, failure_route_rule::next_domain, NULL, failure_route_rule::reply_code, shm_malloc(), SHM_MEM_ERROR, and shm_str_dup().
Referenced by add_failure_route_to_tree().
| struct route_flags* add_route_flags | ( | struct route_flags ** | rf_head, | |
| const flag_t | flags, | |||
| const flag_t | mask | |||
| ) | [read] |
Try to find a matching route_flags struct in rt and return it, add it if not found.
| rf_head | pointer to the head of the route flags list, might be changed during insert | |
| flags | user defined flags | |
| mask | mask for user defined flags |
| rf_head | pointer to the head of the route flags list, might be changed during insert. | |
| flags | user defined flags | |
| mask | mask for user defined flags |
Definition at line 206 of file cr_rule.c.
References route_flags::flags, route_flags::mask, route_flags::next, NULL, shm_malloc(), and SHM_MEM_ERROR.
Referenced by add_route_to_tree().
| int add_route_rule | ( | struct route_flags * | rf, | |
| const str * | 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 a route rule to rf
| rf | the current route_flags struct | |
| 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 NULL-termintated array of hash indices of the route for which this route is backup | |
| comment | a comment for the route rule |
| rf | the current route_flags struct | |
| 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 strip value of the rule | |
| 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 NULL-termintated array of hash indices of the route for which this route is backup | |
| comment | a comment for the route rule |
Definition at line 59 of file cr_rule.c.
References route_rule::backed_up, route_rule::backup, route_rule::comment, destroy_route_rule(), route_rule_p_list::hash_index, route_rule::hash_index, route_rule::host, LM_INFO, route_rule::local_prefix, route_rule::local_suffix, route_flags::max_targets, route_rule::next, route_rule_p_list::next, NULL, route_rule::orig_prob, route_rule::prefix, route_rule::prob, route_flags::rule_list, shm_malloc(), SHM_MEM_ERROR, shm_str_dup(), route_rule::status, and route_rule::strip.
Referenced by add_route_to_tree().
| void destroy_failure_route_rule | ( | struct failure_route_rule * | frr | ) |
Destroys failure route rule frr by freeing all its memory.
| frr | route rule to be destroyed |
Definition at line 400 of file cr_rule.c.
References failure_route_rule::comment, failure_route_rule::host, failure_route_rule::prefix, failure_route_rule::reply_code, _str::s, and shm_free.
Referenced by add_failure_route_rule(), and destroy_failure_route_rule_list().
| void destroy_route_flags | ( | struct route_flags * | rf | ) |
Destroys route_flags in shared memory by freing all its memory.
| rf | route_flags struct to be destroyed |
Definition at line 251 of file cr_rule.c.
References destroy_route_rule(), route_rule::next, NULL, route_flags::rule_list, route_flags::rules, and shm_free.
Referenced by destroy_route_flags_list().
| void destroy_route_rule | ( | struct route_rule * | rr | ) |
Destroys route rule rr by freeing all its memory.
| rr | route rule to be destroyed |
Definition at line 166 of file cr_rule.c.
References route_rule::backed_up, route_rule::backup, route_rule::comment, route_rule::host, route_rule::local_prefix, route_rule::local_suffix, route_rule_p_list::next, route_rule::prefix, _str::s, and shm_free.
Referenced by add_route_rule(), destroy_route_flags(), and update_route_data_recursor().
| struct route_rule* find_auto_backup | ( | struct route_flags * | rf, | |
| struct route_rule * | rule | |||
| ) | [read] |
Definition at line 516 of file cr_rule.c.
References route_rule::backed_up, route_rule::hash_index, route_rule::next, NULL, route_flags::rule_list, and route_rule::status.
Referenced by update_route_data_recursor().
| struct route_rule* find_rule_by_hash | ( | struct route_flags * | rf, | |
| int | hash | |||
| ) | [read] |
Definition at line 418 of file cr_rule.c.
References route_rule::hash_index, route_rule::next, NULL, and route_flags::rule_list.
Referenced by fixup_rule_backup(), and update_route_data_recursor().
| struct route_rule* find_rule_by_host | ( | struct route_flags * | rf, | |
| str * | host | |||
| ) | [read] |
Definition at line 431 of file cr_rule.c.
References route_rule::host, route_rule::next, NULL, route_flags::rule_list, and str_strcmp().
Referenced by update_route_data_recursor().
| int remove_backed_up | ( | struct route_rule * | rule | ) |
Definition at line 489 of file cr_rule.c.
References route_rule::backed_up, route_rule::backup, route_rule::hash_index, route_rule_p_list::hash_index, route_rule_p_list::next, NULL, route_rule_p_list::rr, and shm_free.
Referenced by update_route_data_recursor().
1.5.6