116728Swpaul/* 216793Swpaul * Copyright (c) 1995, 1996 316728Swpaul * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 416728Swpaul * 516728Swpaul * Redistribution and use in source and binary forms, with or without 616728Swpaul * modification, are permitted provided that the following conditions 716728Swpaul * are met: 816728Swpaul * 1. Redistributions of source code must retain the above copyright 916728Swpaul * notice, this list of conditions and the following disclaimer. 1016728Swpaul * 2. Redistributions in binary form must reproduce the above copyright 1116728Swpaul * notice, this list of conditions and the following disclaimer in the 1216728Swpaul * documentation and/or other materials provided with the distribution. 1316728Swpaul * 3. All advertising materials mentioning features or use of this software 1416728Swpaul * must display the following acknowledgement: 1516728Swpaul * This product includes software developed by Bill Paul. 1616728Swpaul * 4. Neither the name of the author nor the names of any co-contributors 1716728Swpaul * may be used to endorse or promote products derived from this software 1816728Swpaul * without specific prior written permission. 1916728Swpaul * 2016728Swpaul * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND 2116728Swpaul * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2216728Swpaul * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2316728Swpaul * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE 2416728Swpaul * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2516728Swpaul * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2616728Swpaul * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2716728Swpaul * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2816728Swpaul * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2916728Swpaul * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3016728Swpaul * SUCH DAMAGE. 3116728Swpaul * 3250476Speter * $FreeBSD: releng/10.2/libexec/mknetid/hash.h 90779 2002-02-17 19:09:20Z imp $ 3316728Swpaul */ 3416728Swpaul 3516793Swpaul/* Groupid entry hung off a member_entry node. */ 3616728Swpaulstruct grouplist { 3716728Swpaul gid_t groupid; 3816728Swpaul struct grouplist *next; 3916728Swpaul}; 4016728Swpaul 4116728Swpaul/* Entry in the cooked member list hash table. */ 4216728Swpaulstruct member_entry { 4316728Swpaul char *key; /* username */ 4416728Swpaul struct grouplist *groups; 4516728Swpaul struct member_entry *next; 4616728Swpaul}; 4716728Swpaul 4816728Swpaul/* Table size (chosen arbitrarily). Not too big, not too small. */ 4916793Swpaul#define TABLESIZE 1024 5016793Swpaul#define HASH_MASK 0x000003FF 5116728Swpaul 5290779Simpextern void mstore(struct member_entry ** , char *, int, int); 5390779Simpextern struct grouplist *lookup(struct member_entry **, char *); 5416728Swpaul 55