Cache system
[Nuauth]

Collaboration diagram for Cache system:


Files

file  acls.c
 Acls manipulations and cache.
file  cache.c
 Generic cache system.
file  users.c
 User cache system.

Data Structures

struct  acl_key

Defines

#define USE_JHASH2

Functions

guint32 hash_acl (gconstpointer key)
gint strcmp_null (gchar *a, gchar *b)
gboolean compare_acls (gconstpointer a, gconstpointer b)
void free_acl_key (gpointer datas)
void free_one_acl_group (struct acl_group *acl, gpointer userdata)
void free_acl_groups (GSList *acl_groups, gpointer userdata)
void free_acl_cache (cache_entry_t *entry)
gpointer acl_create_and_alloc_key (connection_t *kdatas)
gpointer acl_duplicate_key (gpointer datas)
void get_acls_from_cache (connection_t *conn_elt)
int init_acl_cache ()
void cache_entry_content_destroy (cache_entry_content_t *item, GFunc free_datas)
int cache_entry_content_compare (const cache_entry_content_t *content, gconstpointer data)
int cache_entry_content_used (const cache_entry_content_t *content, gconstpointer b)
gboolean cache_entry_is_old (gpointer key, gpointer value, gpointer user_data)
void cache_reset_timestamp (gpointer key, gpointer value, gpointer user_data)
void cache_insert (cache_class_t *this, struct cache_message *message)
void cache_get (cache_class_t *this, cache_entry_t *entry, struct cache_message *message, GSList **local_queue)
void cache_message_destroy (cache_class_t *this, cache_entry_t *entry, struct cache_message *message)
void cache_refresh (cache_class_t *this, cache_entry_t *entry, struct cache_message *message, GSList **local_queue)
void cache_manager (cache_class_t *this)
void cache_destroy (cache_class_t *this)
void cache_reset (cache_class_t *this)
void free_user_struct (struct user_cached_datas *datas, gpointer userdata)
void free_user_cache (cache_entry_t *entry)
void get_users_from_cache (connection_t *conn_elt)
gpointer user_duplicate_key (gpointer datas)
int init_user_cache ()

Define Documentation

#define USE_JHASH2

Definition at line 38 of file acls.c.


Function Documentation

gpointer acl_create_and_alloc_key ( connection_t kdatas  ) 

Definition at line 162 of file acls.c.

References acl_duplicate_key(), acl_key::acl_tracking, connection_t::app_name, acl_key::appname, duplicate_iface_nfo(), acl_key::iface_nfo, connection_t::iface_nfo, connection_t::os_release, connection_t::os_sysname, connection_t::os_version, acl_key::release, acl_key::sysname, connection_t::tracking, and acl_key::version.

Referenced by free_connection(), and get_acls_from_cache().

Here is the call graph for this function:

gpointer acl_duplicate_key ( gpointer  datas  ) 

Definition at line 175 of file acls.c.

References acl_key::acl_tracking, acl_key::appname, duplicate_iface_nfo(), acl_key::iface_nfo, acl_key::release, tracking_t::source, acl_key::sysname, and acl_key::version.

Referenced by acl_create_and_alloc_key(), and init_acl_cache().

Here is the call graph for this function:

void cache_destroy ( cache_class_t this  ) 

Definition at line 341 of file cache.c.

References cache_class_t::hash, and cache_class_t::queue.

Referenced by nuauth_deinit().

int cache_entry_content_compare ( const cache_entry_content_t content,
gconstpointer  data 
)

compare cache datas

Definition at line 53 of file cache.c.

References cache_entry_content_t::datas.

Referenced by cache_message_destroy().

void cache_entry_content_destroy ( cache_entry_content_t item,
GFunc  free_datas 
)

Definition at line 40 of file cache.c.

References cache_entry_content_t::datas.

Referenced by free_acl_cache(), and free_user_cache().

int cache_entry_content_used ( const cache_entry_content_t content,
gconstpointer  b 
)

Definition at line 63 of file cache.c.

References cache_entry_content_t::usage.

Referenced by cache_get().

gboolean cache_entry_is_old ( gpointer  key,
gpointer  value,
gpointer  user_data 
)

cleaning purpose function, find if an entry is old an unused.

Definition at line 72 of file cache.c.

References cache_entry_t::datas, FALSE, cache_entry_t::refresh_timestamp, cache_entry_t::refreshing, TRUE, and cache_entry_content_t::usage.

Referenced by cache_manager().

void cache_get ( cache_class_t this,
cache_entry_t entry,
struct cache_message message,
GSList **  local_queue 
)

Definition at line 126 of file cache.c.

References cache_entry_content_used(), cache_entry_content_t::datas, cache_entry_t::datas, cache_class_t::delete_elt, null_message, null_queue_datas, cache_entry_t::refresh_timestamp, cache_entry_t::refreshing, cache_message::reply_queue, TRUE, and cache_entry_content_t::usage.

Referenced by cache_manager().

Here is the call graph for this function:

void cache_insert ( cache_class_t this,
struct cache_message message 
)

Definition at line 106 of file cache.c.

References cache_entry_t::create_timestamp, cache_entry_t::datas, nuauth_params::datas_persistance, cache_class_t::hash, cache_message::key, nuauthconf, null_message, cache_entry_t::refresh_timestamp, cache_entry_t::refreshing, cache_message::reply_queue, and TRUE.

Referenced by cache_manager().

void cache_manager ( cache_class_t this  ) 

Thread function that wait for cache query.

The algorithm is the following :

Definition at line 269 of file cache.c.

References cache_entry_is_old(), cache_get(), cache_insert(), cache_message_destroy(), cache_refresh(), cache_reset_timestamp(), DEBUG_AREA_MAIN, FREE_MESSAGE, GET_MESSAGE, cache_class_t::hash, INSERT_MESSAGE, cache_message::key, log_message, cache_class_t::queue, REFRESH_MESSAGE, cache_entry_t::refreshing, RESET_MESSAGE, and cache_message::type.

Referenced by init_acl_cache(), and init_user_cache().

Here is the call graph for this function:

void cache_message_destroy ( cache_class_t this,
cache_entry_t entry,
struct cache_message message 
)

Definition at line 190 of file cache.c.

References cache_entry_content_compare(), cache_entry_content_t::datas, cache_message::datas, cache_entry_t::datas, and cache_entry_content_t::usage.

Referenced by cache_manager().

Here is the call graph for this function:

void cache_refresh ( cache_class_t this,
cache_entry_t entry,
struct cache_message message,
GSList **  local_queue 
)

Definition at line 226 of file cache.c.

References cache_entry_t::datas, cache_message::datas, cache_entry_content_t::datas, nuauth_params::datas_persistance, cache_class_t::equal_key, FALSE, cache_message::key, nuauthconf, cache_entry_t::refresh_timestamp, cache_entry_t::refreshing, and cache_entry_content_t::usage.

Referenced by cache_manager().

void cache_reset ( cache_class_t this  ) 

Definition at line 355 of file cache.c.

References cache_class_t::queue, RESET_MESSAGE, and cache_message::type.

Referenced by nuauth_reload().

void cache_reset_timestamp ( gpointer  key,
gpointer  value,
gpointer  user_data 
)

Definition at line 98 of file cache.c.

References cache_entry_t::refresh_timestamp.

Referenced by cache_manager().

gboolean compare_acls ( gconstpointer  a,
gconstpointer  b 
)

Definition at line 96 of file acls.c.

References acl_key::acl_tracking, acl_key::appname, compare_iface_nfo_t(), FALSE, acl_key::iface_nfo, NU_EXIT_ERROR, acl_key::release, strcmp_null(), acl_key::sysname, tracking_equal(), TRUE, and acl_key::version.

Referenced by init_acl_cache().

Here is the call graph for this function:

void free_acl_cache ( cache_entry_t entry  ) 

destroy function for acl cache datas. hash value is a gslist of entry

Definition at line 151 of file acls.c.

References cache_entry_content_destroy(), cache_entry_t::datas, and free_acl_groups().

Referenced by init_acl_cache().

Here is the call graph for this function:

void free_acl_groups ( GSList *  acl_groups,
gpointer  userdata 
)

Definition at line 141 of file acls.c.

References free_one_acl_group().

Referenced by free_acl_cache(), free_connection(), and init_acl_cache().

Here is the call graph for this function:

void free_acl_key ( gpointer  datas  ) 

Definition at line 119 of file acls.c.

References acl_key::acl_tracking, acl_key::appname, acl_key::release, acl_key::sysname, and acl_key::version.

Referenced by get_acls_from_cache(), and init_acl_cache().

void free_one_acl_group ( struct acl_group acl,
gpointer  userdata 
)

Definition at line 130 of file acls.c.

References acl_group::groups, acl_group::log_prefix, acl_group::period, and acl_group::users.

Referenced by free_acl_groups().

void free_user_cache ( cache_entry_t entry  ) 

Definition at line 50 of file users.c.

References cache_entry_content_destroy(), cache_entry_t::datas, DEBUG, DEBUG_AREA_MAIN, DEBUG_AREA_USER, debug_log_message, and free_user_struct().

Referenced by init_user_cache().

Here is the call graph for this function:

void free_user_struct ( struct user_cached_datas datas,
gpointer  userdata 
)

used when destroying value from hash hash value is a gslist of entry

Parameters:
datas Pointer to struct user_cached_datas:
userdata Not used

Definition at line 44 of file users.c.

References user_cached_datas::groups.

Referenced by free_user_cache(), and init_user_cache().

void get_acls_from_cache ( connection_t conn_elt  ) 

ask the acl cache information about a received packet.

Definition at line 197 of file acls.c.

References nuauth_datas::acl_cache, acl_create_and_alloc_key(), connection_t::acl_groups, nuauth_datas::aclqueue, audit_struct::cache_hit_nb, audit_struct::cache_req_nb, cache_message::datas, DEBUG_AREA_MAIN, debug_log_message, free_acl_key(), GET_MESSAGE, INSERT_MESSAGE, cache_message::key, modules_acl_check(), myaudit, nuauthdatas, null_message, null_queue_datas, cache_class_t::queue, cache_message::reply_queue, and cache_message::type.

Referenced by acl_check_and_decide().

Here is the call graph for this function:

void get_users_from_cache ( connection_t conn_elt  ) 

handle discussion with user cache

Definition at line 68 of file users.c.

References audit_struct::cache_hit_nb, audit_struct::cache_req_nb, connection_t::cacheduserdatas, cache_message::datas, DEBUG_AREA_USER, debug_log_message, GET_MESSAGE, user_cached_datas::groups, INSERT_MESSAGE, cache_message::key, log_message, modules_get_user_groups(), modules_get_user_id(), myaudit, nuauthdatas, null_message, null_queue_datas, cache_class_t::queue, cache_message::reply_queue, cache_message::type, user_cached_datas::uid, nuauth_datas::user_cache, connection_t::user_groups, connection_t::user_id, connection_t::username, and nuauth_datas::userqueue.

Here is the call graph for this function:

guint32 hash_acl ( gconstpointer  key  ) 

Function used for connection hash.

Params : a "struct acl_key" Return : the associated key

Definition at line 70 of file acls.c.

References tracking_t::dest.

Referenced by init_acl_cache().

int init_acl_cache (  ) 

Definition at line 252 of file acls.c.

References nuauth_datas::acl_cache, acl_duplicate_key(), cache_manager(), compare_acls(), DEBUG_AREA_MAIN, cache_class_t::delete_elt, cache_class_t::duplicate_key, cache_class_t::equal_key, FALSE, free_acl_cache(), free_acl_groups(), free_acl_key(), cache_class_t::free_key, cache_class_t::hash, hash_acl(), log_message, nuauthdatas, and cache_class_t::queue.

Referenced by init_nuauthdata().

Here is the call graph for this function:

int init_user_cache (  ) 

Definition at line 152 of file users.c.

References cache_manager(), DEBUG_AREA_MAIN, DEBUG_AREA_USER, cache_class_t::delete_elt, cache_class_t::duplicate_key, cache_class_t::equal_key, FALSE, cache_class_t::free_key, free_user_cache(), free_user_struct(), cache_class_t::hash, log_message, nuauthdatas, cache_class_t::queue, nuauth_datas::user_cache, and user_duplicate_key().

Referenced by init_nuauthdata().

Here is the call graph for this function:

gint strcmp_null ( gchar *  a,
gchar *  b 
)

Internal string comparison function

Definition at line 81 of file acls.c.

References FALSE, and TRUE.

Referenced by compare_acls().

gpointer user_duplicate_key ( gpointer  datas  ) 

Definition at line 147 of file users.c.

Referenced by init_user_cache().


Generated on Sat Nov 22 04:01:00 2008 for NuFW by  doxygen 1.4.7