per_dnet.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _PER_DSTORE_H
#define _PER_DSTORE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* per_dnet.h -- DHCP-datastore database definitions.
*/
/*
* DHCP thread deferred work structure. One per deferred client thread.
*
* Track clients who cannot be immediately serviced due
* to a lack of available client threads. Locked by thr_mtx.
*/
typedef struct dsvc_pending {
/*
* DHCP thread structure. One per client thread.
*
* Performance: create and track each client thread, using
* thr_suspend/thr_resume, rather than slower thread creation
* and deletion. Locked by thr_mtx.
*/
struct clnt;
typedef struct dsvc_free {
} dsvc_thr_t;
/*
* DHCP thread structure flags
*/
/*
* DHCP datastore table. One per active network or dhcptab datastore.
*
* Timestamps are used to age the datastore structure, and any cached
* datastore free or lru records managed in select_offer().
* The number of threads and clients can be controlled via MAX_THREADS
* and MAX_CLIENTS server parameters.
*
* Client and offer hashes provide fast lookup/reservation.
* Per-bucket rwlocks implemented in the hash routines reduce
* lock contention between clients.
*
* To minimize expensive datastore activity, threads synchronize to
* manage cached free and lru datastore records, which have the
* same lifetime as cached offers, which can be controlled via
* the OFFER_CACHE_TIMEOUT server parameter.
*/
typedef struct dnet {
int naddrs; /* # addrs owned by server */
int nthreads; /* number of active threads */
int nclients; /* number of active clients */
} dsvc_dnet_t;
/*
* DHCP datastore table flags
*/
/*
* DHCP datastore table macros
*/
struct interfaces;
/*
* DHCP client. One per active client, per network.
*
* Timestamps are used to age the client structure, and any cached
* offer, which can be controlled via the OFFER_CACHE_TIMEOUT server
* parameter, and the -t option, and SIGHUP signal.
*
* The original datastore record is cached, along with offer information,
* for use if the datastore record is modified.
*
* The clnt struct may appear on the client hash table, and offer hash table,
* depending on the validity of the current offer. A different dsvc_clnt_t
* is used for each link, to allow independent aging of client and offer.
*/
typedef struct clnt {
} dsvc_clnt_t;
/*
* Per Client flags and indices
*/
/*
* Per Client macros
*/
/*
* Datastore hash table dynamic data free timeout values
*/
/*
* Datastore database access routines.
*/
/*
* Per Client hash and utility routines.
*/
extern void close_clnts(void);
#ifdef __cplusplus
}
#endif
#endif /* _PER_DSTORE_H */