Example #1
0
class goofy_1(rpchelp.Server):
    prog = 0
    vers = 1
    procs = {
        0:
        rpchelp.Proc(
            'goof_NULL',
            rpchelp.struct('_unnamed', [('c', rpchelp.r_int),
                                        ('d', rpchelp.r_int)]),
            [
                rpchelp.struct('_unnamed', [('a', rpchelp.r_int),
                                            ('b', rpchelp.r_int)]),
                rpchelp.r_int
            ])
    }
Example #2
0
NFNON = 0
NFREG = 1
NFDIR = 2
NFBLK = 3
NFCHR = 4
NFLNK = 5
MAXDATA = 8192
MAXPATHLEN = 1024
MAXNAMLEN = 255
COOKIESIZE = 4
FHSIZE = 32
nfsdata = rpchelp.opaque (rpchelp.var, MAXDATA)
stat = rpchelp.r_int
ftype = rpchelp.r_int
fhandle = rpchelp.opaque (rpchelp.fixed, FHSIZE)
timeval = rpchelp.struct ('timeval', [('seconds',rpchelp.r_uint),('useconds',rpchelp.r_uint)])
fattr = rpchelp.struct ('fattr', [('type',ftype),('mode',rpchelp.r_uint),('nlink',rpchelp.r_uint),('uid',rpchelp.r_uint),('gid',rpchelp.r_uint),('size',rpchelp.r_uint),('blocksize',rpchelp.r_uint),('rdev',rpchelp.r_uint),('blocks',rpchelp.r_uint),('fsid',rpchelp.r_uint),('fileid',rpchelp.r_uint),('atime',timeval),('mtime',timeval),('ctime',timeval)])
sattr = rpchelp.struct ('sattr', [('mode',rpchelp.r_uint),('uid',rpchelp.r_uint),('gid',rpchelp.r_uint),('size',rpchelp.r_uint),('atime',timeval),('mtime',timeval)])
filename = rpchelp.string (rpchelp.var, MAXNAMLEN)
path = rpchelp.string (rpchelp.var, MAXPATHLEN)
attrstat = rpchelp.union ('attrstat', stat, 'status', {NFS_OK : fattr, None : rpchelp.r_void})
diropargs = rpchelp.struct ('diropargs', [('dir',fhandle),('name',filename)])
diropres = rpchelp.union ('diropres', stat, 'status', {NFS_OK : rpchelp.struct ('diropok', [('file',fhandle),('attributes',fattr)]), None : rpchelp.r_void})
statfsres = rpchelp.union ('statfsres', stat, 'status', {NFS_OK : rpchelp.struct ('info', [('tsize',rpchelp.r_uint),('bsize',rpchelp.r_uint),('blocks',rpchelp.r_uint),('bfree',rpchelp.r_uint),('bavail',rpchelp.r_uint)]), None : rpchelp.r_void})
nfscookie = rpchelp.opaque (rpchelp.fixed, COOKIESIZE)
readdirargs = rpchelp.struct ('readdirargs', [('dir',fhandle),('cookie',nfscookie),('count',rpchelp.r_uint)])
entry = rpchelp.linked_list ('entry', 3, [('fileid',rpchelp.r_uint),('name',filename),('cookie',nfscookie),('nextentry',rpchelp.opt_data (lambda : entry))])
readdirres = rpchelp.union ('readdirres', stat, 'status', {NFS_OK : rpchelp.struct ('readdirok', [('entries',rpchelp.opt_data (lambda : entry)),('eof',rpchelp.r_bool)]), None : rpchelp.r_void})
symlinkargs = rpchelp.struct ('symlinkargs', [('from_',diropargs),('to',path),('attributes',sattr)])
linkargs = rpchelp.struct ('linkargs', [('from_',fhandle),('to',diropargs)])
renameargs = rpchelp.struct ('renameargs', [('from_',diropargs),('to',diropargs)])
Example #3
0
File: test.py Project: mayli/pinefs
from_ = 4
n = 5
o = 6
p = 7
q = 5
r = 6
s = 7
t = 5
u = 6
v = 7
aa = 1
ab = 2
goof1 = 1
goof2 = 2
an_enum = rpchelp.r_int
foo = rpchelp.struct ('foo', [('a',rpchelp.r_int),('b',rpchelp.r_double)])
bar = rpchelp.struct ('bar', [('a',rpchelp.r_int),('b',rpchelp.r_double)])
another_enum = rpchelp.r_int
bar2 = rpchelp.struct ('bar2', [('a',rpchelp.r_int),('b',rpchelp.r_double),('another_enum',rpchelp.r_int)])
baz = rpchelp.union ('baz', rpchelp.r_int, 'b', {0 : rpchelp.r_int, 1 : rpchelp.r_int, 2 : rpchelp.r_int, None : rpchelp.r_void})
baz_2 = rpchelp.union ('baz_2', rpchelp.r_int, 'b', {0 : rpchelp.r_int, 1 : rpchelp.r_int, None : rpchelp.r_void})
reserved_test = rpchelp.struct ('reserved_test', [('from_',rpchelp.r_int),('def_',rpchelp.r_int),('def__',rpchelp.r_int),('import_',rpchelp.struct ('import_', [('def___',rpchelp.r_int),('in____',rpchelp.r_int)]))])
in_ = 4
maybe_foo = rpchelp.opt_data (lambda : foo)
# "typedef void;" encountered
foo_fixed_arr = rpchelp.arr (foo, rpchelp.fixed, 40)
foo_var_arr_1 = rpchelp.arr (foo, rpchelp.var, 40)
foo_var_arr_2 = rpchelp.arr (foo, rpchelp.var, None)
int_fixed_arr = rpchelp.arr (rpchelp.r_int, rpchelp.fixed, 40)
double_var_arr = rpchelp.arr (rpchelp.r_double, rpchelp.var, 400)
ll_test1 = rpchelp.linked_list ('ll_test1', 2, [('a',rpchelp.r_uint),('b',rpchelp.r_uint),('silly_link_ptr',rpchelp.opt_data (lambda : ll_test1))])
Example #4
0
NFNON = 0
NFREG = 1
NFDIR = 2
NFBLK = 3
NFCHR = 4
NFLNK = 5
MAXDATA = 8192
MAXPATHLEN = 1024
MAXNAMLEN = 255
COOKIESIZE = 4
FHSIZE = 32
nfsdata = rpchelp.opaque(rpchelp.var, MAXDATA)
stat = rpchelp.r_int
ftype = rpchelp.r_int
fhandle = rpchelp.opaque(rpchelp.fixed, FHSIZE)
timeval = rpchelp.struct('timeval', [('seconds', rpchelp.r_uint),
                                     ('useconds', rpchelp.r_uint)])
fattr = rpchelp.struct('fattr', [('type', ftype), ('mode', rpchelp.r_uint),
                                 ('nlink', rpchelp.r_uint),
                                 ('uid', rpchelp.r_uint),
                                 ('gid', rpchelp.r_uint),
                                 ('size', rpchelp.r_uint),
                                 ('blocksize', rpchelp.r_uint),
                                 ('rdev', rpchelp.r_uint),
                                 ('blocks', rpchelp.r_uint),
                                 ('fsid', rpchelp.r_uint),
                                 ('fileid', rpchelp.r_uint),
                                 ('atime', timeval), ('mtime', timeval),
                                 ('ctime', timeval)])
sattr = rpchelp.struct('sattr', [('mode', rpchelp.r_uint),
                                 ('uid', rpchelp.r_uint),
                                 ('gid', rpchelp.r_uint),
Example #5
0
from_ = 4
n = 5
o = 6
p = 7
q = 5
r = 6
s = 7
t = 5
u = 6
v = 7
aa = 1
ab = 2
goof1 = 1
goof2 = 2
an_enum = rpchelp.r_int
foo = rpchelp.struct('foo', [('a', rpchelp.r_int), ('b', rpchelp.r_double)])
bar = rpchelp.struct('bar', [('a', rpchelp.r_int), ('b', rpchelp.r_double)])
another_enum = rpchelp.r_int
bar2 = rpchelp.struct('bar2', [('a', rpchelp.r_int), ('b', rpchelp.r_double),
                               ('another_enum', rpchelp.r_int)])
baz = rpchelp.union('baz', rpchelp.r_int, 'b', {
    0: rpchelp.r_int,
    1: rpchelp.r_int,
    2: rpchelp.r_int,
    None: rpchelp.r_void
})
baz_2 = rpchelp.union('baz_2', rpchelp.r_int, 'b', {
    0: rpchelp.r_int,
    1: rpchelp.r_int,
    None: rpchelp.r_void
})