+
        3                         ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
HtHt ^ RIHt ^ RIHt ^ RIHt  ! R R]4      t ! R	 R
]	4      tR tRR ltR# )    N)config)	IO_ObjectIO_Object_ContentHandlerIO_Object_XMLGenerator
check_portcheck_tcpudp)log)errors)FirewallErrorc                      a a ] tR t^t oRRRRRRRRRRRR./tRtR	R
.tRRRRRR./tR. RORRR./tV 3R lt	R t
R tR tRtVtV ;t# )Helperversion shortdescriptionfamilymoduleportsz(sssssa(ss))-.Nhelperportprotocolc                   < \         \        V `  4        R V n        R V n        R V n        R V n        R V n        . V n        R# )r   N)	superr   __init__r   r   r   r   r   r   )self	__class__s   &</usr/lib/python3.14/site-packages/firewall/core/io/helper.pyr   Helper.__init__/   s;    fd$&

    c                f    R V n         R V n        R V n        R V n        R V n        V P
                  R R# )r   :NNNN)r   r   r   r   r   r   )r   s   &r   cleanupHelper.cleanup8   s1    
JJqMr!   c                `    R R.pW9  d$   \        \        P                  RV: RV: R24      hR# )ipv4ipv6'z
' not in 'N)r   r
   INVALID_IPV)r   ipvipvss   && r   	check_ipvHelper.check_ipv@   s.    ? 2 2#t4TUU r!   c                z   VR 8X  d0   V F'  p\        V^ ,          4       \        V^,          4       K)  	  R# VR8X  d~   VP                  ! R4      '       g"   \        \        P
                  RV,          4      h\        VP                  ! RR4      4      ^8  d"   \        \        P
                  RV,          4      hR# R# )r   r   nf_conntrack_('%s' does not start with 'nf_conntrack_'r   Module name '%s' too shortN)r   r   
startswithr   r
   INVALID_MODULElenreplace)r   r   item
all_configall_io_objectsr   s   &&&&& r   _check_configHelper._check_configE   s    7?47#T!W%  X$$_55#))>G  6>>/267!;#))+G&+P  < r!   )r   r   r   r   r   r   )r   r   )namer   r   )__name__
__module____qualname____firstlineno__IMPORT_EXPORT_STRUCTUREDBUS_SIGNATUREADDITIONAL_ALNUM_CHARSPARSER_REQUIRED_ELEMENT_ATTRSPARSER_OPTIONAL_ELEMENT_ATTRSr   r#   r,   r9   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r      s     2r""( $N!3Zt8*%! 	/$%!
V
 r!   r   c                   &   a  ] tR t^Yt o R tRtV tR# )helper_ContentHandlerc                   \         P                  ! WV4       V P                  P                  W4       VR 8X  Ed   RV9   d   VR,          V P                  n        RV9   d;   V P                  P                  VR,          4       VR,          V P                  n        RV9   d   VR,          P                  R4      '       g)   \        \        P                  RVR,          ,          4      h\        VR,          P                  RR4      4      ^8  d)   \        \        P                  RVR,          ,          4      hVR,          V P                  n        R# R# VR8X  d   R# VR	8X  d   R# VR
8X  d   \        VR
,          4       \        VR,          4       VR
,          VR,          3pW0P                  P                   9  d(   V P                  P                   P#                  V4       R# \$        P&                  ! RVR
,          VR,          4       R# R# )r   r   r   r   r/   r0   r   r1   r   r   r   r   z#Port '%s/%s' already set, ignoring.N)r   startElementr6   parser_check_element_attrsr   r,   r   r2   r   r
   r3   r4   r5   r   r   r   r   appendr	   warning)r   r;   attrsentrys   &&& r   rL   "helper_ContentHandler.startElementZ   s    --d%@		,,T98E!$))$4		!5 		##E(O4#(?		 5 X11/BB'--BU8_T  uX..CDqH'--4uXF  $)?		  ! W_]"V^uV}%z*+6]E*$56EIIOO+		&&u-9&M*% r!    N)r<   r=   r>   r?   rL   rE   rF   )rH   s   @r   rJ   rJ   Y   s     $ $r!   rJ   c           	      T   \        4       pV P                  R 4      '       g"   \        \        P                  RV ,          4      hV RR Vn        VP                  VP
                  4       Wn        Wn        VP                  \        P                  4      '       d   RMRVn        VP                  Vn        \        V4      p\        P                   ! 4       pVP#                  V4       V: RV : 2p\%        VR4      ;_uu_ 4       p\        P&                  ! R4      pVP)                  V4        VP+                  V4        RRR4       ??T#   \        P,                   d5   p\        \        P.                  RTP1                  4       ,          4      hRp?ii ; i  + '       g   i     ??T# ; i)	.xmlz'%s' is missing .xml suffixNFT/rbznot a valid helper file: %s)r   endswithr   r
   INVALID_NAMEr;   
check_namefilenamepathr2   r   ETC_FIREWALLDbuiltindefaultrJ   saxmake_parsersetContentHandleropenInputSourcesetByteStreamparseSAXParseExceptionINVALID_HELPERgetException)	r\   r]   r   handlerparserr;   fsourcemsgs	   &&       r   helper_readerrp      s\   XFV$$!>!I
 	
 3B-FK
fkk"OK"oof.B.BCCUFN^^FN#F+G__F
W%H%D	dD		Q&Q	LL 	 
 	M $$ 	%%-0@0@0BB 	 
	 	Ms*   (F*EF/FFFF'	c           	         V'       d   TMV P                   pV P                  '       d   V: R V P                  : 2pMV: R V P                  : R2p\        P                   P	                  V4      '       d     \
        P                  ! VRV,          4       \        P                   P                  V4      pVP                  \        P                  4      '       d   \        P                   P	                  V4      '       gp   \        P                   P	                  \        P                  4      '       g&   \        P                  ! \        P                  R4       \        P                  ! VR4       \        P                   ! VRRR7      p\#        V4      pVP%                  4        / pV P&                  VR	&   V P(                  '       d!   V P(                  R
8w  d   V P(                  VR&   V P*                  '       d!   V P*                  R
8w  d   V P*                  VR&   VP-                  RV4       VP/                  R4       V P0                  '       dr   V P0                  R
8w  da   VP/                  R4       VP-                  R/ 4       VP3                  V P0                  4       VP5                  R4       VP/                  R4       V P6                  '       dr   V P6                  R
8w  da   VP/                  R4       VP-                  R/ 4       VP3                  V P6                  4       VP5                  R4       VP/                  R4       V P8                   FI  p	VP/                  R4       VP;                  RRV	^ ,          RV	^,          /4       VP/                  R4       KK  	  VP5                  R4       VP/                  R4       VP=                  4        VP?                  4        ?R#   \         d#   p\        P                  ! RY44        Rp?ELpRp?ii ; i)rV   rU   z%s.oldzBackup of file '%s' failed: %sNi  wtzUTF-8)modeencodingr   r   r   r   r   
z  r   r   r   r   ) r]   r\   r;   osexistsshutilcopy2	Exceptionr	   errordirnamer2   r   r^   mkdiriord   r   startDocumentr   r   r   rL   ignorableWhitespacer   
characters
endElementr   r   simpleElementendDocumentclose)
r   r]   _pathr;   ro   dirpathrm   rk   rP   r   s
   &&        r   helper_writerr      s   DfkkE1#V[[1	ww~~d	CLLx$/ ggood#G&..//w8O8Oww~~f2233HHV))51
% 
4'2A$Q'G EmmE(O~~~&..B.!>>i}}}", --h5)% |||*##D)Wb)6<<(7###D) f00B6##D)]B/6--.=)##D) ##D)fvtAw
DG&LM##D)  x %GGIe  	CII6BB	Cs   7O P
(PP
)N)xml.saxra   rv   r~   rx   firewallr   firewall.core.io.io_objectr   r   r   r   r   firewall.core.loggerr	   r
   firewall.errorsr   r   rJ   rp   r   rS   r!   r   <module>r      sP     	 	    %  )9Y 9~%4 %P>=r!   