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