/usr/lib64/python3.9/site-packages/setools/__pycache__
NameSizeModeActions
boolquery.cpython-39.opt-1.pyc21010644editdlrm
boolquery.cpython-39.pyc21010644editdlrm
boundsquery.cpython-39.opt-1.pyc18830644editdlrm
boundsquery.cpython-39.pyc18830644editdlrm
categoryquery.cpython-39.opt-1.pyc16820644editdlrm
categoryquery.cpython-39.pyc16820644editdlrm
commonquery.cpython-39.opt-1.pyc19120644editdlrm
commonquery.cpython-39.pyc19120644editdlrm
constraintquery.cpython-39.opt-1.pyc47580644editdlrm
constraintquery.cpython-39.pyc47580644editdlrm
defaultquery.cpython-39.opt-1.pyc23630644editdlrm
defaultquery.cpython-39.pyc23630644editdlrm
descriptors.cpython-39.opt-1.pyc101200644editdlrm
descriptors.cpython-39.pyc103130644editdlrm
devicetreeconquery.cpython-39.opt-1.pyc25900644editdlrm
devicetreeconquery.cpython-39.pyc25900644editdlrm
dta.cpython-39.opt-1.pyc156130644editdlrm
dta.cpython-39.pyc156130644editdlrm
exception.cpython-39.opt-1.pyc93230644editdlrm
exception.cpython-39.pyc93230644editdlrm
fsusequery.cpython-39.opt-1.pyc30420644editdlrm
fsusequery.cpython-39.pyc30420644editdlrm
genfsconquery.cpython-39.opt-1.pyc32760644editdlrm
genfsconquery.cpython-39.pyc32760644editdlrm
ibendportconquery.cpython-39.opt-1.pyc33510644editdlrm
ibendportconquery.cpython-39.pyc33510644editdlrm
ibpkeyconquery.cpython-39.opt-1.pyc47630644editdlrm
ibpkeyconquery.cpython-39.pyc47630644editdlrm
infoflow.cpython-39.opt-1.pyc130470644editdlrm
infoflow.cpython-39.pyc130470644editdlrm
initsidquery.cpython-39.opt-1.pyc26180644editdlrm
initsidquery.cpython-39.pyc26180644editdlrm
iomemconquery.cpython-39.opt-1.pyc40960644editdlrm
iomemconquery.cpython-39.pyc40960644editdlrm
ioportconquery.cpython-39.opt-1.pyc41000644editdlrm
ioportconquery.cpython-39.pyc41000644editdlrm
mixins.cpython-39.opt-1.pyc69470644editdlrm
mixins.cpython-39.pyc69470644editdlrm
mlsrulequery.cpython-39.opt-1.pyc32900644editdlrm
mlsrulequery.cpython-39.pyc32900644editdlrm
netifconquery.cpython-39.opt-1.pyc26960644editdlrm
netifconquery.cpython-39.pyc26960644editdlrm
nodeconquery.cpython-39.opt-1.pyc40320644editdlrm
nodeconquery.cpython-39.pyc40320644editdlrm
objclassquery.cpython-39.opt-1.pyc31880644editdlrm
objclassquery.cpython-39.pyc31880644editdlrm
pcideviceconquery.cpython-39.opt-1.pyc29900644editdlrm
pcideviceconquery.cpython-39.pyc29900644editdlrm
permmap.cpython-39.opt-1.pyc128200644editdlrm
permmap.cpython-39.pyc130540644editdlrm
pirqconquery.cpython-39.opt-1.pyc29120644editdlrm
pirqconquery.cpython-39.pyc29120644editdlrm
polcapquery.cpython-39.opt-1.pyc14820644editdlrm
polcapquery.cpython-39.pyc14820644editdlrm
portconquery.cpython-39.opt-1.pyc47530644editdlrm
portconquery.cpython-39.pyc47530644editdlrm
query.cpython-39.opt-1.pyc12720644editdlrm
query.cpython-39.pyc12720644editdlrm
rbacrulequery.cpython-39.opt-1.pyc43520644editdlrm
rbacrulequery.cpython-39.pyc43520644editdlrm
rolequery.cpython-39.opt-1.pyc21900644editdlrm
rolequery.cpython-39.pyc21900644editdlrm
sensitivityquery.cpython-39.opt-1.pyc24020644editdlrm
sensitivityquery.cpython-39.pyc24020644editdlrm
terulequery.cpython-39.opt-1.pyc67030644editdlrm
terulequery.cpython-39.pyc67030644editdlrm
typeattrquery.cpython-39.opt-1.pyc23520644editdlrm
typeattrquery.cpython-39.pyc23520644editdlrm
typequery.cpython-39.opt-1.pyc31460644editdlrm
typequery.cpython-39.pyc31460644editdlrm
userquery.cpython-39.opt-1.pyc40200644editdlrm
userquery.cpython-39.pyc40200644editdlrm
util.cpython-39.opt-1.pyc77230644editdlrm
util.cpython-39.pyc77230644editdlrm
__init__.cpython-39.opt-1.pyc37560644editdlrm
__init__.cpython-39.pyc37560644editdlrm
Edit: /usr/lib64/python3.9/site-packages/setools/__pycache__/portconquery.cpython-39.pyc (4753B)
a qéqeã@s~ddlZddlmZmZddlmZmZmZmZddl m Z ddl m Z ddl mZmZmZddlmZGd d „d e e ƒZdS) éN)Ú IPPROTO_TCPÚ IPPROTO_UDP)ÚIterableÚOptionalÚTupleÚUnioné)Ú MatchContext)Ú PolicyQuery)ÚPortconÚ PortconRangeÚPortconProtocol)Ú match_rangecsúeZdZUdZdZeeed<dZee ed<dZ e ed<dZ e ed<dZ e ed<dZe ed <eee d œd d „ƒZejeeeefdd œdd „ƒZeeed œdd„ƒZejeeeefdd œdd„ƒZdd œ‡fdd„ Zeed œdd„Z‡ZS)Ú PortconQuerya_ Port context query. Parameter: policy The policy to query. Keyword Parameters/Class attributes: protocol The protocol to match (socket.IPPROTO_TCP for TCP or socket.IPPROTO_UDP for UDP) ports A 2-tuple of the port range to match. (Set both to the same value for a single port) ports_subset If true, the criteria will match if it is a subset of the portcon's range. ports_overlap If true, the criteria will match if it overlaps any of the portcon's range. ports_superset If true, the criteria will match if it is a superset of the portcon's range. ports_proper If true, use proper superset/subset operations. No effect if not using set operations. user The criteria to match the context's user. user_regex If true, regular expression matching will be used on the user. role The criteria to match the context's role. role_regex If true, regular expression matching will be used on the role. type_ The criteria to match the context's type. type_regex If true, regular expression matching will be used on the type. range_ The criteria to match the context's range. range_subset If true, the criteria will match if it is a subset of the context's range. range_overlap If true, the criteria will match if it overlaps any of the context's range. range_superset If true, the criteria will match if it is a superset of the context's range. range_proper If true, use proper superset/subset operations. No effect if not using set operations. NÚ _protocolÚ_portsFÚ ports_subsetÚ ports_overlapÚports_supersetÚ ports_proper)ÚreturncCs|jS©N)r©Úself©rú:/usr/lib64/python3.9/site-packages/setools/portconquery.pyÚportsDszPortconQuery.ports)ÚvaluercCsb|rXt|Ž}t|ƒr^|jdks(|jdkr6td |¡ƒ‚|j|jkrPtd |¡ƒ‚||_nd|_dS)Nrz/Port numbers must be positive: {0.low}-{0.high}zAThe low port must be smaller than the high port: {0.low}-{0.high})r ÚallZlowZhighÚ ValueErrorÚformatr)rrZ pending_portsrrrrHsÿ ÿÿcCs|jSr)rrrrrÚprotocol[szPortconQuery.protocolcCs|rt |¡|_nd|_dSr)r Úlookupr)rrrrrr!_sc s(tt|ƒj|fi|¤Žt t¡|_dSr)ÚsuperrÚ__init__ÚloggingZ getLoggerÚ__name__Úlog)rÚpolicyÚkwargs©Ú __class__rrr$fszPortconQuery.__init__ccs¤|j d |¡¡|j d |¡¡|j d |¡¡| |j¡|j ¡D]R}|jrvt|j|j|j |j |j |j ƒsvqL|j rŠ|j |j krŠqL| |j¡s˜qL|VqLdS)z-Generator which yields all matching portcons.z*Generating portcon results from {0.policy}z~Ports: {0.ports}, overlap: {0.ports_overlap}, subset: {0.ports_subset}, superset: {0.ports_superset}, proper: {0.ports_proper}zProtocol: {0.protocol!r}N)r'Úinfor ÚdebugZ_match_context_debugr(Zportconsrrrrrrr!Z_match_contextÚcontext)rZportconrrrÚresultsjs* þ ú zPortconQuery.results)r&Ú __module__Ú __qualname__Ú__doc__rrr Ú__annotations__rr rÚboolrrrÚpropertyrÚsetterrÚintr!rÚstrr$rr r/Ú __classcell__rrr*rrs" ,    r)r%ZsocketrrÚtypingrrrrZmixinsr Úqueryr Z policyrepr r r ÚutilrrrrrrÚs