Chris PeBenito 2705f9
#
Chris PeBenito 2705f9
# ICE related types 
Chris PeBenito 2705f9
#
Chris PeBenito 2705f9
# Author: Ivan Gyurdiev <ivg2@cornell.edu>
Chris PeBenito 2705f9
#
Chris PeBenito 2705f9
# ice_domain(prefix, role) - create ICE sockets
Chris PeBenito 2705f9
# ice_connect(type1_prefix, type2_prefix) - allow communication through ICE sockets 
Chris PeBenito 2705f9
Chris PeBenito 2705f9
define(`ice_domain', `
Chris PeBenito 2705f9
ifdef(`$1_ice_tmp_t_defined',`', `
Chris PeBenito 2705f9
define(`$1_ice_tmp_t_defined')
Chris PeBenito 2705f9
Chris PeBenito 2705f9
# Type for ICE sockets
Chris PeBenito 2705f9
type $1_ice_tmp_t, file_type, $1_file_type, sysadmfile, tmpfile;
Chris PeBenito 2705f9
file_type_auto_trans($1_t, ice_tmp_t, $1_ice_tmp_t)
Chris PeBenito 2705f9
Chris PeBenito 2705f9
# Create the sockets
Chris PeBenito 2705f9
allow $1_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 2705f9
allow $1_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 2705f9
Chris PeBenito 2705f9
# FIXME: How does iceauth tie in?
Chris PeBenito 2705f9
Chris PeBenito 2705f9
')
Chris PeBenito 2705f9
')
Chris PeBenito 2705f9
Chris PeBenito 2705f9
# FIXME: Should this be bidirectional?
Chris PeBenito 2705f9
# Adding only unidirectional for now.
Chris PeBenito 2705f9
Chris PeBenito 2705f9
define(`ice_connect', `
Chris PeBenito 2705f9
Chris PeBenito 2705f9
# Read .ICEauthority file
Chris PeBenito 2705f9
allow $1_t $2_iceauth_home_t:file { read getattr };
Chris PeBenito 2705f9
Chris PeBenito 2705f9
can_unix_connect($1_t, $2_t)
Chris PeBenito 2705f9
allow $1_t ice_tmp_t:dir r_dir_perms;
Chris PeBenito 2705f9
allow $1_t $2_ice_tmp_t:sock_file { read write };
Chris PeBenito 2705f9
allow $1_t $2_t:unix_stream_socket { read write };
Chris PeBenito 2705f9
')