l#gdZddlZddlmZmZmZmZddlmZddl m Z de fdZ Gdd ej ZGd d eZdS) z6JSON encoders to help with sending messages to server.N) IPv4Address IPv4Network IPv6Address IPv6Network) model_to_dict)Modelreturncpt|jst|jSt|S)zn IPv4Network('192.168.1.1/32') -> '192.168.1.1' IPv4Network('192.168.1.0/24') -> '192.168.1.0/24' )inthostmaskstrnetwork_address)nets O/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/json.pyip_net_to_stringr s2 s|  (3&''' s88OceZdZdZdS) IPEncoderct|ttfrt|St|tt frt |Stj ||SN) isinstancerrrrrr json JSONEncoderdefault)selfobjs rrzIPEncoder.defaultsb cK5 6 6 )#C(( ( cK5 6 6 s88O''c222rN)__name__ __module__ __qualname__rrrrrs#33333rrceZdZfdZxZS)ServerJSONEncoderct|trt|St|Sr)rrrsuperr)rr __class__s rrzServerJSONEncoder.defaults9 c5 ! ! & %% %wws###r)rrrr __classcell__)r%s@rr"r"s8$$$$$$$$$rr")__doc__r ipaddressrrrrplayhouse.shortcutsrdefence360agent.modelrr rrrr"r rrr+s<< HHHHHHHHHHHH------''''''S33333 333$$$$$ $$$$$r