xref: /onnv-gate/usr/src/lib/libdhcpsvc/modules/files0/dhcptab.h (revision 0:68f95e015346)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _DHCPTAB_H
28 #define	_DHCPTAB_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/param.h>
33 
34 /*
35  * Implementation-specific data structures and constants for the files0
36  * dhcptab container.  These are subject to change at any time.
37  */
38 
39 #ifdef	__cplusplus
40 extern "C" {
41 #endif
42 
43 /*
44  * Per-record state describing the underlying record, including its
45  * position on-disk.
46  */
47 typedef struct dt_recpos {
48 	dt_rec_t	dtp_rec;	/* traditional record */
49 	size_t		dtp_size;	/* its size in the file */
50 	off_t		dtp_off;	/* its starting offset in the file */
51 } dt_recpos_t;
52 
53 /*
54  * Per-instance state for each instance of an open_dt().
55  */
56 typedef struct dt_handle {
57 	unsigned int	dh_oflags;	/* flags passed into open_dt() */
58 	char		dh_location[MAXPATHLEN];
59 } dt_handle_t;
60 
61 /*
62  * Order of the fields in the on-disk record.
63  */
64 enum { DTF_KEY, DTF_TYPE, DTF_VALUE };
65 
66 #define	DTF_MAX_FIELDS		3	/* maximum number of fields */
67 #define	DTF_COMMENT_CHAR	'#'
68 
69 /*
70  * Constants for use with find_dt().
71  */
72 #define	FIND_PARTIAL	0x0001		/* allow partial success */
73 #define	FIND_POSITION	0x0002 		/* return dt_recpos_t's */
74 
75 #ifdef	__cplusplus
76 }
77 #endif
78 
79 #endif	/* _DHCPTAB_H */
80