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 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/types.h>
33 #include <stdio.h>
34 #include <dhcp_svc_public.h>
35
36 /*
37 * Implementation-specific data structures for the files dhcptab container.
38 * These structures are subject to change at any time.
39 */
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 /*
46 * Per-record state describing the underlying record, including its
47 * position on-disk.
48 */
49 typedef struct dt_recpos {
50 dt_rec_t dtp_rec; /* traditional record */
51 size_t dtp_size; /* its size in the file */
52 off_t dtp_off; /* its starting offset in the file */
53 } dt_recpos_t;
54
55 /*
56 * Per-instance state for each instance of an open_dt()
57 */
58 typedef struct dt_handle {
59 unsigned int dh_oflags; /* flags passed into open_dt() */
60 char dh_location[MAXPATHLEN];
61 } dt_handle_t;
62
63 /*
64 * Order of the fields in the on-disk record.
65 */
66 enum { DTF_KEY, DTF_TYPE, DTF_SIG, DTF_VALUE };
67
68 #define DTF_FIELDS 4 /* number of fields */
69 #define DTF_COMMENT_CHAR '#'
70
71 /*
72 * Constants for use with find_dt()
73 */
74 #define FIND_PARTIAL 0x0001 /* allow partial success */
75 #define FIND_POSITION 0x0002 /* return dt_recpos_t's */
76
77 #ifdef __cplusplus
78 }
79 #endif
80
81 #endif /* _DHCPTAB_H */