src/modules/usrloc/hslot.h
5c4bff80
 /*
31ccf6a2
  * Copyright (C) 2001-2003 FhG Fokus
  *
27642a08
  * This file is part of Kamailio, a free SIP server.
31ccf6a2
  *
27642a08
  * Kamailio is free software; you can redistribute it and/or modify
31ccf6a2
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
27642a08
  * Kamailio is distributed in the hope that it will be useful,
31ccf6a2
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
ab867565
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
9e1ff448
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
31ccf6a2
  */
 
adfa93a7
 /*! \file
  *  \brief USRLOC - Hash table collision slot related functions
  *  \ingroup usrloc
  */
 
 
31ccf6a2
 
 #ifndef HSLOT_H
 #define HSLOT_H
 
cf83221d
 #include "../../core/locking.h"
5d5a0c00
 
31ccf6a2
 #include "udomain.h"
 #include "urecord.h"
 
 
 struct udomain;
 struct urecord;
 
 
 typedef struct hslot {
adfa93a7
 	int n;                  /*!< Number of elements in the collision slot */
 	struct urecord* first;  /*!< First element in the list */
 	struct urecord* last;   /*!< Last element in the list */
 	struct udomain* d;      /*!< Domain we belong to */
ab867565
 	rec_lock_t rlock;       /*!< Recursive lock for hash entry */
31ccf6a2
 } hslot_t;
 
adfa93a7
 /*! \brief
31ccf6a2
  * Initialize slot structure
  */
ab867565
 int init_slot(struct udomain* _d, hslot_t* _s, int n);
31ccf6a2
 
 
adfa93a7
 /*! \brief
31ccf6a2
  * Deinitialize given slot structure
  */
 void deinit_slot(hslot_t* _s);
 
 
adfa93a7
 /*! \brief
31ccf6a2
  * Add an element to slot linked list
  */
 void slot_add(hslot_t* _s, struct urecord* _r);
 
 
adfa93a7
 /*! \brief
31ccf6a2
  * Remove an element from slot linked list
  */
 void slot_rem(hslot_t* _s, struct urecord* _r);
 
 #endif /* HSLOT_H */