dhcp_network.h revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2000 by Sun Microsystems, Inc. 2N/A * All rights reserved. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * Implementation-specific data structures and constants for the binary 2N/A * files dhcp_network container. These structures are subject to change at 2N/A * The client id hash size is based on the idea that, given a perfect hash, 2N/A * the hash chain length shouldn't be more than the number of buckets. 2N/A * Given a worst case network with 2^24 addresses, that means we should 2N/A * have 4096 buckets; we shrink this by a bit to make the dn_header_t size 2N/A * be a power of two (32768 bytes). Note that we assert that a header is 2N/A * this size in open_dn(). 2N/A#
define DN_MAGIC 0x0d6c92e4 /* "dhcpnet" in hexadecimal world */ 2N/A#
define DN_NOREC 0x00000000 /* "no record" id value, must be zero */ 2N/A * Macros to compute the record id for a record with address `addr' in a 2N/A * container with netmask `mask', and to convert a record id `recid' to its 2N/A * starting file offset within its container. Note that we reserve the 2N/A * record id value of 0 for DN_NOREC for reasons explained in open_dn(). 2N/A * What each dn_rec_t looks like on-disk -- contains the dn_rec_t, pointers 2N/A * to the previous and next dn_rec_t's on its client id hash. See the big 2N/A * Header atop each dhcp_network container -- contains some basic 2N/A * information about the container and an array of buckets to chain client 2N/A * discussion on the redundant dn_recid_t's and the concept of "images". 2N/A * Note: read_header() assumes that dnh_cidhash is the last member. 2N/A * Per-instance state for each handle returned from open_dn. 2N/A int dh_fd;
/* fd for open file pointer */ 2N/A#
endif /* _DHCP_NETWORK_H */