nisctl.c 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
*/
/*
* nisctl.c
*
* Copyright (c) 1988-1992 Sun Microsystems Inc
* All Rights Reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* nisctl.c
*
* This program is used to control the operation of NIS+ servers.
* It may be used to turn debugging on and off, and to flush
* various caches and print statistics.
*/
#include <stdio.h>
extern int optind;
extern char *optarg;
usage(s)
char *s;
{
"usage: %s [-M] [-s] [-v on|off] [-f dgot [-n obj_name]] [-H host] [domain]\n",
s);
"\t-f: flush cache (dir, group, object, table) [-n obj_name]\n");
"specified\n");
exit(1);
}
int argc;
char *argv[];
{
int c;
int i;
nis_server **srvs, **x;
char dname[1024], *s;
char server[NIS_MAXNAMELEN];
i = 0;
/* nisctl cannot be used without any options */
if (argc == 1) {
exit(1);
}
switch (c) {
case 'M' :
i = 1;
break;
case 'f' :
for (s = optarg; *s; s++) {
switch (*s) {
case 'g':
break;
case 'd':
break;
case 'o':
break;
case 't':
break;
default:
}
i++;
}
break;
case 'n':
/* specifies a particular entry to flush */
if (i == 0) {
}
if (i > 1) {
"only one option allowed\n");
}
i = 0; /* kludge - reset it */
case TAG_GCACHE_ALL:
break;
case TAG_TCACHE_ALL:
break;
case TAG_DCACHE_ALL:
break;
case TAG_OCACHE:
"Object flushing not supported\n");
default:
}
i = 1; /* reset it back */
break;
case 'v' :
else
break;
case 's' :
break;
case 'H' :
if (!optarg)
else
break;
default :
exit(1);
}
}
else
exit(1);
}
if (! srvs) {
"Unable to get list of servers serving \"%s\"\n", dname);
exit(1);
}
for (x = srvs; *x; x++) {
continue;
if (error == NIS_SUCCESS) {
exit(1);
}
} else {
nis_sperrno(error));
exit(1);
}
nis_freetags(res, i);
}
exit(0);
}