summaryrefslogtreecommitdiffstats
path: root/tapset/nfsd4_secinfo.stp
blob: bdedcce3f7569fbc2d6c382f78ea218733f8c0c9 (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
%{
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/cache.h>

#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/export.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
%}

function nfsd4_secinfo_dump:string(_secinfo:long)
%{
	struct nfsd4_secinfo *secinfo = 
		(struct nfsd4_secinfo *)(long) kread(&(THIS->_secinfo));
	char buf[MAXSTRINGLEN], *si_name=NULL;
	int cc=0;

	if (secinfo <= 0) {
		sprintf(buf+cc, "secinfo NULL");
	} else {
		if (secinfo->si_namelen)
			si_name = kread(&(secinfo->si_name));
		sprintf(buf+cc, "secinfo %p namelen %d name %s", 
			secinfo, secinfo->si_namelen, si_name);
		cc = strlen(buf);

	}
	snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); 

	CATCH_DEREF_FAULT();
%}