/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <libintl.h>
#include <locale.h>
#include <rpcsvc/nlm_prot.h>
#include <sys/systeminfo.h>
#include <netdb.h>
#include <nss_dbdefs.h>
extern char *optarg;
extern int optind;
static int share_zap(char *, char *);
/*
* Clear locks and v4 related state held by
* 'client'.
*/
static int
{
int he_error;
char **ap;
gettext("client name '%s' can not be resolved\n"),
client);
return (1);
}
if (he_error) {
perror("gethostbyname");
return (1);
}
/*
* The NFS4 clear state interface is
* versioned in case we need to pass
* more information in the future.
*/
/*
* Iterate over IP Addresses clear
* state for each.
*/
}
return (0);
}
int
{
int i, c, ret;
int sflag = 0;
int errflg = 0;
exit(1);
}
#if !defined(TEXT_DOMAIN)
#endif
(void) textdomain(TEXT_DOMAIN);
/*
* Get the official hostname for this host
*/
switch (c) {
case 's':
sflag++;
break;
case '?':
errflg++;
}
}
if (errflg || i != 1) {
gettext("Usage: clear_locks [-s] hostname\n"));
exit(2);
}
if (sflag) {
gettext("Clearing locks held for NFS client %s on server %s\n"),
} else {
gettext("Clearing locks held for NFS client %s on server %s\n"),
}
return (ret);
}
/*
* Request that host 'server' free all locks held by
* host 'client'.
*/
static int
{
if (rslt != RPC_SUCCESS) {
return (3);
}
gettext("clear of locks held for %s on %s returned success\n"),
return (0);
}