This file contains functions to enable named views that can hold local zone authority service. More...
Data Structures | |
struct | views |
Views storage, shared. More... | |
struct | view |
View. More... | |
Functions | |
struct views * | views_create (void) |
Create views storage. | |
void | views_delete (struct views *v) |
Delete views storage. | |
int | views_apply_cfg (struct views *v, struct config_file *cfg) |
Apply config settings; Takes care of locking. | |
int | view_cmp (const void *v1, const void *v2) |
Compare two view entries in rbtree. | |
void | view_delete (struct view *v) |
Delete one view. | |
void | views_print (struct views *v) |
Debug helper. | |
struct view * | views_find_view (struct views *vs, const char *name, int write) |
Find a view by name. | |
size_t | views_get_mem (struct views *vs) |
Calculate memory usage of views. | |
size_t | view_get_mem (struct view *v) |
Calculate memory usage of view. | |
void | views_swap_tree (struct views *vs, struct views *data) |
Swap internal tree with preallocated entries. | |
This file contains functions to enable named views that can hold local zone authority service.
struct views * views_create | ( | void | ) |
Create views storage.
References views::lock, rbtree_init(), view_cmp(), and views::vtree.
Referenced by daemon_fork(), fr_construct_from_config(), respip_view_conf_actions_test(), respip_view_conf_data_test(), and view_and_respipchecks().
void views_delete | ( | struct views * | v | ) |
Delete views storage.
v | views to delete. |
References views::lock, traverse_postorder(), and views::vtree.
Referenced by daemon_cleanup(), fr_construct_clear(), respip_view_conf_actions_test(), respip_view_conf_data_test(), and view_and_respipchecks().
int views_apply_cfg | ( | struct views * | v, |
struct config_file * | cfg | ||
) |
Apply config settings; Takes care of locking.
v | view is set up. |
cfg | config data. |
References cfg_str2list_insert(), view::isfirst, config_view::isfirst, config_file::local_data, config_view::local_data, view::local_zones, config_file::local_zones, config_view::local_zones, local_zones_apply_cfg(), local_zones_create(), config_file::local_zones_disable_default, config_file::local_zones_nodefault, config_view::local_zones_nodefault, view::lock, log_err(), config_view::name, config_view::next, config_strlist::next, config_strlist::str, config_file::views, and views_enter_view_name().
Referenced by daemon_fork(), fr_construct_from_config(), respip_view_conf_actions_test(), respip_view_conf_data_test(), and view_and_respipchecks().
int view_cmp | ( | const void * | v1, |
const void * | v2 | ||
) |
Compare two view entries in rbtree.
Sort canonical.
v1 | view 1 |
v2 | view 2 |
References view::name.
Referenced by fptr_whitelist_rbtree_cmp(), and views_create().
void view_delete | ( | struct view * | v | ) |
Delete one view.
v | view to delete. |
References view::local_zones, local_zones_delete(), view::lock, view::name, view::respip_set, and respip_set_delete().
Referenced by views_enter_view_name().
void views_print | ( | struct views * | v | ) |
Debug helper.
Print all views Takes care of locking.
v | the views tree |
Find a view by name.
vs | views |
name | name of the view we are looking for |
write | 1 for obtaining write lock on found view, 0 for read lock |
Find a view by name.
References rbnode_type::key, views::lock, view::lock, view::name, view::node, rbtree_search(), and views::vtree.
Referenced by acl_list_view_cfg(), acl_view_tag_checks(), do_view_data_add(), do_view_data_remove(), do_view_datas_add(), do_view_datas_remove(), do_view_list_local_data(), do_view_list_local_zones(), do_view_zone_add(), do_view_zone_remove(), respip_rewrite_reply(), respip_view_conf_actions_test(), respip_view_conf_data_test(), and respip_views_apply_cfg().
size_t views_get_mem | ( | struct views * | vs | ) |
Calculate memory usage of views.
vs | the views tree. The routine locks and unlocks the structure for reading. |
References views::lock, RBTREE_FOR, view_get_mem(), and views::vtree.
Referenced by fr_printmem().
size_t view_get_mem | ( | struct view * | v | ) |
Calculate memory usage of view.
v | the view. The routine locks and unlocks the structure for reading. |
References getmem_str(), view::local_zones, local_zones_get_mem(), view::lock, view::name, view::respip_set, and respip_set_get_mem().
Referenced by views_get_mem().
Swap internal tree with preallocated entries.
Caller should manage the locks.
vs | views tree |
data | preallocated information. |
References rbtree_type::count, rbtree_type::root, and views::vtree.
Referenced by fr_reload_config().