[OpenSIPS-Devel] SF.net SVN: opensips:[5725] trunk/modules/usrloc

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri May 22 13:20:58 CEST 2009


Revision: 5725
          http://opensips.svn.sourceforge.net/opensips/?rev=5725&view=rev
Author:   bogdan_iancu
Date:     2009-05-22 11:20:58 +0000 (Fri, 22 May 2009)

Log Message:
-----------
- new internal API functions:
	lock_ulslot / unlock_ulsloti(udomain*, slot) - to lock a specific slot of the domain hash table
	get_next_udomain (udomain*) - returns the first udomain in input paramis NULL or the next udomain
	get_next_urecord (udomain*, slot, urecord*) - returns the next urecord (after given input urecord, or first urecord if input is NULL) from the udomain hash table slot.


This new functions provide a controlled way of accessing (from other modules) the usrloc data structures:

1) use get_next_udomain(udomain *) for iterating through  all the domains; if the param is NULL, it will return the first udomain;  otherwise the next following udomain.

2) for each udomain, use udomain->size to see the hash table size...and for each hash entry do:
       a) lock_ulslot(udomain, slot) 
       b) get_next_urecord(udomain, entry_id, urecord*) - iterates  through the all urecords from the hash entry
       c) unlock_ulslot(udomain, slot)

This is the ressult of a discussion with John Khvatov  on the devel list

Modified Paths:
--------------
    trunk/modules/usrloc/dlist.c
    trunk/modules/usrloc/dlist.h
    trunk/modules/usrloc/udomain.c
    trunk/modules/usrloc/udomain.h
    trunk/modules/usrloc/urecord.c
    trunk/modules/usrloc/usrloc.c
    trunk/modules/usrloc/usrloc.h


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Devel mailing list