Functions

cr_rule.c File Reference

Contains the functions to manage routing rule data. More...

#include "../../ut.h"
#include "cr_rule.h"
Include dependency graph for cr_rule.c:

Go to the source code of this file.

Functions


Detailed Description

Definition in file cr_rule.c.


Function Documentation

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]

prefix, host, reply_code, and comment must not contain NULL pointers.

Parameters:
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
Returns:
pointer to the failure_route_rul struct on success, NULL on failure.
See also:
add_failure_route_to_tree()

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, and failure_route_rule::reply_code.

Referenced by add_failure_route_to_tree().

Here is the call graph for this function:

Here is the caller graph for this function:

struct route_flags* add_route_flags ( struct route_flags **  rf_head,
const flag_t  flags,
const flag_t  mask 
) [read]
Parameters:
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
Returns:
pointer to the route_flags struct on success, NULL on failure.

Definition at line 206 of file cr_rule.c.

References route_flags::flags, route_flags::mask, and route_flags::next.

Referenced by add_route_to_tree().

Here is the caller graph for this function:

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 
)

prefix, rewrite_hostpart, rewrite_local_prefix, rewrite_local_suffix, and comment must not contain NULL pointers.

Parameters:
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
Returns:
0 on success, -1 on failure
See also:
add_route_to_tree()

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::hash_index, route_rule::host, route_rule::local_prefix, route_rule::local_suffix, route_flags::max_targets, route_rule::next, route_rule::orig_prob, route_rule::prefix, route_rule::prob, route_flags::rule_list, route_rule::status, and route_rule::strip.

Referenced by add_route_to_tree().

Here is the call graph for this function:

Here is the caller graph for this function:

void destroy_failure_route_rule ( struct failure_route_rule frr  ) 
Parameters:
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, and _str::s.

Referenced by add_failure_route_rule(), and destroy_failure_route_rule_list().

Here is the caller graph for this function:

void destroy_route_flags ( struct route_flags rf  ) 
Parameters:
rf route_flags struct to be destroyed

Definition at line 251 of file cr_rule.c.

References destroy_route_rule(), route_rule::next, route_flags::rule_list, and route_flags::rules.

Referenced by destroy_route_flags_list().

Here is the call graph for this function:

Here is the caller graph for this function:

void destroy_route_rule ( struct route_rule rr  ) 
Parameters:
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::prefix, and _str::s.

Referenced by add_route_rule(), destroy_route_flags(), and update_route_data_recursor().

Here is the caller graph for this function:

static int failure_rule_prio_cmp ( struct failure_route_rule frr1,
struct failure_route_rule frr2 
) [static]
Parameters:
frr1 first failure rule
frr2 second failure rule
Returns:
0 if frr1 and frr2 have the same priority, -1 if frr1 has higher priority than frr2, 1 if frr1 has lower priority than frr2.
See also:
add_failure_route_to_tree()

Definition at line 277 of file cr_rule.c.

References failure_route_rule::host, _str::len, failure_route_rule::mask, failure_route_rule::reply_code, and _str::s.

Referenced by add_failure_route_rule().

Here is the caller graph for this function: