+
        w                         R t . R
Ot^ t^t^t]],          tR]R]R]R]/t]R]R]R]R/t ! R R4      t ! R R4      t	R	# )z
This module provides knowledge object classes and permissions. It should
be used to keep this knowledge from leaking into the more generic parts of
the policy generation.
nrwbc                   0   a  ] tR t^Mt o RtR tR tRtV tR# )PermMapa  A mapping between a permission and its information flow properties.

PermMap represents the information flow properties of a single permission
including the direction (read, write, etc.) and an abstract representation
of the bandwidth of the flow (weight).
c                *    Wn         W n        W0n        R # N)permdirweight)selfr
   r   r   s   &&&&9/usr/lib/python3.14/site-packages/sepolgen/objectmodel.py__init__PermMap.__init__T   s    	    c                l    R V P                   \        V P                  ,          V P                  3,          # )z'<sepolgen.objectmodel.PermMap %s %s %d>)r
   
dir_to_strr   r   r   s   &r   __repr__PermMap.__repr__Y   s0    8DII;Edhh;O;?;;<H H 	Hr   )r   r
   r   N)	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classdictcell____classdict__s   @r   r   r   M   s     
H Hr   r   c                   H   a  ] tR t^^t o RtR tR tR tR tR t	R t
RtV tR	# )
PermMappingszThe information flow properties of a set of object classes and permissions.

PermMappings maps one or more classes and permissions to their PermMap objects
describing their information flow characteristics.
c                8    / V n         ^V n        \        V n        R# )   N)classesdefault_weight	FLOW_BOTHdefault_dirr   s   &r   r   PermMappings.__init__d   s    $r   c           	     (   RpV EF  pVP                  4       p\        V4      ^ 8X  g   \        V4      ^8X  g   V^ ,          R8X  d   KD  V^ ,          R8X  dI   V^,          pWPP                  9   d   \        R4      h/ V P                  V&   V P                  V,          pK  \        V4      ^8w  d   \        R4      hVf   \        R4      h\	        V^ ,          \
        V^,          ,          \        V^,          4      4      pWbVP                  &   EK  	  R# )zcRead the permission mappings from a file. This reads the format used
by Apol in the setools suite.
N#classzduplicate class in perm mapz!error in object class permissionszpermission outside of class)splitlenr$   
ValueErrorr   
str_to_dirintr
   )r   fdcurlinefieldscpms   &&     r   	from_filePermMappings.from_filei   s     DZZ\F6{a3v;!#3vayC7GayG#1I$$%BCC"%Qll1ov;!#$%HII;$%BCCVAY
6!9(=s6!9~N!BGG! r   c                6    V P                   V,          V,          # )zGet the permission map for the object permission.

Returns:
  PermMap representing the permission
Raises:
  KeyError if the object or permission is not defined
)r$   )r   objr
   s   &&&r   getPermMappings.get   s     ||C &&r   c                     V P                   V,          V,          pV#   \         d$    \        Y P                  T P                  4      u # i ; i)zGet the permission map for the object permission or a default.

getdefault is the same as get except that a default PermMap is
returned if the object class or permission is not defined. The
default is FLOW_BOTH with a weight of 5.
)r$   KeyErrorr   r'   r%   )r   r:   r
   r6   s   &&& r   
getdefaultPermMappings.getdefault   sN    	Hc"4(B 	  	H4!1!143F3FGG	Hs    +AAc                j    \         pV F&  pV P                  W4      pW5P                  ,          pK(  	  V# r	   )	FLOW_NONEr?   r   )r   r:   permsr   r
   r6   s   &&&   r   getdefault_direction!PermMappings.getdefault_direction   s1    D+B,C  
r   c                b    ^ pV F&  pV P                  W4      pW5P                  ,          pK(  	  V# )    )r?   r   )r   r:   rC   totalr
   r6   s   &&&   r   getdefault_distance PermMappings.getdefault_distance   s2    D+BYYE  r   )r$   r'   r%   N)r   r   r   r   r   r   r7   r;   r?   rD   rI   r   r   r   s   @r   r!   r!   ^   s-     
%
"8' r   r!   N)	socketr1   processfilelnk_file	fifo_filedbus
capabilityunix_stream_socket)
r   implicitly_typed_objectsrB   	FLOW_READ
FLOW_WRITEr&   r/   r   r   r!    r   r   <module>rW      st   ((H 8 		
#	 Yiz3T
3	Cc9sT
H H"K Kr   