4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
39 #define SIP_HASH_SZ 6037
41 #define SIP_DIGEST_TO_HASH(digest) \
42 ((digest[0] + digest[1] + digest[2] + digest[3] + digest[4] + \
43 digest[5] + digest[6] + digest[7]) % SIP_HASH_SZ)
45 /* An entry in the hash table, sip_obj is opaque */
46 typedef struct sip_hash_obj_s
{
48 struct sip_hash_obj_s
*next_obj
;
49 struct sip_hash_obj_s
*prev_obj
;
53 /* A hash list in the table */
54 typedef struct sip_hash_s
{
55 sip_hash_obj_t
*hash_head
;
56 sip_hash_obj_t
*hash_tail
;
58 pthread_mutex_t sip_hash_mutex
;
61 int sip_hash_add(sip_hash_t
*, void *, int);
62 void *sip_hash_find(sip_hash_t
*, void *, int,
63 boolean_t (*)(void *, void *));
64 void sip_walk_hash(sip_hash_t
*, void (*)(void *, void *), void *);
65 void sip_hash_delete(sip_hash_t
*, void *, int,
66 boolean_t (*)(void *, void *, int *));
73 #endif /* _SIP_HASH_H */