a qéqe6 ã@sdddlZddlmZmZddlmZmZddlmZddl m Z ddl m Z Gdd „d eee ƒZ dS) éN)ÚIterableÚOptionalé)Ú MatchContextÚ MatchName)Ú Ibendportcon)Ú PolicyQuery)Ú match_regexcsteZdZUdZdZeeed<eeedœdd„ƒZ e j eeddœdd„ƒZ ‡fd d „Z e e dœd d „Z‡ZS) ÚIbendportconQueryav Infiniband endport context query. Parameter: policy The policy to query. Keyword Parameters/Class attributes: name The name of the network interface to match. name_regex If true, regular expression matching will be used for matching the name. port The port number to match. 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Ú_port)ÚreturncCs|jS©N)r )Úself©rú?/usr/lib64/python3.9/site-packages/setools/ibendportconquery.pyÚport1szIbendportconQuery.port)Úvaluer cCs<|r2t|ƒ}d|kr dks*ntdƒ‚||_nd|_dS)NrézEndport value must be 1-255.)ÚintÚ ValueErrorr )rrZ pending_valuerrrr5s c s(tt|ƒj|fi|¤Žt t¡|_dSr )Úsuperr Ú__init__ÚloggingZ getLoggerÚ__name__Úlog)rÚpolicyÚkwargs©Ú __class__rrr@szIbendportconQuery.__init__ccs–|j d |¡¡| |j¡|j d |¡¡| |j¡|j ¡D]J}|jrdt |j|j|j ƒsdqF|j dur||j |j kr|qF|  |j ¡sŠqF|VqFdS)z2Generator which yields all matching ibendportcons.z/Generating ibendportcon results from {0.policy}zPort: {0.port!r}N)rÚinfoÚformatZ_match_name_debugÚdebugZ_match_context_debugrZ ibendportconsÚnamer Z name_regexrZ_match_contextÚcontext)rZendportrrrÚresultsDs   ý zIbendportconQuery.results)rÚ __module__Ú __qualname__Ú__doc__r rrÚ__annotations__ÚpropertyrÚsetterrrrr$Ú __classcell__rrrrr s  r )rÚtypingrrZmixinsrrZ policyreprÚqueryrÚutilr r rrrrÚs