+
    O×i¤#  ã                   óÞ   € ^ RI t ^ RIt^ RIt^ RIt^RIHtHtHtHtH	t	H
t
HtHt ]P                  ! ]4      t ! R R]4      t ! R R]4      t ! R R] P&                  4      t ! R	 R
]4      tR# )é    N)Ú	JsonErrorÚ
JsonObjectÚ	JsonValueÚcreate_objectÚget_intÚget_strÚget_str_or_noneÚtypecheckedc                   ód   a a€ ] tR t^t oRtRV3R lV 3R llltV3R lR ltV3R ltRtVt	V ;t
# )	ÚCockpitProblemaÏ  A type of exception that carries a problem code and a message.

Depending on the scope, this is used to handle shutting down:

  - an individual channel (sends problem code in the close message)
  - peer connections (sends problem code in close message for each open channel)
  - the main stdio interaction with the bridge

It is usually thrown in response to some violation of expected protocol
when parsing messages, connecting to a peer, or opening a channel.
c                ó.   <€ V ^8„  d   QhRS[ RRRS[RR/# )é   ÚproblemÚmsgúJsonObject | NoneÚkwargsÚreturnN©Ústrr   )ÚformatÚ__classdict__s   "€Ú2/usr/lib/python3/dist-packages/cockpit/protocol.pyÚ__annotate__ÚCockpitProblem.__annotate__   s2   ø€ ÷ Bñ B¡ð BÐ*=ð BÑPYð BÐ^bñ Bó    c                óx   <€ WR &   \        W#4      V n        \        SV `  \	        V P                  RV4      4       R# )r   ÚmessageN)r   ÚattrsÚsuperÚ__init__r   )Úselfr   r   r   Ú	__class__s   &&&,€r   r    ÚCockpitProblem.__init__   s1   ø€ Ø#ˆyÑÜ" 3Ó/ˆŒ
Ü‰Ñœ §¡¨Y¸Ó@ÖAr   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r   ©r   )r   r   s   "€r   r   r   #   s   ø€ ÷ ñ ™:ñ r   c                ó$  € V P                   R ,          R8X  dn   V P                  e`   \        V P                   \        P                  ! V P                  P
                  V P                  V P                  P                  4      R7      # V P                   # )r   zinternal-error)Úcause)r   Ú	__cause__ÚdictÚ	tracebackÚformat_exceptionr"   Ú__traceback__©r!   s   &r   Ú	get_attrsÚCockpitProblem.get_attrs#   sh   € Ø�:‰:�iÕ Ð$4Ô4¸¿¹Ò9SÜ˜Ÿ
™
¬)×*DÒ*DØ—‘×(Ñ(¨$¯.©.¸$¿.¹.×:VÑ:Vó+ô ð ð —:‘:Ðr   c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )r   r   r&   )r   r   s   "€r   r   r      s   ø‡ ‚ ñ Ñò r   )r   ©N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r    r/   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r"   r   s   @@r   r   r      s'   ù‡ € ñ
÷Bõ B÷
ð ÷' … r   r   c                   óB   a a€ ] tR t^,t oRV3R lV 3R llltRtVtV ;t# )ÚCockpitProtocolErrorc                ó&   <€ V ^8„  d   QhRS[ RS[ /# )r   r   r   )r   )r   r   s   "€r   r   Ú!CockpitProtocolError.__annotate__-   s   ø€ ÷ 3ñ 3¡ð 3©cñ 3r   c                ó(   <€ \         SV `  W!R 7       R# ))r   N)r   r    )r!   r   r   r"   s   &&&€r   r    ÚCockpitProtocolError.__init__-   s   ø€ Ü‰Ñ˜ÐÖ2r   © )zprotocol-error)r3   r4   r5   r6   r    r9   r:   r;   r<   s   @@r   r>   r>   ,   s   ù‡ € ÷3÷ 3õ 3r   r>   c                   óV  a € ] tR t^1t o RtRtRtRtRtV 3R lR lt	V 3R lR lt
V 3R	 lR
 ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR%V 3R lR lltV 3R lR ltR%V 3R lR lltV 3R lR  ltV 3R! lR" ltV 3R# ltR$tV tR# )&ÚCockpitProtocolz“A naive implementation of the Cockpit frame protocol

We need to use this because Python's SelectorEventLoop doesn't supported
buffered protocols.
Nr   Fc                ó   <€ V ^8„  d   QhRR/# ©r   r   NrC   )r   r   s   "€r   r   ÚCockpitProtocol.__annotate__<   s   ø€ ÷ ñ ˜$ñ r   c                ó   € R # r2   rC   r.   s   &r   Údo_readyÚCockpitProtocol.do_ready<   ó   € Ùr   c                ó"   <€ V ^8„  d   QhRRRR/# ©r   ÚexczException | Noner   NrC   )r   r   s   "€r   r   rH   ?   s   ø€ ÷ ñ Ð/ð °Dñ r   c                ó   € R # r2   rC   ©r!   rO   s   &&r   Ú	do_closedÚCockpitProtocol.do_closed?   rL   r   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# ©r   Úcommandr   r   N©r   r   )r   r   s   "€r   r   rH   B   s"   ø€ ÷ "ñ "±#ð "Á
ð "Ètñ "r   c                ó   € \         hr2   ©ÚNotImplementedError©r!   rV   r   s   &&&r   Útransport_control_receivedÚ*CockpitProtocol.transport_control_receivedB   ó   € Ü!Ð!r   c                ó0   <€ V ^8„  d   QhRS[ RS[ RS[RR/# )r   ÚchannelrV   r   r   NrW   )r   r   s   "€r   r   rH   E   s*   ø€ ÷ "ñ "±ð "¹cð "ÉJð "Ð[_ñ "r   c                ó   € \         hr2   rY   )r!   r`   rV   r   s   &&&&r   Úchannel_control_receivedÚ(CockpitProtocol.channel_control_receivedE   r^   r   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r`   Údatar   N©r   Úbytes)r   r   s   "€r   r   rH   H   s"   ø€ ÷ "ñ "©Sð "¹ð "À$ñ "r   c                ó   € \         hr2   rY   )r!   r`   re   s   &&&r   Úchannel_data_receivedÚ%CockpitProtocol.channel_data_receivedH   r^   r   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Úframer   N©rg   )r   r   s   "€r   r   rH   K   s   ø€ ÷ 	(ñ 	(¡Eð 	(¨dñ 	(r   c                óæ   € VP                  R 4      w  r#pVR8w  dE   VP                  R4      p\        P                  R\	        V4      V4       V P                  WT4       R# V P                  V4       R# )ó   
r   Úasciiz.data received: %d bytes of data for channel %sN)Ú	partitionÚdecodeÚloggerÚdebugÚlenri   Úcontrol_received)r!   rl   ÚheaderÚ_re   r`   s   &&    r   Úframe_receivedÚCockpitProtocol.frame_receivedK   s]   € ØŸ/™/¨%Ó0‰ˆ�4à�SŒ=Ø—m‘m GÓ,ˆGÜ�L‰LÐIÌ3ÈtË9ÐV]Ô^Ø×&Ñ& wÖ5ð ×!Ñ! $Ö'r   c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r   re   r   Nrm   )r   r   s   "€r   r   rH   V   s   ø€ ÷ Mñ M¡Uð M¨tñ Mr   c                ó’  €  \        \        P                  ! V4      \        4      p\	        VR 4      p\	        VRR4      pVe+   \
        P                  RV4       V P                  WCV4       R# \
        P                  RV4       V P                  W24       R#   \        P                  \        3 d   p\        RT: 24      ThRp?ii ; i)rV   r`   Nzchannel control received %sztransport control received %szcontrol message: )r
   ÚjsonÚloadsr*   r   rs   rt   rb   r\   ÚJSONDecodeErrorr   r>   )r!   re   r   rV   r`   rO   s   &&    r   rv   Ú CockpitProtocol.control_receivedV   s«   € ð	MÜ!¤$§*¢*¨TÓ"2´DÓ9ˆGÜ˜g yÓ1ˆGÜ˜g y°$Ó7ˆGàÒ"Ü—‘Ð:¸GÔDØ×-Ñ-¨gÀÖHä—‘Ð<¸gÔFØ×/Ñ/°ÖAøä×$Ñ$¤iÐ0ô 	MÜ&Ð):¸3¹'Ð'BÓCÈÐLûð	Mús   ‚A)B Á-'B ÂCÂ1CÃCc                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   re   r   )rg   Úint)r   r   s   "€r   r   rH   f   s   ø€ ÷ ñ ¡eð ±ñ r   c                óž  €  VP                  R4      p \	        TRT 4      pT^,           pYT,           pT\        T4      8”  d   \        T4      T,
          # T P                  YT 4       T#   \         d9   p\        T4      ^
8  d   \        T4      ^
,
          u Rp?# \        R4      ThRp?ii ; i  \         d   p\        R4      ThRp?ii ; i)z¨Consumes a single frame from view.

Returns positive if a number of bytes were consumed, or negative if no
work can be done because of a given number of bytes missing.
ro   Nzsize line is too longzframe size is not an integer)ÚindexÚ
ValueErrorru   r>   rƒ   ry   )r!   re   ÚnewlinerO   ÚlengthÚstartÚends   &&     r   Úconsume_one_frameÚ!CockpitProtocol.consume_one_framef   sÌ   € ð	IØ—j‘j Ó'ˆGð	PÜ˜˜h˜w˜Ó(ˆFð ˜!•ˆØ�nˆà”�T“Œ?ä�t“9˜s•?Ð"ð 	×Ñ˜D s˜OÔ,Øˆ
øô) ô 	IÜ�4‹y˜2Œ~ä˜4“y 2•~Õ%Ü&Ð'>Ó?ÀSÐHûð		Iûô ô 	PÜ&Ð'EÓFÈCÐOûð	Pús:   ‚A* ”B0 Á*B-Á5!B(ÂB-ÂB(Â(B-Â0CÂ;CÃCc                ó8   <€ V ^8„  d   QhRS[ P                  RR/# )r   Ú	transportr   N)ÚasyncioÚBaseTransport)r   r   s   "€r   r   rH   …   s!   ø€ ÷ ñ ©×)>Ñ)>ð À4ñ r   c                ó  € \         P                  R V4       \        V\        P                  4      '       g   Q hWn        V P                  4        V P                  '       d(   \         P                  R4       VP                  4        R# R# )zconnection_made(%s)z;  but the protocol already was closed, so closing transportN)	rs   rt   Ú
isinstancer�   Ú	TransportrŽ   rJ   Ú_closedÚclose)r!   rŽ   s   &&r   Úconnection_madeÚCockpitProtocol.connection_made…   s]   € Ü�‰Ð*¨IÔ6Ü˜)¤W×%6Ñ%6×7Ò7Ð7Ð7Ø"ŒØ�‰Œà�<�<ˆ<Ü�L‰LÐVÔWØ�O‰OÖñ r   c                ó"   <€ V ^8„  d   QhRRRR/# rN   rC   )r   r   s   "€r   r   rH   �   s   ø€ ÷ ñ Ð#5ð ¸$ñ r   c                ó€   € \         P                  R 4       V P                  f   Q hRV n        V P                  V4       R# )Úconnection_lostN)rs   rt   rŽ   r•   rQ   s   &&r   rš   ÚCockpitProtocol.connection_lost�   s1   € Ü�‰Ð&Ô'Ø�~‰~Ò)Ð)Ð)ØˆŒØ�
‰
�3Žr   c                ó"   <€ V ^8„  d   QhRRRR/# rN   rC   )r   r   s   "€r   r   rH   •   s   ø€ ÷ ñ Ð+ð °tñ r   c                ó¶   € V P                   '       d   R # RV n         V P                  '       d   V P                  P                  4        V P                  V4       R # )NT)r”   rŽ   r•   rR   rQ   s   &&r   r•   ÚCockpitProtocol.close•   s:   € Ø�<�<ˆ<ÙØˆŒà�>�>ˆ>Ø�N‰N× Ñ Ô"à�‰�sÖr   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r`   Úpayloadr   Nrf   )r   r   s   "€r   r   rH   Ÿ   s"   ø€ ÷ 	=ñ 	=©#ð 	=¹ð 	=À$ñ 	=r   c                óD  € \        VR,           4      \        V4      ,           pV RV R2P                  R4      pV P                  eD   \        P	                  RV P                  4       V P                  P                  WB,           4       R# \        P	                  R4       R# )z0Send a given payload (bytes) on channel (string)Ú
rp   Nzwriting to transport %sz cannot write to closed transport)ru   ÚencoderŽ   rs   rt   Úwrite)r!   r`   r    Úframe_lengthrw   s   &&&  r   Úwrite_channel_dataÚ"CockpitProtocol.write_channel_dataŸ   sw   € ô ˜7 T�>Ó*¬S°«\Õ9ˆØ �>  G 9¨BÐ/×6Ñ6°wÓ?ˆØ�>‰>Ò%Ü�L‰LÐ2°D·N±NÔCØ�N‰N× Ñ  Õ!1Ö2ä�L‰LÐ;Ö<r   c                ó(   <€ V ^8„  d   QhRRRS[ RR/# )r   r   r   r   r   N)r   )r   r   s   "€r   r   rH   ª   s$   ø€ ÷ 5ñ 5Ð!4ð 5Áyð 5ÐUYñ 5r   c                óÂ   € \         P                  RW4       \        P                  ! \	        W4      ^R7      R,           pV P                  RVP                  4       4       R# )zCWrite a control message.  See jsonutil.create_object() for details.zsending control message %r %r)Úindentr¢   Ú N)rs   rt   r~   Údumpsr   r¦   r£   )r!   r   r   Úprettys   &&, r   Úwrite_controlÚCockpitProtocol.write_controlª   sA   € ä�‰Ð4°cÔBÜ—’œM¨#Ó6¸qÔAÀDÕHˆØ×Ñ  F§M¡M£OÖ4r   c                ó$   <€ V ^8„  d   QhRS[ RR/# r|   rm   )r   r   s   "€r   r   rH   °   s   ø€ ÷ 	ñ 	¡%ð 	¨Dñ 	r   c                ó&  €  V ;P                   V,          un         V P                   '       d;   V P                  V P                   4      pV^ 8:  d   R# V P                   VR V n         KL  R#   \         d   pT P                  T4        Rp?R# Rp?ii ; i)r   N)Úbufferr‹   r>   r•   )r!   re   ÚresultrO   s   &&  r   Údata_receivedÚCockpitProtocol.data_received°   sr   € ð	Ø�KŠK˜4Õ�KØ—+—+�+Ø×/Ñ/°·±Ó<�Ø˜Q”;ÙØ"Ÿk™k¨&¨'Ð2�–ñ	 øô
 $ô 	Ø�J‰J�s�OŠOûð	ús"   ‚*A) ­"A) ÁA) Á)BÁ4BÂBc                ó    <€ V ^8„  d   QhRS[ /# r%   ©Úbool)r   r   s   "€r   r   rH   »   s   ø€ ÷ ñ ™dñ r   c                ó   € R # )FrC   r.   s   &r   Úeof_receivedÚCockpitProtocol.eof_received»   s   € Ùr   c                ó:   <€ V ^8„  d   Qh/ R;R&   S[ ;R&   R;R&   # )r   zasyncio.Transport | NonerŽ   r”   zasyncio.Future[None] | NoneÚ_communication_doner·   )r   r   s   "€r   r   rH   1   s,   ø‡ ‚ ð *Ñ0ñ ñ Ññ ð 7Ñ=ò r   )r”   r²   rŽ   r2   )r3   r4   r5   r6   r7   rŽ   r²   r”   r½   rJ   rR   r\   rb   ri   ry   rv   r‹   r–   rš   r•   r¦   r®   r´   rº   r8   r9   r:   ©r   s   @r   rE   rE   1   sÁ   ø‡ € ñð
 -1€IØ€FØ€GØ9=Ð÷ð ÷ð ÷"ð "÷"ð "÷"ð "÷	(ð 	(÷Mð M÷ ð ÷>ð ÷ð ÷ò ÷	=ð 	=÷5ò 5÷	ð 	÷ð ÷U ƒ r   rE   c                   óÐ   a € ] tR t^Àt o RtRt^ tV 3R lR ltV 3R lR ltV 3R lR lt	V 3R lR	 lt
V 3R
 lR ltRV 3R lR lltRV 3R lR lltV 3R lR ltV 3R ltRtV tR# )ÚCockpitProtocolServerNc                ó   <€ V ^8„  d   QhRR/# rG   rC   )r   r   s   "€r   r   Ú"CockpitProtocolServer.__annotate__Å   s   ø€ ÷ "ñ "˜dñ "r   c                ó   € \         hr2   rY   r.   s   &r   Údo_send_initÚ"CockpitProtocolServer.do_send_initÅ   r^   r   c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r   r   r   Nr&   )r   r   s   "€r   r   rÂ   È   s   ø€ ÷ ñ ™zð ¨dñ r   c                ó   € R # r2   rC   )r!   r   s   &&r   Údo_initÚCockpitProtocolServer.do_initÈ   rL   r   c                ó,   <€ V ^8„  d   QhRRRRRS[ RR/# )r   Úhostú
str | NoneÚgroupr   r   Nr&   )r   r   s   "€r   r   rÂ   Ë   s*   ø€ ÷ "ñ "˜Lð "°ð "É
ð "ÐW[ñ "r   c                ó   € \         hr2   rY   )r!   rÌ   rÎ   r   s   &&&&r   Údo_killÚCockpitProtocolServer.do_killË   r^   r   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# rU   rW   )r   r   s   "€r   r   rÂ   Î   s'   ø€ ÷ Yñ Y±#ð YÁ
ð YÈtñ Yr   c                óF  € VR 8X  dA   \        VR4      ^8w  d   \        R4      h\        VR4      V n        V P	                  V4       R# VR8X  d,   V P                  \        VRR4      \        VRR4      V4       R# VR8X  d   V P                  V4       R# \        RV R	24      h)
ÚinitÚversionzincorrect version numberrÌ   ÚkillNrÎ   Ú	authorizezunexpected control message z	 received)r   r>   r   Ú	init_hostrÉ   rÐ   r	   Údo_authorizer[   s   &&&r   r\   Ú0CockpitProtocolServer.transport_control_receivedÎ   s˜   € Ø�fÔÜ�w 	Ó*¨aÔ/Ü*Ð+EÓFÐFÜ$ W¨fÓ5ˆDŒNØ�L‰L˜Ö!Ø˜ÔØ�L‰Lœ¨°&¸$Ó?ÄÐQXÐZaÐcgÓAhÐjqÖrØ˜Ô#Ø×Ñ˜gÖ&ä&Ð)DÀWÀIÈYÐ'WÓXÐXr   c                ó   <€ V ^8„  d   QhRR/# rG   rC   )r   r   s   "€r   r   rÂ   Û   s   ø€ ÷ ñ ˜$ñ r   c                ó&   € V P                  4        R # r2   )rÄ   r.   s   &r   rJ   ÚCockpitProtocolServer.do_readyÛ   s   € Ø×ÑÖr   c                ó0   <€ V ^8„  d   QhRS[ RRRS[RS[/# ©r   Ú	challengeÚtimeoutz
int | Noner   r   )r   r   r   )r   r   s   "€r   r   rÂ   ß   s-   ø€ ÷ ,ñ ,Ùð,Ø'3ð,ÙFOð,á	ñ,r   c           	   ‹  óÚ  "  € V P                   f   / V n         \        V P                  4      pV ;P                  ^,          un        \        P                  ! 4       P                  4       p WPP                   V&   V P                  ! RRRRVRV/VB  \        P                  ! WR4      G R j  x€L
 V P                   P                  V4       #  L  T P                   P                  T4       i ; i5i)NrV   r×   rà   Úcookier2   )	Úauthorizationsr   Únext_auth_idr�   Úget_running_loopÚcreate_futurer®   Úwait_forÚpop)r!   rà   rá   r   rã   Úfutures   &&&,  r   Úrequest_authorization_objectÚ2CockpitProtocolServer.request_authorization_objectß   sÇ   é € ð ×ÑÒ&Ø"$ˆDÔÜ�T×&Ñ&Ó'ˆØ×Ò˜QÕÕÜ×)Ò)Ó+×9Ñ9Ó;ˆð	,Ø*0×Ñ Ñ'Ø×ÒÑg¨[ÐgÀIÐgÐV\ÐgÐ`fÒgÜ ×)Ò)¨&Ó:×:à×Ñ×#Ñ# FÕ+ñ ;øà×Ñ×#Ñ# FÕ+üs0   ‚A'C+Á*?C Â)C	Â*C Â-C+Ã	C ÃC(Ã(C+c                ó0   <€ V ^8„  d   QhRS[ RRRS[RS[ /# rß   r   )r   r   s   "€r   r   rÂ   î   s3   ø€ ÷ jñ jÙðjØ'3ðjÙFOðjá	ñjr   c              ‹  óX   "  € \        V P                  ! W3/ VB G R j  x€L
 R4      #  L	5i)NÚresponse)r   rë   )r!   rà   rá   r   s   &&&,r   Úrequest_authorizationÚ+CockpitProtocolServer.request_authorizationî   s,   é € ô ˜T×>Ò>¸yÑ\ÐU[Ñ\×\Ð^hÓiÐiÑ\ùs   ‚*ž(Ÿ
*c                ó$   <€ V ^8„  d   QhRS[ RR/# rÇ   r&   )r   r   s   "€r   r   rÂ   ó   s   ø€ ÷ 8ñ 8¡Jð 8°4ñ 8r   c                óÌ   € \        VR 4      pV P                  e   W P                  9  d   \        P                  R4       R# V P                  V,          P	                  V4       R# )rã   Nzno matching authorize request)r   rä   rs   ÚwarningÚ
set_result)r!   r   rã   s   && r   rÙ   Ú"CockpitProtocolServer.do_authorizeó   sN   € Ü˜ (Ó+ˆà×ÑÒ&¨&×8KÑ8KÔ*KÜ�N‰NÐ:Ô;Ùà×Ñ˜FÕ#×.Ñ.¨wÖ7r   c                ó.   <€ V ^8„  d   Qh/ R;R&   R;R&   # )r   rÍ   rØ   z,dict[str, asyncio.Future[JsonObject]] | Nonerä   rC   )r   r   s   "€r   r   rÂ   À   s   ø‡ ‚ ØÑ"ñ àBÑIò r   )rä   rØ   r2   )r3   r4   r5   r6   rØ   rä   rå   rÄ   rÉ   rÐ   r\   rJ   rë   rð   rÙ   r8   r9   r:   r¾   s   @r   rÀ   rÀ   À   sp   ø‡ € Ø"€IØEI€NØ€L÷"ð "÷ð ÷"ð "÷Yð Y÷ð ÷,ò ,÷jò j÷
8ð 8÷g ƒ r   rÀ   )r�   r~   Úloggingr+   Újsonutilr   r   r   r   r   r   r	   r
   Ú	getLoggerr3   rs   Ú	Exceptionr   r>   ÚProtocolrE   rÀ   rC   r   r   Ú<module>rý      se   ðó Û Û Û ç u× uÓ uà	×	Ò	˜8Ó	$€ô�Yô ô83˜>ô 3ô
K�g×&Ñ&ô Kô^:8˜Oö :8r   