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
|
%{
#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_namelen:long (secinfo:long ) {
return @cast(secinfo, "nfsd4_secinfo", "kernel:nfsd")->si_namelen
}
function nfsd4_secinfo_name:string (secinfo:long) {
return kernel_string(@cast(secinfo, "nfsd4_secinfo", "kernel:nfsd")->si_name)
}
/*
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();
%}
*/
|