summaryrefslogtreecommitdiffstats
path: root/tapset/nfs4_callback.stp
blob: 05c756c9a92923b0e19b9e29e3112f5d07da5b69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
%{
#include <linux/socket.h>
#include <net/sock.h>
#include <net/inet_sock.h>
#include <linux/skbuff.h>

#include <linux/sunrpc/svc.h>

#include <linux/nfs4.h>
#include <linux/nfsd/nfsfh.h>
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,33)
#include <linux/nfsd/state.h>
#include <linux/nfsd/xdr4.h>
#endif
#include <linux/nfsd/nfsd.h>
%}

function nfs4_callback:string(_stp:long)
%{
	struct nfs4_stateid *stp = (struct nfs4_stateid *) 
		(long) kread(&(THIS->_stp));
	struct nfs4_stateowner *sop = (struct nfs4_stateowner *) 
		(long) kread(&stp->st_stateowner);
	struct nfs4_client *so_client = (struct nfs4_client *)
		(long)kread(&sop->so_client);
	/*
	struct nfs4_callback *cb = (struct nfs4_callback *)
		&so_client->cl_callback;
	*/
	struct nfs4_cb_conn *cb = (struct nfs4_cb_conn *)
		&so_client->cl_cb_conn;

	char buf[MAXSTRINGLEN];
	int cc=0;

	snprintf(buf+cc, MAXSTRINGLEN, "cb: cb_set %d sop %p so_confirmed %d", 
		cb->cb_set.counter, sop, sop->so_confirmed);
			
	cc = strlen(buf);
	snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); 

	CATCH_DEREF_FAULT();

%}
function nfs4_callback_addr:string(_clp:long)
%{
	struct nfs4_client *clp = (struct nfs4_client *)
		(long)kread(&(THIS->_clp));

	char buf[MAXSTRINGLEN];
	int cc=0;

	snprintf(THIS->__retvalue, MAXSTRINGLEN, 
		NIPQUAD_FMT, NIPQUAD(clp->cl_addr));

	CATCH_DEREF_FAULT();

%}
function nfs4_openconf:string(_oc:long)
%{
	struct nfsd4_open_confirm *oc = (struct nfsd4_open_confirm *)
		(long)kread(&(THIS->_oc));
	struct nfs4_stateowner *sop = (struct nfs4_stateowner *) 
		(long) kread(&oc->oc_stateowner);

	snprintf(THIS->__retvalue, MAXSTRINGLEN, 
		"sop %p so_confirmed %d", sop, sop->so_confirmed);

	CATCH_DEREF_FAULT();

%}