Skip to content

Commit

Permalink
nfsv4.1 Add DESTROY_CLIENTID operation
Browse files Browse the repository at this point in the history
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
  • Loading branch information
sahlberg committed Jun 8, 2020
1 parent de3d1e5 commit ff73bb6
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
28 changes: 28 additions & 0 deletions nfs4/libnfs-raw-nfs4.c
Original file line number Diff line number Diff line change
Expand Up @@ -3463,6 +3463,26 @@ zdr_WANT_DELEGATION4res (ZDR *zdrs, WANT_DELEGATION4res *objp)
return TRUE;
}

uint32_t
zdr_DESTROY_CLIENTID4args (ZDR *zdrs, DESTROY_CLIENTID4args *objp)
{


if (!zdr_clientid4 (zdrs, &objp->dca_clientid))
return FALSE;
return TRUE;
}

uint32_t
zdr_DESTROY_CLIENTID4res (ZDR *zdrs, DESTROY_CLIENTID4res *objp)
{


if (!zdr_nfsstat4 (zdrs, &objp->dcr_status))
return FALSE;
return TRUE;
}

uint32_t
zdr_ILLEGAL4res (ZDR *zdrs, ILLEGAL4res *objp)
{
Expand Down Expand Up @@ -3673,6 +3693,10 @@ zdr_nfs_argop4 (ZDR *zdrs, nfs_argop4 *objp)
if (!zdr_WANT_DELEGATION4args (zdrs, &objp->nfs_argop4_u.opwantdelegation))
return FALSE;
break;
case OP_DESTROY_CLIENTID:
if (!zdr_DESTROY_CLIENTID4args (zdrs, &objp->nfs_argop4_u.opdestroyclientid))
return FALSE;
break;
case OP_ILLEGAL:
break;
default:
Expand Down Expand Up @@ -3885,6 +3909,10 @@ zdr_nfs_resop4 (ZDR *zdrs, nfs_resop4 *objp)
if (!zdr_WANT_DELEGATION4res (zdrs, &objp->nfs_resop4_u.opwantdelegation))
return FALSE;
break;
case OP_DESTROY_CLIENTID:
if (!zdr_DESTROY_CLIENTID4res (zdrs, &objp->nfs_resop4_u.opdestroyclientid))
return FALSE;
break;
case OP_ILLEGAL:
if (!zdr_ILLEGAL4res (zdrs, &objp->nfs_resop4_u.opillegal))
return FALSE;
Expand Down
17 changes: 17 additions & 0 deletions nfs4/libnfs-raw-nfs4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,16 @@ struct WANT_DELEGATION4res {
};
typedef struct WANT_DELEGATION4res WANT_DELEGATION4res;

struct DESTROY_CLIENTID4args {
clientid4 dca_clientid;
};
typedef struct DESTROY_CLIENTID4args DESTROY_CLIENTID4args;

struct DESTROY_CLIENTID4res {
nfsstat4 dcr_status;
};
typedef struct DESTROY_CLIENTID4res DESTROY_CLIENTID4res;

struct ILLEGAL4res {
nfsstat4 status;
};
Expand Down Expand Up @@ -1812,6 +1822,7 @@ enum nfs_opnum4 {
OP_SET_SSV = 54,
OP_TEST_STATEID = 55,
OP_WANT_DELEGATION = 56,
OP_DESTROY_CLIENTID = 57,
OP_ILLEGAL = 10044,
};
typedef enum nfs_opnum4 nfs_opnum4;
Expand Down Expand Up @@ -1861,6 +1872,7 @@ struct nfs_argop4 {
SET_SSV4args opsetssv;
TEST_STATEID4args opteststateid;
WANT_DELEGATION4args opwantdelegation;
DESTROY_CLIENTID4args opdestroyclientid;
} nfs_argop4_u;
};
typedef struct nfs_argop4 nfs_argop4;
Expand Down Expand Up @@ -1917,6 +1929,7 @@ struct nfs_resop4 {
SET_SSV4res opsetssv;
TEST_STATEID4res opteststateid;
WANT_DELEGATION4res opwantdelegation;
DESTROY_CLIENTID4res opdestroyclientid;
ILLEGAL4res opillegal;
} nfs_resop4_u;
};
Expand Down Expand Up @@ -2337,6 +2350,8 @@ extern uint32_t zdr_TEST_STATEID4res (ZDR *, TEST_STATEID4res*);
extern uint32_t zdr_deleg_claim4 (ZDR *, deleg_claim4*);
extern uint32_t zdr_WANT_DELEGATION4args (ZDR *, WANT_DELEGATION4args*);
extern uint32_t zdr_WANT_DELEGATION4res (ZDR *, WANT_DELEGATION4res*);
extern uint32_t zdr_DESTROY_CLIENTID4args (ZDR *, DESTROY_CLIENTID4args*);
extern uint32_t zdr_DESTROY_CLIENTID4res (ZDR *, DESTROY_CLIENTID4res*);
extern uint32_t zdr_ILLEGAL4res (ZDR *, ILLEGAL4res*);
extern uint32_t zdr_nfs_opnum4 (ZDR *, nfs_opnum4*);
extern uint32_t zdr_nfs_argop4 (ZDR *, nfs_argop4*);
Expand Down Expand Up @@ -2621,6 +2636,8 @@ extern uint32_t zdr_TEST_STATEID4res ();
extern uint32_t zdr_deleg_claim4 ();
extern uint32_t zdr_WANT_DELEGATION4args ();
extern uint32_t zdr_WANT_DELEGATION4res ();
extern uint32_t zdr_DESTROY_CLIENTID4args ();
extern uint32_t zdr_DESTROY_CLIENTID4res ();
extern uint32_t zdr_ILLEGAL4res ();
extern uint32_t zdr_nfs_opnum4 ();
extern uint32_t zdr_nfs_argop4 ();
Expand Down
14 changes: 14 additions & 0 deletions nfs4/nfs4.x
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,17 @@ default:
void;
};

/*
* DESTROY_CLIENTID
*/
struct DESTROY_CLIENTID4args {
clientid4 dca_clientid;
};

struct DESTROY_CLIENTID4res {
nfsstat4 dcr_status;
};

/*
* ILLEGAL: Response for illegal operation numbers
*/
Expand Down Expand Up @@ -1918,6 +1929,7 @@ enum nfs_opnum4 {
OP_SET_SSV = 54,
OP_TEST_STATEID = 55,
OP_WANT_DELEGATION = 56,
OP_DESTROY_CLIENTID = 57,
OP_ILLEGAL = 10044
};

Expand Down Expand Up @@ -1976,6 +1988,7 @@ union nfs_argop4 switch (nfs_opnum4 argop) {
case OP_SET_SSV: SET_SSV4args opsetssv;
case OP_TEST_STATEID: TEST_STATEID4args opteststateid;
case OP_WANT_DELEGATION: WANT_DELEGATION4args opwantdelegation;
case OP_DESTROY_CLIENTID: DESTROY_CLIENTID4args opdestroyclientid;
case OP_ILLEGAL: void;
};

Expand Down Expand Up @@ -2034,6 +2047,7 @@ union nfs_resop4 switch (nfs_opnum4 resop){
case OP_SET_SSV: SET_SSV4res opsetssv;
case OP_TEST_STATEID: TEST_STATEID4res opteststateid;
case OP_WANT_DELEGATION: WANT_DELEGATION4res opwantdelegation;
case OP_DESTROY_CLIENTID: DESTROY_CLIENTID4res opdestroyclientid;
case OP_ILLEGAL: ILLEGAL4res opillegal;
};

Expand Down

0 comments on commit ff73bb6

Please sign in to comment.