diff options
author | Mats O Jansson <maja@cvs.openbsd.org> | 2003-06-22 23:57:08 +0000 |
---|---|---|
committer | Mats O Jansson <maja@cvs.openbsd.org> | 2003-06-22 23:57:08 +0000 |
commit | 1d604f2421b24cb4cdba6facc533af0cbb6bed2a (patch) | |
tree | 1fc9a1ad935ab809fd15103205505378973c4987 /usr.sbin/ypserv | |
parent | 68e9b481b25028d497447e7d2dc11eeefb6b45c3 (diff) |
Remove files without copyright. Add a yp v1 protocol specification and
generate files at compile time. -moj ok @deraadt
Diffstat (limited to 'usr.sbin/ypserv')
-rw-r--r-- | usr.sbin/ypserv/ypserv/Makefile | 28 | ||||
-rw-r--r-- | usr.sbin/ypserv/ypserv/ypserv.c | 42 | ||||
-rw-r--r-- | usr.sbin/ypserv/ypserv/ypserv_proc.c | 24 | ||||
-rw-r--r-- | usr.sbin/ypserv/ypserv/ypserv_xdr_v1.c | 92 | ||||
-rw-r--r-- | usr.sbin/ypserv/ypserv/ypv1.h | 241 | ||||
-rw-r--r-- | usr.sbin/ypserv/ypserv/ypv1.x | 161 |
6 files changed, 218 insertions, 370 deletions
diff --git a/usr.sbin/ypserv/ypserv/Makefile b/usr.sbin/ypserv/ypserv/Makefile index 235b95b5096..706bd0a3d2c 100644 --- a/usr.sbin/ypserv/ypserv/Makefile +++ b/usr.sbin/ypserv/ypserv/Makefile @@ -1,13 +1,33 @@ -# $OpenBSD: Makefile,v 1.9 2003/02/13 05:54:39 maja Exp $ +# $OpenBSD: Makefile,v 1.10 2003/06/22 23:57:07 maja Exp $ PROG= ypserv -SRCS= ypserv.c ypserv_proc.c ypserv_db.c acl.c yplog.c ypdb.c \ - ypserv_xdr_v1.c MAN= ypserv.acl.5 securenet.5 ypserv.8 + +XSRCS= ypv1.x +TSRCS= ${XSRCS:R:S/$/.c/g} +HDRS= ${XSRCS:R:S/$/.h/g} +SRCS+= ${TSRCS} + +SRCS+= ypserv.c ypserv_proc.c ypserv_db.c acl.c yplog.c ypdb.c + +CLEANFILES+= ${TSRCS} ${HDRS} + LDADD+= -lutil -lrpcsvc DPADD+= ${LIBUTIL} ${LIBRPCSVC} .PATH: ${.CURDIR}/../common -CFLAGS+=-DDAEMON -DOPTDB -I${.CURDIR}/../common +CFLAGS+=-DDAEMON -DOPTDB -I${.CURDIR}/../common -I. #CFLAGS=-DDAEMON -I${.CURDIR}/../common -DDEBUG -g +all: ypserv +beforedepend: ${HDRS} +ypv1.c: ypv1.h + .include <bsd.prog.mk> + +.SUFFIXES: .x .c .h + +.x.c: + rpcgen -C -c ${.IMPSRC} -o ${.TARGET} + +.x.h: + rpcgen -C -h ${.IMPSRC} -o ${.TARGET} diff --git a/usr.sbin/ypserv/ypserv/ypserv.c b/usr.sbin/ypserv/ypserv/ypserv.c index b9f1f643ba2..523067c9c53 100644 --- a/usr.sbin/ypserv/ypserv/ypserv.c +++ b/usr.sbin/ypserv/ypserv/ypserv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypserv.c,v 1.29 2003/06/12 21:09:48 deraadt Exp $ */ +/* $OpenBSD: ypserv.c,v 1.30 2003/06/22 23:57:07 maja Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -27,7 +27,7 @@ */ #ifndef LINT -static const char rcsid[] = "$OpenBSD: ypserv.c,v 1.29 2003/06/12 21:09:48 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: ypserv.c,v 1.30 2003/06/22 23:57:07 maja Exp $"; #endif #include <sys/types.h> @@ -115,15 +115,15 @@ static void ypprog_1(struct svc_req *rqstp, SVCXPRT *transp) { union { - domainname ypproc_domain_1_arg; - domainname ypproc_domain_nonack_1_arg; - yprequest ypproc_match_1_arg; - yprequest ypproc_first_1_arg; - yprequest ypproc_next_1_arg; - yprequest ypproc_poll_1_arg; - yprequest ypproc_push_1_arg; - yprequest ypproc_pull_1_arg; - yprequest ypproc_get_1_arg; + domainname ypoldproc_domain_1_arg; + domainname ypoldproc_domain_nonack_1_arg; + yprequest ypoldproc_match_1_arg; + yprequest ypoldproc_first_1_arg; + yprequest ypoldproc_next_1_arg; + yprequest ypoldproc_poll_1_arg; + yprequest ypoldproc_push_1_arg; + yprequest ypoldproc_pull_1_arg; + yprequest ypoldproc_get_1_arg; } argument; char *result; xdrproc_t xdr_argument, xdr_result; @@ -134,61 +134,61 @@ ypprog_1(struct svc_req *rqstp, SVCXPRT *transp) case YPOLDPROC_NULL: xdr_argument = (xdrproc_t) xdr_void; xdr_result = (xdrproc_t) xdr_void; - local = (char *(*)(char *, struct svc_req *)) ypproc_null_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_null_1_svc; break; case YPOLDPROC_DOMAIN: xdr_argument = (xdrproc_t) xdr_domainname; xdr_result = (xdrproc_t) xdr_bool; - local = (char *(*)(char *, struct svc_req *)) ypproc_domain_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_domain_1_svc; break; case YPOLDPROC_DOMAIN_NONACK: xdr_argument = (xdrproc_t) xdr_domainname; xdr_result = (xdrproc_t) xdr_bool; - local = (char *(*)(char *, struct svc_req *)) ypproc_domain_nonack_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_domain_nonack_1_svc; break; case YPOLDPROC_MATCH: xdr_argument = (xdrproc_t) xdr_yprequest; xdr_result = (xdrproc_t) xdr_ypresponse; - local = (char *(*)(char *, struct svc_req *)) ypproc_match_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_match_1_svc; break; case YPOLDPROC_FIRST: xdr_argument = (xdrproc_t) xdr_yprequest; xdr_result = (xdrproc_t) xdr_ypresponse; - local = (char *(*)(char *, struct svc_req *)) ypproc_first_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_first_1_svc; break; case YPOLDPROC_NEXT: xdr_argument = (xdrproc_t) xdr_yprequest; xdr_result = (xdrproc_t) xdr_ypresponse; - local = (char *(*)(char *, struct svc_req *)) ypproc_next_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_next_1_svc; break; case YPOLDPROC_POLL: xdr_argument = (xdrproc_t) xdr_yprequest; xdr_result = (xdrproc_t) xdr_ypresponse; - local = (char *(*)(char *, struct svc_req *)) ypproc_poll_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_poll_1_svc; break; case YPOLDPROC_PUSH: xdr_argument = (xdrproc_t) xdr_yprequest; xdr_result = (xdrproc_t) xdr_void; - local = (char *(*)(char *, struct svc_req *)) ypproc_push_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_push_1_svc; break; case YPOLDPROC_PULL: xdr_argument = (xdrproc_t) xdr_yprequest; xdr_result = (xdrproc_t) xdr_void; - local = (char *(*)(char *, struct svc_req *)) ypproc_pull_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_pull_1_svc; break; case YPOLDPROC_GET: xdr_argument = (xdrproc_t) xdr_yprequest; xdr_result = (xdrproc_t) xdr_void; - local = (char *(*)(char *, struct svc_req *)) ypproc_get_1_svc; + local = (char *(*)(char *, struct svc_req *)) ypoldproc_get_1_svc; break; default: diff --git a/usr.sbin/ypserv/ypserv/ypserv_proc.c b/usr.sbin/ypserv/ypserv/ypserv_proc.c index 8b9d78bca5e..2527fe80238 100644 --- a/usr.sbin/ypserv/ypserv/ypserv_proc.c +++ b/usr.sbin/ypserv/ypserv/ypserv_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypserv_proc.c,v 1.21 2003/06/02 21:58:27 maja Exp $ */ +/* $OpenBSD: ypserv_proc.c,v 1.22 2003/06/22 23:57:07 maja Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -27,7 +27,7 @@ */ #ifndef LINT -static const char rcsid[] = "$OpenBSD: ypserv_proc.c,v 1.21 2003/06/02 21:58:27 maja Exp $"; +static const char rcsid[] = "$OpenBSD: ypserv_proc.c,v 1.22 2003/06/22 23:57:07 maja Exp $"; #endif #include <rpc/rpc.h> @@ -525,7 +525,7 @@ bail: } void * -ypproc_null_1_svc(void *argp, struct svc_req *rqstp) +ypoldproc_null_1_svc(void *argp, struct svc_req *rqstp) { static char *result; struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt); @@ -545,7 +545,7 @@ ypproc_null_1_svc(void *argp, struct svc_req *rqstp) } bool_t * -ypproc_domain_1_svc(domainname *argp, struct svc_req *rqstp) +ypoldproc_domain_1_svc(domainname *argp, struct svc_req *rqstp) { static bool_t result; /* is domain_served? */ struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt); @@ -573,7 +573,7 @@ bail: } bool_t * -ypproc_domain_nonack_1_svc(domainname *argp, struct svc_req *rqstp) +ypoldproc_domain_nonack_1_svc(domainname *argp, struct svc_req *rqstp) { static bool_t result; /* is domain served? */ struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt); @@ -606,7 +606,7 @@ bail: } ypresponse * -ypproc_match_1_svc(yprequest *argp, struct svc_req *rqstp) +ypoldproc_match_1_svc(yprequest *argp, struct svc_req *rqstp) { static ypresponse res; struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt); @@ -657,7 +657,7 @@ bail: } ypresponse * -ypproc_first_1_svc(yprequest *argp, struct svc_req *rqstp) +ypoldproc_first_1_svc(yprequest *argp, struct svc_req *rqstp) { static ypresponse res; struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt); @@ -705,7 +705,7 @@ bail: } ypresponse * -ypproc_next_1_svc(yprequest *argp, struct svc_req *rqstp) +ypoldproc_next_1_svc(yprequest *argp, struct svc_req *rqstp) { static ypresponse res; struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt); @@ -756,7 +756,7 @@ bail: } ypresponse * -ypproc_poll_1_svc(yprequest *argp, struct svc_req *rqstp) +ypoldproc_poll_1_svc(yprequest *argp, struct svc_req *rqstp) { static ypresponse res; ypresp_order order; @@ -807,7 +807,7 @@ bail: } void * -ypproc_push_1_svc(yprequest *argp, struct svc_req *rqstp) +ypoldproc_push_1_svc(yprequest *argp, struct svc_req *rqstp) { struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt); int ok = acl_check_host(&caller->sin_addr); @@ -852,7 +852,7 @@ bail: } void * -ypproc_pull_1_svc(yprequest *argp, struct svc_req *rqstp) +ypoldproc_pull_1_svc(yprequest *argp, struct svc_req *rqstp) { struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt); int ok = acl_check_host(&caller->sin_addr); @@ -897,7 +897,7 @@ bail: } void * -ypproc_get_1_svc(yprequest *argp, struct svc_req *rqstp) +ypoldproc_get_1_svc(yprequest *argp, struct svc_req *rqstp) { struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt); int ok = acl_check_host(&caller->sin_addr); diff --git a/usr.sbin/ypserv/ypserv/ypserv_xdr_v1.c b/usr.sbin/ypserv/ypserv/ypserv_xdr_v1.c deleted file mode 100644 index abed54e4d75..00000000000 --- a/usr.sbin/ypserv/ypserv/ypserv_xdr_v1.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include <rpcsvc/yp.h> -#include "ypv1.h" -#ifndef lint -static const char rcsid[] = "$OpenBSD: ypserv_xdr_v1.c,v 1.5 2003/05/05 08:37:05 avsm Exp $"; -#endif /* not lint */ - -bool_t -xdr_ypreqtype(xdrs, objp) - XDR *xdrs; - ypreqtype *objp; -{ - if (!xdr_enum(xdrs, (enum_t *)objp)) { - return (FALSE); - } - return (TRUE); -} - -bool_t -xdr_ypresptype(xdrs, objp) - XDR *xdrs; - ypresptype *objp; -{ - if (!xdr_enum(xdrs, (enum_t *)objp)) { - return (FALSE); - } - return (TRUE); -} - -bool_t -xdr_yprequest(xdrs, objp) - XDR *xdrs; - yprequest *objp; -{ - if (!xdr_ypreqtype(xdrs, &objp->yp_reqtype)) { - return (FALSE); - } - switch (objp->yp_reqtype) { - case YPREQ_KEY: - if (!xdr_ypreq_key(xdrs, &objp->yp_reqbody.yp_req_keytype)) { - return (FALSE); - } - break; - case YPREQ_NOKEY: - if (!xdr_ypreq_nokey(xdrs, &objp->yp_reqbody.yp_req_nokeytype)) { - return (FALSE); - } - break; - case YPREQ_MAP_PARMS: - if (!xdr_ypmap_parms(xdrs, &objp->yp_reqbody.yp_req_map_parmstype)) { - return (FALSE); - } - break; - default: - return (FALSE); - } - return (TRUE); -} - -bool_t -xdr_ypresponse(xdrs, objp) - XDR *xdrs; - ypresponse *objp; -{ - if (!xdr_ypresptype(xdrs, &objp->yp_resptype)) { - return (FALSE); - } - switch (objp->yp_resptype) { - case YPRESP_VAL: - if (!xdr_ypresp_val(xdrs, &objp->yp_respbody.yp_resp_valtype)) { - return (FALSE); - } - break; - case YPRESP_KEY_VAL: - if (!xdr_ypresp_key_val(xdrs, &objp->yp_respbody.yp_resp_key_valtype)) { - return (FALSE); - } - break; - case YPRESP_MAP_PARMS: - if (!xdr_ypmap_parms(xdrs, &objp->yp_respbody.yp_resp_map_parmstype)) { - return (FALSE); - } - break; - default: - return (FALSE); - } - return (TRUE); -} diff --git a/usr.sbin/ypserv/ypserv/ypv1.h b/usr.sbin/ypserv/ypserv/ypv1.h deleted file mode 100644 index 898e87146f5..00000000000 --- a/usr.sbin/ypserv/ypserv/ypv1.h +++ /dev/null @@ -1,241 +0,0 @@ -/* $OpenBSD: ypv1.h,v 1.3 2002/07/19 02:38:40 deraadt Exp $ */ - -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _YPV1_H_RPCGEN -#define _YPV1_H_RPCGEN - -#include <rpc/rpc.h> - -#define YPOLDVERS ((u_long)1) - -enum ypreqtype { - YPREQ_KEY = 1, - YPREQ_NOKEY = 2, - YPREQ_MAP_PARMS = 3 -}; -typedef enum ypreqtype ypreqtype; -#ifdef __cplusplus -extern "C" bool_t xdr_ypreqtype(XDR *, ypreqtype *); -#elif defined(__STDC__) -extern bool_t xdr_ypreqtype(XDR *, ypreqtype *); -#else /* Old Style C */ -bool_t xdr_ypreqtype(); -#endif /* Old Style C */ - -typedef struct { - ypreqtype yp_reqtype; - union { - struct ypreq_key yp_req_keytype; - struct ypreq_nokey yp_req_nokeytype; - struct ypmap_parms yp_req_map_parmstype; - }yp_reqbody; -} yprequest; -#ifdef __cplusplus -extern "C" bool_t xdr_yprequest(XDR *, yprequest *); -#elif defined(__STDC__) -extern bool_t xdr_yprequest(XDR *, yprequest *); -#else /* Old Style C */ -bool_t xdr_yprequest(); -#endif /* Old Style C */ - -#define YPMATCH_REQTYPE YPREQ_KEY -#define ypmatch_req_domain yp_reqbody.yp_req_keytype.domain -#define ypmatch_req_map yp_reqbody.yp_req_keytype.map -#define ypmatch_req_keydat yp_reqbody.yp_req_keytype.key -#define ypmatch_req_keyptr yp_reqbody.yp_req_keytype.key.keydat_val -#define ypmatch_req_keysize yp_reqbody.yp_req_keytype.key.keydat_len - -#define YPFIRST_REQTYPE YPREQ_NOKEY -#define ypfirst_req_domain yp_reqbody.yp_req_nokeytype.domain -#define ypfirst_req_map yp_reqbody.yp_req_nokeytype.map - -#define YPNEXT_REQTYPE YPREQ_KEY -#define ypnext_req_domain yp_reqbody.yp_req_keytype.domain -#define ypnext_req_map yp_reqbody.yp_req_keytype.map -#define ypnext_req_keydat yp_reqbody.yp_req_keytype.key -#define ypnext_req_keyptr yp_reqbody.yp_req_keytype.key.keydat_val -#define ypnext_req_keysize yp_reqbody.yp_req_keytype.key.keydat_len - -#define YPPUSH_REQTYPE YPREQ_NOKEY -#define yppush_req_domain yp_reqbody.yp_req_nokeytype.domain -#define yppush_req_map yp_reqbody.yp_req_nokeytype.map - -#define YPPULL_REQTYPE YPREQ_NOKEY -#define yppull_req_domain yp_reqbody.yp_req_nokeytype.domain -#define yppull_req_map yp_reqbody.yp_req_nokeytype.map - -#define YPPOLL_REQTYPE YPREQ_NOKEY -#define yppoll_req_domain yp_reqbody.yp_req_nokeytype.domain -#define yppoll_req_map yp_reqbody.yp_req_nokeytype.map - -#define YPGET_REQTYPE YPREQ_MAP_PARMS -#define ypget_req_domain yp_reqbody.yp_req_map_parmstype.domain -#define ypget_req_map yp_reqbody.yp_req_map_parmstype.map -#define ypget_req_ordernum yp_reqbody.yp_req_map_parmstype.ordernum -#define ypget_req_owner yp_reqbody.yp_req_map_parmstype.peer - -enum ypresptype { - YPRESP_VAL = 1, - YPRESP_KEY_VAL = 2, - YPRESP_MAP_PARMS = 3 -}; -typedef enum ypresptype ypresptype; -#ifdef __cplusplus -extern "C" bool_t xdr_ypresptype(XDR *, ypresptype *); -#elif defined(__STDC__) -extern bool_t xdr_ypresptype(XDR *, ypresptype *); -#else /* Old Style C */ -bool_t xdr_ypresptype(); -#endif /* Old Style C */ - -typedef struct { - ypresptype yp_resptype; - union { - struct ypresp_val yp_resp_valtype; - struct ypresp_key_val yp_resp_key_valtype; - struct ypmap_parms yp_resp_map_parmstype; - } yp_respbody; -} ypresponse; -#ifdef __cplusplus -extern "C" bool_t xdr_ypresponse(XDR *, ypresponse *); -#elif defined(__STDC__) -extern bool_t xdr_ypresponse(XDR *, ypresponse *); -#else /* Old Style C */ -bool_t xdr_ypresponse(); -#endif /* Old Style C */ - -#define YPMATCH_RESPTYPE YPRESP_VAL -#define ypmatch_resp_status yp_respbody.yp_resp_valtype.stat -#define ypmatch_resp_val yp_respbody.yp_resp_valtype -#define ypmatch_resp_valdat yp_respbody.yp_resp_valtype.val -#define ypmatch_resp_valptr yp_respbody.yp_resp_valtype.val.valdat_val -#define ypmatch_resp_valsize yp_respbody.yp_resp_valtype.val.valdat_len - -#define YPFIRST_RESPTYPE YPRESP_KEY_VAL -#define ypfirst_resp_status yp_respbody.yp_resp_key_valtype.stat -#define ypfirst_resp_keydat yp_respbody.yp_resp_key_valtype.key -#define ypfirst_resp_keyptr yp_respbody.yp_resp_key_valtype.key.keydat_val -#define ypfirst_resp_keysize yp_respbody.yp_resp_key_valtype.key.keydat_len -#define ypfirst_resp_val yp_respbody.yp_resp_key_valtype -#define ypfirst_resp_valdat yp_respbody.yp_resp_key_valtype.val -#define ypfirst_resp_valptr yp_respbody.yp_resp_key_valtype.val.valdat_val -#define ypfirst_resp_valsize yp_respbody.yp_resp_key_valtype.val.valdat_len - -#define YPNEXT_RESPTYPE YPRESP_KEY_VAL -#define ypnext_resp_status yp_respbody.yp_resp_key_valtype.stat -#define ypnext_resp_keydat yp_respbody.yp_resp_key_valtype.key -#define ypnext_resp_keyptr yp_respbody.yp_resp_key_valtype.key.keydat_val -#define ypnext_resp_keysize yp_respbody.yp_resp_key_valtype.key.keydat_len -#define ypnext_resp_val yp_respbody.yp_resp_key_valtype -#define ypnext_resp_valdat yp_respbody.yp_resp_key_valtype.val -#define ypnext_resp_valptr yp_respbody.yp_resp_key_valtype.val.valdat_val -#define ypnext_resp_valsize yp_respbody.yp_resp_key_valtype.val.valdat_len - -#define YPPOLL_RESPTYPE YPRESP_MAP_PARMS -#define yppoll_resp_domain yp_respbody.yp_resp_map_parmstype.domain -#define yppoll_resp_map yp_respbody.yp_resp_map_parmstype.map -#define yppoll_resp_ordernum yp_respbody.yp_resp_map_parmstype.ordernum -#define yppoll_resp_owner yp_respbody.yp_resp_map_parmstype.peer - -#ifdef __cplusplus -#define YPOLDPROC_NULL ((u_long)0) -extern "C" void * ypproc_null_1(void *, CLIENT *); -extern "C" void * ypproc_null_1_svc(void *, struct svc_req *); -#define YPOLDPROC_DOMAIN ((u_long)1) -extern "C" bool_t * ypproc_domain_1(domainname *, CLIENT *); -extern "C" bool_t * ypproc_domain_1_svc(domainname *, struct svc_req *); -#define YPOLDPROC_DOMAIN_NONACK ((u_long)2) -extern "C" bool_t * ypproc_domain_nonack_1(domainname *, CLIENT *); -extern "C" bool_t * ypproc_domain_nonack_1_svc(domainname *, struct svc_req *); -#define YPOLDPROC_MATCH ((u_long)3) -extern "C" ypresponse * ypproc_match_1(yprequest *, CLIENT *); -extern "C" ypresponse * ypproc_match_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_FIRST ((u_long)4) -extern "C" ypresponse * ypproc_first_1(yprequest *, CLIENT *); -extern "C" ypresponse * ypproc_first_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_NEXT ((u_long)5) -extern "C" ypresponse * ypproc_next_1(yprequest *, CLIENT *); -extern "C" ypresponse * ypproc_next_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_POLL ((u_long)6) -extern "C" ypresponse * ypproc_poll_1(yprequest *, CLIENT *); -extern "C" ypresponse * ypproc_poll_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_PUSH ((u_long)7) -extern "C" void * ypproc_push_1(yprequest *, CLIENT *); -extern "C" void * ypproc_push_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_PULL ((u_long)8) -extern "C" void * ypproc_pull_1(yprequest *, CLIENT *); -extern "C" void * ypproc_pull_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_GET ((u_long)9) -extern "C" void * ypproc_get_1(yprequest *, CLIENT *); -extern "C" void * ypproc_get_1_svc(yprequest *, struct svc_req *); - -#elif defined(__STDC__) -#define YPOLDPROC_NULL ((u_long)0) -extern void * ypproc_null_1(void *, CLIENT *); -extern void * ypproc_null_1_svc(void *, struct svc_req *); -#define YPOLDPROC_DOMAIN ((u_long)1) -extern bool_t * ypproc_domain_1(domainname *, CLIENT *); -extern bool_t * ypproc_domain_1_svc(domainname *, struct svc_req *); -#define YPOLDPROC_DOMAIN_NONACK ((u_long)2) -extern bool_t * ypproc_domain_nonack_1(domainname *, CLIENT *); -extern bool_t * ypproc_domain_nonack_1_svc(domainname *, struct svc_req *); -#define YPOLDPROC_MATCH ((u_long)3) -extern ypresponse * ypproc_match_1(yprequest *, CLIENT *); -extern ypresponse * ypproc_match_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_FIRST ((u_long)4) -extern ypresponse * ypproc_first_1(yprequest *, CLIENT *); -extern ypresponse * ypproc_first_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_NEXT ((u_long)5) -extern ypresponse * ypproc_next_1(yprequest *, CLIENT *); -extern ypresponse * ypproc_next_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_POLL ((u_long)6) -extern ypresponse * ypproc_poll_1(yprequest *, CLIENT *); -extern ypresponse * ypproc_poll_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_PUSH ((u_long)7) -extern void * ypproc_push_1(yprequest *, CLIENT *); -extern void * ypproc_push_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_PULL ((u_long)8) -extern void * ypproc_pull_1(yprequest *, CLIENT *); -extern void * ypproc_pull_1_svc(yprequest *, struct svc_req *); -#define YPOLDPROC_GET ((u_long)9) -extern void * ypproc_get_1(yprequest *, CLIENT *); -extern void * ypproc_get_1_svc(yprequest *, struct svc_req *); - -#else /* Old Style C */ -#define YPOLDPROC_NULL ((u_long)0) -extern void * ypproc_null_1(); -extern void * ypproc_null_1_svc(); -#define YPOLDPROC_DOMAIN ((u_long)1) -extern bool_t * ypproc_domain_1(); -extern bool_t * ypproc_domain_1_svc(); -#define YPOLDPROC_DOMAIN_NONACK ((u_long)2) -extern bool_t * ypproc_domain_nonack_1(); -extern bool_t * ypproc_domain_nonack_1_svc(); -#define YPOLDPROC_MATCH ((u_long)3) -extern ypresponse * ypproc_match_1(); -extern ypresponse * ypproc_match_1_svc(); -#define YPOLDPROC_FIRST ((u_long)4) -extern ypresponse * ypproc_first_1(); -extern ypresponse * ypproc_first_1_svc(); -#define YPOLDPROC_NEXT ((u_long)5) -extern ypresponse * ypproc_next_1(); -extern ypresponse * ypproc_next_1_svc(); -#define YPOLDPROC_POLL ((u_long)6) -extern ypresponse * ypproc_poll_1(); -extern ypresponse * ypproc_poll_1_svc(); -#define YPOLDPROC_PUSH ((u_long)7) -extern void * ypproc_push_1(); -extern void * ypproc_push_1_svc(); -#define YPOLDPROC_PULL ((u_long)8) -extern void * ypproc_pull_1(); -extern void * ypproc_pull_1_svc(); -#define YPOLDPROC_GET ((u_long)9) -extern void * ypproc_get_1(); -extern void * ypproc_get_1_svc(); -#endif /* Old Style C */ - -#endif /* !_YPV1_H_RPCGEN */ diff --git a/usr.sbin/ypserv/ypserv/ypv1.x b/usr.sbin/ypserv/ypserv/ypv1.x new file mode 100644 index 00000000000..37f82b6226e --- /dev/null +++ b/usr.sbin/ypserv/ypserv/ypv1.x @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2003 Mats O Jansson <moj@stacken.kth.se> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * YP v1 access protocol + * + * Created by looking at ypv1_prot.h on AIX 5.1 + * + */ +#ifdef RPC_HDR +%#include <rpcsvc/yp.h> +#endif + +enum ypreqtype { + YPREQ_KEY = 1, + YPREQ_NOKEY = 2, + YPREQ_MAP_PARMS = 3 +}; + +enum ypresptype { + YPRESP_VAL = 1, + YPRESP_KEY_VAL = 2, + YPRESP_MAP_PARMS = 3 +}; + +union yprequest switch (ypreqtype yp_reqtype) { +case YPREQ_KEY: + ypreq_key yp_req_keytype; +case YPREQ_NOKEY: + ypreq_nokey yp_req_nokeytype; +case YPREQ_MAP_PARMS: + ypmap_parms yp_req_map_parmstype; +}; + +union ypresponse switch (ypresptype yp_resptype) { +case YPRESP_VAL: + ypresp_val yp_resp_valtype; +case YPRESP_KEY_VAL: + ypresp_key_val yp_resp_key_valtype; +case YPRESP_MAP_PARMS: + ypmap_parms yp_resp_map_parmstype; +}; + +program YPPROG { + version YPOLDVERS { + + void + YPOLDPROC_NULL(void) = 0; + + bool_t + YPOLDPROC_DOMAIN(domainname) = 1; + + bool_t + YPOLDPROC_DOMAIN_NONACK(domainname) = 2; + + ypresponse + YPOLDPROC_MATCH(yprequest) = 3; + + ypresponse + YPOLDPROC_FIRST(yprequest) = 4; + + ypresponse + YPOLDPROC_NEXT(yprequest) = 5; + + ypresponse + YPOLDPROC_POLL(yprequest) = 6; + + void + YPOLDPROC_PUSH(yprequest) = 7; + + void + YPOLDPROC_PULL(yprequest) = 8; + + void + YPOLDPROC_GET(yprequest) = 9; + } = 1; +} = 100004; + +#ifdef RPC_HDR +%#define YPMATCH_REQTYPE YPREQ_KEY +%#define ypmatch_req_domain yprequest_u.yp_req_keytype.domain +%#define ypmatch_req_map yprequest_u.yp_req_keytype.map +%#define ypmatch_req_keydat yprequest_u.yp_req_keytype.key +%#define ypmatch_req_keyptr yprequest_u.yp_req_keytype.key.keydat_val +%#define ypmatch_req_keysize yprequest_u.yp_req_keytype.key.keydat_len +% +%#define YPMATCH_RESPTYPE YPRESP_VAL +%#define ypmatch_resp_status ypresponse_u.yp_resp_valtype.stat +%#define ypmatch_resp_val ypresponse_u.yp_resp_valtype +%#define ypmatch_resp_valdat ypresponse_u.yp_resp_valtype.val +%#define ypmatch_resp_valptr ypresponse_u.yp_resp_valtype.val.valdat_val +%#define ypmatch_resp_valsize ypresponse_u.yp_resp_valtype.val.valdat_len +% +%#define YPFIRST_REQTYPE YPREQ_NOKEY +%#define ypfirst_req_domain yprequest_u.yp_req_nokeytype.domain +%#define ypfirst_req_map yprequest_u.yp_req_nokeytype.map +% +%#define YPFIRST_RESPTYPE YPRESP_KEY_VAL +%#define ypfirst_resp_status ypresponse_u.yp_resp_key_valtype.stat +%#define ypfirst_resp_keydat ypresponse_u.yp_resp_key_valtype.key +%#define ypfirst_resp_keyptr ypresponse_u.yp_resp_key_valtype.key.keydat_val +%#define ypfirst_resp_keysize ypresponse_u.yp_resp_key_valtype.key.keydat_len +%#define ypfirst_resp_val ypresponse_u.yp_resp_key_valtype +%#define ypfirst_resp_valdat ypresponse_u.yp_resp_key_valtype.val +%#define ypfirst_resp_valptr ypresponse_u.yp_resp_key_valtype.val.valdat_val +%#define ypfirst_resp_valsize ypresponse_u.yp_resp_key_valtype.val.valdat_len +% +%#define YPNEXT_REQTYPE YPREQ_KEY +%#define ypnext_req_domain yprequest_u.yp_req_keytype.domain +%#define ypnext_req_map yprequest_u.yp_req_keytype.map +%#define ypnext_req_keydat yprequest_u.yp_req_keytype.key +%#define ypnext_req_keyptr yprequest_u.yp_req_keytype.key.keydat_val +%#define ypnext_req_keysize yprequest_u.yp_req_keytype.key.keydat_len +% +%#define YPNEXT_RESPTYPE YPRESP_KEY_VAL +%#define ypnext_resp_status ypresponse_u.yp_resp_key_valtype.stat +%#define ypnext_resp_keydat ypresponse_u.yp_resp_key_valtype.key +%#define ypnext_resp_keyptr ypresponse_u.yp_resp_key_valtype.key.keydat_val +%#define ypnext_resp_keysize ypresponse_u.yp_resp_key_valtype.key.keydat_len +%#define ypnext_resp_val ypresponse_u.yp_resp_key_valtype +%#define ypnext_resp_valdat ypresponse_u.yp_resp_key_valtype.val +%#define ypnext_resp_valptr ypresponse_u.yp_resp_key_valtype.val.valdat_val +%#define ypnext_resp_valsize ypresponse_u.yp_resp_key_valtype.val.valdat_len +% +%#define YPPUSH_REQTYPE YPREQ_NOKEY +%#define yppush_req_domain yprequest_u.yp_req_nokeytype.domain +%#define yppush_req_map yprequest_u.yp_req_nokeytype.map +% +%#define YPPULL_REQTYPE YPREQ_NOKEY +%#define yppull_req_domain yprequest_u.yp_req_nokeytype.domain +%#define yppull_req_map yprequest_u.yp_req_nokeytype.map +% +%#define YPPOLL_REQTYPE YPREQ_NOKEY +%#define yppoll_req_domain yprequest_u.yp_req_nokeytype.domain +%#define yppoll_req_map yprequest_u.yp_req_nokeytype.map +% +%#define YPPOLL_RESPTYPE YPRESP_MAP_PARMS +%#define yppoll_resp_domain ypresponse_u.yp_resp_map_parmstype.domain +%#define yppoll_resp_map ypresponse_u.yp_resp_map_parmstype.map +%#define yppoll_resp_ordernum ypresponse_u.yp_resp_map_parmstype.ordernum +%#define yppoll_resp_owner ypresponse_u.yp_resp_map_parmstype.peer +% +%#define YPGET_REQTYPE YPREQ_MAP_PARMS +%#define ypget_req_domain yprequest_u.yp_req_map_parmstype.domain +%#define ypget_req_map yprequest_u.yp_req_map_parmstype.map +%#define ypget_req_ordernum yprequest_u.yp_req_map_parmstype.ordernum +%#define ypget_req_owner yprequest_u.yp_req_map_parmstype.peer +#endif |