nfs-ganesha 1.4
Classes | Defines | Functions | Variables

AuthGss_HashTable.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "HashData.h"
#include "HashTable.h"
#include "log.h"
#include "config_parsing.h"
#include "nfs_core.h"
#include "rpcal.h"
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_generic.h>

Go to the source code of this file.

Classes

struct  svc_rpc_gss_data_stored

Defines

#define GSS_CNAMELEN   1024
#define GSS_CKSUM_LEN   1024

Functions

uint32_t gss_ctx_hash_func (hash_parameter_t *p_hparam, hash_buffer_t *buffclef)
uint64_t gss_ctx_rbt_hash_func (hash_parameter_t *p_hparam, hash_buffer_t *buffclef)
int compare_gss_ctx (hash_buffer_t *buff1, hash_buffer_t *buff2)
int display_gss_ctx (hash_buffer_t *pbuff, char *str)
int display_gss_svc_data (hash_buffer_t *pbuff, char *str)
int Gss_ctx_Hash_Set (gss_union_ctx_id_desc *pgss_ctx, struct svc_rpc_gss_data *gd)
int Gss_ctx_Hash_Get (gss_union_ctx_id_desc *pgss_ctx, struct svc_rpc_gss_data *gd, bool_t **established, u_int **seqlast, uint32_t **seqmask)
int Gss_ctx_Hash_Del (gss_union_ctx_id_desc *pgss_ctx)
int Gss_ctx_Hash_Init (nfs_krb5_parameter_t param)
void Gss_ctx_Hash_Print (void)

Variables

hash_table_tht_gss_ctx

Define Documentation

#define GSS_CKSUM_LEN   1024

Definition at line 29 of file AuthGss_HashTable.c.

#define GSS_CNAMELEN   1024

Definition at line 28 of file AuthGss_HashTable.c.


Function Documentation

int compare_gss_ctx ( hash_buffer_t buff1,
hash_buffer_t buff2 
)

compare_gss_ctx: compares the gss_ctx stored in the key buffers.

compare the gss_ctx stored in the key buffers. This function is to be used as 'compare_key' field in the hashtable storing the gss context.

Parameters:
buff1[IN] first key
buff2[IN] second key
Returns:
0 if keys are identifical, 1 if they are different.

Definition at line 271 of file AuthGss_HashTable.c.

int display_gss_ctx ( hash_buffer_t pbuff,
char *  str 
)

display_gss_ctx: displays the gss_ctx stored in the buffer.

displays the gss_ctx stored in the buffer. This function is to be used as 'key_to_str' field in the hashtable storing the gss context.

Parameters:
buff1[IN] buffer to display
buff2[OUT] output string
Returns:
number of character written.

Definition at line 294 of file AuthGss_HashTable.c.

int display_gss_svc_data ( hash_buffer_t pbuff,
char *  str 
)

display_gss_svc_data: displays the gss_svc_data stored in the buffer.

displays the gss_svc__data stored in the buffer. This function is to be used as 'value_to_str' field in the hashtable storing the gss context.

Parameters:
buff1[IN] buffer to display
buff2[OUT] output string
Returns:
number of character written.

Definition at line 317 of file AuthGss_HashTable.c.

int Gss_ctx_Hash_Del ( gss_union_ctx_id_desc *  pgss_ctx)

Gss_ctx_Hash_Del

This routine removes a state from the Gss ctx hashtable.

Returns:
1 if ok, 0 otherwise.

Definition at line 455 of file AuthGss_HashTable.c.

uint32_t gss_ctx_hash_func ( hash_parameter_t p_hparam,
hash_buffer_t buffclef 
)

gss_ctx_hash_func: computes the hash value for the entry in GSS Ctx cache.

Computes the hash value for the entry in GSS Ctx cache. 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

Parameters:
hparam[IN] hash table parameter.
buffcleff[IN] pointer to the hash key buffer
Returns:
the computed hash value.
See also:
HashTable_Init

Definition at line 198 of file AuthGss_HashTable.c.

int Gss_ctx_Hash_Get ( gss_union_ctx_id_desc *  pgss_ctx,
struct svc_rpc_gss_data *  gd,
bool_t **  established,
u_int **  seqlast,
uint32_t **  seqmask 
)

Gss_ctx_Hash_Get

This routine gets a Gss Ctx from the hashtable and returns a pointers to a the established, seqlast, and seqmask variables of the context.

Returns:
1 if ok, 0 otherwise.

Definition at line 404 of file AuthGss_HashTable.c.

int Gss_ctx_Hash_Init ( nfs_krb5_parameter_t  param)

Gss_ctx_Hash_Init: Init the hashtable for GSS Ctx

Perform all the required initialization for hashtable Gss ctx cache

Returns:
0 if successful, -1 otherwise

Definition at line 483 of file AuthGss_HashTable.c.

void Gss_ctx_Hash_Print ( void  )

Gss_ctx_Hash_Print: Displays the content of the hash table (for debugging)

Displays the content of the hash table (for debugging).

Returns:
nothing (void function)

Definition at line 503 of file AuthGss_HashTable.c.

int Gss_ctx_Hash_Set ( gss_union_ctx_id_desc *  pgss_ctx,
struct svc_rpc_gss_data *  gd 
)

Gss_ctx_Hash_Set

This routine sets a Gss Ctx into the Gss Context's hashtable.

Returns:
1 if ok, 0 otherwise.

Definition at line 339 of file AuthGss_HashTable.c.

uint64_t gss_ctx_rbt_hash_func ( hash_parameter_t p_hparam,
hash_buffer_t buffclef 
)

gss_ctx_rbt_hash_func: computes the rbt value for the entry in GSS Ctx cache.

Computes the rbt value for the entry in GSS Ctx cache. In fact, it just use the address value itself (which is an unsigned integer) as the rbt value. This function is called internal in the HasTable_* function

Parameters:
hparam[IN] hash table parameter.
buffcleff[in]pointer to the hash key buffer
Returns:
the computed rbt value.
See also:
HashTable_Init

Definition at line 236 of file AuthGss_HashTable.c.


Variable Documentation

Definition at line 181 of file AuthGss_HashTable.c.