Chris PeBenito 8cc494
## <summary>User network interface configuration helper</summary>
Chris PeBenito 8cc494
Chris PeBenito 8cc494
########################################
Chris PeBenito 8cc494
## <summary>
Chris PeBenito 8cc494
##	Execute usernetctl in the usernetctl domain.
Chris PeBenito 8cc494
## </summary>
Chris PeBenito 8cc494
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 8cc494
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 8cc494
## </param>
Chris PeBenito 8cc494
#
Chris PeBenito 8cc494
interface(`usernetctl_domtrans',`
Chris PeBenito 8cc494
	gen_require(`
Chris PeBenito 8cc494
		type usernetctl_t, usernetctl_exec_t;
Chris PeBenito 8cc494
	')
Chris PeBenito 8cc494
Chris PeBenito 8cc494
	tunable_policy(`user_net_control',`
Chris PeBenito 8cc494
		domain_auto_trans($1,usernetctl_exec_t,usernetctl_t)
Chris PeBenito 8cc494
Chris PeBenito 8cc494
		allow $1 usernetctl_t:fd use;
Chris PeBenito 8cc494
		allow usernetctl_t $1:fd use;
Chris PeBenito 8cc494
		allow usernetctl_t $1:fifo_file rw_file_perms;
Chris PeBenito 8cc494
		allow usernetctl_t $1:process sigchld;
Chris PeBenito 8cc494
	',`
Chris PeBenito 8cc494
		can_exec($1,usernetctl_exec_t)
Chris PeBenito 8cc494
	')
Chris PeBenito 8cc494
')
Chris PeBenito 8cc494
Chris PeBenito 8cc494
########################################
Chris PeBenito 8cc494
## <summary>
Chris PeBenito 8cc494
##	Execute usernetctl in the usernetctl domain, and
Chris PeBenito 8cc494
##	allow the specified role the usernetctl domain.
Chris PeBenito 8cc494
## </summary>
Chris PeBenito 8cc494
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 8cc494
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 8cc494
## </param>
Chris PeBenito 8cc494
## <param name="role">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 8cc494
##	The role to be allowed the usernetctl domain.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 8cc494
## </param>
Chris PeBenito 8cc494
## <param name="terminal">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 8cc494
##	The type of the terminal allow the usernetctl domain to use.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 8cc494
## </param>
Chris PeBenito 8cc494
#
Chris PeBenito 8cc494
interface(`usernetctl_run',`
Chris PeBenito 8cc494
	gen_require(`
Chris PeBenito 8cc494
		type usernetctl_t;
Chris PeBenito 8cc494
	')
Chris PeBenito 8cc494
Chris PeBenito 8cc494
	usernetctl_domtrans($1)
Chris PeBenito 8cc494
	role $2 types usernetctl_t;
Chris PeBenito 8cc494
	allow usernetctl_t $3:chr_file rw_term_perms;
Chris PeBenito 8cc494
Chris PeBenito 8cc494
	sysnet_run_ifconfig(usernetctl_t,$2,$3)
Chris PeBenito 8cc494
	sysnet_run_dhcpc(usernetctl_t,$2,$3)
Chris PeBenito 8cc494
Chris PeBenito 8cc494
	optional_policy(`consoletype',`
Chris PeBenito 8cc494
		consoletype_run(usernetctl_t,$2,$3)
Chris PeBenito 8cc494
	')
Chris PeBenito 8cc494
Chris PeBenito 8cc494
	optional_policy(`iptables',`
Chris PeBenito 8cc494
		iptables_run(usernetctl_t,$2,$3)
Chris PeBenito 8cc494
	')
Chris PeBenito 8cc494
Chris PeBenito 8cc494
	optional_policy(`modutils',`
Chris PeBenito 8cc494
		modutils_run_insmod(usernetctl_t,$2,$3)
Chris PeBenito 8cc494
	')
Chris PeBenito 8cc494
')