示例#1
0
文件: nfs.py 项目: saalweachter/fs
    @rpc_version(vers=4)
    class NFS_V4(object):
        @rpc_procedure(proc=0, args=xdr_void, ret=xdr_void)
        def NFSPROC4_NULL(self):
            pass

        @rpc_procedure(proc=1, args=COMPOUND4args, ret=COMPOUND4res)
        def NFSPROC4_COMPOUND(self, args):
            pass

    NFS_VERS = 4


if __name__ == "__main__":
    from rpc import rpc_server
    server = rpc_server(2049)
    server.add_program(NFS4_PROGRAM())
    for i in range(60):
        print("loop.")
        server.cycle(1000.0)
    import sys
    sys.exit(0)


if __name__ == "__main__":
    from xdrlib import Unpacker
    unpacker = Unpacker(b)
    args = COMPOUND4args.unpack(unpacker)
    print(args)
    print("tag: %s" % args.tag)
    print("minor version: %d" % args.minorversion)
示例#2
0
        @rpc_procedure(proc=7, args=xdr_string, ret=netbuf)
        def RPCBPROC_UADDR2TADDR(self, arg):
            pass
        @rpc_procedure(proc=8, args=netbuf, ret=xdr_string)
        def RPCBPROC_TADDR2UADDR(self, arg):
            pass
        @rpc_procedure(proc=9, args=rpcb, ret=xdr_string)
        def RPCBPROC_GETVERSADDR(self, arg):
            pass
        @rpc_procedure(proc=10, args=rpcb_rmtcallargs, ret=rpcb_rmtcallres)
        def RPCBPROC_INDIRECT(self, arg):
            pass
        @rpc_procedure(proc=11, args=rpcb, ret=rpcb_entry_list_ptr)
        def RPCBPROC_GETADDRLIST(self, arg):
            pass
        @rpc_procedure(proc=12, args=xdr_void, ret=rpcb_stat_byvers)
        def RPCBPROC_GETSTAT(self):
            pass


if __name__ == "__main__":
    from rpc import rpc_server
    server = rpc_server(111)
    server.add_program(RPCBPROG())
    for i in range(60):
        print("loop.")
        server.cycle(1000.0)
    import sys
    sys.exit(0)