nfs-ganesha 1.4
|
Id mapping functions. More...
#include "HashData.h"
#include "HashTable.h"
#include "log.h"
#include "nfs_core.h"
#include "nfs_exports.h"
#include "config_parsing.h"
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <pwd.h>
#include <grp.h>
Go to the source code of this file.
Id mapping functions.
Definition in file idmapper_cache.c.
int ___idmap_compute_hash_value | ( | char * | name, |
uint32_t * | phashval | ||
) |
Definition at line 298 of file idmapper_cache.c.
int compare_idmapper | ( | hash_buffer_t * | buff1, |
hash_buffer_t * | buff2 | ||
) |
compare_idmapper: compares the values stored in the key buffers.
Compares the values stored in the key buffers. This function is to be used as 'compare_key' field in the hashtable storing the nfs duplicated requests.
buff1 | [IN] first key |
buff2 | [IN] second key |
Definition at line 150 of file idmapper_cache.c.
int compare_namemapper | ( | hash_buffer_t * | buff1, |
hash_buffer_t * | buff2 | ||
) |
Definition at line 155 of file idmapper_cache.c.
int display_idmapper_key | ( | hash_buffer_t * | pbuff, |
char * | str | ||
) |
display_idmapper_key: displays the entry key stored in the buffer.
Displays the entry key stored in the buffer. This function is to be used as 'key_to_str' field in the hashtable storing the id mapper stuff
buff1 | [IN] buffer to display |
buff2 | [OUT] output string |
Definition at line 176 of file idmapper_cache.c.
int display_idmapper_val | ( | hash_buffer_t * | pbuff, |
char * | str | ||
) |
display_idmapper_val: displays the entry key stored in the buffer.
Displays the entry key stored in the buffer. This function is to be used as 'val_to_str' field in the hashtable storing the id mapper stuff
buff1 | [IN] buffer to display |
buff2 | [OUT] output string |
Definition at line 194 of file idmapper_cache.c.
int gidmap_add | ( | char * | key, |
unsigned int | val | ||
) |
Definition at line 588 of file idmapper_cache.c.
int gidmap_get | ( | char * | key, |
unsigned long * | pval | ||
) |
Definition at line 730 of file idmapper_cache.c.
int gidmap_remove | ( | char * | key | ) |
Definition at line 832 of file idmapper_cache.c.
int gnamemap_add | ( | unsigned int | key, |
char * | val | ||
) |
Definition at line 604 of file idmapper_cache.c.
int gnamemap_get | ( | unsigned int | key, |
char * | val | ||
) |
Definition at line 735 of file idmapper_cache.c.
int gnamemap_remove | ( | unsigned int | key | ) |
Definition at line 837 of file idmapper_cache.c.
int idmap_add | ( | hash_table_t * | ht, |
char * | key, | ||
unsigned int | val | ||
) |
idmap_add: Adds a value by key
Adss a value by key.
ht | [INOUT] the hash table to be used |
key | [IN] the ip address requested |
val | [OUT] the value |
Definition at line 406 of file idmapper_cache.c.
int idmap_clear | ( | ) |
Definition at line 523 of file idmapper_cache.c.
int idmap_get | ( | hash_table_t * | ht, |
char * | key, | ||
unsigned long * | pval | ||
) |
idmap_get: gets a value by key
Gets a value by key.
ht | [INOUT] the hash table to be used |
key | [IN] the ip address requested |
hostname | [OUT] the hostname |
Definition at line 633 of file idmapper_cache.c.
void idmap_get_stats | ( | idmap_type_t | maptype, |
hash_stat_t * | phstat, | ||
hash_stat_t * | phstat_reverse | ||
) |
idmap_get_stats: gets the hash table statistics for the idmap et the reverse id map
Gets the hash table statistics for the idmap et the reverse idmap.
maptype | [IN] type of the mapping to be queried (should be UIDMAP_TYPE or GIDMAP_TYPE) |
phstat | [OUT] pointer to the resulting stats for direct map. |
phstat | [OUT] pointer to the resulting stats for reverse map. |
Definition at line 958 of file idmapper_cache.c.
int idmap_gid_init | ( | nfs_idmap_cache_parameter_t | param | ) |
idmap_gid_init: Inits the hashtable for GID mapping.
Inits the hashtable for GID mapping.
param | [IN] parameter used to init the gid map cache |
Definition at line 257 of file idmapper_cache.c.
int idmap_gname_init | ( | nfs_idmap_cache_parameter_t | param | ) |
Definition at line 269 of file idmapper_cache.c.
int idmap_populate | ( | char * | path, |
idmap_type_t | maptype | ||
) |
idmap_populate_by_conf: Use the configuration file to populate the ID_MAPPER.
Use the configuration file to populate the ID_MAPPER.
Definition at line 850 of file idmapper_cache.c.
int idmap_remove | ( | hash_table_t * | ht, |
char * | key | ||
) |
idmap_remove: Tries to remove an entry for ID_MAPPER
Tries to remove an entry for ID_MAPPER
ht | [INOUT] the hash table to be used |
key | [IN] the key uncached. |
Definition at line 752 of file idmapper_cache.c.
int idmap_uid_init | ( | nfs_idmap_cache_parameter_t | param | ) |
idmap_uid_init: Inits the hashtable for UID mapping.
Inits the hashtable for UID mapping.
param | [IN] parameter used to init the uid map cache |
Definition at line 210 of file idmapper_cache.c.
int idmap_uname_init | ( | nfs_idmap_cache_parameter_t | param | ) |
Definition at line 234 of file idmapper_cache.c.
uint64_t idmapper_rbt_hash_func | ( | hash_parameter_t * | p_hparam, |
hash_buffer_t * | buffclef | ||
) |
idmapper_rbt_hash_func: computes the rbt value for the entry in the id mapper stuff.
Computes the rbt value for the entry in the id mapper stuff.
hparam | [IN] hash table parameter. |
buffcleff[in] | pointer to the hash key buffer |
Definition at line 119 of file idmapper_cache.c.
uint32_t idmapper_value_hash_func | ( | hash_parameter_t * | p_hparam, |
hash_buffer_t * | buffclef | ||
) |
idmapper_rbt_hash_func: computes the hash value for the entry in id mapper stuff
Computes the hash value for the entry in id mapper stuff. In fact, it just use addresse as value (identity function) modulo the size of the hash. This function is called internal in the HasTable_* function
hparam | [IN] hash table parameter. |
buffcleff[in] | pointer to the hash key buffer |
Definition at line 84 of file idmapper_cache.c.
int namemap_add | ( | hash_table_t * | ht, |
unsigned int | key, | ||
char * | val | ||
) |
Definition at line 437 of file idmapper_cache.c.
int namemap_clear | ( | ) |
Definition at line 545 of file idmapper_cache.c.
int namemap_get | ( | hash_table_t * | ht, |
unsigned int | key, | ||
char * | pval | ||
) |
Definition at line 659 of file idmapper_cache.c.
int namemap_remove | ( | hash_table_t * | ht, |
unsigned int | key | ||
) |
Definition at line 776 of file idmapper_cache.c.
uint64_t namemapper_rbt_hash_func | ( | hash_parameter_t * | p_hparam, |
hash_buffer_t * | buffclef | ||
) |
Definition at line 131 of file idmapper_cache.c.
uint32_t namemapper_value_hash_func | ( | hash_parameter_t * | p_hparam, |
hash_buffer_t * | buffclef | ||
) |
Definition at line 99 of file idmapper_cache.c.
size_t strnlen | ( | const char * | s, |
size_t | maxlen | ||
) |
int uidgidmap_add | ( | unsigned int | key, |
unsigned int | value | ||
) |
Definition at line 469 of file idmapper_cache.c.
int uidgidmap_clear | ( | ) |
Definition at line 501 of file idmapper_cache.c.
int uidgidmap_get | ( | unsigned int | key, |
unsigned int * | pval | ||
) |
Definition at line 686 of file idmapper_cache.c.
int uidgidmap_init | ( | nfs_idmap_cache_parameter_t | param | ) |
Definition at line 222 of file idmapper_cache.c.
int uidgidmap_remove | ( | unsigned int | key | ) |
Definition at line 801 of file idmapper_cache.c.
int uidmap_add | ( | char * | key, |
unsigned int | val | ||
) |
Definition at line 556 of file idmapper_cache.c.
int uidmap_get | ( | char * | key, |
unsigned long * | pval | ||
) |
Definition at line 720 of file idmapper_cache.c.
int uidmap_remove | ( | char * | key | ) |
Definition at line 822 of file idmapper_cache.c.
int unamemap_add | ( | unsigned int | key, |
char * | val | ||
) |
Definition at line 572 of file idmapper_cache.c.
int unamemap_get | ( | unsigned int | key, |
char * | val | ||
) |
Definition at line 725 of file idmapper_cache.c.
int unamemap_remove | ( | unsigned int | key | ) |
Definition at line 827 of file idmapper_cache.c.
Definition at line 66 of file idmapper_cache.c.
Definition at line 64 of file idmapper_cache.c.
Definition at line 63 of file idmapper_cache.c.
Definition at line 65 of file idmapper_cache.c.
Definition at line 67 of file idmapper_cache.c.