index.c File Reference

Nonce index related functions

More...

#include <stdio.h>
#include "../../dprint.h"
#include "../../timer.h"
#include "index.h"
#include "auth_mod.h"

Include dependency graph for index.c:

Go to the source code of this file.

Defines

#define check_buf_bit(index)   ( nonce_buf[index>>3] & (1<<(index%8)) )
#define set_buf_bit(index)
#define unset_buf_bit(index)

Functions

int is_nonce_index_valid (int index)
 Check if the nonce has been used before.
int reserve_nonce_index (void)
 Get valid index for nonce.


Detailed Description

Nonce index related functions

Definition in file index.c.


Define Documentation

#define check_buf_bit ( index   )     ( nonce_buf[index>>3] & (1<<(index%8)) )

Definition at line 50 of file index.c.

Referenced by is_nonce_index_valid().

#define set_buf_bit ( index   ) 

Value:

do{\
        nonce_buf[index>>3] |=  (1<<(index%8));\
    }while(0)

Definition at line 40 of file index.c.

Referenced by is_nonce_index_valid().

#define unset_buf_bit ( index   ) 

Value:

do{\
        nonce_buf[index>>3] &=  ~(1<<(index%8));\
    }while(0)

Definition at line 45 of file index.c.

Referenced by reserve_nonce_index().


Function Documentation

int is_nonce_index_valid ( int  index  ) 

Check if the nonce has been used before.

Parameters:
index index
Returns:
1 if nonce is valid, 0 if not valid or on errors

Definition at line 139 of file index.c.

References check_buf_bit, LM_DBG, LM_ERR, MAX_NONCE_INDEX, next_index, nonce_lock, sec_monit, second, and set_buf_bit.

Referenced by post_auth().

int reserve_nonce_index ( void   ) 

Get valid index for nonce.

Returns:
index on success, -1 on failure

Definition at line 57 of file index.c.

References get_ticks(), LM_DBG, LM_INFO, MAX_NONCE_INDEX, next_index, nonce_expire, nonce_lock, sec_monit, second, and unset_buf_bit.

Referenced by build_auth_hf().


Generated on Wed May 23 08:01:16 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6