K6hDdZddlZddlZdZdZdedefdZdedefd ZdS) u  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.  If not, see . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see Nz139.162.216.201cFtjtjtj}|d |t df|d|S#|wxYw)N r)socketAF_INET SOCK_DGRAM settimeoutconnectCLIENT_PORTAL_IP getsocknameclose)ss H/opt/imunify360/venv/lib/python3.11/site-packages/imav/patchman/utils.pyget_current_iprsx fnf&788ALL #Q'(((}}q!   s 5B B ipv4returncjtj|gd}tfd|DS)N)z 10.0.0.0/8z 172.16.0.0/12z192.168.0.0/16c3DK|]}tj|vVdS)N) ipaddress ip_network).0netips r z is_private_ip..)s3CC3rY)#...CCCCCC)r ip_addressany)rnetworksrs @r is_private_ipr&sA  d # #B@@@H CCCC(CCC C CCrrc^ tj|n#tj$rYdSwxYwdS)NFT)r IPv4AddressAddressValueError)rs ris_ipv4r#,sEb!!!!  &uu 4s **) __doc__rrr rstrboolrr#rrr(s* $DDDDDD r