common.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 _COMMON_H
#define _COMMON_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Contains nisplus module-generic code.
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <dhcp_svc_public.h>
/*
* Utility macros
*/
#define DEFAULT_COL_SEP ' '
#define NIS_DEF_TTL 3600
/*
* dhcp table NIS+ related definitions
*/
#define DSVC_NIS_COOKIE "sunwnis+"
/* service related */
/* generic dhcptab table */
#define KEY_DT 0 /* first column contains key */
/* generic dhcp_network table */
/* number possible (uint32_t) in ascii form */
/* 4294967296, plus null. 20 is more than */
/* adequate */
/* Value type for query spec */
/*
* nisplus specific handle
* It contains the object type, name, and a copy of the table object (mainly
* for the object ID).
*/
typedef struct {
/* generic nis related functions */
nis_object *);
extern int dsvcnis_free_handle(dsvcnis_handle_t **);
extern int dsvcnis_get_tobject(const char *, const nis_name,
const nis_name, nis_object **);
extern int dsvcnis_set_table_fields(dsvcnis_handle_t *,
nis_object *);
extern int dsvcnis_add_to_qspec(char **, const char *,
dsvcnis_qtype_t, void *);
nis_result **, uint_t);
extern int dsvcnis_get_username(char *, size_t);
extern int dsvcnis_get_groupname(char *, size_t);
#ifdef __cplusplus
}
#endif
#endif /* !_COMMON_H */