ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ bNc@s+dZdZdZdZdZddlZddlZdejfdYZe d Z e d Z e d kr'ed Z ed ddZe GHxe jD] ZeGHqWxejD] ZeGHqWxe eBjD] ZeGHqWxe eAjD] ZeGHqWxe D] ZeGHqWndS(sIP4 address range set implementation. Implements an IPv4-range type. Copyright (C) 2006, Heiko Wundram. Released under the MIT-license. s Heiko Wundram s0.2t3s 2006-01-20iNtIP4RangecBseZdZdZdZdjgedD]Zee^q+Z dZ dZ dZ d Z d Zd Zd Zd ZdZdZeZdZRS(sbIP4 address range class with efficient storage of address ranges. Supports all set operations.iii tis 0123456789.cGs+t|dkrCt|dtrCtt|j|ddSt|}xtt|D]}||}t|trd|kr|j|j dd||5 - a set of addresses, interpreted as 1.2.3.0-1.2.5.255 - 1.2.0.0/16 - a set of addresses, interpreted as 1.2.0.0-1.2.255.255 Only the first three notations are valid if you use a string address in a tuple, whereby notation 2 is interpreted as 1.2.3.0 if specified as lower bound and 1.2.3.255 if specified as upper bound, not as a range of addresses. Specifying a range is done with the <-> operator. This is necessary because '-' might be present in a hostname. '<->' shouldn't be, ever. iiNs<->s/isTuple is of invalid length.sInvalid argument.tmintmax(tlent isinstanceRtsupert__init__tlisttrangetstrt _parseRangetsplitt _parseMaskt_parseAddrRangettuplet ValueErrortinttlongt TypeErrort_MINIP4t_MAXIP4(tselftargstitargvaltaddr1taddr2((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyR&s:%    " cCst|\}}t|\}}||kr_||d||d>d|d>@7}|}n||krztdn|d|dK}|d|dK}|dd|d>d7}||fS(Niis!Range has more dots than address.i(t _parseAddrR(RRRtnaddr1t naddr1lentnaddr2t naddr2len((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyR js    c Csct|\}}|d|dK}yD|s6d}n t|}d|koYdknsgtnWntk r(yt|t}Wntk rtdnXd}d}|sd}q)x|d@s|d7}qWx"|d@r|dL}|d7}qW||dkr)tdq)nX|d|>dd|>@}|dd|>d}||fS(Niiii sMask isn't parseable.isMask isn't a proper host mask.(RRRtFalse( Rtaddrtmasktnaddrtnaddrlentmasklent remainingRR ((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyRxs6         cCsTt|\}}|d|d>}|d|d>dd|d>d}||fS(Niii(R(RR#R%R&RR ((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyRs&cCsQg}x5tdD]'}|jt|d@|dL}qWdjt|S(Niiis.(R tappendR tjointreversed(RtnumtrvR((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyt_int2ips ccs2x+tt|jD]}|j|VqWdS(swReturns an iterator which iterates over ips in this iprange. An IP is returned in string form (e.g. '1.2.3.4').N(RRt__iter__R.(Rtv((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyt iteraddressessccsrxk|jD]`}|d|ddkr=|j|dVq d|j|d|j|ddfVq WdS(sReturns an iterator which iterates over ip-ip ranges which build this iprange if combined. An ip-ip pair is returned in string form (e.g. '1.2.3.4-2.3.4.5').iis%s-%sN(t_rangesR.(Rtr((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyt iterrangessccs7x0|jD]%}x|j|D] }|Vq Wq WdS(sReturns an iterator which iterates over ip/mask pairs which build this iprange if combined. An IP/Mask pair is returned in string form (e.g. '1.2.3.0/24').N(R2t _itermasks(RR3R0((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyt itermaskssccs|g}x|r|j}d}xptrdd|>}|d|dd|>dd|>@}||dkr|||dkrPq'|d7}q'Wd|j||fV|d|kr|j|d|fn|d||kr |j|||dfq q WdS(Niii s%s/%s(tpoptTrueR.R)(RR3trangestcurtcurmaskt curmasklentstart((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyR5s    &$cCsg}xt|jD]i\}}||dkrL|jd|j|fq|jd|j||j|dfqWd|jjdj|fS(s?Returns a string which can be used to reconstruct this iprange.is%rs(%r,%r)s%s(%s)s,(R2R)R.t __class__t__name__R*(RR-R=tstop((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyt__repr__s ll(R?t __module__t__doc__RRR*R tntchrt _UNITYTRANSt _IPREMOVERR RRR.R1R4R6R5R/RA(((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyRs . D    cCs$|rW|jtjtjrWytj|}WqWtjk rStdqWXnd}xt|j dD]\}}|dkrtdnyD|sd}n t |}d|kodknstnWntk rtdnX|dK}||7}qsW||d fS( NsInvalid Hostname as argument.is.is&Address contains more than four parts.isAddress part out of range.ii( t translateRRFRGtsockett gethostbynameterrorRt enumerateR R(R#tlookupR%tnaddrpostpart((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyRs("      cCst|d|dS(NRMi(R(R#RM((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pytip2intst__main__s172.22.162.250/24s172.22.162.250s172.22.163.250s172.22.163.253<->255(RCt __author__t __version__t __revision__t__date__tintsetRItIntSetRR8RRPR?txtyR6tvalR4(((s?/opt/alt/python27/lib/python2.7/site-packages/paste/util/ip4.pyts.