Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
# Network Interface generated macros 
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`create_netif_interfaces',``
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_tcp_sendrecv_$1">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send and receive TCP network traffic on the $1 interface.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="both" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_tcp_sendrecv_$1',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_netif_t:netif { tcp_send tcp_recv };
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_tcp_sendrecv_$1_depend',`
Chris PeBenito f2e4ab
	type $1_netif_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class netif { tcp_send tcp_recv };
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_udp_send_$1">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send UDP network traffic on the $1 interface.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="write" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_send_$1',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_netif_t:netif udp_send;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_udp_send_$1_depend',`
Chris PeBenito f2e4ab
	type $1_netif_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class netif udp_send;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_udp_receive_$1">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Receive UDP network traffic on the $1 interface.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="read" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_receive_$1',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_netif_t:netif udp_recv;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_udp_receive_$1_depend',`
Chris PeBenito f2e4ab
	type $1_netif_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class netif udp_recv;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenetwork_sendrecv_udp_on_$1_interface">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send and receive UDP network traffic on the $1 interface.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="both" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_sendrecv_$1',`
Chris PeBenito f2e4ab
	corenet_udp_send_$1(dollarsone)
Chris PeBenito f2e4ab
	corenet_udp_receive_$1(dollarsone)
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_raw_send_$1">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send raw IP packets on the $1 interface.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="write" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_raw_send_$1',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_netif_t:netif rawip_send;
Chris PeBenito f2e4ab
	allow dollarsone self:capability net_raw;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_raw_send_$1_depend',`
Chris PeBenito f2e4ab
	type $1_netif_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class netif rawip_send;
Chris PeBenito f2e4ab
	class capability net_raw;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_raw_receive_$1">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Receive raw IP packets on the $1 interface.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="read" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_raw_receive_$1',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_netif_t:netif rawip_recv;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_raw_receive_$1_depend',`
Chris PeBenito f2e4ab
	type $1_netif_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class netif rawip_recv;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_raw_sendrecv_$1">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send and receive raw IP packets on the $1 interface.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="both" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_raw_sendrecv_$1',`
Chris PeBenito f2e4ab
	corenet_raw_send_$1(dollarsone)
Chris PeBenito f2e4ab
	corenet_raw_receive_$1(dollarsone)
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
'') dnl end create_netif_interfaces
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
# Network node generated macros 
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`create_node_interfaces',``
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_tcp_sendrecv_$1_node">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send and receive TCP traffic on the $1 node.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="both" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_tcp_sendrecv_$1_node',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_node_t:node { tcp_send tcp_recv };
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_tcp_sendrecv_$1_node_depend',`
Chris PeBenito f2e4ab
	type $1_node_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class node { tcp_send tcp_recv };
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_udp_send_$1_node">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send UDP traffic on the $1 node.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="write" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_send_$1_node',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_node_t:node udp_send;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_udp_send_$1_node_depend',`
Chris PeBenito f2e4ab
	type $1_node_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class node udp_send;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_udp_receive_$1_node">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Receive UDP traffic on the $1 node.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="read" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_receive_$1_node',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_node_t:node udp_recv;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_udp_receive_$1_node_depend',`
Chris PeBenito f2e4ab
	type $1_node_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class node udp_recv;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_udp_sendrecv_$1_node">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send and receive UDP traffic on the $1 node.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="both" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_sendrecv_$1_node',`
Chris PeBenito f2e4ab
	corenet_udp_send_$1_node(dollarsone)
Chris PeBenito f2e4ab
	corenet_udp_receive_$1_node(dollarsone)
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_raw_send_$1_node">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send raw IP packets on the $1 node.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="write" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_raw_send_$1_node',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_node_t:node rawip_send;
Chris PeBenito f2e4ab
	allow dollarsone self:capability net_raw;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_raw_send_$1_node_depend',`
Chris PeBenito f2e4ab
	type $1_node_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class node rawip_send;
Chris PeBenito f2e4ab
	class capability net_raw;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_raw_receive_$1_node">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Receive raw IP packets on the $1 node.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="write" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_raw_receive_$1_node',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_node_t:node rawip_recv;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_raw_receive_$1_node_depend',`
Chris PeBenito f2e4ab
	type $1_node_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class node rawip_recv;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_raw_sendrecv_$1_node">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send and receive raw IP packets on the $1 node.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="both" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_raw_sendrecv_$1_node',`
Chris PeBenito f2e4ab
	corenet_raw_send_$1_node(dollarsone)
Chris PeBenito f2e4ab
	corenet_raw_receive_$1_node(dollarsone)
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_tcp_bind_$1_node">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Bind TCP sockets to node $1.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="none"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_tcp_bind_$1_node',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_node_t:tcp_socket node_bind;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_tcp_bind_$1_node_depend',`
Chris PeBenito f2e4ab
	type $1_node_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class tcp_socket node_bind;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_udp_bind_$1_node">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Bind UDP sockets to the $1 node.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="none"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_bind_$1_node',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_node_t:udp_socket node_bind;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_udp_bind_$1_node_depend',`
Chris PeBenito f2e4ab
	type $1_node_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class udp_socket node_bind;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
'') dnl end create_node_interfaces
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
# Network port generated macros 
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`create_port_interfaces',``
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_tcp_sendrecv_$1_port">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send and receive TCP traffic on the $1 port.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="both" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_tcp_sendrecv_$1_port',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_port_t:tcp_socket { send_msg recv_msg };
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_tcp_sendrecv_$1_port_depend',`
Chris PeBenito f2e4ab
	type $1_port_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class tcp_socket { send_msg recv_msg };
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_udp_send_$1_port">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send UDP traffic on the $1 port.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="write" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_send_$1_port',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_port_t:udp_socket send_msg;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_udp_send_$1_port_depend',`
Chris PeBenito f2e4ab
	type $1_port_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class udp_socket send_msg;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_udp_receive_$1_port">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Receive UDP traffic on the $1 port.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="read" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_receive_$1_port',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_port_t:udp_socket recv_msg;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_udp_receive_$1_port_depend',`
Chris PeBenito f2e4ab
	type $1_port_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class udp_socket recv_msg;
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenetwork_sendrecv_udp_on_$1_port">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Send and receive UDP traffic on the $1 port.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="both" weight="10"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_sendrecv_$1_port',`
Chris PeBenito f2e4ab
	corenet_udp_send_$1_port(dollarsone)
Chris PeBenito f2e4ab
	corenet_udp_receive_$1_port(dollarsone)
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_tcp_bind_$1_port">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Bind TCP sockets to the $1 port.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="none"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_tcp_bind_$1_port',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
	allow dollarsone $1_port_t:tcp_socket name_bind;
Chris PeBenito f2e4ab
	$2
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_tcp_bind_$1_port_depend',`
Chris PeBenito f2e4ab
	type $1_port_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class tcp_socket name_bind;
Chris PeBenito f2e4ab
	$3
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
########################################
Chris PeBenito f2e4ab
## <interface name="corenet_udp_bind_$1_port">
Chris PeBenito f2e4ab
##	<description>
Chris PeBenito f2e4ab
##		Bind UDP sockets to the $1 port.
Chris PeBenito f2e4ab
##	</description>
Chris PeBenito f2e4ab
##	<parameter name="domain">
Chris PeBenito f2e4ab
##		The type of the process performing this action.
Chris PeBenito f2e4ab
##	</parameter>
Chris PeBenito f2e4ab
##	<infoflow type="none"/>
Chris PeBenito f2e4ab
## </interface>
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`corenet_udp_bind_$1_port',`
Chris PeBenito c24ac9
	gen_require(`dollarszero'_depend)
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	allow dollarsone $1_port_t:udp_socket name_bind;
Chris PeBenito f2e4ab
	$2
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`corenet_udp_bind_$1_port_depend',`
Chris PeBenito f2e4ab
	type $1_port_t;
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
	class udp_socket name_bind;
Chris PeBenito f2e4ab
	$3
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
'') dnl end create_port_interfaces
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
# network_interface(linux_interfacename,mls_sensitivity)
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`network_interface',`
Chris PeBenito f2e4ab
create_netif_interfaces($1)
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
# network_node(node_name,mls_sensitivity,address,netmask)
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`network_node',`
Chris PeBenito f2e4ab
create_node_interfaces($1)
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
# These next three macros have formatting, and should not me indented
Chris PeBenito f2e4ab
define(`determine_reserved_capability',`dnl
Chris PeBenito f2e4ab
ifelse(eval($2 < 1024),1,``allow' dollarsone self:capability net_bind_service;',`dnl
Chris PeBenito f2e4ab
ifelse($4,`',`',`determine_reserved_capability(shiftn(3,$*))')dnl end inner ifelse
Chris PeBenito f2e4ab
')dnl end outer ifelse
Chris PeBenito f2e4ab
') dnl end determine reserved capability
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`determine_reserved_capability_depend',`dnl
Chris PeBenito f2e4ab
ifelse(eval($2 < 1024),1,`class capability net_bind_service;',`dnl
Chris PeBenito f2e4ab
ifelse($4,`',`',`determine_reserved_capability_depend(shiftn(3,$*))')dnl end inner ifelse
Chris PeBenito f2e4ab
')dnl end outer ifelse
Chris PeBenito f2e4ab
') dnl end determine reserved capability depend
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
define(`declare_ports',`dnl
Chris PeBenito f2e4ab
ifelse(eval($3 < 1024),1,`typeattribute $1 reserved_port_type;',`dnl')
Chris PeBenito f2e4ab
portcon $2 $3 context_template(system_u:object_r:$1,$4)
Chris PeBenito f2e4ab
ifelse(`$5',`',`',`declare_ports($1,shiftn(4,$*))')dnl
Chris PeBenito f2e4ab
')
Chris PeBenito f2e4ab
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
# network_port(port_name,protocol portnum mls_sensitivity [,protocol portnum mls_sensitivity[,...]])
Chris PeBenito f2e4ab
#
Chris PeBenito f2e4ab
define(`network_port',`
Chris PeBenito f2e4ab
create_port_interfaces($1,determine_reserved_capability(shift($*)),determine_reserved_capability_depend(shift($*)))
Chris PeBenito f2e4ab
')