dhcp_svc_private.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 (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _DHCP_SVC_PRIVATE_H
#define _DHCP_SVC_PRIVATE_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Contains SMI-private interfaces to DHCP data service. DO NOT SHIP!
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <dhcp_svc_confopt.h>
#include <dhcp_svc_public.h>
#define DSVC_PUBLIC_PREFIX "ds"
/*
* Public (service provider) layer definitions at boundary with private layer.
*/
typedef int (*dsvc_splfuncp_t)();
typedef struct {
typedef struct {
char *d_resource; /* datastore name; e.g. "SUNWfiles" */
char *d_location; /* location of datastore containers */
char *d_config; /* datastore-specific config data */
int d_conver; /* container version */
/*
* Container types.
*/
typedef enum {
/*
* Container ID: so far just the network and netmask for DSVC_DHCPNETWORK
* containers, but may include more information in the future.
*/
typedef struct {
} dsvc_conid_t;
struct dsvc_synch_ops; /* forward declaration */
/*
* Per-handle synchronization information, used when modules require
* private-layer synchronization.
*/
typedef struct {
char s_loctoken[MAXPATHLEN];
char *s_conname; /* container name */
void *s_data; /* synch-layer private data */
} dsvc_synch_t;
/*
* Synchronization operations; each synchronization strategy must implement
* these operations. Right now, we only have one synchronization strategy,
* but this may change someday.
*/
typedef struct dsvc_synch_ops {
int (*synch_init)(dsvc_synch_t *, unsigned int);
void (*synch_fini)(dsvc_synch_t *);
int (*synch_rdlock)(dsvc_synch_t *, void **);
int (*synch_wrlock)(dsvc_synch_t *, void **);
int (*synch_unlock)(dsvc_synch_t *, void *);
/*
* We divide the dsvc_synchtype_t up into two parts: a strategy part and a
* flags part. Right now, the only flag tells private layer to request
* cross-host synchronization. This is here instead of <dhcp_svc_public.h>
* since it's not a public interface and there's nowhere better to put it.
*/
#define DSVC_SYNCH_FLAGMASK 0xffff0000
#define DSVC_SYNCH_STRATMASK 0x0000ffff
#define DSVC_SYNCH_CROSSHOST 0x00010000
/*
* Private layer handle, one per open instance of a container.
* Allocated by open_dd(), destroyed by close_dd().
*/
typedef struct dsvc_handle {
void *d_instance; /* dlopen() instance */
void *d_hand; /* public module handle */
} *dsvc_handle_t;
/*
* Quick-n-dirty check for an invalid dsvc_handle_t.
*/
extern int enumerate_dd(char ***, int *);
extern int status_dd(dsvc_datastore_t *);
extern int mklocation_dd(dsvc_datastore_t *);
extern int add_dd_entry(dsvc_handle_t, void *);
extern int modify_dd_entry(dsvc_handle_t, const void *, void *);
extern int delete_dd_entry(dsvc_handle_t, void *);
extern int close_dd(dsvc_handle_t *);
const char *, uint_t);
void **, uint_t *);
extern void free_dd(dsvc_handle_t, void *);
extern void free_dd_list(dsvc_handle_t, void *);
/*
* Under DEBUG, the DHCP_CONFOPT_ROOT environment variable can be set to
* the path of a directory for the DHCP server to use an alternate root
* for its configuration information and datastores.
*/
#ifdef DEBUG
#else
#define DHCP_CONFOPT_ROOT ""
#endif
#ifdef __cplusplus
}
#endif
#endif /* !_DHCP_SVC_PRIVATE_H */