V Qc@sddlZddlmZmZddlmZmZmZdZdZdZ dZ dZ dZ dZ d Zd Zd efd YZd efdYZdefdYZdZdS(iN(t UDPClientt TCPClient(tFHSIZEt MountPackert MountUnpackeriiiiiiit NFSPackercBs5eZdZdZdZdZdZRS(cCs*|\}}|j||j|dS(N(t pack_fhandlet pack_sattr(tselftsatfilet attributes((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytpack_sattrargss  cCsj|\}}}}}}|j||j||j||j||j||j|dS(N(t pack_uintt pack_timeval(RR tmodetuidtgidtsizetatimetmtime((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyR$s     cCs*|\}}|j||j|dS(N(Rt pack_string(Rtdatdirtname((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytpack_diropargs-s  cCs:|\}}}|j||j||j|dS(N(RR (RtraRtcookietcount((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytpack_readdirargs2s  cCs*|\}}|j||j|dS(N(R (Rttvtsecstusecs((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyR8s  (t__name__t __module__R RRRR(((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyRs    t NFSUnpackercBs>eZdZdZdZdZdZdZRS(cCsU|j}|tkrE|j|j}|j}||f}nd}||fS(N(t unpack_enumtNFS_OKt unpack_listt unpack_entryt unpack_booltNone(Rtstatustentriesteoftrest((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytunpack_readdirres@s   cCs1|j}|j}|j}|||fS(N(t unpack_uintt unpack_string(RtfileidRR((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyR'Js   cCsO|j}|tkr?|j}|j}||f}nd}||fS(N(R$R%tunpack_fhandlet unpack_fattrR)(RR*tfhtfaR-((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytunpack_diropresPs    cCs7|j}|tkr'|j}nd}||fS(N(R$R%R3R)(RR*R ((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytunpack_attrstatZs   cCs|j}|j}|j}|j}|j}|j}|j}|j}|j} |j} |j} |j} |j} |j}||||||||| | | | | |fS(N(R$R/tunpack_timeval(RttypeRtnlinkRRRt blocksizetrdevtblockstfsidR1RRtctime((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyR3bs               cCs"|j}|j}||fS(N(R/(RRR ((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyR8ts  (R!R"R.R'R6R7R3R8(((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyR#>s    t NFSClientcBsPeZdZdZdZdZdZdZdZdZ RS(cCstj||ttdS(N(Rt__init__t NFS_PROGRAMt NFS_VERSION(Rthost((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyRA|scCst|_td|_dS(Nt(RtpackerR#tunpacker(R((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyt addpackerss cCs1|jdkr*tjtjf|_n|jS(N(tcredR)trpct AUTH_UNIXtmake_auth_unix_default(R((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytmkcredscCs"|jd||jj|jjS(Ni(t make_callRFRRGR7(RR4((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytGetattrs  cCs"|jd||jj|jjS(Ni(RNRFR RGR7(RR ((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytSetattrs  cCs"|jd||jj|jjS(Ni(RNRFRRGR6(RR((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytLookups  cCs"|jd||jj|jjS(Ni(RNRFRRGR.(RR((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytReaddirs  c Csg}|ddf}x|j|\}}|tkr=Pn|\}}d}x0|D](\} } } |j| | f| }qVW|s|dkrPn|d||df}q|S(Niii(RRR%R)tappend( RRtlistRR*R-R+R,t last_cookieR1RR((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytListdirs   ( R!R"RARHRMRORPRQRRRV(((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyR@zs       c Cs#ddl}|jdr)|jd}nd}|jdrL|jd}nd}ddlm}m}||}|dkr|j}x|D] }|GHqWdS|j|}|GH|d} | rt|} | j | } | GH| j | }x|D] }|GHqW|j |ndS(NiiREi(tUDPMountClienttTCPMountClient( tsystargvR)t mountclientRWRXtExporttMntR@RORVtUmnt( RYRDtfilesysRWRXtmclRTtitemtsfR4tncltattrstat((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyttests2           (RJRRR[RRRRBRCR%tNFNONtNFREGtNFDIRtNFBLKtNFCHRtNFLNKRR#R@Re(((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyt s !<9