+
    ˜qgj™  ã                   ó6  a € R* t;0 t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
Ht ^ RIHt ^ RIHt ^ RIHtHtHtHtHtHtHt ^ RIt^ RIHtHtHt ^ RIHtHt ]P@                  ! ]!4      t"Rt#R	t$R
t%Rt&Rt' ! R R](4      t) ! R R])4      t* ! R R])4      t+ ! R R])4      t,R+R R llt-R t.R,R lt/R,R lt0R R lt1R R lt2R R lt3R  R! lt4 ! R" R#]Pj                  4      t6 ! R$ R%]64      t7 ! R& R']64      t8 ! R( R)]64      t9]8]7]9.t:] ^ k R# )-é    N)Úsuppress)ÚStringIO)ÚTimeoutExpired)ÚAnyÚCallableÚDictÚListÚOptionalÚTupleÚType)ÚsubpÚ
temp_utilsÚutil)Úget_interface_macÚis_ib_interfacez/run/systemd/netif/leasesz/var/lib/dhclientz.+\.leases?$ÚnmcliaN  #!/bin/sh
log() {
    echo "udhcpc[$PPID]" "$interface: $2"
}
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
case $1 in
    bound|renew)
    cat <<JSON > "$LEASE_FILE"
{
    "interface": "$interface",
    "fixed-address": "$ip",
    "subnet-mask": "$subnet",
    "routers": "${router%% *}",
    "static_routes" : "${staticroutes}"
}
JSON
    ;;
    deconfig)
    log err "Not supported"
    exit 1
    ;;
    leasefail | nak)
    log err "configuration failed: $1: $message"
    exit 1
    ;;
    *)
    echo "$0: Unknown udhcpc command: $1" >&2
    exit 1
    ;;
esac
c                   ó   € ] tR t^BtRtRtR# )ÚNoDHCPLeaseErrorz'Raised when unable to get a DHCP lease.© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    Ú4/usr/lib/python3/dist-packages/cloudinit/net/dhcp.pyr   r   B   s   † Ý1r   r   c                   ó   € ] tR t^FtRtRtR# )ÚInvalidDHCPLeaseFileErrorz›Raised when parsing an empty or invalid dhclient.lease file.

Current uses are DataSourceAzure and DataSourceEc2 during ephemeral
boot to scrape metadata.
r   Nr   r   r   r   r    r    F   s   † õr   r    c                   ó   € ] tR t^NtRtRtR# )ÚNoDHCPLeaseInterfaceErrorz7Raised when unable to find a viable interface for DHCP.r   Nr   r   r   r   r"   r"   N   s   † ÝAr   r"   c                   ó   € ] tR t^RtRtRtR# )ÚNoDHCPLeaseMissingDhclientErrorz$Raised when unable to find dhclient.r   Nr   r   r   r   r$   r$   R   s   † Ý.r   r$   c                ó˜   € V ^8„  d   QhR\         \        \        \        \        .R3,          ,          R\        \        \        3,          /# )é   Údhcp_log_funcNÚreturn)r
   r   Ústrr   r   )Úformats   "r   Ú__annotate__r+   V   sA   € ÷ Oñ Oô œH¤c¬3´ _°dÐ%:Õ;Õ<ðOô 
Œ#Œsˆ(…^ñ	Or   c                ó¬   € T;'       g    V P                   pVf    \        P                  R4       \        4       hV P                  P                  W2V 4      # )aý  Perform dhcp discovery if nic valid and dhclient command exists.

If the nic is invalid or undiscoverable or dhclient command is not found,
skip dhcp_discovery and return an empty dict.

@param nic: Name of the network interface we want to run dhclient on.
@param dhcp_log_func: Callable accepting the interface and client's
    stdout, stderr streams.
@return: A list of dicts representing dhcp options for each lease obtained
    from the dhclient discovery if run, otherwise an empty list is
    returned.
z1Skip dhcp_discovery: Unable to find fallback nic.)Úfallback_interfaceÚLOGÚdebugr"   Údhcp_clientÚdhcp_discovery)ÚdistroÚnicr'   Ú	interfaces   &&& r   Úmaybe_perform_dhcp_discoveryr5   V   sL   € ð" ×0Ð0�v×0Ñ0€IØÒÜ�	‰	ÐEÔFÜ'Ó)Ð)à×Ñ×,Ñ,¨YÀvÓNÐNr   c                óV   € \        \        P                  ! \        V 4      RR7      4      # )zÏParse a systemd lease file content as in /run/systemd/netif/leases/

Parse this (almost) ini style file even though it says:
  # This is private data. Do not parse.

Simply return a dictionary of key/values.F©Úlist_values)ÚdictÚ	configobjÚ	ConfigObjr   )Úcontents   &r   Únetworkd_parse_leaser=   o   s!   € ô ”	×#Ò#¤H¨WÓ$5À5ÔIÓJÐJr   c           	     ó"  € V f   \         p / p\        P                  P                  V 4      '       g   V# \        P                  ! V 4       FA  p\        \        P                  ! \        P                  P                  W4      4      4      W&   KC  	  V# )z—Return a dictionary of dictionaries representing each lease
found in lease_d.i

The top level key will be the filename, which is typically the ifindex.)	ÚNETWORKD_LEASES_DIRÚosÚpathÚisdirÚlistdirr=   r   Úload_text_fileÚjoin)Úleases_dÚretÚlfiles   &  r   Únetworkd_load_leasesrI   z   sm   € ð ÒÜ&ˆà€CÜ�7‰7�=‰=˜×"Ò"Øˆ
Ü—’˜HÖ%ˆÜ)Ü×Ò¤§¡§¡¨XÓ =Ó>ó
ˆ‹
ñ &ð €Jr   c                 ó¸   € Vf   \         p\        VR7      p\        VP                  4       4       F&  w  r4VP	                  V 4      '       g   K  W@,          u # 	  R # )N)rF   )r?   rI   ÚsortedÚitemsÚget)ÚkeynamerF   ÚleasesÚ_ifindexÚdatas   &&   r   Únetworkd_get_option_from_leasesrR   �   sJ   € ØÒÜ&ˆÜ!¨8Ô4€FÜ  §¡£Ö0‰ˆØ�8‰8�G×ÔØ•=Ò ñ 1ñ r   c                óF   € V ^8„  d   QhR\         \        ,          R\        /# )r&   Ú
nmcli_optsr(   )r	   r)   )r*   s   "r   r+   r+   —   s   € ÷ ñ œ$œs�)ð ¬ñ r   c                 óX  € \         P                  ! \        4      pV'       g   \        4       hV.V ,           p \         P                   ! V4      w  r4V#   \         P                   dC   p\
        P                  R TP                  TP                  TP                  4       \        ThRp?ii ; i)z8nmcli command exited with code: %s stderr: %r stdout: %rN)r   ÚwhichÚNMCLIr$   ÚProcessExecutionErrorr.   r/   Ú	exit_codeÚstderrÚstdoutr   )rT   Ú
nmcli_pathÚcommandÚoutÚ_Úerrors   &     r   Ú	run_nmclira   —   s�   € Ü—’œEÓ"€JßÜ-Ó/Ð/àˆl˜ZÕ'€Gð*Ü—’Øó
‰ˆð €Jøô ×%Ñ%ô *Ü�	‰	ØFØ�O‰OØ�L‰LØ�L‰Lô		
ô  EÐ)ûð*ús   ¸A ÁB)Á'=B$Â$B)c                óR   € V ^8„  d   QhR\         R\        \         \         3,          /# )r&   Údevicer(   ©r)   r   )r*   s   "r   r+   r+   ¬   s&   € ÷ Añ A¬ð A´´S¼#°Xµñ Ar   c                ó  € RRRRV .p\        V4      p. pVP                  4        F:  pVP                  R4      ^,          P                  4       pVP	                  V4       K<  	  \        \        P                  ! VRR7      4      # )z9Return a dictionary of lease options obtained from NM cliz--fieldsÚDHCP4rc   ÚshowÚ:Fr7   )ra   Ú
splitlinesÚ	partitionÚstripÚappendr9   r:   r;   )rc   ÚoptsÚ	nmcli_outr<   Úlines   &    r   Únetwork_manager_load_leasesrp   ¬   sw   € ð ˜ ¨6°6Ð:€DÜ˜$“€Ià€GØ×$Ñ$Ö&ˆØ�~‰~˜cÓ" 1Õ%×+Ñ+Ó-ˆØ�‰�tÖñ 'ô ”	×#Ò# G¸Ô?Ó@Ð@r   c                ó:   € V ^8„  d   QhR\         \        ,          /# ©r&   r(   ©r
   r)   )r*   s   "r   r+   r+   º   s   € ÷ ñ ¤8¬C¥=ñ r   c                 ó  € RR.p \        V 4      pVP                  4        F6  pVR8X  d   K   VP                  R^4      w  r4rTTR8w  d   K+  TR8X  d   K4  Tu # 	  R#   \         d    \        P                  RT4        K`  i ; i)	zLReturn the lease value for
the first connected device as returned by 'nmcli'z--terserc   Ú rh   zDUnexpected nmcli format: expected 4 colon-delimited values, found %sÚ	connectedÚloN)ra   ri   ÚsplitÚ
ValueErrorr.   Úwarning)Údevice_list_optsrn   ro   Údev_namer_   Ústates         r   Úfind_correct_device_nmclir~   º   s�   € ð " 8Ð,ÐÜÐ*Ó+€Ià×$Ñ$Ö&ˆØ�2Œ:Ùð	Ø$(§J¡J¨s°AÓ$6Ñ!ˆH˜ð �KÔÙà�tÔÙØŠñ' 'ñ( øô ô 	Ü�K‰Kð$àôò
 ð	ús   ­AÁ!BÂ Bc                óF   € V ^8„  d   QhR\         R\        \         ,          /# )r&   rN   r(   )r)   r
   )r*   s   "r   r+   r+   Ø   s   € ÷ 3ñ 3´Cð 3¼HÄS½Mñ 3r   c                 óv   € R p\        4       pV'       d   \        V4      pV'       d   VP                  V 4      # R # ©N)r~   rp   rM   )rN   rO   Údevs   &  r   Ú&network_manager_get_option_from_leasesrƒ   Ø   s2   € Ø€FÜ
#Ó
%€Cß
Ü,¨SÓ1ˆç"(ˆ6�:‰:�gÓÐ2¨dÐ2r   c                   ó$  a € ] tR t^át o Rt^
tR t]R 4       t]R 4       t	]V 3R lR l4       t
]V 3R lR l4       t]P                  V 3R	 lR
 l4       t]]P                  V 3R lR l4       4       t]P                  RV 3R lR ll4       tRtV tR# )Ú
DhcpClientru   c                óˆ   € \         P                  ! V P                  4      V n        V P                  '       g   \	        4       hR # r�   )r   rV   Úclient_nameÚdhcp_client_pathr$   )Úselfs   &r   Ú__init__ÚDhcpClient.__init__å   s3   € Ü $§
¢
¨4×+;Ñ+;Ó <ˆÔØ×$×$Ð$Ü1Ó3Ð3ñ %r   c                óR   € \         P                   ! R V P                  .^ ^.R7       R# )Úpkill©ÚrcsN)r   r‡   )Úclss   &r   Úkill_dhcp_clientÚDhcpClient.kill_dhcp_clientê   s   € ä�	Š	�7˜CŸO™OÐ,°1°a°&×9r   c                ó�   € V P                  4        \        P                  ! R 4      pV F  p\        P                  ! V4       K  	  R# )z/var/lib/dhcp/*N)r‘   Úglobr@   Úremove)r�   ÚfilesÚfiles   &  r   Úclear_leasesÚDhcpClient.clear_leasesî   s2   € à×ÑÔÜ—	’	Ð+Ó,ˆÛˆDÜ�IŠI�dŽOó r   c                ó    <€ V ^8„  d   QhRS[ /# ©r&   Údhcp_interface©r)   )r*   Ú__classdict__s   "€r   r+   ÚDhcpClient.__annotate__ö   s   ø€ ÷ 
ñ 
©3ñ 
r   c                óH   € VP                  R V P                  V^ ^.R7       R# )ÚstartrŽ   N©Úmanage_servicer‡   ©r�   rœ   r2   s   &&&r   Ústart_serviceÚDhcpClient.start_serviceõ   s&   € à×ÑØ�S—_‘_ n¸1¸a¸&ð 	ö 	
r   c                ó    <€ V ^8„  d   QhRS[ /# r›   r�   )r*   rž   s   "€r   r+   rŸ   ü   s   ø€ ÷ Cñ C©#ñ Cr   c                óF   € VP                  R V P                  ^ ^.R7       R# )ÚstoprŽ   Nr¢   r¤   s   &&&r   Ústop_serviceÚDhcpClient.stop_serviceû   s   € à×Ñ˜f c§o¡o¸A¸q¸6ÐÖBr   c                ó<   <€ V ^8„  d   QhRS[ RS[S[ S[3,          /# ©r&   r4   r(   ©r)   r   r   )r*   rž   s   "€r   r+   rŸ      s#   ø€ ÷ ñ ©#ð ±$±s¹C°xµ.ñ r   c                ó   € / # )zœGet the most recent lease from the ephemeral phase as a dict.

Return a dict of dhcp options. The dict contains key value
pairs from the most recent lease.
r   ©r‰   r4   s   &&r   Úget_newest_leaseÚDhcpClient.get_newest_leaseÿ   s	   € ð ˆ	r   c                óL   <€ V ^8„  d   QhRS[ RS[S[S[ S[ 3,          ,          /# ©r&   Úroutesr(   ©r)   r	   r   )r*   rž   s   "€r   r+   rŸ   
  s(   ø€ ÷ ñ ¡Cð ©D±±s¹C°xµÕ,Añ r   c                ó   € . # )a8  
parse classless static routes from string

The tuple is composed of the network_address (including net length) and
gateway for a parsed static route.

@param routes: string containing classless static routes
@returns: list of tuple(str, str) for all valid parsed routes until the
          first parsing error.
r   )rµ   s   &r   Úparse_static_routesÚDhcpClient.parse_static_routes  s	   € ð ˆ	r   Nc                óp   <€ V ^8„  d   QhRS[ RS[S[S[ S[ S[ .R3,          ,          RS[S[ S[3,          /# ©r&   r4   r'   Nr(   ©r)   r
   r   r   r   )r*   rž   s   "€r   r+   rŸ     sF   ø€ ÷ ñ áðñ  ¡©#©s±C¨¸$Ð)>Õ ?Õ@ðñ
 
‰c‘3ˆh�ñr   c                ó   € / # )a°  Run dhcp client on the interface without scripts or filesystem
artifacts.

@param interface: Name of the network interface on which to send a
    dhcp request
@param dhcp_log_func: Callable accepting the interface and client's
    stdout, stderr streams.
@param distro: a distro object for network interface manipulation
@return: dict of lease options representing the most recent dhcp lease
    parsed from the dhclient.lease file
r   )r‰   r4   r'   r2   s   &&&&r   r1   ÚDhcpClient.dhcp_discovery  s	   € ð$ ˆ	r   )rˆ   ©NN)r   r   r   r   r‡   ÚtimeoutrŠ   Úclassmethodr‘   r˜   r¥   rª   ÚabcÚabstractmethodr±   Ústaticmethodr¸   r1   r   Ú__classdictcell__©rž   s   @r   r…   r…   á   sÁ   ø‡ € Ø€KØ€Gò4ð
 ñ:ó ð:ð ñó ðð ÷
ó ð
ð
 ÷Có ðCð 	×Ñ÷ó ðð Ø×Ñ÷ó ó ðð 	×Ñ÷ñ ó ör   r…   c                   óÔ   a a€ ] tR tRt oRtV 3R lt]V3R lR l4       t]R 4       tV3R lR lt	RV3R	 lR
 llt
]V3R lR l4       t]V3R lR l4       tV3R lR ltRtVtV ;t# )ÚIscDhclienté,  Údhclientc                ó2   <€ \         SV `  4        R V n        R# )z/run/dhclient.leaseN©ÚsuperrŠ   Ú
lease_file©r‰   Ú	__class__s   &€r   rŠ   ÚIscDhclient.__init__/  s   ø€ Ü‰ÑÔØ/ˆŽr   c                óL   <€ V ^8„  d   QhRS[ RS[S[S[ S[3,          ,          /# )r&   Úlease_contentr(   )r)   r	   r   r   )r*   rž   s   "€r   r+   ÚIscDhclient.__annotate__4  s(   ø€ ÷ ñ ¡Cð ©D±±c¹3°hµÕ,@ñ r   c                ó  € \         P                  ! R\         P                  4      p. pV '       g   . # VP                  V 4       FÅ  p. pVP	                  R4       F^  pVP                  4       P                  RR4      P                  RR4      pV'       g   K=  VP                  VP	                  R^4      4       K`  	  \        V4      pVP                  R4      pV'       d   \        P                  V4      VR&   VP                  V4       KÇ  	  V# )z£parse the content of a lease file

@param lease_content: a string containing the contents of an
    isc-dhclient lease
@return: a list of leases, most recent last
zlease {(?P<lease>.*?)}\nÚ;Ú"ru   zoption Ú úunknown-245)ÚreÚcompileÚDOTALLÚfindallrx   rk   Úreplacerl   r9   rM   rÈ   Úget_ip_from_lease_value)rÓ   Úlease_regexÚdhcp_leasesÚleaseÚlease_optionsro   ÚoptionsÚopt_245s   &       r   Úparse_leasesÚIscDhclient.parse_leases3  sã   € ô —j’jÐ!<¼b¿i¹iÓHˆØ"$ˆßØˆIØ ×(Ñ(¨Ö7ˆEØˆMØŸ™ CÖ(�à—z‘z“|×+Ñ+¨C°Ó4×<Ñ<¸YÈÓK�ß‘4Ø!×(Ñ(¨¯©°C¸Ó);Ö<ñ	 )ô
 ˜=Ó)ˆGØ—k‘k -Ó0ˆGßÜ)4×)LÑ)LØó*�˜Ñ&ð ×Ñ˜wÖ'ñ 8ð Ðr   c           	     ón  € V P                  R R4      p\        V4      ^8”  dn   RpVP                  R4       F$  p\        V4      ^8X  d
   RV,           pW#,          pK&  	  \        P                  ! R\        VP                  RR4      ^4      4      pMVP                  R4      p\        P                  ! V4      # )Ú\ru   rh   Ú0z>Lzutf-8)	rÞ   Úlenrx   ÚstructÚpackÚintÚencodeÚsocketÚ	inet_ntoa)Úfallback_lease_valueÚunescaped_valueÚ
hex_stringÚhex_pairÚpacked_bytess   &    r   rß   Ú#IscDhclient.get_ip_from_lease_valueO  s¤   € à.×6Ñ6°t¸RÓ@ˆÜˆÓ !Ô#ØˆJØ+×1Ñ1°#Ö6�Ü�x“= AÔ%Ø" X�~�HØÕ&’
ñ 7ô "Ÿ;š;Ø”c˜*×,Ñ,¨S°"Ó5°rÓ:ó‰Lð +×1Ñ1°'Ó:ˆLÜ×Ò Ó-Ð-r   c                ó<   <€ V ^8„  d   QhRS[ RS[S[ S[3,          /# r­   r®   )r*   rž   s   "€r   r+   rÔ   _  s#   ø€ ÷ ñ ©#ð ±$±s¹C°xµ.ñ r   c                ó  € \        \        4      ;_uu_ 4        \        P                  ! V P                  4      pV'       d-   V P                  V4      pV'       d   VR,          uuRRR4       # RRR4       / #   + '       g   i     / # ; i)a˜  Get the most recent lease from the ephemeral phase as a dict.

Return a dict of dhcp options. The dict contains key value
pairs from the most recent lease.

@param interface: an interface string - not used in this class, but
    required for function signature compatibility with other classes
    that require a distro object
@raises: InvalidDHCPLeaseFileError on empty or unparsable leasefile
    content.
Néÿÿÿÿ)r   ÚFileNotFoundErrorr   rD   rÎ   ræ   )r‰   r4   r<   rá   s   &&  r   r±   ÚIscDhclient.get_newest_lease_  sc   € ô Ô'×(Õ(Ü×)Ò)¨$¯/©/Ó:ˆGßØ"×/Ñ/°Ó8�ßØ& r�?÷ )×(Ò(ð ˆ	÷ )Ö(ð ˆ	ús   ˜AA7ÁA7Á7B	c                óp   <€ V ^8„  d   QhRS[ RS[S[S[ S[ S[ .R3,          ,          RS[S[ S[3,          /# r»   r¼   )r*   rž   s   "€r   r+   rÔ   s  sK   ø€ ÷ E*ñ E*áðE*ñ  ¡©#©s±C¨¸$Ð)>Õ ?Õ@ðE*ñ
 
‰c‘3ˆh�ñE*r   c           	     ó@  € \         P                  RV4       RpRpRp\        V P                  V,          4      p\        V P                  ^,          4      p\	        \
        4      ;_uu_ 4        \        P                  ! V4       \        P                  ! V P                  4       RRR4       VP                  P                  V4       \        V4      '       dx   R\        V4      R,          ,          p	RV: RV	: R	2p
\        P                  ! R
R7      p\        P                  P!                  W±R,           4      p\"        P$                  ! WZ4        \&        P&                  ! VP)                  V P*                  V P                  VVV4      4      w  rÍ\"        P6                  ! Y@P                  .TRR7      pT'       d/   \         P9                  RRP!                  R T 4       4      4       / # RpRpRpRp\;        T4       F¡  p \"        P<                  ! T4      P?                  4       p\        T4      pTPA                  T4      pT^8X  d@   \         P                  RT4       \        PB                  ! T\D        PF                  4       R
p M0 \J        PL                  ! T4       K£  	  \         P                  T4       T'       g   \         PO                  RTTR4       Te
   T! YT4       T PQ                  T4      pT'       d   T# \S        4       h  + '       g   i     ELm; i  \&        P,                   dC   p\         P                  RTP.                  TP0                  TP2                  4       \4        ThRp?ii ; i  \
         d    RT R2p EL\H         d    RT R2p ELi ; i)aª  Run dhclient on the interface without scripts/filesystem artifacts.

@param interface: Name of the network interface on which to send a
    dhcp request
@param dhcp_log_func: Callable accepting the interface and client's
    stdout, stderr streams.
@param distro: a distro object for network interface manipulation
@return: dict of lease options representing the most recent dhcp lease
    parsed from the dhclient.lease file
ú!Performing a dhcp discovery on %sz/run/dhclient.pidNç{®Gáz„?z20:%sºé$   NNzinterface "z" {send dhcp-client-identifier z;}T©Ú	needs_exez-dhclient.confz3dhclient exited with code: %s stderr: %r stdout: %r)ÚmaxwaitÚnaplenz+dhclient did not produce expected files: %sz, c              3   ó`   "  € T F$  p\         P                  P                  V4      x € K&  	  R # 5ir�   )r@   rA   Úbasename)Ú.0Úfs   & r   Ú	<genexpr>Ú-IscDhclient.dhcp_discovery.<locals>.<genexpr>Ê  s"   é € Ð?±w°!œ"Ÿ'™'×*Ñ*¨1×-Ð-³wùs   ‚,.ÚunknownFru   zkilling dhclient with pid=%súNo PID file found at z, dhclient is still runningúPID file contained [z], dhclient is still runningzCdhclient(pid=%s, parentpid=%s) failed to daemonize after %s secondsg      $@)*r.   r/   rî   rÀ   r   rû   r@   r•   rÎ   Únet_opsÚlink_upr   r   r   Úget_tmp_ancestorrA   rE   r   Ú
write_filer   Úbuild_dhclient_cmdrˆ   rX   rY   rZ   r[   r   Úwait_for_filesrz   ÚrangerD   rk   Úget_proc_ppidÚkillÚsignalÚSIGKILLry   ÚtimeÚsleepr`   r±   r    )r‰   r4   r'   r2   Úpid_fileÚconfig_fileÚ
sleep_timeÚsleep_cyclesr  Údhcp_client_identifierÚinterface_dhclient_contentÚtmp_dirr^   Úerrr`   ÚmissingÚppidÚ
daemonizedÚpid_contentÚ	debug_msgr_   Úpidrâ   s   &&&&                   r   r1   ÚIscDhclient.dhcp_discoverys  s  € ô  	�	‰	Ð5°yÔAð
 'ˆØˆØˆ
Ü˜4Ÿ<™<¨*Õ4Ó5ˆÜ�d—l‘l QÕ&Ó'ˆô Ô'×(Õ(Ü�IŠI�hÔÜ�IŠI�d—o‘oÔ&÷ )ð 	�‰×Ñ˜yÔ)ô
 ˜9×%Ò%àÔ+¨IÓ6°sÕ;Õ;ñ #ó Ó4ð6ð 'ô
 !×1Ò1¸DÔAˆGÜŸ'™'Ÿ,™, wÐ<LÕ0LÓMˆKÜ�OŠO˜KÔDð	.Ü—y’yØ×)Ñ)Ø×)Ñ)Ø—O‘OØØØóó‰HˆCô2 ×%Ò%Ø—‘Ð'°Àô
ˆ÷ Ü�K‰KØ=Ø—	‘	Ñ?±wÓ?Ó?ôð ˆIàˆØˆ
ØˆØˆ	Ü�|Ö$ˆAðÜ"×1Ò1°(Ó;×AÑAÓC�Ü˜+Ó&�ð ×+Ñ+¨CÓ0�Ø˜1”9Ü—I‘IÐ<¸cÔBÜ—G’G˜C¤§¡Ô0Ø!%�JÙð	 ô
 �JŠJ�zÖ"ñ+ %ô. �I‰I�iÔ çÜ�I‰IðàØØôð Ò$Ù˜)¨#Ô.Ø×%Ñ% iÓ0ˆßØˆLÜ'Ó)Ð)÷Q )×(Ð(ûôH ×)Ñ)ô 	.Ü�I‰IØEØ—‘Ø—‘Ø—‘ô	ô #¨Ð-ûð	.ûôD %ô à+¨H¨:ð 60ð 0ó ô ô à*¨;¨-ð 80ð 0ó ðúsB   Á,7LÅ?L Ç?/M5ÌL	ÌM2Ì0=M-Í-M2Í5NÎ	NÎNÎNc                óL   <€ V ^8„  d   QhRS[ RS[S[S[ S[ 3,          ,          /# r´   r¶   )r*   rž   s   "€r   r+   rÔ   û  s,   ø€ ÷ uñ u¡Cð u©D±±s¹C°xµÕ,Añ ur   c           
     óî  a€ V P                  R4      o\        P                  ! RS4       Uu. uF  q'       g   K  VNK  	  pp. pRS9   d%   V Uu. uF  p\        \	        V^4      4      NK  	  ppV3R lp^ p\        V4       EFä  w  raWe8  d   K  \	        V4      pV\        ^^!4      9   dx   ^	p\        W&R 4      V8  d   V! Wx\        W&R 4      4       Vu # RP                  W&^,           V^,            4      p	RP                  W&^,           Wh,            4      p
Wh,           pEM)V\        ^^4      9   d€   ^p\        W&R 4      V8  d   V! Wx\        W&R 4      4       Vu # RP                  W&^,           V^,            R.,           4      p	RP                  W&^,           Wh,            4      p
Wh,           pEM™V\        ^	^4      9   d�   ^p\        W&R 4      V8  d   V! Wx\        W&R 4      4       Vu # RP                  W&^,           V^,            RR.,           4      p	RP                  W&^,           Wh,            4      p
Wh,           pEMV\        ^^	4      9   d€   ^p\        W&R 4      V8  d   V! Wx\        W&R 4      4       Vu # RP                  W&^,           V^,            . RO,           4      p	RP                  W&^,           Wh,            4      p
Wh,           pMxV^ 8X  dX   ^p\        W&R 4      V8  d   V! Wx\        W&R 4      4       Vu # Rp	RP                  W&^,           Wh,            4      p
Wh,           pM\        P                  R	V4       Vu # VP                  V	: R
V: 2V
34       EKç  	  V# u upi u upi )aX  
parse rfc3442 format and return a list containing tuple of strings.

The tuple is composed of the network_address (including net length) and
gateway for a parsed static route.  It can parse two formats of
rfc3442, one from dhcpcd and one from dhclient (isc).

@param rfc3442: string in rfc3442 format (isc or dhcpd)
@returns: list of tuple(str, str) for all valid parsed routes until the
    first parsing error.

e.g.:

sr=parse_static_routes(        "32,169,254,169,254,130,56,248,255,0,130,56,240,1")
sr=[
    ("169.254.169.254/32", "130.56.248.255"),         ("0.0.0.0/0", "130.56.240.1")
]

sr2 = parse_static_routes(        "24.191.168.128 192.168.128.1,0 192.168.128.1")
sr2 = [
    ("191.168.128.0/24", "192.168.128.1"),        ("0.0.0.0/0", "192.168.128.1")
]

# unknown-121 option format
sr3 = parse_static_routes(        "0:a:0:0:1:20:a8:3f:81:10:a:0:0:1:20:a9:fe:a9:fe:a:0:0:1")
sr3 = [
    ("0.0.0.0/0", "10.0.0.1"),
    ("168.63.129.16/32", "10.0.0.1"),
    ("169.254.169.254/32", "10.0.0.1"),
]

Python version of isc-dhclient's hooks:
   /etc/dhcp/dhclient-exit-hooks.d/rfc3442-classless-routes
rÖ   z[, . :]rh   c                 óV   <€ R V : RV: RV: RS: 2p\         P                  V4       R# )z5RFC3442 string malformed.  Current route has CIDR of z and requires z significant octets, but only z< remain. Verify DHCP rfc3442-classless-static-routes value: N)r.   r`   )ÚcidrÚrequiredÚremainÚmsgÚrfc3442s   &&& €r   Ú_trunc_errorÚ5IscDhclient.parse_static_routes.<locals>._trunc_error,  s%   ø� ó
 ›£6ª7ð4ð ô �I‰I�cŽNr   NÚ.rê   z0.0.0.0zSParsed invalid net length "%s".  Verify DHCP rfc3442-classless-static-routes value.Ú/)rê   rê   rê   )ÚrstriprÚ   rx   r)   rî   Ú	enumerater  rë   rE   r.   r`   rl   )rµ   ÚtokÚtokensÚstatic_routesr4  Úcurrent_idxÚidxÚ
net_lengthÚreq_toksÚnet_addressÚgatewayr3  s   &          @r   r¸   ÚIscDhclient.parse_static_routesú  s7  ø€ ðT —-‘- Ó$ˆÜ!#§¢¨*°gÔ!>ÓFÑ!>˜#Ã#—#�#Ñ!>ˆÐFØ/1ˆð �'Œ>Ù39Ó:±6¨C”cœ#˜c 2›,Ö'±6ˆFÐ:õ	ð ˆÜ! &×)‰HˆCØÔ ÙÜ˜S›ˆJØœU 2 r›]Ô*Ø�Ü�v˜d�|Ó$ xÔ/Ù  ´s¸6À$¸<Ó7HÔIØ(Ò(Ø!Ÿh™h v°A­g¸¸a½Ð'@ÓA�ØŸ(™( 6°­'°CµNÐ#CÓD�Ø!�n’Øœu R¨›}Ô,Ø�Ü�v˜d�|Ó$ xÔ/Ù  ´s¸6À$¸<Ó7HÔIØ(Ò(Ø!Ÿh™h v°A­g¸¸a½Ð'@ÀCÀ5Õ'HÓI�ØŸ(™( 6°­'°CµNÐ#CÓD�Ø!�n’Øœu Q¨›|Ô+Ø�Ü�v˜d�|Ó$ xÔ/Ù  ´s¸6À$¸<Ó7HÔIØ(Ò(Ø!Ÿh™h v°A­g¸¸a½Ð'@ÀCÈÀ:Õ'MÓN�ØŸ(™( 6°­'°CµNÐ#CÓD�Ø!�n’Øœu Q¨›{Ô*Ø�Ü�v˜d�|Ó$ xÔ/Ù  ´s¸6À$¸<Ó7HÔIØ(Ò(Ø!Ÿh™hØ �7 S¨1¥WÐ-²Õ?ó�ð Ÿ(™( 6°­'°CµNÐ#CÓD�Ø!�n‘Ø˜q”Ø�Ü�v˜d�|Ó$ xÔ/Ù  ´s¸6À$¸<Ó7HÔIØ(Ò(Ø'�ØŸ(™( 6°­'°CµNÐ#CÓD�Ø!�n‘ä—	‘	ð=àôð
 %Ò$à× Ñ Û'ªÐ4°gÐ>÷ñm *ðt ÐùòW Gùò
 ;s   ¬	M-ºM-ÁM2c                ó0   <€ V ^8„  d   QhRS[ S[,          /# rr   rs   )r*   rž   s   "€r   r+   rÔ   s  s   ø€ ÷ )ñ )±X¹cµ]ñ )r   c                óÌ  € RpV P                   V P                  3\        \        33 F§  w  r#V'       g   K  . p \        P
                  ! V4      pRpT Fk  p\        P                  ! Y64      '       g   K!  \        P                  P                  Y&4      p\        P                  P                  T4      pY…8”  g   Kg  TpTpKm  	  T'       g   K¥  Tu # 	  R#   \         d     K»  i ; i)zÜGet the latest lease file from a distro-managed dhclient

Doesn't consider the ephemeral timeframe lease.

@param distro: used for distro-specific lease location and filename
@return: The most recent lease file, or None
Ng      ð¿)Údhclient_lease_directoryÚdhclient_lease_file_regexÚDHCLIENT_FALLBACK_LEASE_DIRÚDHCLIENT_FALLBACK_LEASE_REGEXr@   rC   rû   rÚ   ÚsearchrA   rE   Úgetmtime)	r2   Úlatest_fileÚ	directoryÚregexÚlease_filesÚlatest_mtimeÚfnameÚabs_pathÚmtimes	   &        r   Ú!get_newest_lease_file_from_distroÚ-IscDhclient.get_newest_lease_file_from_distror  sÛ   € ð ˆð
 ×/Ñ/Ø×0Ñ0ðô )Ô*GÐHó!
ÑˆI÷ ÙàˆKðÜ Ÿjšj¨Ó3�ð  ˆLÛ$�Ü—y’y ×.Ò.ÙäŸ7™7Ÿ<™<¨	Ó9�ÜŸ™×(Ñ(¨Ó2�ØÖ'Ø#(�LØ"*’Kñ %÷ ‰{Ø"Ò"ñ;!
ñ< øô# %ô Úðús   ¹CÃC#Ã"C#c                ó    <€ V ^8„  d   QhRS[ /# )r&   Úkeyr�   )r*   rž   s   "€r   r+   rÔ   ž  s   ø€ ÷ &ñ &±Sñ &r   c                óø   € V P                  V4      pV'       da   \        P                  ! V4      pV'       dA   \        V P	                  V4      4       F   pVP                  V4      pV'       g   K  Vu # 	  R# R# R# )a  Get a key from the latest lease from distro-managed dhclient

Doesn't consider the ephemeral timeframe lease.

@param lease_dir: distro-specific lease to check
@param lease_file_regex: distro-specific regex to match lease name
@return: The most recent lease file, or None
N)rT  r   rD   Úreversedræ   rM   )r‰   r2   rW  rÎ   r<   râ   Úservers   &&&    r   Úget_key_from_latest_leaseÚ%IscDhclient.get_key_from_latest_leasež  sf   € ð ×;Ñ;¸FÓCˆ
ßÜ×)Ò)¨*Ó5ˆGßÜ% d×&7Ñ&7¸Ó&@ÖA�EØ"ŸY™Y s›^�Fß‘vØ%šó Bñ ñ r   ©rÎ   r¿   )r   r   r   r   r‡   rŠ   rÄ   ræ   rß   r±   r1   r¸   rT  r[  r   rÅ   Ú__classcell__©rÐ   rž   s   @@r   rÈ   rÈ   ,  s‰   ù‡ € Ø€Kõ0ð ÷ó ðð6 ñ.ó ð.÷ð ÷(E*ò E*ðN ÷uó ðuðn ÷)ó ð)÷V&÷ &ð &r   rÈ   c                   ó¤   a € ] tR tRt o RtRtRV 3R lR llt]V 3R lR l4       t]V 3R	 lR
 l4       t	V 3R lR lt
]V 3R lR l4       tRtV tR# )ÚDhcpcdi±  ÚdhcpcdrÉ   Nc                óp   <€ V ^8„  d   QhRS[ RS[S[S[ S[ S[ .R3,          ,          RS[S[ S[3,          /# r»   r¼   )r*   rž   s   "€r   r+   ÚDhcpcd.__annotate__µ  sK   ø€ ÷ v.ñ v.áðv.ñ  ¡©#©s±C¨¸$Ð)>Õ ?Õ@ðv.ñ
 
‰c‘3ˆh�ñv.r   c                ó”  € \         P                  RV4       Rp\        V P                  V,          4      p. pVP                  P                  V4        \        V4      '       d   R.pV P                  RRRRRR	.VOVNp\        P                  ! VV P                  R
7      w  r‰Ve
   V! WV	4       V P                  V4      p
V
'       dí   \        P                  ! . VORN4      P                  P                  4       pRpRpRp\        V4       FŽ  p \        P                  ! V4      P                  4       p\        V4      pVP                  V4      pV'       d@   \         P                  RVV4       \         P"                  ! V\$        P&                  4        V
#  V
u # 	  \         P                  V4       V
# \3        R4      h  \(         d    \         P                  RT4         T
# \*         d
    RT R2p M\,         d
    RT R2p Mi ; i\.        P0                  ! T4       EK    \4         dC   p\         P                  RTP                  TP6                  TP                  4       \2        ThRp?i\        P8                   dC   p\         P                  RTP:                  TP6                  TP                  4       \2        ThRp?ii ; i)a¨  Run dhcpcd on the interface without scripts/filesystem artifacts.

@param interface: Name of the network interface on which to send a
    dhcp request
@param dhcp_log_func: Callable accepting the interface and client's
    stdout, stderr streams.
@param distro: a distro object for network interface manipulation
@return: dict of lease options representing the most recent dhcp lease
    parsed from the dhclient.lease file
rÿ   r   z
--clientidú
--ipv4onlyz--waitipz--persistentz--noarpz--debugz--script=/bin/true)rÀ   Nz-PFru   z!killing dhcpcd with pid=%s gid=%sz9Process group id [%s] has already exited, nothing to killr  z, dhcpcd is still runningr  z], dhcpcd is still runningzNo lease foundz8dhcpcd timed out after %s seconds: stderr: %r stdout: %rú1dhcpcd exited with code: %s stderr: %r stdout: %r)r.   r/   rî   rÀ   r  r  r   r‡   r   r±   r[   rk   r  r   rD   Úget_proc_pgidr@   Úkillpgr  r  ÚProcessLookupErrorrû   ry   r  r  r   r   rZ   rX   rY   )r‰   r4   r'   r2   r  r   Úinfiniband_argumentr]   r^   r$  râ   r  r(  Úgidr)  r_   r*  r`   s   &&&&              r   r1   ÚDhcpcd.dhcp_discoveryµ  s¶  € ô  	�	‰	Ð5°yÔAØˆ
Ü˜4Ÿ<™<¨*Õ4Ó5ˆØ Ðð 	�‰×Ñ˜yÔ)ð\	.ô ˜y×)Ò)Ø'3 nÐ#à× Ñ ØØØØØØ$ð
ð %ð
ð ð
ˆGô —y’yØØŸ™ô‰HˆCð Ò(Ù˜i¨cÔ2Ø×)Ñ)¨)Ó4ˆE÷ ô  Ÿ9š9Ð%5 wÐ%5°Ð%5Ó6×=Ñ=×CÑCÓE�Ø"�Ø�Ø�	Ü˜|Ö,�Að%Ü&*×&9Ò&9¸(Ó&C×&IÑ&IÓ&K˜Ü! +Ó.˜Ø$×2Ñ2°3Ó7˜ßÜŸI™IØ CÀSÈ#ôô ŸIšI c¬6¯>©>Ô:Ø!ð. �ð9 ð0  %šñ; -ô@ —I‘I˜iÔ(Ø�Ü"Ð#3Ó4Ð4øô/ .ô ÜŸ	™	ð.àôñ
 ð  �ô -ô à3°H°:ð >6ð 6ò "ô &ô à2°;°-ð @6ð 6ò "ðúô —J’J˜z×*øô ô 	.Ü�I‰IØJØ—‘Ø—‘Ø—‘ô	ô #¨Ð-ûÜ×)Ñ)ô 	.Ü�I‰IØCØ—‘Ø—‘Ø—‘ô	ô #¨Ð-ûð	.ús�   ÁA4H% ÃAH% ÄBF?ÆH% ÆH% ÆH% Æ4H% Æ?!H	Ç H% Ç$H	Ç-H	Ç4H% Ç6H	Ç?H	ÈH% ÈH	È	H% È%KÈ0=I-É-KÊKÊ=KËKc                ó<   <€ V ^8„  d   QhRS[ RS[RS[S[ ,          /# )r&   rQ   Údhcp_option_numberr(   )Úbytesrî   r
   )r*   rž   s   "€r   r+   rd  .  s)   ø€ ÷ )ñ )Ùð)Ù),ð)á	‘%�ñ)r   c                óL   € ^ðpR R lpV! W4       F  w  rEWA8X  g   K  Vu # 	  R# )a&  get a specific option from a binary lease file

This is required until upstream dhcpcd supports unknown option 245
upstream bug: https://github.com/NetworkConfiguration/dhcpcd/issues/282

@param data: Binary lease data
@param number: Option number to return
@return: the option (bytes) or None
c                ó0   € V ^8„  d   QhR\         R\        /# )r&   rQ   Úindex)rp  rî   )r*   s   "r   r+   Ú>Dhcpcd.parse_unknown_options_from_packet.<locals>.__annotate__F  s   € ÷ 	+ñ 	+œuð 	+¬Sñ 	+r   c              3  óÎ   "  € \        V 4      V^,           8¼  dJ   W,          pV ^V,           ,          pV ^V,           ^V,           V,            pW$3x € ^V,           V,           pK`  R# 5i)zžoptions are variable length, and consist of the following format

option number: 1 byte
option length: 1 byte
option data: variable length (see length field)
N)rë   )rQ   rs  ÚcodeÚlengthÚoptions   &&   r   Úiter_optionsÚ>Dhcpcd.parse_unknown_options_from_packet.<locals>.iter_optionsF  s_   é € ô �d“)˜u q�yÔ(Ø•{�Ø˜a %�i��Ø˜a %�i¨!¨e­)°fÕ*<Ð=�Ø�lÒ"Ø˜F�
 UÕ*’ñ )ùs   ‚A#A%Nr   )rQ   ro  ÚINDEXry  rv  rx  s   &&    r   Ú!parse_unknown_options_from_packetÚ(Dhcpcd.parse_unknown_options_from_packet-  s1   € ð. ˆõ	+ñ )¨Ö5‰LˆDØÖ)Ø’ñ 6ñ r   c                ó,   <€ V ^8„  d   QhRS[ RS[ RS[/# )r&   Ú
lease_dumpr4   r(   rd   )r*   rž   s   "€r   r+   rd  Z  s'   ø€ ÷ Fñ F¡sð F±sð F¹tñ Fr   c           
     óV  € \         P                  RW4        \        V P                  4       P	                  RR4      P                  R4       Uu. uF  pRV9   g   K  VP                  R^R7      NK!  	  up4      pV'       g)   Rp\         P                  W@4       \        W@,          4      h YR
&   TP                  4        UUu/ uF  w  rgTP	                  RR4      TbK  	  pppRRRR/pTP                  4        F   w  ršY“9   g   K  TP                  T	4      Y:&   K"  	  \        P                  ! RT R24      p\        P                  T^õ4      pT'       d   \        P                   ! T4      TR&   T# u upi   \         d#   p\         P                  RT 4       \        ThR	p?ii ; iu uppi )aà  parse the output of dhcpcd --dump

map names to the datastructure we create from dhclient

example dhcpcd output:

broadcast_address='192.168.15.255'
dhcp_lease_time='3600'
dhcp_message_type='5'
dhcp_server_identifier='192.168.0.1'
domain_name='us-east-2.compute.internal'
domain_name_servers='192.168.0.2'
host_name='ip-192-168-0-212'
interface_mtu='9001'
ip_address='192.168.0.212'
network_number='192.168.0.0'
routers='192.168.0.1'
subnet_cidr='20'
subnet_mask='255.255.240.0'
z)Parsing dhcpcd lease for interface %s: %rÚ'ru   Ú
Ú=)Úmaxsplitz;No valid DHCP lease configuration found in dhcpcd lease: %rzError parsing dhcpcd lease: %rNr4   r_   Ú-z
ip-addresszfixed-addresszclassless-static-routesr<  z/var/lib/dhcpcd/z.leaserÙ   )r.   r/   r9   rk   rÞ   rx   r`   r    ry   rL   Úpopr   Úload_binary_filera  r|  rð   rñ   )r  r4   Úarâ   r2  r`   rW  ÚvalueÚname_mapÚsourceÚdestinationÚdhcp_messagerå   s   &&           r   Úparse_dhcpcd_leaseÚDhcpcd.parse_dhcpcd_leaseY  s¤  € ô, 	�	‰	Ø7¸ô	
ð
	7Üð (×-Ñ-Ó/×7Ñ7¸¸RÓ@×FÑFÀtÔLóáL˜Ø˜a‘xô -�A—G‘G˜C¨!�GÖ,ÙLñóˆE÷ ð0ð ô —	‘	˜#Ô*Ü/°Õ0@ÓAÐAð ð 'ˆkÑð AFÇÁÄÔNÁ±*°#�—‘˜S #Ó&¨Ò-ÁˆÑNð ˜/Ø% ð
ˆð $,§>¡>Ö#3ÑˆFØŽØ%*§Y¡Y¨vÓ%6�Ó"ñ $4ô ×,Ò,Ø˜y˜k¨Ð0ó
ˆô ×:Ñ:¸<ÈÓMˆßÜ#)×#3Ò#3°GÓ#<ˆE�-Ñ ØˆùòUøô ô 	7Ü�I‰IÐ6¸
ÔCÜ+°Ð6ûð	7üó Os;   ˜6E5 Á	E0ÁE0Á3E5 Â(E5 ÃF%Å0E5 Å5F"Æ FÆF"c                ó<   <€ V ^8„  d   QhRS[ RS[S[ S[3,          /# r­   r®   )r*   rž   s   "€r   r+   rd  ¢  s#   ø€ ÷ .ñ .©#ð .±$±s¹C°xµ.ñ .r   c                ó4  €  V P                  \        P                  ! V P                  RRV.4      P                  V4      #   \        P                   dC   p\
        P                  RTP                  TP                  TP                  4       \        ThRp?ii ; i)zªReturn a dict of dhcp options.

@param interface: which interface to dump the lease from
@raises: InvalidDHCPLeaseFileError on empty or unparsable leasefile
    content.
z--dumpleaserf  rg  N)
rŽ  r   r‡   r[   rX   r.   r/   rY   rZ   r   )r‰   r4   r`   s   && r   r±   ÚDhcpcd.get_newest_lease¢  s�   € ð	.Ø×*Ñ*Ü—	’	à×(Ñ(Ø%Ø$Ø!ð	ó÷ ‘&Øó
ð 
øô ×)Ñ)ô 	.Ü�I‰IØCØ—‘Ø—‘Ø—‘ô	ô #¨Ð-ûð	.ús   ‚=A  Á BÁ=BÂBc                óL   <€ V ^8„  d   QhRS[ RS[S[S[ S[ 3,          ,          /# r´   r¶   )r*   rž   s   "€r   r+   rd  À  s(   ø€ ÷ ñ ¡Cð ©D±±s¹C°xµÕ,Añ r   c                ó¾   € V P                  4       pV'       d*   \        VR,          VR,          4       Uu. uF  q"NK  	  up# \        P                  RV 4       . # u upi )a  
classless static routes as returned from dhcpcd --dumplease and return
a list containing tuple of strings.

The tuple is composed of the network_address (including net length) and
gateway for a parsed static route.

@param routes: string containing classless static routes
@returns: list of tuple(str, str) for all valid parsed routes until the
          first parsing error.

e.g.:

sr=parse_static_routes(
    "0.0.0.0/0 10.0.0.1 168.63.129.16/32 10.0.0.1"
)
sr=[
    ("0.0.0.0/0", "10.0.0.1"),
    ("169.63.129.16/32", "10.0.0.1"),
]
ºNNr&   ºé   Nr&   z'Malformed classless static routes: [%s])rx   Úzipr.   rz   ©rµ   r<  Úis   &  r   r¸   ÚDhcpcd.parse_static_routes¿  sT   € ð. Ÿ™›ˆßä" =°Õ#5°}ÀTÕ7JÔKÓLÑK˜!’AÑKÑLÐLÜ�‰Ð=¸vÔFØˆ	ùò Ms   µ
Ar   r¿   )r   r   r   r   r‡   rÀ   r1   rÄ   r|  rŽ  r±   r¸   r   rÅ   rÆ   s   @r   ra  ra  ±  sf   ø‡ € Ø€KØ€G÷v.ò v.ðp ÷)ó ð)ðV ÷Fó ðF÷P.ð .ð: ÷ó ör   ra  c                   óz   a a€ ] tR tRt oRtV 3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4       t	R
t
VtV ;t# )ÚUdhcpciÞ  Úudhcpcc                ó2   <€ \         SV `  4        R V n        R# )ru   NrÌ   rÏ   s   &€r   rŠ   ÚUdhcpc.__init__á  s   ø€ Ü‰ÑÔØˆŽr   c                óp   <€ V ^8„  d   QhRS[ RS[S[S[ S[ S[ .R3,          ,          RS[S[ S[3,          /# r»   r¼   )r*   rž   s   "€r   r+   ÚUdhcpc.__annotate__å  sK   ø€ ÷ F0ñ F0áðF0ñ  ¡©#©s±C¨¸$Ð)>Õ ?Õ@ðF0ñ
 
‰c‘3ˆh�ñF0r   c                ó  € \         P                  RV4       \        P                  ! RR7      p\        P
                  P                  WAR,           4      V n        \        \        4      ;_uu_ 4        \        P                  ! V P                  4       RRR4       VP                  P                  V4       \        P
                  P                  VR4      p\        P                  ! V\        R4       V P                   RR	R
VRVRRRR.p\#        V4      '       dC   VP%                  RRP'                  \)        V4      R,          P+                  RR4      4      .4        \,        P,                  ! VRV P                  /RR7      w  rxTe
   T! YT4       T P9                  T4      #   + '       g   i     EL; i  \,        P.                   dC   p	\         P                  RT	P0                  T	P2                  T	P4                  4       \6        T	hRp	?	ii ; i)aN  Run udhcpc on the interface without scripts or filesystem artifacts.

@param interface: Name of the network interface on which to run udhcpc.
@param dhcp_log_func: Callable accepting the interface and client's
    stdout, stderr streams.
@return: A list of dicts of representing the dhcp leases parsed from
    the udhcpc lease file.
rÿ   Tr  z.lease.jsonNÚudhcpc_scriptií  z-OÚstaticroutesz-iz-sz-nz-qz-fz-vz-xz	0x3d:20{}r  rh   ru   Ú
LEASE_FILE)Ú
update_envÚcapturez1udhcpc exited with code: %s stderr: %r stdout: %r)r.   r/   r   r  r@   rA   rE   rÎ   r   rû   r•   r  r  r   r  ÚUDHCPC_SCRIPTr‡   r   Úextendr*   r   rÞ   r   rX   rY   rZ   r[   r   r±   )
r‰   r4   r'   r2   r#  r¤  Úcmdr^   r$  r`   s
   &&&&      r   r1   ÚUdhcpc.dhcp_discoveryå  s©  € ô 	�	‰	Ð5°yÔAä×-Ò-¸Ô=ˆÜŸ'™'Ÿ,™, w¸MÕ0IÓJˆŒÜÔ'×(Õ(Ü�IŠI�d—o‘oÔ&÷ )ð 	�‰×Ñ˜yÔ)äŸ™Ÿ™ W¨oÓ>ˆÜ�Š˜¤}°eÔ<ð ×ÑØØØØØØØØØØð
ˆô$ ˜9×%Ò%Ø�J‰JàØ×&Ñ&Ü)¨)Ó4°SÕ9×AÑAÀ#ÀrÓJóðôð	.Ü—y’yØ ¨t¯©Ð ?Èô‰HˆCð Ò$Ù˜)¨#Ô.à×$Ñ$ YÓ/Ð/÷i )×(Ð(ûôP ×)Ñ)ô 	.Ü�I‰IØCØ—‘Ø—‘Ø—‘ô	ô #¨Ð-ûð	.ús$   Á0!F Å'F4 Æ F1	Æ4HÇ	=HÈHc                ó<   <€ V ^8„  d   QhRS[ RS[S[ S[3,          /# r­   r®   )r*   rž   s   "€r   r+   r¢  -  s'   ø€ ÷ Dñ D©#ð D±$±s¹C°xµ.ñ Dr   c                ój   € \         P                  ! \         P                  ! V P                  4      4      # )a–  Get the most recent lease from the ephemeral phase as a dict.

Return a dict of dhcp options. The dict contains key value
pairs from the most recent lease.

@param interface: an interface name - not used in this class, but
    required for function signature compatibility with other classes
    that require a distro object
@raises: InvalidDHCPLeaseFileError on empty or unparsable leasefile
    content.
)r   Ú	load_jsonrD   rÎ   r°   s   &&r   r±   ÚUdhcpc.get_newest_lease-  s"   € ô �~Š~œd×1Ò1°$·/±/ÓBÓCÐCr   c                óL   <€ V ^8„  d   QhRS[ RS[S[S[ S[ 3,          ,          /# r´   r¶   )r*   rž   s   "€r   r+   r¢  <  s(   ø€ ÷ ñ ¡Cð ©D±±s¹C°xµÕ,Añ r   c                ó’   € V P                  4       pV'       d*   \        VR ,          VR,          4       Uu. uF  q"NK  	  up# . # u upi )r•  r–  )rx   r˜  r™  s   &  r   r¸   ÚUdhcpc.parse_static_routes;  sC   € àŸ™›ˆßä" =°Õ#5°}ÀTÕ7JÔKÓLÑK˜!’AÑKÑLÐLØˆ	ùò Ms   µ
Ar]  r¿   )r   r   r   r   r‡   rŠ   r1   r±   rÄ   r¸   r   rÅ   r^  r_  s   @@r   r�  r�  Þ  sA   ù‡ € Ø€Kõ÷F0ò F0÷PDð Dð ÷ó ÷ð r   r�  c                ól   € V ^8„  d   Qh/ ^ \         9   d    \        \        \        ,          ,          ;R&   # )r&   ÚALL_DHCP_CLIENTS)Ú__conditional_annotations__r	   r   r…   )r*   s   "r   r+   r+      s%   € ‡
�
÷z! IÒ H”$”tœJÕ'Õ(Ñ Hò{! r   r¿   r�   )<r¶  rÂ   r”   Úloggingr@   rÚ   r  rð   rì   r  Ú
contextlibr   Úior   Ú
subprocessr   Útypingr   r   r   r	   r
   r   r   r:   Ú	cloudinitr   r   r   Úcloudinit.netr   r   Ú	getLoggerr   r.   r?   rH  rI  rW   r©  Ú	Exceptionr   r    r"   r$   r5   r=   rI   rR   ra   rp   r~   rƒ   ÚABCr…   rÈ   ra  r�  rµ  r+   )r¶  s   @r   Ú<module>rÁ     s$  øð÷ €
Û Û Û 	Û 	Û Û Û Û Ý Ý Ý %ß C× CÑ Cã ç ,Ñ ,ß <à×Ò˜Ó!€à1Ð Ø1Ð à /Ð Ø€ð€ôB2�yô 2ôÐ 0ô ôBÐ 0ô Bô/Ð&6ô /÷Oò2Kôô&õõ*Aõõ<3ôH�—‘ô HôVB&�*ô B&ôJjˆZô jôZ	cˆZô cðL -3°KÀÐ+HÐ Õ Hr   