3 @)fW@sddlmZddlZeejd<ddlZddlZddlZddlZddl m Z ddl m Z m Z mZddlmZddlmZddlmZdd lmZdd lmZdd lmZmZmZdd l mZdd lmZddl m!Z!m"Z"m#Z#m$Z$Gdddejj%j&Z'dS))GObjectNZgobject)config)dbus_to_python%dbus_introspection_prepare_properties!dbus_introspection_add_properties)Zone)ifcfg_set_zone_of_interface)DEFAULT_ZONE_TARGET) Rich_Rule)log)handle_exceptionsdbus_handle_exceptionsdbus_service_method)errors) FirewallError)portStrportInPortRangecoalescePortRangebreakPortRangecs eZdZdZdZejjZe fddZ e ddZ e ddZ e d d Zeejd d d e dddZeejddd e dddZejjjejjeejdde dddZejjejddddZejjjejjeejdde dfdd Zeejjd de dd!d"Zeejjdde dd#d$Zd%d&Z eejjd de dd'd(Z!eejjdde dd)d*Z"eejje dd+d,Z#ejjejjdde d-d.Z$eejje dd/d0Z%ejjejjdde d1d2Z&eejjdde dd3d4Z'ejjejjdde d5d6Z(eejjdde dd7d8Z)eejjdde dd9d:Z*eejjdde dd;d<Z+eejjdde dd=d>Z,eejjdde dd?d@Z-eejjdde ddAdBZ.eejjdde ddCdDZ/eejjdde ddEdFZ0eejjdGde ddHdIZ1eejjdGde ddJdKZ2eejjdde ddLdMZ3eejjdde ddNdOZ4eejjddPd e ddQdRZ5eejjdSde ddTdUZ6eejjdSde ddVdWZ7eejjd de ddXdYZ8eejjd de ddZd[Z9eejjd dPd e dd\d]Z:eejjdGde dd^d_Z;eejjdGde dd`daZeejjddPd e ddfdgZ?eejjdSde ddhdiZ@eejjdSde ddjdkZAeejjd de ddldmZBeejjd de ddndoZCeejjd dPd e ddpdqZDeejjdGde ddrdsZEeejjdGde ddtduZFeejjdde ddvdwZGeejjdde ddxdyZHeejjddPd e ddzd{ZIeejjdPde dd|d}ZJeejjdPde dd~dZKeejje dddZLeejje dddZMeejjdPde dddZNeejjdPde dddZOeejjdPde dddZPeejje dddZQeejje dddZReejjdPde dddZSeejjdde dddZTeejjdde dddZUeejjdde dddZVeejjdde dddZWeejjddPd e dddZXeejjdGde dddZYeejjdGde dddZZeejjdde dddZ[eejjdde dddZ\eejjddPd e dddZ]eejjdGde dddZ^eejjdGde dddZ_eejjdde dddZ`eejjdde dddZaeejjddPd e dddZbeejjdGde dddZceejjdGde dddZdeejjdde dddZeeejjdde dddZfeejjddPd e dddZgZhS(FirewallDConfigZonezFirewallD main classTcs\tt|j||||_||_||_||_|d|_|d|_d|j|_ t |tj j dS)Nrzconfig.zone.%d) superr__init__parentrobjitem_idbusnamepath _log_prefixrdbusDBUS_INTERFACE_CONFIG_ZONE)selfrZconfZzonerargskwargs) __class__!/usr/lib/python3.6/config_zone.pyr=s   zFirewallDConfigZone.__init__cCsdS)Nr%)r!r%r%r&__del__JszFirewallDConfigZone.__del__cCs |jdS)N)Zremove_from_connection)r!r%r%r& unregisterNszFirewallDConfigZone.unregistercCs|dkrtj|jjS|dkr,tj|jjS|dkrBtj|jjS|dkrXtj|jjS|dkrntj|jjStj j d|dS)NnamefilenamerdefaultbuiltinzDorg.freedesktop.DBus.Error.InvalidArgs: Property '%s' does not exist) rStringrr)r*rZBooleanr+r, exceptions DBusException)r! property_namer%r%r& _get_propertyVsz!FirewallDConfigZone._get_propertyZssv) in_signature out_signatureNcCsLt|t}t|t}tjd|j|||tjjkrBtjj d||j |S)Nz%s.Get('%s', '%s')zJorg.freedesktop.DBus.Error.UnknownInterface: Interface '%s' does not exist) rstrr debug1rrrr r.r/r1)r!interface_namer0senderr%r%r&Getgs    zFirewallDConfigZone.Getsza{sv}cCsdt|t}tjd|j||tjjkr6tjj d|i}xd D]}|j |||<q@Wtj |dd S) Nz%s.GetAll('%s')zJorg.freedesktop.DBus.Error.UnknownInterface: Interface '%s' does not existr)r*rr+r,Zsv) signature)r)r*rr+r,) rr5r r6rrrr r.r/r1Z Dictionary)r!r7r8retxr%r%r&GetAllxs   zFirewallDConfigZone.GetAllZssv)r3cCslt|t}t|t}t|}tjd|j||||jj||tjj krXtj j d|tj j d|dS)Nz%s.Set('%s', '%s', '%s')zJorg.freedesktop.DBus.Error.UnknownInterface: Interface '%s' does not existzGorg.freedesktop.DBus.Error.PropertyReadOnly: Property '%s' is read-only) rr5r r6rr accessCheckrrr r.r/)r!r7r0Z new_valuer8r%r%r&Sets      zFirewallDConfigZone.Setzsa{sv}as)r;cCs2t|t}t|}t|}tjd|j|||dS)Nz&%s.PropertiesChanged('%s', '%s', '%s'))rr5r r6r)r!r7Zchanged_propertiesZinvalidated_propertiesr%r%r&PropertiesChangeds   z%FirewallDConfigZone.PropertiesChanged)r4cs8tjd|jtt|j|j|jj}t ||t j j S)Nz%s.Introspect()) r Zdebug2rrr IntrospectrrZget_busrrrr )r!r8data)r$r%r&rBs  zFirewallDConfigZone.Introspectz&(sssbsasa(ss)asba(ssss)asasasasa(ss)b)cCsDtjd|j|jj|j}|dtkr@t|}d|d<t|}|S)zget settings for zone z%s.getSettings()r+) r r6rrZget_zone_configrr listtuple)r!r8settings _settingsr%r%r& getSettingss zFirewallDConfigZone.getSettingscCs4tjd|j|jj|j}|dtkr0d|d<|S)zget settings for zone z%s.getSettings2()targetr+)r r6rrget_zone_config_dictrr )r!r8rGr%r%r& getSettings2s  z FirewallDConfigZone.getSettings2c Cs|jj|j}d|kr"t|dnt}d|kr|ddkr>t|d<|j||jj |j ||_ |j |j j dS)z!update settings for zone z%s.update2('...')rJr+N) rr r6rrr?r rRrZset_zone_config_dictrrSr))r!rGr8r%r%r&update2s  zFirewallDConfigZone.update2cCs<tjd|j|jj||jj|j|_|j|jj dS)z/load default settings for builtin zone z%s.loadDefaults()N) r r6rrr?rZload_zone_defaultsrrSr))r!r8r%r%r& loadDefaultss z FirewallDConfigZone.loadDefaultscCstjd|j|fdS)Nz%s.Updated('%s'))r r6r)r!r)r%r%r&rSszFirewallDConfigZone.UpdatedcCs:tjd|j|jj||jj|j|jj|jdS)zremove zone z%s.removeZone()N) r r6rrr?rZ remove_zonerZ removeZone)r!r8r%r%r&removes zFirewallDConfigZone.removecCstjd|j|fdS)Nz%s.Removed('%s'))r r6r)r!r)r%r%r&Removed#szFirewallDConfigZone.RemovedcCsFt|t}tjd|j||jj||jj|j ||_ |j |dS)zrename zone z%s.rename('%s')N) rr5r r6rrr?rZ rename_zonerRenamed)r!r)r8r%r%r&rename*s   zFirewallDConfigZone.renamecCstjd|j|fdS)Nz%s.Renamed('%s'))r r6r)r!r)r%r%r&rY6szFirewallDConfigZone.RenamedcCstjd|j|jdS)Nz%s.getVersion()r)r r6rrI)r!r8r%r%r& getVersion=szFirewallDConfigZone.getVersioncCsHt|t}tjd|j||jj|t|j}||d<|j |dS)Nz%s.setVersion('%s')r) rr5r r6rrr?rErIrT)r!versionr8rGr%r%r& setVersionDs    zFirewallDConfigZone.setVersioncCstjd|j|jdS)Nz %s.getShort()r)r r6rrI)r!r8r%r%r&getShortQszFirewallDConfigZone.getShortcCsHt|t}tjd|j||jj|t|j}||d<|j |dS)Nz%s.setShort('%s')r) rr5r r6rrr?rErIrT)r!Zshortr8rGr%r%r&setShortXs    zFirewallDConfigZone.setShortcCstjd|j|jdS)Nz%s.getDescription())r r6rrI)r!r8r%r%r&getDescriptionesz"FirewallDConfigZone.getDescriptioncCsHt|t}tjd|j||jj|t|j}||d<|j |dS)Nz%s.setDescription('%s')r`) rr5r r6rrr?rErIrT)r! descriptionr8rGr%r%r&setDescriptionls    z"FirewallDConfigZone.setDescriptioncCs.tjd|j|j}|dtkr*|dSdS)Nz%s.getTarget()rDr+)r r6rrIr )r!r8rGr%r%r& getTarget|szFirewallDConfigZone.getTargetcCsTt|t}tjd|j||jj|t|j}|dkr>|nt |d<|j |dS)Nz%s.setTarget('%s')r+rD) rr5r r6rrr?rErIr rT)r!rJr8rGr%r%r& setTargets    zFirewallDConfigZone.setTargetascCstjd|j|jdS)Nz%s.getServices())r r6rrI)r!r8r%r%r& getServicesszFirewallDConfigZone.getServicescCsNt|t}tjd|jdj||jj|t|j}||d<|j |dS)Nz%s.setServices('[%s]'),rg) rrEr r6rjoinrr?rIrT)r!Zservicesr8rGr%r%r& setServicess     zFirewallDConfigZone.setServicescCsft|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |dS)Nz%s.addService('%s')rg)rr5r r6rrr?rErIrrALREADY_ENABLEDappendrT)r!servicer8rGr%r%r& addServices     zFirewallDConfigZone.addServicecCsft|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |dS)Nz%s.removeService('%s')rg)rr5r r6rrr?rErIrr NOT_ENABLEDrWrT)r!rnr8rGr%r%r& removeServices     z!FirewallDConfigZone.removeServicebcCs*t|t}tjd|j|||jdkS)Nz%s.queryService('%s')rg)rr5r r6rrI)r!rnr8r%r%r& queryServices z FirewallDConfigZone.queryServiceza(ss)cCstjd|j|jdS)Nz %s.getPorts())r r6rrI)r!r8r%r%r&getPortsszFirewallDConfigZone.getPortscCsg}x6t|tD](}t|tr.|jt|q|j|qW|}tjd|jdjdd|D|j j |t|j }||d<|j |dS)Nz%s.setPorts('[%s]')ricss"|]}d|d|dfVqdS)z ('%s, '%s')rrNr%).0portr%r%r& sz/FirewallDConfigZone.setPorts..rt) rrErPrmrFr r6rrjrr?rIrT)r!portsr8_portsrwrGr%r%r&setPortss    zFirewallDConfigZone.setPortsc st|t}tttjd|j||jj|t|j}tt fdd|d}x.|D]&}t ||dr^t t j d|fq^Wt|dd|D\}}x$|D]} |djt| d fqWx$|D]} |djt| d fqW|j|dS) Nz%s.addPort('%s', '%s')cs |dkS)Nrr%)r=)protocolr%r&sz-FirewallDConfigZone.addPort..rtrz%s:%scSsg|] \}}|qSr%r%)rv_port _protocolr%r%r& sz/FirewallDConfigZone.addPort..-)rr5r r6rrr?rErIfilterrrrrlrrWrrmrT) r!rwr|r8rGexisting_port_idsport_id added_rangesremoved_rangesranger%)r|r&addPorts"        zFirewallDConfigZone.addPortc st|t}tttjd|j||jj|t|j}tt fdd|d}x0|D]}t ||dr^Pq^Wt t j d|ft|dd|D\}}x$|D]} |djt| d fqWx$|D]} |djt| d fqW|j|dS) Nz%s.removePort('%s', '%s')cs |dkS)Nrr%)r=)r|r%r&r}sz0FirewallDConfigZone.removePort..rtrz%s:%scSsg|] \}}|qSr%r%)rvr~rr%r%r&rsz2FirewallDConfigZone.removePort..r)rr5r r6rrr?rErIrrrrrprrWrrmrT) r!rwr|r8rGrrrrrr%)r|r& removePorts"        zFirewallDConfigZone.removePortcCsZt|t}t|t}tjd|j||x.|jdD]\}}t||r4||kr4dSq4WdS)Nz%s.queryPort('%s', '%s')rtTF)rr5r r6rrIr)r!rwr|r8r~rr%r%r& queryPorts   zFirewallDConfigZone.queryPortcCstjd|j|jdS)Nz%s.getProtocols() )r r6rrI)r!r8r%r%r& getProtocolssz FirewallDConfigZone.getProtocolscCsNt|t}tjd|jdj||jj|t|j}||d<|j |dS)Nz%s.setProtocols('[%s]')rir) rrEr r6rrjrr?rIrT)r!Z protocolsr8rGr%r%r& setProtocols&s     z FirewallDConfigZone.setProtocolscCsft|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |dS)Nz%s.addProtocol('%s')r)rr5r r6rrr?rErIrrrlrmrT)r!r|r8rGr%r%r& addProtocol2s     zFirewallDConfigZone.addProtocolcCsft|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |dS)Nz%s.removeProtocol('%s')r)rr5r r6rrr?rErIrrrprWrT)r!r|r8rGr%r%r&removeProtocol?s     z"FirewallDConfigZone.removeProtocolcCs*t|t}tjd|j|||jdkS)Nz%s.queryProtocol('%s')r)rr5r r6rrI)r!r|r8r%r%r& queryProtocolLs z!FirewallDConfigZone.queryProtocolcCstjd|j|jdS)Nz%s.getSourcePorts())r r6rrI)r!r8r%r%r&getSourcePortsVsz"FirewallDConfigZone.getSourcePortscCsg}x6t|tD](}t|tr.|jt|q|j|qW|}tjd|jdjdd|D|j j |t|j }||d<|j |dS)Nz%s.setSourcePorts('[%s]')ricss"|]}d|d|dfVqdS)z ('%s, '%s')rrNr%)rvrwr%r%r&rxjsz5FirewallDConfigZone.setSourcePorts..r) rrErPrmrFr r6rrjrr?rIrT)r!ryr8rzrwrGr%r%r&setSourcePorts]s    z"FirewallDConfigZone.setSourcePortsc st|t}tttjd|j||jj|t|j}tt fdd|d}x.|D]&}t ||dr^t t j d|fq^Wt|dd|D\}}x$|D]} |djt| d fqWx$|D]} |djt| d fqW|j|dS) Nz%s.addSourcePort('%s', '%s')cs |dkS)Nrr%)r=)r|r%r&r}zsz3FirewallDConfigZone.addSourcePort..rrz%s:%scSsg|] \}}|qSr%r%)rvr~rr%r%r&rsz5FirewallDConfigZone.addSourcePort..r)rr5r r6rrr?rErIrrrrrlrrWrrmrT) r!rwr|r8rGrrrrrr%)r|r& addSourcePortps"        z!FirewallDConfigZone.addSourcePortc st|t}tttjd|j||jj|t|j}tt fdd|d}x0|D]}t ||dr^Pq^Wt t j d|ft|dd|D\}}x$|D]} |djt| d fqWx$|D]} |djt| d fqW|j|dS) Nz%s.removeSourcePort('%s', '%s')cs |dkS)Nrr%)r=)r|r%r&r}sz6FirewallDConfigZone.removeSourcePort..rrz%s:%scSsg|] \}}|qSr%r%)rvr~rr%r%r&rsz8FirewallDConfigZone.removeSourcePort..r)rr5r r6rrr?rErIrrrrrprrWrrmrT) r!rwr|r8rGrrrrrr%)r|r&removeSourcePorts"        z$FirewallDConfigZone.removeSourcePortcCsZt|t}t|t}tjd|j||x.|jdD]\}}t||r4||kr4dSq4WdS)Nz%s.querySourcePort('%s', '%s')rTF)rr5r r6rrIr)r!rwr|r8r~rr%r%r&querySourcePorts   z#FirewallDConfigZone.querySourcePortcCstjd|j|jdS)Nz%s.getIcmpBlocks())r r6rrI)r!r8r%r%r& getIcmpBlockssz!FirewallDConfigZone.getIcmpBlockscCsNt|t}tjd|jdj||jj|t|j}||d<|j |dS)Nz%s.setIcmpBlocks('[%s]')rir) rrEr r6rrjrr?rIrT)r!Z icmptypesr8rGr%r%r& setIcmpBlockss     z!FirewallDConfigZone.setIcmpBlockscCsft|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |dS)Nz%s.addIcmpBlock('%s')r)rr5r r6rrr?rErIrrrlrmrT)r!icmptyper8rGr%r%r& addIcmpBlocks     z FirewallDConfigZone.addIcmpBlockcCsft|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |dS)Nz%s.removeIcmpBlock('%s')r)rr5r r6rrr?rErIrrrprWrT)r!rr8rGr%r%r&removeIcmpBlocks     z#FirewallDConfigZone.removeIcmpBlockcCs*t|t}tjd|j|||jdkS)Nz%s.queryIcmpBlock('%s')r)rr5r r6rrI)r!rr8r%r%r&queryIcmpBlocks z"FirewallDConfigZone.queryIcmpBlockcCstjd|j|jdS)Nz%s.getIcmpBlockInversion())r r6rrI)r!r8r%r%r&getIcmpBlockInversionsz)FirewallDConfigZone.getIcmpBlockInversioncCsHt|t}tjd|j||jj|t|j}||d<|j |dS)Nz%s.setIcmpBlockInversion('%s')r) rboolr r6rrr?rErIrT)r!flagr8rGr%r%r&setIcmpBlockInversions    z)FirewallDConfigZone.setIcmpBlockInversioncCsPtjd|j|jj|t|j}|dr:ttj dd|d<|j |dS)Nz%s.addIcmpBlockInversion()rzicmp-block-inversionT) r r6rrr?rErIrrrlrT)r!r8rGr%r%r&addIcmpBlockInversions   z)FirewallDConfigZone.addIcmpBlockInversioncCsPtjd|j|jj|t|j}|ds:ttj dd|d<|j |dS)Nz%s.removeIcmpBlockInversion()rzicmp-block-inversionF) r r6rrr?rErIrrrprT)r!r8rGr%r%r&removeIcmpBlockInversions   z,FirewallDConfigZone.removeIcmpBlockInversioncCstjd|j|jdS)Nz%s.queryIcmpBlockInversion()r)r r6rrI)r!r8r%r%r&queryIcmpBlockInversion sz+FirewallDConfigZone.queryIcmpBlockInversioncCstjd|j|jdS)Nz%s.getMasquerade())r r6rrI)r!r8r%r%r& getMasqueradesz!FirewallDConfigZone.getMasqueradecCsHt|t}tjd|j||jj|t|j}||d<|j |dS)Nz%s.setMasquerade('%s')r) rrr r6rrr?rErIrT)r! masquerader8rGr%r%r& setMasquerades    z!FirewallDConfigZone.setMasqueradecCsPtjd|j|jj|t|j}|dr:ttj dd|d<|j |dS)Nz%s.addMasquerade()rrT) r r6rrr?rErIrrrlrT)r!r8rGr%r%r& addMasquerade's   z!FirewallDConfigZone.addMasqueradecCsPtjd|j|jj|t|j}|ds:ttj dd|d<|j |dS)Nz%s.removeMasquerade()rrF) r r6rrr?rErIrrrprT)r!r8rGr%r%r&removeMasquerade2s   z$FirewallDConfigZone.removeMasqueradecCstjd|j|jdS)Nz%s.queryMasquerade()r)r r6rrI)r!r8r%r%r&queryMasquerade=sz#FirewallDConfigZone.queryMasqueradeza(ssss)cCstjd|j|jdS)Nz%s.getForwardPorts() )r r6rrI)r!r8r%r%r&getForwardPortsFsz#FirewallDConfigZone.getForwardPortscCsg}x6t|tD](}t|tr.|jt|q|j|qW|}tjd|jdjdd|D|j j |t|j }||d<|j |dS)Nz%s.setForwardPorts('[%s]')ricss.|]&}d|d|d|d|dfVqdS)z('%s, '%s', '%s', '%s')rrr`Nr%)rvrwr%r%r&rxZsz6FirewallDConfigZone.setForwardPorts..r) rrErPrmrFr r6rrjrr?rIrT)r!ryr8rzrwrGr%r%r&setForwardPortsMs      z#FirewallDConfigZone.setForwardPortsZsssscCst|t}t|t}t|t}t|t}tjd|j|||||jj|||t|t|f}t|j}||dkrt t j d||||f|dj ||j |dS)Nz)%s.addForwardPort('%s', '%s', '%s', '%s')rz %s:%s:%s:%s)rr5r r6rrr?rErIrrrlrmrT)r!rwr|toporttoaddrr8fwp_idrGr%r%r&addForwardPortas        z"FirewallDConfigZone.addForwardPortcCst|t}t|t}t|t}t|t}tjd|j|||||jj|||t|t|f}t|j}||dkrt t j d||||f|dj ||j |dS)Nz,%s.removeForwardPort('%s', '%s', '%s', '%s')rz %s:%s:%s:%s)rr5r r6rrr?rErIrrrprWrT)r!rwr|rrr8rrGr%r%r&removeForwardPortus        z%FirewallDConfigZone.removeForwardPortcCsbt|t}t|t}t|t}t|t}tjd|j||||||t|t|f}||jdkS)Nz+%s.queryForwardPort('%s', '%s', '%s', '%s')r)rr5r r6rrI)r!rwr|rrr8rr%r%r&queryForwardPorts    z$FirewallDConfigZone.queryForwardPortcCstjd|j|jdS)Nz%s.getInterfaces() )r r6rrI)r!r8r%r%r& getInterfacessz!FirewallDConfigZone.getInterfacescCsNt|t}tjd|jdj||jj|t|j}||d<|j |dS)Nz%s.setInterfaces('[%s]')rir) rrEr r6rrjrr?rIrT)r!rMr8rGr%r%r& setInterfacess     z!FirewallDConfigZone.setInterfacescCstt|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |t|jj|dS)Nz%s.addInterface('%s')r)rr5r r6rrr?rErIrrrlrmrTrrr))r! interfacer8rGr%r%r& addInterfaces      z FirewallDConfigZone.addInterfacecCspt|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |td|dS)Nz%s.removeInterface('%s')r)rr5r r6rrr?rErIrrrprWrTr)r!rr8rGr%r%r&removeInterfaces      z#FirewallDConfigZone.removeInterfacecCs*t|t}tjd|j|||jdkS)Nz%s.queryInterface('%s')r)rr5r r6rrI)r!rr8r%r%r&queryInterfaces z"FirewallDConfigZone.queryInterfacecCstjd|j|jdS)Nz%s.getSources() )r r6rrI)r!r8r%r%r& getSourcesszFirewallDConfigZone.getSourcescCsNt|t}tjd|jdj||jj|t|j}||d<|j |dS)Nz%s.setSources('[%s]')rir) rrEr r6rrjrr?rIrT)r!rNr8rGr%r%r& setSourcess     zFirewallDConfigZone.setSourcescCsft|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |dS)Nz%s.addSource('%s')r)rr5r r6rrr?rErIrrrlrmrT)r!rQr8rGr%r%r& addSources     zFirewallDConfigZone.addSourcecCsft|t}tjd|j||jj|t|j}||dkrJt t j ||dj ||j |dS)Nz%s.removeSource('%s')r)rr5r r6rrr?rErIrrrprWrT)r!rQr8rGr%r%r& removeSources     z FirewallDConfigZone.removeSourcecCs*t|t}tjd|j|||jdkS)Nz%s.querySource('%s')r)rr5r r6rrI)r!rQr8r%r%r& querySources zFirewallDConfigZone.querySourcecCstjd|j|jdS)Nz%s.getRichRules() )r r6rrI)r!r8r%r%r& getRichRules sz FirewallDConfigZone.getRichRulescCs\t|t}tjd|jdj||jj|t|j}dd|D}||d<|j |dS)Nz%s.setRichRules('[%s]')ricSsg|]}tt|dqS))rule_str)r5r )rvrr%r%r&rsz4FirewallDConfigZone.setRichRules..r) rrEr r6rrjrr?rIrT)r!Zrulesr8rGr%r%r& setRichRuless     z FirewallDConfigZone.setRichRulescCstt|t}tjd|j||jj|t|j}tt |d}||dkrXt t j ||dj ||j|dS)Nz%s.addRichRule('%s'))rr)rr5r r6rrr?rErIr rrrlrmrT)r!ruler8rGrr%r%r& addRichRule s     zFirewallDConfigZone.addRichRulecCstt|t}tjd|j||jj|t|j}tt |d}||dkrXt t j ||dj ||j|dS)Nz%s.removeRichRule('%s'))rr)rr5r r6rrr?rErIr rrrprWrT)r!rr8rGrr%r%r&removeRichRule.s     z"FirewallDConfigZone.removeRichRulecCs8t|t}tjd|j|tt|d}||jdkS)Nz%s.queryRichRule('%s'))rr)rr5r r6rr rI)r!rr8rr%r%r& queryRichRule<s z!FirewallDConfigZone.queryRichRule)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)i__name__ __module__ __qualname____doc__Z persistentrrZPK_ACTION_CONFIGZdefault_polkit_auth_requiredr rr r'r(r1rZPROPERTIES_IFACEr9r>slipZpolkitZ require_authr@rnsignalrAZPK_ACTION_INFOZINTROSPECTABLE_IFACErBr rIrLrRrTrUrVrSrWrXrZrYr[r]r^r_rarcrdrerhrkrorqrsrur{rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr __classcell__r%r%)r$r&r5sf                                           r)(Z gi.repositoryrsysmodulesrZ dbus.serviceZ slip.dbusrZslip.dbus.serviceZfirewallrZfirewall.dbus_utilsrrrZfirewall.core.io.zonerZfirewall.core.fw_ifcfgrZfirewall.core.baser Zfirewall.core.richr Zfirewall.core.loggerr Zfirewall.server.decoratorsr r rrZfirewall.errorsrZfirewall.functionsrrrrrnZObjectrr%r%r%r&s$