kx]c@spddlmZddlZddlmZmZddlmZddlZddl Z ddl Z ddl Z ddl Z de e kre je _e je _ni eej6eej6eej6eej6eej6eej6eej6eej6eej6eej6eej6eej 6Z!dZ"dZ#dZ$d Z%d Z&d Z'd Z(d{d|d}gZ)d~dddgZ*ddfddfddfddfddfd dfd"dfd$dfd&dfd(dfd*dfd,dfd.dfd0dfd2dfgZ+dddddgZ,d<dfd=dfd>dfgZ-ie)d?6e*d@6e+dA6e,dB6e-dC6Z.iidDd6dEd6dFd#6dG6Z/iidHd6dId6dJd+6dKdL6dMdN6dO6idPd6dQd6dRd6dSd!6dMd+6dT6i dUd6dVd6dWd6dXd6dYd!6dZd#6d[d%6d\d'6d]d)6d^d+6d_6id`d6dad#6dbdN6dcdd6de6Z0dfe1e/j2DZ3dge1e0j2DZ4ie/e3fdh6e0e4fdi6Z5djZ6dkZ7dlZ8dmZ9dnZ:doZ;dpZ<dqZ=drZ>ie=ds6Z?ie>ds6Z@dtZAduZBdvZCeDeDdwZEeDeDdxZFdyZGdzZHdS(i(tFieldDescriptorN(t IPv4Addresst ip_address(t IPv6Addresst encodebytescCs|jjtjjS(N(t GetOptionst Extensionstopts_pb2tcriuthex(tfield((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt_marked_as_hex0scCs|jjtjjS(N(RRRRtipadd(R ((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt _marked_as_ip4scCs|jjtjjS(N(RRRRtflags(R ((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt_marked_as_flags8scCs|jjtjjS(N(RRRRtdev(R ((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt_marked_as_dev<scCs|jjtjjS(N(RRRRtodev(R ((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt_marked_as_odev@scCs|jjtjjS(N(RRRRtdict(R ((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt_marked_as_dictDscCs|jjtjjS(N(RRRRtconv(R ((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt _custom_convHst PROT_READit PROT_WRITEit PROT_EXECit MAP_SHAREDt MAP_PRIVATEtMAP_ANONi t MAP_GROWSDOWNit VMA_AREA_NONEitVMA_AREA_REGULARtVMA_AREA_STACKtVMA_AREA_VSYSCALLt VMA_AREA_VDSOit VMA_AREA_HEAPitVMA_FILE_PRIVATEitVMA_FILE_SHAREDitVMA_ANON_SHAREDitVMA_ANON_PRIVATEi tVMA_AREA_SYSVIPCi tVMA_AREA_SOCKETi t VMA_AREA_VVARi tVMA_AREA_AIORINGi t VMA_UNSUPPitO_WRONLYtO_RDWRtO_APPENDitO_DIRECTi@t O_LARGEFILEit PE_PARENTtPE_LAZYt PE_PRESENTs mmap.prots mmap.flagss mmap.statuss rfile.flagss pmap.flagstAlivetZombietStoppedt task_statetUNIXtINETtINET6tNETLINKitPACKETitfamilytSTREAMtDGRAMtRAWt SEQPACKETttypet ESTABLISHEDtSYN_SENTtSYN_RECVt FIN_WAIT1t FIN_WAIT2t TIME_WAITtCLOSEt CLOSE_WAITtLAST_ACKtLISTENtstatetIPtTCPtUDPtUDPLITEitprotocCs5i|]+\}}dt|jD|qS(cSsi|]\}}||qS(((t.0tk2tv2((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pys s (tlisttitems(RUtktv((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pys s cCs5i|]+\}}dt|jD|qS(cSsi|]\}}||qS(((RURVRW((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pys s (RXRY(RURZR[((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pys s tgentskcCsgg|D]}||d@r |^q D]}|d^q(}|tg|D]}|d^qKM}|r|jd|ndj|S(Niis0x%xs | (tsumtappendtjoin(tvaluet flags_maptxtbs((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt map_flagss >(cCsv|dkrdSt|}tgg|jdD]}|j^q2D]'}tt|j||d^qHS(Ntit|(RR^tsplittstriptinttstrtget(RaRbtbdRc((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt unmap_flagss   icCsNt|r,dtj|tj|fSd|t?|dt>d@fSdS(Ns%d:%di(Rtostmajortminortkern_minorbits(R Ra((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt decode_devs   cCsdg|jdD]}t|^q}t|rLtj|d|dS|dt>|dBSdS(Nt:ii(RhRjRRotmakedevRr(R RaRcR((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt encode_devs( cCs tj|S(N(tbase64R(Ra((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt encode_base64scCs tj|S(N(Rwt decodebytes(Ra((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt decode_base64scCs tj|S(N(tquoprit encodestring(Ra((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt encode_unixscCs tj|S(N(R{t decodestring(Ra((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt decode_unixst unix_namecCs"t|}|rt|StSdS(N(RtencodeRx(R tc((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt get_bytes_encs cCs"t|}|rt|StSdS(N(RtdecodeRz(R R((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt get_bytes_decs cCs.dtkrt}n ttf}t||S(Nt basestring(t __builtins__RRktbytest isinstance(Rat string_types((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt is_strings   cCs|st|}n|jtjkr7t|||S|jtjkrYt||S|jtjkr|jj j |dj S|jt krft |j}|r\|tkr\|rd|St|rt||St|}|r"yt|}Wntk rd|SXt||Snt|}|r\t|d|j j |||Sn||Std|j |jfdS(Ns0x%xis!Field(%s) has unsupported type %d(R RDtFDt TYPE_MESSAGEtpb2dictt TYPE_BYTESRt TYPE_ENUMt enum_typetvalues_by_numberRltNonetnamet _basic_castRjRRsRt flags_mapst ExceptionReRt dict_maps(R Ratprettytis_hextcastRRbtdct((s9/usr/lib/python2.7/site-packages/pycriu/images/pb2dict.pyt _pb2dict_casts8       ( c Cs^|rtjni}x?|jD]1\}}|jtjkr4g}|rt|rt|dkrtj |d}t |}nbdtj |dd>tj |dd>tj |dd>tj |d}t |}|j |j qIxB|D]"}|j t||||q Wnt||||}|||js                                                               ( (