## implementation of the Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux.
########################################
##
## Execute domain in the phc2sys domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`linuxptp_domtrans_phc2sys',`
gen_require(`
type phc2sys_t, phc2sys_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, phc2sys_exec_t, phc2sys_t)
')
########################################
##
## Execute domain in the phc2sys domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`linuxptp_domtrans_ptp4l',`
gen_require(`
type ptp4l_t, ptp4l_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, ptp4l_exec_t, ptp4l_t)
')
######################################
##
## Connect to timemaster using a unix
## domain stream socket.
##
##
##
## Domain allowed access.
##
##
#
interface(`timemaster_stream_connect',`
gen_require(`
type timemaster_t, timemaster_var_run_t;
')
files_search_pids($1)
stream_connect_pattern($1, timemaster_var_run_t, timemaster_var_run_t, timemaster_t)
')
########################################
##
## Read timemaster conf files.
##
##
##
## Domain allowed access.
##
##
#
interface(`timemaster_read_pid_files',`
gen_require(`
type timemaster_var_run_t;
')
read_files_pattern($1, timemaster_var_run_t, timemaster_var_run_t)
')
########################################
##
## Read and write timemaster shared memory.
##
##
##
## Domain allowed access.
##
##
#
interface(`timemaster_rw_shm',`
gen_require(`
type timemaster_t, timemaster_tmpfs_t;
')
allow $1 timemaster_t:shm rw_shm_perms;
list_dirs_pattern($1, timemaster_tmpfs_t, timemaster_tmpfs_t)
rw_files_pattern($1, timemaster_tmpfs_t, timemaster_tmpfs_t)
read_lnk_files_pattern($1, timemaster_tmpfs_t, timemaster_tmpfs_t)
fs_search_tmpfs($1)
')
########################################
##
## Read and write ptp4l_t shared memory.
##
##
##
## Domain allowed access.
##
##
#
interface(`ptp4l_rw_shm',`
gen_require(`
type ptp4l_t, timemaster_tmpfs_t;
')
allow $1 ptp4l_t:shm rw_shm_perms;
list_dirs_pattern($1, timemaster_tmpfs_t, timemaster_tmpfs_t)
rw_files_pattern($1, timemaster_tmpfs_t, timemaster_tmpfs_t)
read_lnk_files_pattern($1, timemaster_tmpfs_t, timemaster_tmpfs_t)
fs_search_tmpfs($1)
')
########################################
##
## Read and write phc2sys_t shared memory.
##
##
##
## Domain allowed access.
##
##
#
interface(`phc2sys_rw_shm',`
gen_require(`
type phc2sys_t, timemaster_tmpfs_t;
')
allow $1 phc2sys_t:shm rw_shm_perms;
list_dirs_pattern($1, timemaster_tmpfs_t, timemaster_tmpfs_t)
rw_files_pattern($1, timemaster_tmpfs_t, timemaster_tmpfs_t)
read_lnk_files_pattern($1, timemaster_tmpfs_t, timemaster_tmpfs_t)
fs_search_tmpfs($1)
')