xref: /netbsd-src/usr.sbin/ypserv/yppush/yppush_proc.c (revision 07ce40632e7aec9e3c738f3250b39f23d21c5437)
1*07ce4063Ssnj /*	$NetBSD: yppush_proc.c,v 1.6 2009/10/20 00:51:14 snj Exp $	*/
260aa689cSthorpej 
360aa689cSthorpej /*
460aa689cSthorpej  * Copyright (c) 1996 Mats O Jansson <moj@stacken.kth.se>
560aa689cSthorpej  * All rights reserved.
660aa689cSthorpej  *
760aa689cSthorpej  * Redistribution and use in source and binary forms, with or without
860aa689cSthorpej  * modification, are permitted provided that the following conditions
960aa689cSthorpej  * are met:
1060aa689cSthorpej  * 1. Redistributions of source code must retain the above copyright
1160aa689cSthorpej  *    notice, this list of conditions and the following disclaimer.
1260aa689cSthorpej  * 2. Redistributions in binary form must reproduce the above copyright
1360aa689cSthorpej  *    notice, this list of conditions and the following disclaimer in the
1460aa689cSthorpej  *    documentation and/or other materials provided with the distribution.
1560aa689cSthorpej  *
1660aa689cSthorpej  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
1760aa689cSthorpej  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1860aa689cSthorpej  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1960aa689cSthorpej  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
2060aa689cSthorpej  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2160aa689cSthorpej  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2260aa689cSthorpej  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2360aa689cSthorpej  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2460aa689cSthorpej  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2560aa689cSthorpej  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2660aa689cSthorpej  * SUCH DAMAGE.
2760aa689cSthorpej  */
2860aa689cSthorpej 
2988b87b15Slukem #include <sys/cdefs.h>
3088b87b15Slukem #ifndef lint
31*07ce4063Ssnj __RCSID("$NetBSD: yppush_proc.c,v 1.6 2009/10/20 00:51:14 snj Exp $");
3288b87b15Slukem #endif
3388b87b15Slukem 
3460aa689cSthorpej #include <sys/types.h>
3560aa689cSthorpej 
3660aa689cSthorpej #include <err.h>
373d8138fcSthorpej #include <string.h>
3860aa689cSthorpej 
3960aa689cSthorpej #include <rpc/rpc.h>
4060aa689cSthorpej #include <rpc/xdr.h>
4160aa689cSthorpej #include <rpcsvc/yp_prot.h>
4260aa689cSthorpej 
4360aa689cSthorpej #include "yppush.h"
4460aa689cSthorpej 
4560aa689cSthorpej void *
yppushproc_null_1_svc(void * argp,struct svc_req * rqstp)468891dbdcSwiz yppushproc_null_1_svc(void *argp, struct svc_req *rqstp)
4760aa689cSthorpej {
4860aa689cSthorpej 	static char result;
4960aa689cSthorpej 
5060aa689cSthorpej 	(void) memset(&result, 0, sizeof(result));
5160aa689cSthorpej 	return ((void *)&result);
5260aa689cSthorpej }
5360aa689cSthorpej 
5460aa689cSthorpej void *
yppushproc_xfrresp_1_svc(void * argp,struct svc_req * rqstp)558891dbdcSwiz yppushproc_xfrresp_1_svc(void *argp, struct svc_req *rqstp)
5660aa689cSthorpej {
5760aa689cSthorpej 	struct yppushresp_xfr *resp = argp;
5860aa689cSthorpej 	static char result;
5960aa689cSthorpej 
6060aa689cSthorpej 	if (resp->status != YPPUSH_SUCC)
618e4ac5feSlukem 		warnx("%s", yppush_err_string(resp->status));
6260aa689cSthorpej 
6360aa689cSthorpej 	(void) memset(&result, 0, sizeof(result));
6460aa689cSthorpej 	return ((void *)&result);
6560aa689cSthorpej }
66