ó ¿œ^c@sÃddlZddlmZmZddlmZmZmZdZdZdZ dZ dZ dZ dZ d Zd Zd efd „ƒYZd efd„ƒYZdefd„ƒYZd„ZdS(iÿÿÿÿN(t UDPClientt TCPClient(tFHSIZEt MountPackert MountUnpackeri£†iiiiiit NFSPackercBs5eZd„Zd„Zd„Zd„Zd„ZRS(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>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(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 NFSClientcBsPeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(cCstj||ttƒdS(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*tjtjƒf|_n|jS(N(tcredR)trpct AUTH_UNIXtmake_auth_unix_default(R((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytmkcredƒscCs"|jd||jj|jjƒS(Ni(t make_callRFRRGR7(RR4((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytGetattrˆs  cCs"|jd||jj|jjƒS(Ni(RNRFR RGR7(RR ((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytSetattrs  cCs"|jd||jj|jjƒS(Ni(RNRFRRGR6(RR((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytLookup”s  cCs"|jd||jj|jjƒS(Ni(RNRFRRGR.(RR((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytReaddir›s  c Cs·g}|ddf}x›|j|ƒ\}}|tkr=Pn|\}}d}x0|D](\} } } |j| | fƒ| }qVW|s”|dkr˜Pn|d||df}qW|S(NiiÐi(RRR%R)tappend( RRtlistRR*R-R+R,t last_cookieR1RR((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pytListdir¡s   ( 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] }|GHq“WdS|j|ƒ}|GH|d} | rt|ƒ} | j | ƒ} | GH| j | ƒ}x|D] }|GHqW|j |ƒndS(NiÿÿÿÿiREi(tUDPMountClienttTCPMountClient( tsystargvR)t mountclientRWRXtExporttMntR@RORVtUmnt( RYRDtfilesysRWRXtmclRTtitemtsfR4tncltattrstat((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyttest³s2           (RJRRR[RRRRBRCR%tNFNONtNFREGtNFDIRtNFBLKtNFCHRtNFLNKRR#R@Re(((s*/usr/lib64/python2.7/Demo/rpc/nfsclient.pyt s !<9