V Qc@sddlZddlmZmZmZmZdZdZdZdefdYZdefd YZ d dd YZ d e efd YZ de efdYZ dZ dS(iN(tPackertUnpackert TCPClientt UDPClientiii t MountPackercBseZdZRS(cCs|jt|dS(N(t pack_fopaquetFHSIZE(tselftfhandle((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyt pack_fhandles(t__name__t __module__R (((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyRst MountUnpackercBsGeZdZdZdZdZdZdZdZRS(cCs |jtS(N(tunpack_fopaqueR(R((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytunpack_fhandle*scCs7|j}|dkr'|j}nd}||fS(Ni(t unpack_uintRtNone(Rtstatustfh((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytunpack_fhstatus-s   cCs|j|jS(N(t unpack_listtunpack_mountstruct(R((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytunpack_mountlist5scCs"|j}|j}||fS(N(t unpack_string(Rthostnamet directory((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyR8s  cCs|j|jS(N(Rtunpack_exportstruct(R((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytunpack_exportlist=scCs"|j}|j}||fS(N(Rt unpack_groups(Rtfilesystgroups((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyR@s  cCs|j|jS(N(RR(R((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyREs( R R RRRRRRR(((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyR (s      tPartialMountClientcBsPeZdZdZdZdZdZdZdZdZ RS(cCst|_td|_dS(Nt(RtpackerR tunpacker(R((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyt addpackersPs cCsnddl}y|j}Wntk r5d}nX|dkrZtj|jd}n|jjddS(NiiiR (R i(tostgetuidtAttributeErrortrpct bindresvporttsocktbind(RR$tuidtport((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyt bindsocketXs    cCs1|jdkr*tjtjf|_n|jS(N(tcredRR't AUTH_UNIXtmake_auth_unix_default(R((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytmkcredfscCs"|jd||jj|jjS(Ni(t make_callR!t pack_stringR"R(RR((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytMnts  cCs|jddd|jjS(Ni(R2RR"R(R((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytDumps cCs|jd||jjdS(Ni(R2R!R3R(RR((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytUmnts cCs|jddddS(Ni(R2R(R((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytUmntallscCs|jddd|jjS(Ni(R2RR"R(R((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pytExports ( R R R#R-R1R4R5R6R7R8(((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyRLs   #    tTCPMountClientcBseZdZRS(cCstj||ttdS(N(Rt__init__t MOUNTPROGt MOUNTVERS(Rthost((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyR:s(R R R:(((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyR9stUDPMountClientcBseZdZRS(cCstj||ttdS(N(RR:R;R<(RR=((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyR:s(R R R:(((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyR>scCsddl}|jdr?|jddkr?t}|jd=n9|jdrr|jddkrrt}|jd=nt}|jdr|jd}nd}||}|j}xK|D]C}|GHy|j|dWndGHqnX|j|dqWdS(Niis-ts-uR itSorry(tsystargvR9R>R8R4R6(R@tCR=tmcltlisttitem((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyttests*         ((R'RRRRR;R<RRR RR9R>RF(((s,/usr/lib64/python2.7/Demo/rpc/mountclient.pyt s " $W