1*043fbe51Sderaadt /* $OpenBSD: yppush_err.c,v 1.8 2009/10/27 23:59:58 deraadt Exp $ */
2bbfaf3a3Sderaadt
363ab8f9cSdm /*
463ab8f9cSdm * Copyright (c) 1996 Mats O Jansson <moj@stacken.kth.se>
563ab8f9cSdm * All rights reserved.
663ab8f9cSdm *
763ab8f9cSdm * Redistribution and use in source and binary forms, with or without
863ab8f9cSdm * modification, are permitted provided that the following conditions
963ab8f9cSdm * are met:
1063ab8f9cSdm * 1. Redistributions of source code must retain the above copyright
1163ab8f9cSdm * notice, this list of conditions and the following disclaimer.
1263ab8f9cSdm * 2. Redistributions in binary form must reproduce the above copyright
1363ab8f9cSdm * notice, this list of conditions and the following disclaimer in the
1463ab8f9cSdm * documentation and/or other materials provided with the distribution.
1563ab8f9cSdm *
1663ab8f9cSdm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
1763ab8f9cSdm * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1863ab8f9cSdm * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1963ab8f9cSdm * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
2063ab8f9cSdm * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2163ab8f9cSdm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2263ab8f9cSdm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2363ab8f9cSdm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2463ab8f9cSdm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2563ab8f9cSdm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2663ab8f9cSdm * SUCH DAMAGE.
2763ab8f9cSdm */
2863ab8f9cSdm
2963ab8f9cSdm #include <rpcsvc/yp.h>
305325fcc5Sderaadt #include "yppush.h"
3163ab8f9cSdm
3263ab8f9cSdm char *
yppush_err_string(enum yppush_status y)3333dd5606Sderaadt yppush_err_string(enum yppush_status y)
34c4c5f39cSderaadt {
35c4c5f39cSderaadt
3663ab8f9cSdm switch (y) {
3763ab8f9cSdm case YPPUSH_SUCC:
38c4c5f39cSderaadt return ("Success");
3963ab8f9cSdm case YPPUSH_AGE:
40c4c5f39cSderaadt return ("Master's version not newer");
4163ab8f9cSdm case YPPUSH_NOMAP:
42c4c5f39cSderaadt return ("Can't find server for map");
4363ab8f9cSdm case YPPUSH_NODOM:
44c4c5f39cSderaadt return ("Domain not supported");
4563ab8f9cSdm case YPPUSH_RSRC:
46c4c5f39cSderaadt return ("Local resource alloc failure");
4763ab8f9cSdm case YPPUSH_RPC:
48c4c5f39cSderaadt return ("RPC failure talking to server");
4963ab8f9cSdm case YPPUSH_MADDR:
50c4c5f39cSderaadt return ("Can't get master address");
5163ab8f9cSdm case YPPUSH_YPERR:
52c4c5f39cSderaadt return ("YP server/map db error");
5363ab8f9cSdm case YPPUSH_BADARGS:
54c4c5f39cSderaadt return ("Request arguments bad");
5563ab8f9cSdm case YPPUSH_DBM:
56c4c5f39cSderaadt return ("Local dbm operation failed");
5763ab8f9cSdm case YPPUSH_FILE:
58c4c5f39cSderaadt return ("Local file I/O operation failed");
5963ab8f9cSdm case YPPUSH_SKEW:
60c4c5f39cSderaadt return ("Map version skew during transfer");
6163ab8f9cSdm case YPPUSH_CLEAR:
62c4c5f39cSderaadt return ("Can't send \"Clear\" req to local ypserv");
6363ab8f9cSdm case YPPUSH_FORCE:
64c4c5f39cSderaadt return ("No local order number in map use -f flag.");
6563ab8f9cSdm case YPPUSH_XFRERR:
66c4c5f39cSderaadt return ("ypxfr error");
6763ab8f9cSdm case YPPUSH_REFUSED:
68c4c5f39cSderaadt return ("Transfer request refused by ypserv");
6963ab8f9cSdm }
70c4c5f39cSderaadt return ("unknown error");
71c4c5f39cSderaadt }
72