File rp/rp_tree.c

  $Revision: 1.9 $

Radix payload (rp) - user level functions for storing data in radix trees
rp_load = user level tree maintenance (knows about registries and attributes)
Status: NOT REVIEWED, TESTED
Design and implementation by: Marek Bukowy

Included Files


Preprocessor definitions

#define RP_IMPL

Global Variable Lock

pthread_mutex_t Lock
Included from /home/shane/release/RIP/include/ca_defs.h
Visible in:  aa/aa.c
   ac/ac_persistence.c
   ac/access_control.c
   au/AU_util.c
   ca/ca_configFns.c
   ca/ca_initFn.c
   ca/ca_sanityCheck.c
   ca/ca_sourceLoader.c
   ca/ca_values.c
   co/constants.c
   df/defs.c
   er/er.c
   er/er_arrays.c
   er/er_macro.c
   er/er_paths.c
   er/er_print.c
   ip/ip.c
   ma/bitmask.c
   mm/mm.c
   nh/nh.c
   pa/gpg.c
   pa/spawn.c
   pc/pc_commands.c
   pc/protocol_config.c
   pm/pm_serials.c
   pm/protocol_mirror.c
   pr/properties.c
   pw/protocol_whois.c
   qc/mg_getopt.c
   qc/query_command.c
   qi/query_instructions.c
   rp/rp_convert.c
   rp/rp_load.c
   rp/rp_search.c
   rp/rp_tree.c
Used in: ca_get_adminIntElement()ca/ca_configFns.c
  ca_get_adminStrElement()ca/ca_configFns.c
  ca_get_boolean()ca/ca_configFns.c
  ca_get_dirlist()ca/ca_configFns.c
  ca_get_int()ca/ca_configFns.c
  ca_get_string()ca/ca_configFns.c
  ca_set_boolean()ca/ca_configFns.c
  ca_srchandle2Intelement()ca/ca_configFns.c
  ca_srchandle2Strelement()ca/ca_configFns.c

Global Variable rx_forest_rwlock

rw_lock_t rx_forest_rwlock
Included from /home/shane/release/RIP/include/rp.h
Visible in:  aa/aa.c
   ac/ac_persistence.c
   ac/access_control.c
   au/AU_util.c
   ca/ca_configFns.c
   ca/ca_initFn.c
   ca/ca_sanityCheck.c
   ca/ca_sourceLoader.c
   ca/ca_values.c
   co/constants.c
   df/defs.c
   er/er.c
   er/er_arrays.c
   er/er_macro.c
   er/er_paths.c
   er/er_print.c
   ip/ip.c
   ma/bitmask.c
   mm/mm.c
   nh/nh.c
   pa/gpg.c
   pa/spawn.c
   pc/pc_commands.c
   pc/protocol_config.c
   pm/pm_serials.c
   pm/protocol_mirror.c
   pr/properties.c
   pw/protocol_whois.c
   qc/mg_getopt.c
   qc/query_command.c
   qi/query_instructions.c
   rp/rp_convert.c
   rp/rp_load.c
   rp/rp_search.c
   rp/rp_tree.c
Used in: RP_tree_add()rp/rp_tree.c
  RP_tree_get()rp/rp_tree.c

Global Variable rx_forest

GList* rx_forest
Included from /home/shane/release/RIP/include/rp.h
Visible in:  aa/aa.c
   ac/ac_persistence.c
   ac/access_control.c
   au/AU_util.c
   ca/ca_configFns.c
   ca/ca_initFn.c
   ca/ca_sanityCheck.c
   ca/ca_sourceLoader.c
   ca/ca_values.c
   co/constants.c
   df/defs.c
   er/er.c
   er/er_arrays.c
   er/er_macro.c
   er/er_paths.c
   er/er_print.c
   ip/ip.c
   ma/bitmask.c
   mm/mm.c
   nh/nh.c
   pa/gpg.c
   pa/spawn.c
   pc/pc_commands.c
   pc/protocol_config.c
   pm/pm_serials.c
   pm/protocol_mirror.c
   pr/properties.c
   pw/protocol_whois.c
   qc/mg_getopt.c
   qc/query_command.c
   qi/query_instructions.c
   rp/rp_convert.c
   rp/rp_load.c
   rp/rp_search.c
   rp/rp_tree.c
Used in: RP_tree_add()rp/rp_tree.c
  RP_tree_get()rp/rp_tree.c

Global Function RP_init_trees()

er_ret_t RP_init_trees ( rp_regid_t reg_id )
Prototyped in: /home/shane/release/RIP/include/rp.h
Calls: NOERR()er/er.c
  rp_init_attr_tree()rp/rp_tree.c
Called by: set_initrx()pc/pc_commands.c

Global Function RP_tree_add()

       put into LL of trees; handle alloc err ??? 

since other threads are supposed to be reading already, must create the tree locked and observe the forest mutex.
er_ret_t RP_tree_add ( rp_regid_t reg_id, rp_attr_t attr, char* prefixstr, rx_mem_mt mem_mode, rx_subtree_mt subtrees )
rp_regid_t reg_id
id of the registry
rp_attr_t attr
extra tree id (within the same registry/space/family
char* prefixstr
prefix the tree will cover (string)
rx_mem_mt mem_mode
 
rx_subtree_mt subtrees
one of NONE, AUTO, HAND
Prototyped in: /home/shane/release/RIP/include/rp.h
Calls: RP_attr2fam()rp/rp_convert.c
  RP_tree_del()rp/rp_tree.c
  RP_tree_get()rp/rp_tree.c
  RX_tree_cre(), TH_acquire_write_lockw(), TH_release_write_lockw(), UT_free_real(), UT_malloc_real(), g_list_append()
Called by: rp_init_attr_tree()rp/rp_tree.c
References Variables: rx_forestrp/rp_tree.c
  rx_forest_rwlockrp/rp_tree.c

Global Function RP_tree_del()

  finds a tree and deletes its contents
  the tree itself is not deleted !

Returns: RX_OK or RX_NOTREE if no such tree can be found.
er_ret_t RP_tree_del ( rx_tree_t* tree )
Prototyped in: /home/shane/release/RIP/include/rp.h
Calls: ER_inf_va()er/er.c
  ER_perror()er/er.c
  rx_delete_tree()
Called by: RP_tree_add()rp/rp_tree.c

Global Function RP_tree_get()

  finds a tree matching the specified criteria(registry+space+family+tid).

MT-note: locks/unlocks forest (still to be done)
Returns: RX_OK or RX_NOTREE if no such tree can be found.
er_ret_t RP_tree_get ( rx_tree_t** treeptr, rp_regid_t reg_id, ip_space_t spc_id, rp_attr_t attr )
rx_tree_t** treeptr
answer goes here, please
rp_regid_t reg_id
id of the registry
ip_space_t spc_id
type of space (ipv4/ipv6)
rp_attr_t attr
extra tree id (within the same reg/spc/fam
Prototyped in: /home/shane/release/RIP/include/rp.h
Calls: ER_dbg_va()er/er.c
  TH_acquire_read_lockw(), TH_release_read_lockw(), g_list_first()
Called by: RP_asc_search()rp/rp_search.c
  RP_sql_load_attr_space()rp/rp_load.c
  RP_tree_add()rp/rp_tree.c
References Variables: rx_forestrp/rp_tree.c
  rx_forest_rwlockrp/rp_tree.c

Global Function rp_init_attr_tree()

er_ret_t rp_init_attr_tree ( rp_regid_t reg_id, rp_attr_t attr )
Calls: RP_attr2spc()rp/rp_convert.c
  RP_tree_add()rp/rp_tree.c
Called by: RP_init_trees()rp/rp_tree.c

Local Function asctime_r()

static char* asctime_r ( const struct tm* __tm, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_asctime_r()

Local Function ctime_r()

static char* ctime_r ( const time_t* __time, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_ctime_r()

Local Function getlogin_r()

static int getlogin_r ( char* __name, int __len )
Included from: /usr/include/unistd.h
Calls: __posix_getlogin_r()

Local Function readdir_r()

static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )
Included from: /usr/include/dirent.h
Calls: __posix_readdir_r()

Local Function sigwait()

static int sigwait ( const sigset_t* __setp, int* __signo )
Included from: /usr/include/signal.h
Calls: __posix_sigwait()

Local Function ttyname_r()

static int ttyname_r ( int __fildes, char* __buf, size_t __size )
Included from: /usr/include/unistd.h
Calls: __posix_ttyname_r()