rquota_svc.c is still by-hand as it contains alot of extras.
These should really be moved to rquota_server.c
## Process this file with automake to produce Makefile.in
+RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen
+
+GENFILES_XDR = rquota_xdr.c
+GENFILES_H = rquota.h
+
+GENFILES = $(GENFILES_XDR) $(GENFILES_H)
man8_MANS = rquotad.man
RPCPREFIX = rpc.
MAINTAINERCLEANFILES = Makefile.in
+
+$(RPCGEN):
+ make -C $(top_srcdir)/tools/rpcgen all
+
+$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
+ test -f $@ && rm -rf $@ || true
+ $(RPCGEN) -c -o $@ $<
+
+
+$(GENFILES_H): %.h: %.x $(RPCGEN)
+ test -f $@ && rm -rf $@ || true
+ $(RPCGEN) -h -o $@ $<
+
#######################################################################
# The following allows the current practice of having
# daemons renamed during the install to include RPCPREFIX
+++ /dev/null
-#define RQ_PATHLEN 1024
-
-struct getquota_args {
- char *gqa_pathp;
- int gqa_uid;
-};
-typedef struct getquota_args getquota_args;
-bool_t xdr_getquota_args();
-
-
-struct ext_getquota_args {
- char *gqa_pathp;
- int gqa_type;
- int gqa_id;
-};
-typedef struct ext_getquota_args ext_getquota_args;
-bool_t xdr_ext_getquota_args();
-
-
-struct rquota {
- int rq_bsize;
- bool_t rq_active;
- u_int rq_bhardlimit;
- u_int rq_bsoftlimit;
- u_int rq_curblocks;
- u_int rq_fhardlimit;
- u_int rq_fsoftlimit;
- u_int rq_curfiles;
- u_int rq_btimeleft;
- u_int rq_ftimeleft;
-};
-typedef struct rquota rquota;
-bool_t xdr_rquota();
-
-
-enum gqr_status {
- Q_OK = 1,
- Q_NOQUOTA = 2,
- Q_EPERM = 3,
-};
-typedef enum gqr_status gqr_status;
-bool_t xdr_gqr_status();
-
-
-struct getquota_rslt {
- gqr_status status;
- union {
- rquota gqr_rquota;
- } getquota_rslt_u;
-};
-typedef struct getquota_rslt getquota_rslt;
-bool_t xdr_getquota_rslt();
-
-
-#define RQUOTAPROG ((u_long)100011)
-#define RQUOTAVERS ((u_long)1)
-#define RQUOTAPROC_GETQUOTA ((u_long)1)
-extern getquota_rslt *rquotaproc_getquota_1();
-#define RQUOTAPROC_GETACTIVEQUOTA ((u_long)2)
-extern getquota_rslt *rquotaproc_getactivequota_1();
-#define EXT_RQUOTAVERS ((u_long)2)
-extern getquota_rslt *rquotaproc_getquota_2();
-extern getquota_rslt *rquotaproc_getactivequota_2();
-
return(&result);
}
-getquota_rslt *rquotaproc_getquota_1(getquota_args *argp, struct svc_req *rqstp)
+getquota_rslt *rquotaproc_getquota_1_svc(getquota_args *argp, struct svc_req *rqstp)
{
return(getquotainfo(0, (caddr_t *)argp, rqstp));
}
-getquota_rslt *rquotaproc_getactivequota_1(getquota_args *argp, struct svc_req *rqstp)
+getquota_rslt *rquotaproc_getactivequota_1_svc(getquota_args *argp, struct svc_req *rqstp)
{
return(getquotainfo(ACTIVE, (caddr_t *)argp, rqstp));
}
-getquota_rslt *rquotaproc_getquota_2(ext_getquota_args *argp, struct svc_req *rqstp)
+getquota_rslt *rquotaproc_getquota_2_svc(ext_getquota_args *argp, struct svc_req *rqstp)
{
return(getquotainfo(TYPE_EXTENDED, (caddr_t *)argp, rqstp));
}
-getquota_rslt *rquotaproc_getactivequota_2(ext_getquota_args *argp, struct svc_req *rqstp)
+getquota_rslt *rquotaproc_getactivequota_2_svc(ext_getquota_args *argp, struct svc_req *rqstp)
{
return(getquotainfo(TYPE_EXTENDED | ACTIVE, (caddr_t *)argp, rqstp));
}
#define SIG_PF void(*)(int)
#endif
-extern getquota_rslt *rquotaproc_getquota_1(getquota_args *argp,
- struct svc_req *rqstp);
-extern getquota_rslt *rquotaproc_getactivequota_1(getquota_args *argp,
- struct svc_req *rqstp);
-extern getquota_rslt *rquotaproc_getquota_2(ext_getquota_args *argp,
- struct svc_req *rqstp);
-extern getquota_rslt *rquotaproc_getactivequota_2(ext_getquota_args *argp,
- struct svc_req *rqstp);
-
static struct option longopts[] =
{
{ "help", 0, 0, 'h' },
case RQUOTAPROC_GETQUOTA:
xdr_argument = (xdrproc_t) xdr_getquota_args;
xdr_result = (xdrproc_t) xdr_getquota_rslt;
- local = (char *(*)(char *, struct svc_req *)) rquotaproc_getquota_1;
+ local = (char *(*)(char *, struct svc_req *)) rquotaproc_getquota_1_svc;
break;
case RQUOTAPROC_GETACTIVEQUOTA:
xdr_argument = (xdrproc_t) xdr_getquota_args;
xdr_result = (xdrproc_t) xdr_getquota_rslt;
- local = (char *(*)(char *, struct svc_req *)) rquotaproc_getactivequota_1;
+ local = (char *(*)(char *, struct svc_req *)) rquotaproc_getactivequota_1_svc;
break;
default:
case RQUOTAPROC_GETQUOTA:
xdr_argument = (xdrproc_t) xdr_ext_getquota_args;
xdr_result = (xdrproc_t) xdr_getquota_rslt;
- local = (char *(*)(char *, struct svc_req *)) rquotaproc_getquota_2;
+ local = (char *(*)(char *, struct svc_req *)) rquotaproc_getquota_2_svc;
break;
case RQUOTAPROC_GETACTIVEQUOTA:
xdr_argument = (xdrproc_t) xdr_ext_getquota_args;
xdr_result = (xdrproc_t) xdr_getquota_rslt;
- local = (char *(*)(char *, struct svc_req *)) rquotaproc_getactivequota_2;
+ local = (char *(*)(char *, struct svc_req *)) rquotaproc_getactivequota_2_svc;
break;
default:
+++ /dev/null
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <rpc/rpc.h>
-#include "rquota.h"
-
-
-bool_t
-xdr_getquota_args(xdrs, objp)
- XDR *xdrs;
- getquota_args *objp;
-{
- if (!xdr_string(xdrs, &objp->gqa_pathp, RQ_PATHLEN)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->gqa_uid)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-
-
-
-bool_t
-xdr_ext_getquota_args(xdrs, objp)
- XDR *xdrs;
- ext_getquota_args *objp;
-{
- if (!xdr_string(xdrs, &objp->gqa_pathp, RQ_PATHLEN)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->gqa_type)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->gqa_id)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-
-
-
-bool_t
-xdr_rquota(xdrs, objp)
- XDR *xdrs;
- rquota *objp;
-{
- if (!xdr_int(xdrs, &objp->rq_bsize)) {
- return (FALSE);
- }
- if (!xdr_bool(xdrs, &objp->rq_active)) {
- return (FALSE);
- }
- if (!xdr_u_int(xdrs, &objp->rq_bhardlimit)) {
- return (FALSE);
- }
- if (!xdr_u_int(xdrs, &objp->rq_bsoftlimit)) {
- return (FALSE);
- }
- if (!xdr_u_int(xdrs, &objp->rq_curblocks)) {
- return (FALSE);
- }
- if (!xdr_u_int(xdrs, &objp->rq_fhardlimit)) {
- return (FALSE);
- }
- if (!xdr_u_int(xdrs, &objp->rq_fsoftlimit)) {
- return (FALSE);
- }
- if (!xdr_u_int(xdrs, &objp->rq_curfiles)) {
- return (FALSE);
- }
- if (!xdr_u_int(xdrs, &objp->rq_btimeleft)) {
- return (FALSE);
- }
- if (!xdr_u_int(xdrs, &objp->rq_ftimeleft)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-
-
-
-bool_t
-xdr_gqr_status(xdrs, objp)
- XDR *xdrs;
- gqr_status *objp;
-{
- if (!xdr_enum(xdrs, (enum_t *)objp)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-
-
-
-bool_t
-xdr_getquota_rslt(xdrs, objp)
- XDR *xdrs;
- getquota_rslt *objp;
-{
- if (!xdr_gqr_status(xdrs, &objp->status)) {
- return (FALSE);
- }
- switch (objp->status) {
- case Q_OK:
- if (!xdr_rquota(xdrs, &objp->getquota_rslt_u.gqr_rquota)) {
- return (FALSE);
- }
- break;
- case Q_NOQUOTA:
- break;
- case Q_EPERM:
- break;
- default:
- return (FALSE);
- }
- return (TRUE);
-}
-
-