/*
 * 5799-WZQ (C) COPYRIGHT = NONE
 * LICENSED MATERIALS - PROPERTY OF IBM
 */
/* $Header:ypprot_err.c 12.0$ */
/* $ACIS:ypprot_err.c 12.0$ */
/* $Source: /ibm/acis/usr/src/lib/libc/yp/RCS/ypprot_err.c,v $ */

#ifndef lint
static char *rcsid = "$Header:ypprot_err.c 12.0$";
#endif

#include <sys/nfs_defines.h>

#ifdef VFS

/* @(#)ypprot_err.c	1.3 87/08/06 3.2/4.3NFSSRC */
#ifndef lint
static  char sccsid[] = "@(#)ypprot_err.c 1.1 86/09/24 Copyr 1985 Sun Micro";
#endif

#include <rpc/rpc.h>
#include "yp_prot.h"
#include "ypclnt.h"

/*
 * Maps a yp protocol error code (as defined in
 * yp_prot.h) to a yp client interface error code (as defined in
 * ypclnt.h).
 */
int
ypprot_err(yp_protocol_error)
	unsigned int yp_protocol_error;
{
	int reason;

	switch (yp_protocol_error) {
	case YP_TRUE: 
		reason = 0;
		break;
 	case YP_NOMORE: 
		reason = YPERR_NOMORE;
		break;
 	case YP_NOMAP: 
		reason = YPERR_MAP;
		break;
 	case YP_NODOM: 
		reason = YPERR_DOMAIN;
		break;
 	case YP_NOKEY: 
		reason = YPERR_KEY;
		break;
 	case YP_BADARGS:
		reason = YPERR_BADARGS;
		break;
 	case YP_BADDB:
		reason = YPERR_BADDB;
		break;
 	case YP_VERS:
		reason = YPERR_VERS;
		break;
	default:
		reason = YPERR_YPERR;
		break;
	}
	
  	return(reason);
}

#endif
