Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_send_tcp_on_general_interface(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_send_tcp_on_general_interface',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_send_tcp_on_general_interface_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_t:netif tcp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_send_tcp_on_general_interface_depend',`
Chris PeBenito b4cd15
type netif_t;
Chris PeBenito b4cd15
class netif tcp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_send_udp_on_general_interface(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_send_udp_on_general_interface',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_send_udp_on_general_interface_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_t:netif udp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_send_udp_on_general_interface_depend',`
Chris PeBenito b4cd15
type netif_t;
Chris PeBenito b4cd15
class netif udp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_send_raw_on_general_interface(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_send_raw_on_general_interface',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_send_raw_on_general_interface_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_t:netif rawip_send;
Chris PeBenito b4cd15
allow $1 self:capability net_raw;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_send_raw_on_general_interface_depend',`
Chris PeBenito b4cd15
type netif_t;
Chris PeBenito b4cd15
class netif rawip_send;
Chris PeBenito b4cd15
class capability net_raw;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_receive_tcp_on_general_interface(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_receive_tcp_on_general_interface',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_receive_tcp_on_general_interface_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_t:netif tcp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_receive_tcp_on_general_interface_depend',`
Chris PeBenito b4cd15
type netif_t;
Chris PeBenito b4cd15
class netif tcp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_receive_udp_on_general_interface(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_receive_udp_on_general_interface',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_receive_udp_on_general_interface_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_t:netif udp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_receive_udp_on_general_interface_depend',`
Chris PeBenito b4cd15
type netif_t;
Chris PeBenito b4cd15
class netif udp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_receive_raw_on_general_interface(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_receive_raw_on_general_interface',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_receive_raw_on_general_interface_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_t:netif rawip_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_receive_raw_on_general_interface_depend',`
Chris PeBenito b4cd15
type netif_t;
Chris PeBenito b4cd15
class netif rawip_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_send_tcp_on_all_interfaces(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_send_tcp_on_all_interfaces',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_send_tcp_on_all_interfaces_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_type:netif tcp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_send_tcp_on_all_interfaces_depend',`
Chris PeBenito b4cd15
attribute all_netif_type;
Chris PeBenito b4cd15
class netif tcp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_send_udp_on_all_interfaces(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_send_udp_on_all_interfaces',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_send_udp_on_all_interfaces_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_type:netif udp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_send_udp_on_all_interfaces_depend',`
Chris PeBenito b4cd15
attribute netif_type;
Chris PeBenito b4cd15
class netif udp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_send_raw_on_all_interfaces(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_send_raw_on_all_interfaces',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_send_raw_on_all_interfaces_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_type:netif rawip_send;
Chris PeBenito b4cd15
allow $1 self:capability net_raw;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_send_raw_on_all_interfaces_depend',`
Chris PeBenito b4cd15
attribute netif_type;
Chris PeBenito b4cd15
class netif rawip_send;
Chris PeBenito b4cd15
class capability net_raw;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_receive_tcp_on_all_interfaces(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_receive_tcp_on_all_interfaces',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_receive_tcp_on_all_interfaces_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_type:netif tcp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_receive_tcp_on_all_interfaces_depend',`
Chris PeBenito b4cd15
attribute netif_type;
Chris PeBenito b4cd15
class netif tcp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_receive_udp_on_all_interfaces(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_receive_udp_on_all_interfaces',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_receive_udp_on_all_interfaces_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_type:netif udp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_receive_udp_on_all_interfaces_depend',`
Chris PeBenito b4cd15
attribute netif_type;
Chris PeBenito b4cd15
class netif udp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_receive_raw_on_all_interfaces(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_receive_raw_on_all_interfaces',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_receive_raw_on_all_interfaces_depend',$2)
Chris PeBenito b4cd15
allow $1 netif_type:netif rawip_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_receive_raw_on_all_interfaces_depend',`
Chris PeBenito b4cd15
attribute netif_type;
Chris PeBenito b4cd15
class netif rawip_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# This section is processed through m4 to create real interfaces
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
Chris PeBenito b4cd15
# dont generate anything but macros on this pass
Chris PeBenito b4cd15
ifdef(`interface_pass',`
Chris PeBenito b4cd15
define(`allow',`dnl')
Chris PeBenito b4cd15
define(`type',`dnl')
Chris PeBenito b4cd15
define(`attribute',`dnl')
Chris PeBenito b4cd15
define(`portcon',`dnl')
Chris PeBenito b4cd15
define(`devices_make_device_node',`dnl')
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`create_netif_interfaces',``
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_send_tcp_on_interface_$1(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_send_tcp_on_interface_$1',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_send_tcp_on_interface_$1_depend',dollarstwo)
Chris PeBenito b4cd15
allow dollarsone $1_netif_t:netif tcp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_send_tcp_on_interface_$1_depend',`
Chris PeBenito b4cd15
type $1_netif_t;
Chris PeBenito b4cd15
class netif tcp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_send_udp_on_interface_$1(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_send_udp_on_interface_$1',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_send_udp_on_interface_$1_depend',dollarstwo)
Chris PeBenito b4cd15
allow dollarsone $1_netif_t:netif udp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_send_udp_on_interface_$1_depend',`
Chris PeBenito b4cd15
type $1_netif_t;
Chris PeBenito b4cd15
class netif udp_send;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_send_raw_on_interface_$1(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_send_raw_on_interface_$1',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_send_raw_on_interface_$1_depend',dollarstwo)
Chris PeBenito b4cd15
allow dollarsone $1_netif_t:netif rawip_send;
Chris PeBenito b4cd15
allow dollarsone self:capability net_raw;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_send_raw_on_interface_$1_depend',`
Chris PeBenito b4cd15
type $1_netif_t;
Chris PeBenito b4cd15
class netif rawip_send;
Chris PeBenito b4cd15
class capability net_raw;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_receive_tcp_on_interface_$1(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_receive_tcp_on_interface_$1',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_receive_tcp_on_interface_$1_depend',dollarstwo)
Chris PeBenito b4cd15
allow dollarsone $1_netif_t:netif tcp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_receive_tcp_on_interface_$1_depend',`
Chris PeBenito b4cd15
type $1_netif_t;
Chris PeBenito b4cd15
class netif tcp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_receive_udp_on_interface_$1(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_receive_udp_on_interface_$1',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_receive_udp_on_interface_$1_depend',dollarstwo)
Chris PeBenito b4cd15
allow dollarsone $1_netif_t:netif udp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_receive_udp_on_interface_$1_depend',`
Chris PeBenito b4cd15
type $1_netif_t;
Chris PeBenito b4cd15
class netif udp_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# corenetwork_receive_raw_on_interface_$1(domain,[`optional'])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`corenetwork_receive_raw_on_interface_$1',`
Chris PeBenito b4cd15
requires_block_template(`corenetwork_receive_raw_on_interface_$1_depend',dollarstwo)
Chris PeBenito b4cd15
allow dollarsone $1_netif_t:netif rawip_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`corenetwork_receive_raw_on_interface_$1_depend',`
Chris PeBenito b4cd15
type $1_netif_t;
Chris PeBenito b4cd15
class netif rawip_recv;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
'') dnl end create_interfaces
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# network_interface(linux_interfacename)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`network_interface',`
Chris PeBenito b4cd15
ifdef(`interface_pass',`
Chris PeBenito b4cd15
create_netif_interfaces($1)
Chris PeBenito b4cd15
',`
Chris PeBenito b4cd15
type $1_netif_t alias netif_$1_t, netif_type;
Chris PeBenito b4cd15
requires_block_template(`type unlabeled_t')
Chris PeBenito b4cd15
netifcon $1 system_u:object_r:$1_netif_t system_u:object_r:unlabeled_t
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# network_node(node_name,address,netmask)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`network_node',`
Chris PeBenito b4cd15
ifdef(`interface_pass',`
Chris PeBenito b4cd15
#create_node_interfaces($1)
Chris PeBenito b4cd15
',`
Chris PeBenito b4cd15
type $1_node_t alias node_$1_t, node_type;
Chris PeBenito b4cd15
nodecon $2 $3 system_u:object_r:$1_node_t
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`declare_ports',`dnl
Chris PeBenito b4cd15
ifelse(eval($3 < 1024),1,`typeattribute $1 reserved_port_type;',`dnl')
Chris PeBenito b4cd15
portcon $2 $3 system_u:object_r:$1
Chris PeBenito b4cd15
ifelse(`$4',`',`',`declare_ports($1,shiftn(3,$*))')dnl
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# network_port(port_name,protocol portnum [,protocol portnum[,...]])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`network_port',`
Chris PeBenito b4cd15
ifdef(`interface_pass',`
Chris PeBenito b4cd15
#create_port_interfaces($1)
Chris PeBenito b4cd15
',`
Chris PeBenito b4cd15
type $1_port_t, port_type;
Chris PeBenito b4cd15
declare_ports($1_port_t,shift($*))
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
')