Cross reference for ac/ac_persistence.c of index.

# File ac/ac_persistence.c

      $Revision: 1.7 $

      Access control (AC).  ac_persistence.c - functions to make the access
      control tree persistent.

      Status: NOT REVIEWED, NOT TESTED, COMPLETE

      Implementation by: Tiago Antao

## Included Files

- `#include ";/home/shane/release/RIP/include/rip.h";`
  - `#include </home/shane/release/RIP/include/config.h>`
  - `#include <sys/param.h>`
  - `#include <glib.h>`
  - `#include ";/home/shane/release/RIP/include/AU_util.h";`
    - `#include <stdio.h>`
    - `#include <stdlib.h>`
    - `#include <string.h>`
    - `#include <sys/types.h>`
    - `#include <unistd.h>`
    - `#include <regex.h>`
    - `#include <glib.h>`
  - `#include ";/home/shane/release/RIP/include/aa.h";`
    - `#include ";/home/shane/release/RIP/include/iproutines.h";`
      - `#include <sys/types.h>`
      - `#include <glib.h>`
      - `#include </home/shane/release/RIP/include/inet6def.h>`
      - `#include </home/shane/release/RIP/include/erroutines.h>`
  - `#include ";/home/shane/release/RIP/include/access_control.h";`
    - `#include ";/home/shane/release/RIP/include/timediff.h";`
      - `#include <sys/time.h>`
    - `#include ";/home/shane/release/RIP/include/erroutines.h";`
    - `#include ";/home/shane/release/RIP/include/iproutines.h";`
    - `#include ";/home/shane/release/RIP/include/rxroutines.h";`
      - `#include <glib.h>`
      - `#include <pthread.h>`
      - `#include <stubs.h>`
      - `#include </home/shane/release/RIP/include/memwrap.h>`
      - `#include <stdio.h>`
      - `#include <iproutines.h>`
      - `#include <erroutines.h>`
      - `#include ";/home/shane/release/RIP/include/sk.h";`
        - `#include ";/home/shane/release/RIP/include/stubs.h";`
        - `#include <sys/time.h>`
        - `#include <unistd.h>`
        - `#include <sys/types.h>`
        - `#include <sys/socket.h>`
        - `#include <netinet/in.h>`
        - `#include <netdb.h>`
        - `#include <pthread.h>`
        - `#include <stdlib.h>`
        - `#include <errno.h>`
        - `#include <fcntl.h>`
        - `#include <signal.h>`
        - `#include <stdio.h>`
        - `#include ";/home/shane/release/RIP/include/iproutines.h";`
      - `#include ";/home/shane/release/RIP/include/thread.h";`
    - `#include ";/home/shane/release/RIP/include/mysql_driver.h";`
      - `#include ";/usr/local/mysql/include/mysql/mysql.h";`
        - `#include <sys/types.h>`
        - `#include ";/usr/local/mysql/include/mysql/mysql_com.h";`
        - `#include ";/usr/local/mysql/include/mysql/mysql_version.h";`
      - `#include ";/usr/local/mysql/include/mysql/mysqld_error.h";`
      - `#include ";/home/shane/release/RIP/include/erroutines.h";`
  - `#include ";/home/shane/release/RIP/include/bitmask.h";`
  - `#include ";/home/shane/release/RIP/include/ca_adminAttribs.h";`
  - `#include ";/home/shane/release/RIP/include/ca_configFns.h";`
    - `#include ";/home/shane/release/RIP/include/ca_defs.h";`
      - `#include <pthread.h>`
      - `#include <glib.h>`
    - `#include <memwrap.h>`
    - `#include <erroutines.h>`
  - `#include ";/home/shane/release/RIP/include/ca_defs.h";`
  - `#include ";/home/shane/release/RIP/include/ca_dictionary.h";`
  - `#include ";/home/shane/release/RIP/include/ca_macros.h";`
    - `#include ";/home/shane/release/RIP/include/ca_adminAttribs.h";`
  - `#include ";/home/shane/release/RIP/include/ca_srcAttribs.h";`
  - `#include ";/home/shane/release/RIP/include/comparisons.h";`
  - `#include ";/home/shane/release/RIP/include/constants.h";`
    - `#include <glib.h>`
  - `#include ";/home/shane/release/RIP/include/defs.h";`
    - `#include <glib.h>`
    - `#include ";/home/shane/release/RIP/include/bitmask.h";`
    - `#include ";/home/shane/release/RIP/include/DF_class_enum.def";`
    - `#include ";/home/shane/release/RIP/include/DF_class_mask.def";`
    - `#include ";/home/shane/release/RIP/include/DF_attribute_enum.def";`
    - `#include ";/home/shane/release/RIP/include/DF_attribute_inv_attr_mask.def";`
    - `#include ";/home/shane/release/RIP/include/which_keytypes.h";`
      - `#include ";/home/shane/release/RIP/include/bitmask.h";`
    - `#include ";/home/shane/release/RIP/include/iproutines.h";`
    - `#include ";/home/shane/release/RIP/include/rxroutines.h";`
  - `#include ";/home/shane/release/RIP/include/er_arrays.h";`
    - `#include ";/home/shane/release/RIP/include/erroutines.h";`
  - `#include ";/home/shane/release/RIP/include/er_aspects.h";`
  - `#include ";/home/shane/release/RIP/include/er_facilities.h";`
  - `#include ";/home/shane/release/RIP/include/er_formats.h";`
  - `#include ";/home/shane/release/RIP/include/er_macro.h";`
    - `#include ";/home/shane/release/RIP/include/sk.h";`
  - `#include ";/home/shane/release/RIP/include/er_paths.h";`
    - `#include <sys/param.h>`
    - `#include <glib.h>`
  - `#include ";/home/shane/release/RIP/include/er_yacc_helper.h";`
  - `#include ";/home/shane/release/RIP/include/erroutines.h";`
  - `#include ";/home/shane/release/RIP/include/fdwrap.h";`
    - `#include <stdio.h>`
  - `#include ";/home/shane/release/RIP/include/mg_getopt.h";`
  - `#include ";/home/shane/release/RIP/include/globaldefs.h";`
  - `#include ";/home/shane/release/RIP/include/gpg.h";`
    - `#include <netdb.h>`
    - `#include <unistd.h>`
    - `#include ";/home/shane/release/RIP/include/mail_parser.h";`
      - `#include ";/home/shane/release/RIP/include/gpg.h";`
      - `#include ";/home/shane/release/RIP/include/memwrap.h";`
  - `#include ";/home/shane/release/RIP/include/inet6def.h";`
  - `#include ";/home/shane/release/RIP/include/iproutines.h";`
  - `#include ";/home/shane/release/RIP/include/mail_parser.h";`
  - `#include ";/home/shane/release/RIP/include/memwrap.h";`
  - `#include ";/home/shane/release/RIP/include/mm.h";`
    - `#include ";/home/dbase/src/orange/imap-2001a/c-client/mail.h";`
      - `#include ";/home/dbase/src/orange/imap-2001a/c-client/linkage.h";`
    - `#include ";/home/dbase/src/orange/imap-2001a/c-client/osdep.h";`
      - `#include <string.h>`
      - `#include <sys/types.h>`
      - `#include <stdlib.h>`
      - `#include <dirent.h>`
      - `#include <fcntl.h>`
      - `#include <unistd.h>`
      - `#include <time.h>`
      - `#include <utime.h>`
      - `#include <syslog.h>`
      - `#include <sys/file.h>`
      - `#include <ustat.h>`
      - `#include ";/home/dbase/src/orange/imap-2001a/c-client/env_unix.h";`
        - `#include ";/home/dbase/src/orange/imap-2001a/c-client/env.h";`
      - `#include ";/home/dbase/src/orange/imap-2001a/c-client/fs.h";`
      - `#include ";/home/dbase/src/orange/imap-2001a/c-client/ftl.h";`
      - `#include ";/home/dbase/src/orange/imap-2001a/c-client/nl.h";`
      - `#include ";/home/dbase/src/orange/imap-2001a/c-client/tcp.h";`
      - `#include ";/home/dbase/src/orange/imap-2001a/c-client/flocksim.h";`
    - `#include ";/home/shane/release/RIP/include/gpg.h";`
    - `#include ";/home/shane/release/RIP/include/mail_parser.h";`
    - `#include ";/home/shane/release/RIP/include/memwrap.h";`
    - `#include ";/usr/local/include/glib-1.2/glib.h";`
  - `#include ";/home/shane/release/RIP/include/mysql_driver.h";`
  - `#include ";/home/shane/release/RIP/include/nh.h";`
    - `#include <mysql_driver.h>`
  - `#include ";/home/shane/release/RIP/include/notification.h";`
    - `#include <stdarg.h>`
    - `#include <stdio.h>`
    - `#include <strings.h>`
    - `#include <unistd.h>`
    - `#include <stdlib.h>`
    - `#include <time.h>`
    - `#include <glib.h>`
    - `#include ";/home/shane/release/RIP/include/UP_util.h";`
      - `#include ";/home/shane/release/RIP/include/syntax_api.h";`
  - `#include ";/home/shane/release/RIP/include/numconv.h";`
  - `#include ";/home/shane/release/RIP/include/pc_commands.h";`
  - `#include ";/home/shane/release/RIP/include/properties.h";`
  - `#include ";/home/shane/release/RIP/include/protocol_config.h";`
  - `#include ";/home/shane/release/RIP/include/protocol_mirror.h";`
    - `#include <glib.h>`
    - `#include ";/home/shane/release/RIP/include/mysql_driver.h";`
    - `#include ";/home/shane/release/RIP/include/iproutines.h";`
    - `#include ";/home/shane/release/RIP/include/aa.h";`
      - `#include ";/home/shane/release/RIP/include/iproutines.h";`
  - `#include ";/home/shane/release/RIP/include/protocol_whois.h";`
    - `#include ";/home/shane/release/RIP/include/query_command.h";`
      - `#include <glib.h>`
      - `#include ";/home/shane/release/RIP/include/bitmask.h";`
      - `#include ";/home/shane/release/RIP/include/sk.h";`
  - `#include ";/home/shane/release/RIP/include/query_command.h";`
  - `#include ";/home/shane/release/RIP/include/query_instructions.h";`
    - `#include ";/home/shane/release/RIP/include/rxroutines.h";`
    - `#include ";/home/shane/release/RIP/include/iproutines.h";`
    - `#include ";/home/shane/release/RIP/include/mysql_driver.h";`
    - `#include ";/home/shane/release/RIP/include/query_command.h";`
    - `#include ";/home/shane/release/RIP/include/defs.h";`
    - `#include ";/home/shane/release/RIP/include/which_keytypes.h";`
    - `#include ";/home/shane/release/RIP/include/access_control.h";`
    - `#include ";/home/shane/release/RIP/include/ca_configFns.h";`
    - `#include ";/home/shane/release/RIP/include/ca_dictionary.h";`
    - `#include ";/home/shane/release/RIP/include/ca_macros.h";`
    - `#include ";/home/shane/release/RIP/include/ca_srcAttribs.h";`
  - `#include ";/home/shane/release/RIP/include/rp.h";`
    - `#include <stddef.h>`
    - `#include <glib.h>`
    - `#include <pthread.h>`
    - `#include <defs.h>`
    - `#include <iproutines.h>`
    - `#include <erroutines.h>`
    - `#include <rxroutines.h>`
    - `#include <mysql_driver.h>`
    - `#include ";/home/shane/release/RIP/include/ca_defs.h";`
    - `#include <thread.h>`
  - `#include ";/home/shane/release/RIP/include/rxroutines.h";`
  - `#include ";/home/shane/release/RIP/include/server.h";`
  - `#include ";/home/shane/release/RIP/include/sk.h";`
  - `#include ";/home/shane/release/RIP/include/stubs.h";`
  - `#include ";/home/shane/release/RIP/include/syntax_api.h";`
  - `#include ";/home/shane/release/RIP/include/ta.h";`
    - `#include <glib.h>`
    - `#include <pthread.h>`
    - `#include <stdio.h>`
    - `#include ";/home/shane/release/RIP/include/stubs.h";`
    - `#include ";/home/shane/release/RIP/include/memwrap.h";`
    - `#include ";/home/shane/release/RIP/include/sk.h";`
    - `#include ";/home/shane/release/RIP/include/timediff.h";`
  - `#include ";/home/shane/release/RIP/include/thread.h";`
  - `#include ";/home/shane/release/RIP/include/timediff.h";`
  - `#include ";/home/shane/release/RIP/include/ud.h";`
  - `#include ";/home/shane/release/RIP/include/ud_int.h";`
    - `#include <stdio.h>`
    - `#include <strings.h>`
    - `#include <glib.h>`
    - `#include <stdlib.h>`
    - `#include <ctype.h>`
    - `#include <unistd.h>`
    - `#include ";/home/shane/release/RIP/include/defs.h";`
    - `#include ";/home/shane/release/RIP/include/mysql_driver.h";`
    - `#include ";/home/shane/release/RIP/include/iproutines.h";`
    - `#include ";/home/shane/release/RIP/include/erroutines.h";`
    - `#include ";/home/shane/release/RIP/include/rp.h";`
    - `#include ";/home/shane/release/RIP/include/nh.h";`
    - `#include ";/home/shane/release/RIP/include/sk.h";`
    - `#include ";/home/shane/release/RIP/include/memwrap.h";`
    - `#include ";/home/shane/release/RIP/include/ca_configFns.h";`
    - `#include ";/home/shane/release/RIP/include/ca_dictionary.h";`
    - `#include ";/home/shane/release/RIP/include/ca_macros.h";`
    - `#include ";/home/shane/release/RIP/include/ca_srcAttribs.h";`
    - `#include ";/home/shane/release/RIP/include/globaldefs.h";`
    - `#include ";/home/shane/release/RIP/include/bitmask.h";`
    - `#include ";/home/shane/release/RIP/include/which_keytypes.h";`
  - `#include ";/home/shane/release/RIP/include/ud_tr.h";`
    - `#include ";/home/shane/release/RIP/include/ud_int.h";`
  - `#include ";/home/shane/release/RIP/include/ut_string.h";`
  - `#include ";/home/shane/release/RIP/include/wh_queries.h";`
    - `#include ";/home/shane/release/RIP/include/sk.h";`
  - `#include ";/home/shane/release/RIP/include/which_keytypes.h";`

- `#include <math.h>`

## Typedef acc_ip

`typedef struct {...} acc_ip`

`struct` |
`{` |
`acc_st acc;` |
`ip_prefix_internal_t ip;` |
`}` |

## Global Variable ac_auto_save

`int ac_auto_save`

Visible in: |  | aa/aa.c
|  | ac/ac_persistence.c
Used in: | AC_persistence_daemon() | ac/ac_persistence.c
| AC_persistence_init() | ac/ac_persistence.c

## 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

## External Variables

oldest_timestamp
`extern ut_timer_t oldest_timestamp`

## Local Variables

save_lock
`static rw_lock_t save_lock`

Used in: | AC_persistence_init()
| AC_persistence_save()

on_save
`static char on_save`

Used in: | AC_persistence_save()

## Global Function AC_acc_copy_l()

`void AC_acc_copy_l ( acc_st* dest, acc_st* src )`

Calls: | memcpy()
Called by: | AC_persistence_get_leaves_hook_l() | ac/ac_persistence.c

## Global Function AC_delete_timestamp_l()

`void AC_delete_timestamp_l ( MYSQL* conn )`

Calls: | SQ_execute_query(), UT_time_getvalue(), ceil(), sprintf()
Called by: | AC_persistence_load() | ac/ac_persistence.c
| AC_persistence_walk_l() | ac/ac_persistence.c
References Variables: | oldest_timestamp

## Global Function AC_persistence_daemon()

`er_ret_t AC_persistence_daemon ( void )`

Prototyped in: | /home/shane/release/RIP/include/access_control.h
Calls: | AC_persistence_save() | ac/ac_persistence.c
| CO_get_do_server(), SV_sleep(), TA_add(), TA_delete(), ca_get_int()
References Variables: | ac_auto_save | ac/ac_persistence.c

## Global Function AC_persistence_get_leaves_hook_l()

`er_ret_t AC_persistence_get_leaves_hook_l ( rx_node_t* node, int level, int node_counter, void* con )`

Calls: | AC_acc_copy_l() | ac/ac_persistence.c
| UT_malloc_real(), g_list_prepend()
Used in: | ac_persistence_get_leaves() | ac/ac_persistence.c

## Global Function AC_persistence_init()

`er_ret_t AC_persistence_init ( void )`

Prototyped in: | /home/shane/release/RIP/include/access_control.h
Calls: | AC_persistence_load() | ac/ac_persistence.c
| TH_init_read_write_lock(), UT_timeget(), ca_get_boolean()
References Variables: | ac_auto_save | ac/ac_persistence.c
| save_lock | ac/ac_persistence.c
| oldest_timestamp

## Global Function AC_persistence_load()

`void AC_persistence_load ( void )`

Calls: | AC_delete_timestamp_l() | ac/ac_persistence.c
| AC_dbopen_admin(), AC_decay_leaf_l(), AC_prunable(), ER_perror(), IP_pref_f2b_v4(), SQ_close_connection(), SQ_execute_query(), SQ_free_result(), SQ_get_column_int(), SQ_get_column_string_nocopy(), SQ_row_next(), TH_acquire_write_lock(), TH_release_write_lock(), UT_free_real(), UT_malloc_real(), UT_time_set(), UT_timediff(), atof(), rx_bin_node()
Called by: | AC_persistence_init() | ac/ac_persistence.c
References Variables: | act_runtime, oldest_timestamp

## Global Function AC_persistence_save()

`er_ret_t AC_persistence_save ( void )`

Prototyped in: | /home/shane/release/RIP/include/access_control.h
Calls: | AC_persistence_save_l() | ac/ac_persistence.c
| TH_acquire_write_lock(), TH_release_write_lock()
Called by: | AC_persistence_daemon() | ac/ac_persistence.c
References Variables: | on_save | ac/ac_persistence.c
| save_lock | ac/ac_persistence.c

## Global Function ac_persistence_get_leaves()

`GList* ac_persistence_get_leaves ( void )`

Calls: | TH_acquire_write_lock(), TH_release_write_lock(), rx_walk_tree()
Called by: | AC_persistence_save_l() | ac/ac_persistence.c
References Functions: | AC_persistence_get_leaves_hook_l() | ac/ac_persistence.c
References Variables: | act_runtime

## Local Function AC_persistence_save_l()

`static void AC_persistence_save_l ( void )`

Calls: | AC_persistence_walk_l() | ac/ac_persistence.c
| ac_persistence_get_leaves() | ac/ac_persistence.c
| UT_free_real(), g_list_free(), g_list_length(), g_list_nth_data()
Called by: | AC_persistence_save() | ac/ac_persistence.c

## Local Function AC_persistence_walk_l()

`static void AC_persistence_walk_l ( GList* list )`

Calls: | AC_delete_timestamp_l() | ac/ac_persistence.c
| AC_dbopen_admin(), ER_perror(), IP_pref_b2_len(), IP_pref_b2v4_addr(), SQ_close_connection(), SQ_execute_query(), UT_time_getvalue(), ceil(), sprintf()
Called by: | AC_persistence_save_l() | ac/ac_persistence.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()