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 _DHCP_NETWORK_H
  28 #define _DHCP_NETWORK_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  * dhcp_network 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 dn_recpos {
  48         dn_rec_t        dnp_rec;        /* traditional record */
  49         size_t          dnp_size;       /* its size in the file */
  50         off_t           dnp_off;        /* its starting offset in the file */
  51 } dn_recpos_t;
  52 
  53 /*
  54  * Per-instance state for each instance of an open_dn().
  55  */
  56 typedef struct dn_handle {
  57         unsigned int    dh_oflags;      /* flags passed into open_dn() */
  58         char            dh_location[MAXPATHLEN];
  59         ipaddr_t        dh_net;
  60 } dn_handle_t;
  61 
  62 /*
  63  * Order of the fields in the on-disk record.
  64  */
  65 enum { DNF_CID, DNF_FLAGS, DNF_CIP, DNF_SIP, DNF_LEASE, DNF_MACRO,
  66     DNF_COMMENT };
  67 
  68 #define DNF_MAX_FIELDS          7       /* maximum number of fields */
  69 #define DNF_REQ_FIELDS          5       /* number of required fields */
  70 #define DNF_COMMENT_CHAR        '#'
  71 
  72 /*
  73  * Constants for use with find_dn().
  74  */
  75 #define FIND_PARTIAL    0x0001          /* allow partial success */
  76 #define FIND_POSITION   0x0002          /* return dn_recpos_t's */
  77 
  78 #ifdef  __cplusplus
  79 }
  80 #endif
  81 
  82 #endif  /* _DHCP_NETWORK_H */