/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
*/
/*
*/
#ifndef _DHCP_SVC_PUBLIC_H
#define _DHCP_SVC_PUBLIC_H
/*
* Contains published interfaces to the DHCP data service.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Errors which can be returned from the defined API
*/
/* public module unavailable */
/*
* Flags that can be passed to open_*
*/
/*
* Query macros - used for initializing query flags to lookup_*
*/
#define DSVC_QINIT(q) ((q) = 0)
/*
* DHCP Configuration Container (dhcptab(4))
*/
/* Query flags for lookup_dt */
/*
* Consumer's dhcptab record form. Dynamically allocated by underlying data
* store. dt_sig is set by underlying data store -- it's opaque to the
* DHCP service, and is used by the data store to detect update collisions.
* All fields must be fixed-width types and in host byte order. Note that
* SUNWbinfiles writes these records directly to disk, thus changing its
* definition may introduce binary compatibility problems. Note also that
* fields have been carefully ordered to avoid internal padding and the
* structure's size is 64-bit aligned to avoid capricious trailing padding.
*/
typedef struct {
} dt_rec_t;
typedef struct dt_rec_list {
/*
* DHCP Network Container (dhcp_network(4))
*/
/* Query flags for lookup_dn */
DN_QFMANUAL | DN_QFUNUSABLE |\
/* dn_flags values */
/*
* Consumer's DHCP network container record form. Dynamically allocated by
* underlying data store. dn_sig is set by underlying data store -- it's
* opaque to the DHCP service, and is used by the data store to detect
* update collisions. All fields must be fixed-width types and in host
* byte order. Note that SUNWbinfiles writes these records directly to
* disk, thus changing its definition may introduce binary compatibility
* problems. Note also that fields have been carefully ordered to avoid
* internal padding and the structure's size is 64-bit aligned to avoid
* capricious trailing padding.
*/
typedef struct {
} dn_rec_t;
typedef struct dn_rec_list {
/*
* Synchronization Service Type and values.
*/
/*
* Generic API provided by SMI
*/
extern dt_rec_t *alloc_dtrec(const char *, char, const char *);
extern void free_dtrec(dt_rec_t *);
extern void free_dnrec(dn_rec_t *);
extern void free_dtrec_list(dt_rec_list_t *);
extern void free_dnrec_list(dn_rec_list_t *);
extern const char *dhcpsvc_errmsg(uint_t);
/*
* The remaining functions are not directly callable by the libdhcpsvc
* implementation; don't expose them to it.
*/
#ifndef _DHCPSVC_IMPL
/*
* Generic Service Provider Layer API provided by data store implementor
*/
extern int status(const char *);
extern int version(int *);
extern int configure(const char *);
extern int mklocation(const char *);
/*
* dhcptab Service Provider Layer API
*/
extern int close_dt(void **);
extern int remove_dt(const char *);
/*
* DHCP Network Service Provider Layer API
* IP address arguments are host order.
*/
const struct in_addr *);
extern int close_dn(void **);
#endif
#ifdef __cplusplus
}
#endif
#endif /* !_DHCP_SVC_PUBLIC_H */