summaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv/yppush
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-07-15 06:10:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-07-15 06:10:47 +0000
commit922441d1f8a1fee372fbabd2bc2847427c615021 (patch)
treed238dad6c670df972d60933dbd365b716ada61ec /usr.sbin/ypserv/yppush
parentd87819fc35744dfcf59693c3497e2bbca6c7f933 (diff)
protos and repairs
Diffstat (limited to 'usr.sbin/ypserv/yppush')
-rw-r--r--usr.sbin/ypserv/yppush/yppush.c14
-rw-r--r--usr.sbin/ypserv/yppush/yppush.h31
-rw-r--r--usr.sbin/ypserv/yppush/yppush_err.c5
-rw-r--r--usr.sbin/ypserv/yppush/yppush_proc.c13
-rw-r--r--usr.sbin/ypserv/yppush/yppush_svc.c21
5 files changed, 32 insertions, 52 deletions
diff --git a/usr.sbin/ypserv/yppush/yppush.c b/usr.sbin/ypserv/yppush/yppush.c
index d901b5078e9..d449cf514fc 100644
--- a/usr.sbin/ypserv/yppush/yppush.c
+++ b/usr.sbin/ypserv/yppush/yppush.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yppush.c,v 1.20 2003/06/02 21:58:27 maja Exp $ */
+/* $OpenBSD: yppush.c,v 1.21 2003/07/15 06:10:46 deraadt Exp $ */
/*
* Copyright (c) 1995 Mats O Jansson <moj@stacken.kth.se>
@@ -27,7 +27,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: yppush.c,v 1.20 2003/06/02 21:58:27 maja Exp $";
+static const char rcsid[] = "$OpenBSD: yppush.c,v 1.21 2003/07/15 06:10:46 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -63,14 +63,14 @@ char *master;
extern void yppush_xfrrespprog_1(struct svc_req *request, SVCXPRT *xprt);
extern bool_t xdr_ypreq_xfr(XDR *, struct ypreq_xfr *);
-void
+static void
usage(void)
{
fprintf(stderr, "usage: yppush [-d domainname] [-h host] [-v] mapname\n");
exit(1);
}
-void
+static void
_svc_run(void)
{
fd_set *readfdsp = NULL;
@@ -110,7 +110,7 @@ _svc_run(void)
}
}
-void
+static void
req_xfr(pid_t pid, u_int prog, SVCXPRT *transp, char *host, CLIENT *client)
{
struct ypreq_xfr request;
@@ -144,7 +144,7 @@ req_xfr(pid_t pid, u_int prog, SVCXPRT *transp, char *host, CLIENT *client)
}
}
-void
+static void
push(int inlen, char *indata)
{
char host[MAXHOSTNAMELEN];
@@ -209,7 +209,7 @@ push(int inlen, char *indata)
}
-int
+static int
pushit(u_long instatus, char *inkey, int inkeylen, char *inval, int invallen,
void *indata)
{
diff --git a/usr.sbin/ypserv/yppush/yppush.h b/usr.sbin/ypserv/yppush/yppush.h
index 2049a6ad808..aa07f04036f 100644
--- a/usr.sbin/ypserv/yppush/yppush.h
+++ b/usr.sbin/ypserv/yppush/yppush.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: yppush.h,v 1.8 2003/06/02 21:58:27 maja Exp $ */
+/* $OpenBSD: yppush.h,v 1.9 2003/07/15 06:10:46 deraadt Exp $ */
/*
* Copyright (c) 1996 Mats O Jansson <moj@stacken.kth.se>
@@ -31,32 +31,6 @@
#include <rpc/rpc.h>
-enum yppush_status {
- YPPUSH_SUCC = 1,
- YPPUSH_AGE = 2,
- YPPUSH_NOMAP = -1,
- YPPUSH_NODOM = -2,
- YPPUSH_RSRC = -3,
- YPPUSH_RPC = -4,
- YPPUSH_MADDR = -5,
- YPPUSH_YPERR = -6,
- YPPUSH_BADARGS = -7,
- YPPUSH_DBM = -8,
- YPPUSH_FILE = -9,
- YPPUSH_SKEW = -10,
- YPPUSH_CLEAR = -11,
- YPPUSH_FORCE = -12,
- YPPUSH_XFRERR = -13,
- YPPUSH_REFUSED = -14
-};
-typedef enum yppush_status yppush_status;
-
-struct yppushresp_xfr {
- u_int transid;
- yppush_status status;
-};
-typedef struct yppushresp_xfr yppushresp_xfr;
-
#define YPPUSH_XFRRESPPROG ((u_long)0x40000000)
#define YPPUSH_XFRRESPVERS ((u_long)1)
#define YPPUSHPROC_NULL ((u_long)0)
@@ -67,9 +41,8 @@ bool_t xdr_yppush_status(XDR *, yppush_status *);
bool_t xdr_yppushresp_xfr(XDR *, yppushresp_xfr *);
void * yppushproc_null_1(void *, CLIENT *);
void * yppushproc_null_1_svc(void *, struct svc_req *);
-void * yppushproc_xfrresp_1(yppushresp_xfr *, CLIENT *);
-void * yppushproc_xfrresp_1_svc(yppushresp_xfr *, struct svc_req *);
char * yppush_err_string(enum yppush_status y);
+void yppush_xfrrespprog_1(struct svc_req *, SVCXPRT *);
__END_DECLS
#endif /* !_YPPUSH_H_RPCGEN */
diff --git a/usr.sbin/ypserv/yppush/yppush_err.c b/usr.sbin/ypserv/yppush/yppush_err.c
index 5c909eee7ee..074aaed8d75 100644
--- a/usr.sbin/ypserv/yppush/yppush_err.c
+++ b/usr.sbin/ypserv/yppush/yppush_err.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yppush_err.c,v 1.6 2003/06/02 21:58:27 maja Exp $ */
+/* $OpenBSD: yppush_err.c,v 1.7 2003/07/15 06:10:46 deraadt Exp $ */
/*
* Copyright (c) 1996 Mats O Jansson <moj@stacken.kth.se>
@@ -27,10 +27,11 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: yppush_err.c,v 1.6 2003/06/02 21:58:27 maja Exp $";
+static const char rcsid[] = "$OpenBSD: yppush_err.c,v 1.7 2003/07/15 06:10:46 deraadt Exp $";
#endif /* not lint */
#include <rpcsvc/yp.h>
+#include "yppush.h"
char *
yppush_err_string(enum yppush_status y)
diff --git a/usr.sbin/ypserv/yppush/yppush_proc.c b/usr.sbin/ypserv/yppush/yppush_proc.c
index ecb557980aa..8e2309f3834 100644
--- a/usr.sbin/ypserv/yppush/yppush_proc.c
+++ b/usr.sbin/ypserv/yppush/yppush_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yppush_proc.c,v 1.7 2003/06/02 21:58:27 maja Exp $ */
+/* $OpenBSD: yppush_proc.c,v 1.8 2003/07/15 06:10:46 deraadt Exp $ */
/*
* Copyright (c) 1996 Mats O Jansson <moj@stacken.kth.se>
@@ -27,9 +27,11 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: yppush_proc.c,v 1.7 2003/06/02 21:58:27 maja Exp $";
+static const char rcsid[] = "$OpenBSD: yppush_proc.c,v 1.8 2003/07/15 06:10:46 deraadt Exp $";
#endif /* not lint */
+#include <sys/types.h>
+#include <rpcsvc/yp.h>
#include <stdio.h>
#include "yppush.h"
@@ -46,9 +48,10 @@ yppushproc_null_1_svc(void *argp, struct svc_req *rqstp)
return((void *) &result);
}
-void *
-yppushproc_xfrresp_1_svc(yppushresp_xfr *argp, struct svc_req *rqstp)
+yppushresp_xfr *
+yppushproc_xfrresp_1_svc(void *v, struct svc_req *rqstp)
{
+ yppushresp_xfr *argp = (yppushresp_xfr *)v;
static char *result;
/*
@@ -57,5 +60,5 @@ yppushproc_xfrresp_1_svc(yppushresp_xfr *argp, struct svc_req *rqstp)
if ((argp->status < YPPUSH_SUCC) || Verbose)
fprintf(stderr, "yppush: %s\n",
yppush_err_string(argp->status));
- return((void *) &result);
+ return((yppushresp_xfr *) &result);
}
diff --git a/usr.sbin/ypserv/yppush/yppush_svc.c b/usr.sbin/ypserv/yppush/yppush_svc.c
index b272282c15d..d42dc65941a 100644
--- a/usr.sbin/ypserv/yppush/yppush_svc.c
+++ b/usr.sbin/ypserv/yppush/yppush_svc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yppush_svc.c,v 1.10 2003/06/02 21:58:27 maja Exp $ */
+/* $OpenBSD: yppush_svc.c,v 1.11 2003/07/15 06:10:46 deraadt Exp $ */
/*
* Copyright (c) 1996 Mats O Jansson <moj@stacken.kth.se>
@@ -27,11 +27,9 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: yppush_svc.c,v 1.10 2003/06/02 21:58:27 maja Exp $";
+static const char rcsid[] = "$OpenBSD: yppush_svc.c,v 1.11 2003/07/15 06:10:46 deraadt Exp $";
#endif /* not lint */
-#include "yppush.h"
-
#include <sys/types.h>
#include <sys/ttycom.h>
#include <sys/socket.h>
@@ -41,6 +39,9 @@ static const char rcsid[] = "$OpenBSD: yppush_svc.c,v 1.10 2003/06/02 21:58:27 m
#include <netdb.h>
#include <memory.h>
#include <syslog.h>
+#include <rpcsvc/yp.h>
+
+#include "yppush.h"
#ifdef DEBUG
#define RPC_SVC_FG
@@ -67,25 +68,27 @@ void _msgout(char *msg)
void
yppush_xfrrespprog_1(struct svc_req *rqstp, SVCXPRT *transp)
{
- union {
+ union argument {
int fill;
} argument;
char *result;
- bool_t (*xdr_argument)(), (*xdr_result)();
- char *(*local)();
+ xdrproc_t xdr_argument, xdr_result;
+ char *(*local)(union argument *, struct svc_req *);
_rpcsvcdirty = 1;
switch (rqstp->rq_proc) {
case YPPUSHPROC_NULL:
xdr_argument = xdr_void;
xdr_result = xdr_void;
- local = (char *(*)()) yppushproc_null_1_svc;
+ local = (char *(*)(union argument *, struct svc_req *))
+ yppushproc_null_1_svc;
break;
case YPPUSHPROC_XFRRESP:
xdr_argument = xdr_yppushresp_xfr;
xdr_result = xdr_void;
- local = (char *(*)()) yppushproc_xfrresp_1_svc;
+ local = (char *(*)(union argument *, struct svc_req *))
+ yppushproc_xfrresp_1_svc;
break;
default: