Exemplo n.º 1
0
from rpc import rpc_program, rpc_version, rpc_procedure
from rpc import auth_flavor as rpc_auth_flavor


int32_t = xdr_int
uint32_t = xdr_uint
int64_t = xdr_hyper
uint64_t = xdr_uhyper

NFS4_FHSIZE = 128
NFS4_VERIFIER_SIZE = 8
NFS4_OPAQUE_LIMIT = 1024

attrlist4 = xdr_opaque()
bitmap4 = xdr_array(uint32_t)
changeid4 = uint64_t
clientid4 = uint64_t
utf8str_cs = xdr_opaque()
component4 = utf8str_cs
count4 = uint32_t
length4 = uint64_t
linktext4 = utf8str_cs
mode4 = uint32_t
nfs_cookie4 = uint64_t
nfs_fh4 = xdr_opaque(max=NFS4_FHSIZE)

class nfs_ftype4(xdr_enum):
    NF4REG = 1 # Regular File
    NF4DIR = 2 # Directory
    NF4BLK = 3 # Special File - block device
Exemplo n.º 2
0
# Link list of all the stats about rmtcall
class rpcbs_rmtcalllist(xdr_struct):
    prog = xdr_uhyper
    vers = xdr_uhyper
    proc = xdr_uhyper
    success = xdr_int
    failure = xdr_int
    indirect = xdr_int  # whether callit or indirect
    netid = xdr_array(xdr_string)


#    next = xdr_optional(rpcbs_rmtcalllist)
rpcbs_rmtcalllist.next = xdr_optional(rpcbs_rmtcalllist)

rpcbs_proc = xdr_array(xdr_int, size=RPCBSTAT_HIGHPROC)
rpcbs_addrlist_ptr = xdr_optional(rpcbs_addrlist)
rpcbs_rmtcalllist_ptr = xdr_optional(rpcbs_rmtcalllist)


class rpcb_stat(xdr_struct):
    info = rpcbs_proc
    setinfo = xdr_int
    unsetinfo = xdr_int
    addrinfo = rpcbs_addrlist_ptr
    rmtinfo = rpcbs_rmtcalllist_ptr


# One rpcb_stat structure is returned for each version of rpcbind
# being monitored.
rpcb_stat_byvers = xdr_array(rpcb_stat, size=RPCBVERS_STAT)