2005-10-21 13:11:17 +00:00
|
|
|
#
|
|
|
|
# shiftn(num,list...)
|
|
|
|
#
|
|
|
|
# shift the list num times
|
|
|
|
#
|
|
|
|
define(`shiftn',`ifelse($1,0,`shift($*)',`shiftn(decr($1),shift(shift($*)))')')
|
|
|
|
|
2005-06-08 21:46:39 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Network Interface generated macros
|
|
|
|
#
|
|
|
|
########################################
|
|
|
|
|
|
|
|
define(`create_netif_interfaces',``
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send and receive TCP network traffic on the $1 interface.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="both" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_tcp_sendrecv_$1',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_netif_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_netif_t:netif { tcp_send tcp_recv };
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send UDP network traffic on the $1 interface.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="write" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_send_$1',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_netif_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_netif_t:netif udp_send;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Receive UDP network traffic on the $1 interface.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="read" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_receive_$1',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_netif_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_netif_t:netif udp_recv;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send and receive UDP network traffic on the $1 interface.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="both" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_sendrecv_$1',`
|
2005-06-08 21:46:39 +00:00
|
|
|
corenet_udp_send_$1(dollarsone)
|
|
|
|
corenet_udp_receive_$1(dollarsone)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send raw IP packets on the $1 interface.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="write" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_raw_send_$1',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_netif_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_netif_t:netif rawip_send;
|
2005-09-23 15:37:41 +00:00
|
|
|
|
|
|
|
# cjp: comment out until raw access is
|
|
|
|
# is fixed for network users
|
|
|
|
#allow dollarsone self:capability net_raw;
|
2005-06-08 21:46:39 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Receive raw IP packets on the $1 interface.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="read" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_raw_receive_$1',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_netif_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_netif_t:netif rawip_recv;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send and receive raw IP packets on the $1 interface.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="both" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_raw_sendrecv_$1',`
|
2005-06-08 21:46:39 +00:00
|
|
|
corenet_raw_send_$1(dollarsone)
|
|
|
|
corenet_raw_receive_$1(dollarsone)
|
|
|
|
')
|
|
|
|
'') dnl end create_netif_interfaces
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Network node generated macros
|
|
|
|
#
|
|
|
|
########################################
|
|
|
|
|
|
|
|
define(`create_node_interfaces',``
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send and receive TCP traffic on the $1 node.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="both" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_tcp_sendrecv_$1_node',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_node_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_node_t:node { tcp_send tcp_recv };
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send UDP traffic on the $1 node.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="write" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_send_$1_node',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_node_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_node_t:node udp_send;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Receive UDP traffic on the $1 node.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="read" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_receive_$1_node',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_node_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_node_t:node udp_recv;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send and receive UDP traffic on the $1 node.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="both" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_sendrecv_$1_node',`
|
2005-06-08 21:46:39 +00:00
|
|
|
corenet_udp_send_$1_node(dollarsone)
|
|
|
|
corenet_udp_receive_$1_node(dollarsone)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send raw IP packets on the $1 node.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="write" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_raw_send_$1_node',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_node_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_node_t:node rawip_send;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Receive raw IP packets on the $1 node.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="write" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_raw_receive_$1_node',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_node_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_node_t:node rawip_recv;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send and receive raw IP packets on the $1 node.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="both" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_raw_sendrecv_$1_node',`
|
2005-06-08 21:46:39 +00:00
|
|
|
corenet_raw_send_$1_node(dollarsone)
|
|
|
|
corenet_raw_receive_$1_node(dollarsone)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Bind TCP sockets to node $1.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="none"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_tcp_bind_$1_node',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_node_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_node_t:tcp_socket node_bind;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Bind UDP sockets to the $1 node.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="none"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_bind_$1_node',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_node_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_node_t:udp_socket node_bind;
|
|
|
|
')
|
|
|
|
'') dnl end create_node_interfaces
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Network port generated macros
|
|
|
|
#
|
|
|
|
########################################
|
|
|
|
|
|
|
|
define(`create_port_interfaces',``
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send and receive TCP traffic on the $1 port.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="both" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_tcp_sendrecv_$1_port',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_port_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_port_t:tcp_socket { send_msg recv_msg };
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send UDP traffic on the $1 port.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="write" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_send_$1_port',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_port_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_port_t:udp_socket send_msg;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Receive UDP traffic on the $1 port.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="read" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_receive_$1_port',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_port_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_port_t:udp_socket recv_msg;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Send and receive UDP traffic on the $1 port.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="both" weight="10"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_sendrecv_$1_port',`
|
2005-06-08 21:46:39 +00:00
|
|
|
corenet_udp_send_$1_port(dollarsone)
|
|
|
|
corenet_udp_receive_$1_port(dollarsone)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Bind TCP sockets to the $1 port.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="none"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_tcp_bind_$1_port',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_port_t;
|
|
|
|
')
|
2005-07-22 15:38:01 +00:00
|
|
|
|
2005-06-08 21:46:39 +00:00
|
|
|
allow dollarsone $1_port_t:tcp_socket name_bind;
|
|
|
|
$2
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-22 15:38:01 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Bind UDP sockets to the $1 port.
|
2005-07-22 15:38:01 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <infoflow type="none"/>
|
2005-06-08 21:46:39 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`corenet_udp_bind_$1_port',`
|
2005-06-17 18:59:34 +00:00
|
|
|
gen_require(`
|
|
|
|
type $1_port_t;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
|
|
|
|
allow dollarsone $1_port_t:udp_socket name_bind;
|
|
|
|
$2
|
|
|
|
')
|
2005-07-22 15:38:01 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Make a TCP connection to the $1 port.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`corenet_tcp_connect_$1_port',`
|
|
|
|
gen_require(`
|
|
|
|
type $1_port_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow dollarsone $1_port_t:tcp_socket name_connect;
|
|
|
|
')
|
2005-06-08 21:46:39 +00:00
|
|
|
'') dnl end create_port_interfaces
|
|
|
|
|
|
|
|
#
|
|
|
|
# network_interface(linux_interfacename,mls_sensitivity)
|
|
|
|
#
|
|
|
|
define(`network_interface',`
|
|
|
|
create_netif_interfaces($1)
|
|
|
|
')
|
|
|
|
|
|
|
|
#
|
|
|
|
# network_node(node_name,mls_sensitivity,address,netmask)
|
|
|
|
#
|
|
|
|
define(`network_node',`
|
|
|
|
create_node_interfaces($1)
|
|
|
|
')
|
|
|
|
|
|
|
|
# These next three macros have formatting, and should not me indented
|
|
|
|
define(`determine_reserved_capability',`dnl
|
|
|
|
ifelse(eval($2 < 1024),1,``allow' dollarsone self:capability net_bind_service;',`dnl
|
|
|
|
ifelse($4,`',`',`determine_reserved_capability(shiftn(3,$*))')dnl end inner ifelse
|
|
|
|
')dnl end outer ifelse
|
|
|
|
') dnl end determine reserved capability
|
|
|
|
|
|
|
|
define(`declare_ports',`dnl
|
|
|
|
ifelse(eval($3 < 1024),1,`typeattribute $1 reserved_port_type;',`dnl')
|
2005-10-06 19:33:06 +00:00
|
|
|
portcon $2 $3 gen_context(system_u:object_r:$1,$4)
|
2005-06-08 21:46:39 +00:00
|
|
|
ifelse(`$5',`',`',`declare_ports($1,shiftn(4,$*))')dnl
|
|
|
|
')
|
|
|
|
|
|
|
|
#
|
|
|
|
# network_port(port_name,protocol portnum mls_sensitivity [,protocol portnum mls_sensitivity[,...]])
|
|
|
|
#
|
|
|
|
define(`network_port',`
|
2005-09-23 15:37:41 +00:00
|
|
|
create_port_interfaces($1,determine_reserved_capability(shift($*)))
|
2005-06-08 21:46:39 +00:00
|
|
|
')
|