nis_proc.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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _NIS_PROC_H
#define _NIS_PROC_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <pthread.h>
#include <nis_servlist.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
*
* This module contains definitions used by the NIS service.
*
*/
/*
* Structure definitions used by the various functions
*/
struct nis_db_result {
unsigned long ticks; /* Number of clock ticks used */
};
typedef struct nis_db_result nis_db_result;
struct obj_list {
u_char r; /* readable flag */
nis_object *o; /* object */
};
struct nis_db_list_result {
int numo; /* Number of objects */
unsigned long ticks; /* Database ticks */
};
typedef struct nis_db_list_result nis_db_list_result;
struct nis_fn_result {
unsigned long ticks; /* the obligatory ticks value */
};
typedef struct nis_fn_result nis_fn_result;
struct limits {
int max_attrval; /* Maximum length of 1 attribute */
int max_attr; /* Maximum number of attributes */
int max_columns; /* Maximum number of columns */
};
struct ticks {
};
struct object_list {
int num;
};
struct cleanup {
void (*func)();
void *data;
char *tag;
int id;
};
struct xdr_clean_data {
char *xdr_data;
};
typedef struct xdr_clean_data xdr_clean_data;
#define INIT_UPD_LIST_TIME_INCR 120
#define MAX_UPD_LIST_TIME_INCR 1920
/*
* "nis_mt.h" needs some of the declarations above (notably nis_fn_result),
* but also redefines some items below, so it needs to be included here.
*/
#include "nis_mt.h"
/*
* We include <nisdb_ldap.h> and "nis_ldap.h" here as a convenience for
* the rpc.nisd source files.
*/
#include <nisdb_ldap.h>
#include "nis_ldap.h"
struct ping_item {
};
struct sdata {
void *buf; /* Memory allocation pointer */
};
/* operations statistics vector */
struct ops_stats {
int cursamp; /* current sample index */
};
/*
* Used for caching table objects
*/
struct table_item {
};
/*
*/
struct callback_id {
struct callback_id *next;
};
typedef struct callback_id callback_id;
/*
* Forward reference declarations for functions in the service and in
* the nis library
*/
#ifdef __STDC__
/* in nis_db.c */
extern void __make_legal(char *);
extern void free_db_list(nis_db_list_result *);
nis_object *);
nis_object *);
nis_object *);
nis_object *, u_long);
extern void add_checkpoint(nis_name);
extern int checkpoint_db();
extern char *internal_table_name(nis_name, char *);
extern int nis_db_sync_log(void);
extern nis_error db_configure(char *);
extern int loadLDAPdata(void);
/* in nis_subr_proc.c */
extern int nis_strcasecmp(char *, char *);
extern int nis_isserving(nis_object *);
nis_object **);
nis_object **, int);
extern void nis_getprincipal(char *, struct svc_req *);
extern u_char *__get_xdr_buf(int);
extern char *__get_string_buf(int);
extern entry_col *__get_entry_col(int);
extern table_col *__get_table_col(int);
extern nis_attr *__get_attrs(int);
extern int nis_isstable(log_entry *, int);
extern void flush_tablecache(nis_name);
extern int replica_update(ping_item *);
extern int ping_replicas(ping_item *);
extern void do_cleanup(cleanup *);
extern void add_cleanup(void (*)(), void *, char *);
extern void do_xdr_cleanup(xdr_clean_data *);
extern void add_xdr_cleanup(bool_t (*)(), char *, char *);
int (*)());
/* in nis_ib_proc.c */
struct netbuf *, char **, int);
/* in nis_log_svc.c */
extern int apply_transaction(log_entry *);
extern int checkpoint_log(void);
extern int abort_transaction(int);
/* in nis_log_common.c */
extern int begin_transaction(nis_name);
extern int end_transaction_x(int, int);
extern int end_transaction(int);
extern int lockTransLog(char *, int, int);
extern void unlockTransLog(char *, int);
extern int map_log(char *, int);
extern void sync_log();
/* nis_opacc.c */
struct svc_req *);
extern void nis_delete_callback_id(pthread_t);
#else
/* in nis_db.c */
extern void __make_legal();
extern nis_db_result *db_add();
extern nis_db_result *db_remove();
extern nis_error __db_remove();
extern nis_db_result *db_lookup();
extern nis_db_result *db_lookup_deferred();
extern nis_db_list_result *db_list();
extern nis_db_list_result *db_list_flags();
extern void free_db_list();
extern nis_db_result *db_addib();
extern nis_error *__db_addib();
extern nis_error *__db_addib_nolog();
extern nis_error *__db_addib_nosync();
extern nis_db_result *db_remib();
extern nis_error __db_remib();
extern nis_error __db_remib_nosync();
extern nis_fn_result *db_firstib();
extern nis_fn_result *db_nextib();
extern nis_error db_find_table();
extern nis_error db_destroy();
extern void db_flush();
extern void add_checkpoint();
extern int checkpoint_db();
extern nis_name __table_name();
extern int nis_db_sync_log();
extern nis_error db_configure();
extern int loadLDAPdata();
/* in nis_subr_proc.c */
extern int nis_strcasecmp();
extern int nis_isserving();
extern nis_error __directory_object();
extern nis_error __directory_object_msg();
extern void nis_getprincipal();
extern nis_error get_object_safely();
extern nis_result *svc_lookup();
extern int __can_do();
extern u_char *__get_xdr_buf();
extern char *__get_string_buf();
extern entry_col *__get_entry_col();
extern table_col *__get_table_col();
extern nis_attr *__get_attrs();
extern int nis_isstable();
extern void flush_tablecache();
extern u_long nis_cptime();
extern void make_stamp();
extern void replica_update();
extern void add_pingitem();
extern void do_cleanup();
extern void add_cleanup();
extern void do_xdr_cleanup();
extern void add_xdr_cleanup();
extern nis_result *__nis_local_lookup();
/* in nis_ib_proc.c */
extern nis_object *nis_censor_object_attr();
extern nis_object *nis_censor_object();
extern endpoint *__nis_alt_callback_server();
/* in nis_log_svc.c */
extern u_long last_update();
extern int apply_transaction();
extern int checkpoint_log();
extern u_long add_update();
extern u_long add_update_nosync();
extern int abort_transaction();
extern void entries_since();
/* in nis_log_common.c */
extern int begin_transaction();
extern int end_transaction_x();
extern int end_transaction();
extern int lockTransLog();
extern void unlockTransLog();
extern int map_log();
extern void sync_log();
extern int __log_resync();
extern char *__make_name();
/* nis_opacc.c */
extern bool_t nis_op_access();
extern void nis_delete_callback_id();
extern pid_t nis_get_callback_id();
extern anonid_t nis_add_callback_id();
#endif
/*
* Declarations for global state used by the service.
*/
extern int root_server; /* set by the -r switch */
extern int verbose; /* set by the -v switch */
extern int static_root; /* set by network partition */
extern int secure_level; /* set by the -S switch */
extern int checkpoint_all;
/*
* MACRO definitions for the various source modules.
*/
#define ROOT_OBJ "root.object"
#define PARENT_OBJ "parent.object"
#define FN_NOMANGLE 0 /* don't mangle objects on first/next calls */
#define ADD_OP 1
#define REM_OP 2
#define MOD_OP 3
#define FIRST_OP 4
#define NEXT_OP 5
#define DIR_IDLE_TIME 120
/* Global variables defined in nis_log_common.c */
extern pid_t master_pid;
/* Global variables defined in nis_main.c */
extern int children; /* Server load control */
extern int max_children; /* Max number of forked children */
extern int readonly; /* When true the service is read only */
extern int need_checkpoint; /* When true the log should be checkpointed */
extern int force_checkpoint; /* When true the log WILL be checkpointed */
extern int auth_verbose; /* verbose authorization messages */
/*
* A set of defines for tracking memory problems. A simple memory allocator
* and checker is part of nis_malloc.c and when DEBUG is defined and this
* freeing free memory, etc.
*/
#ifdef MEM_DEBUG
#ifdef __STDC__
extern void xfree(void *);
extern char *xstrdup(char *);
extern char *xmalloc(int);
extern char *xcalloc(int, int);
#else
extern void xfree();
extern char *xstrdup();
extern char *xmalloc();
extern char *xcalloc();
#endif /* __STDC__ */
#else
#endif
#ifdef __cplusplus
}
#endif
#endif /* _NIS_PROC_H */