|
Chris PeBenito |
ca83af |
########################################
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
# Macros for switching between source policy
|
|
Chris PeBenito |
ca83af |
# and loadable policy module support
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
|
|
Chris PeBenito |
ca83af |
##############################
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
# For adding the module statement
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
define(`policy_module',`
|
|
Chris PeBenito |
ca83af |
ifdef(`monolithic_policy',`',`
|
|
Chris PeBenito |
ca83af |
module $1 $2;
|
|
Chris PeBenito |
ca83af |
')
|
|
Chris PeBenito |
ca83af |
')
|
|
Chris PeBenito |
ca83af |
|
|
Chris PeBenito |
ca83af |
##############################
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
# For use in interfaces, to optionally insert a requires block
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
define(`requires_block_template',`
|
|
Chris PeBenito |
ca83af |
ifdef(`monolithic_policy',`',`
|
|
Chris PeBenito |
ca83af |
require {
|
|
Chris PeBenito |
ca83af |
$1
|
|
Chris PeBenito |
ca83af |
}
|
|
Chris PeBenito |
ca83af |
') dnl end ifdef monolithic_policy
|
|
Chris PeBenito |
ca83af |
') dnl end requires_block_template
|
|
Chris PeBenito |
ca83af |
|
|
Chris PeBenito |
ca83af |
##############################
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
# Optional policy handling
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
define(`optional_policy',`
|
|
Chris PeBenito |
ca83af |
ifdef(`monolithic_policy',`
|
|
Chris PeBenito |
ca83af |
ifdef(`$1',$2,$3)
|
|
Chris PeBenito |
ca83af |
',`
|
|
Chris PeBenito |
ca83af |
optional {
|
|
Chris PeBenito |
ca83af |
$2
|
|
Chris PeBenito |
ca83af |
} else {
|
|
Chris PeBenito |
ca83af |
$3
|
|
Chris PeBenito |
ca83af |
}
|
|
Chris PeBenito |
ca83af |
') dnl end ifdef monolithic_policy
|
|
Chris PeBenito |
ca83af |
') dnl end optional_policy
|
|
Chris PeBenito |
ca83af |
|
|
Chris PeBenito |
ca83af |
##############################
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
# Tunable policy handling
|
|
Chris PeBenito |
ca83af |
#
|
|
Chris PeBenito |
ca83af |
define(`tunable_policy',`
|
|
Chris PeBenito |
ca83af |
ifdef(`monolithic_policy',`
|
|
Chris PeBenito |
ca83af |
ifdef(`$1',$2,$3)
|
|
Chris PeBenito |
ca83af |
',`
|
|
Chris PeBenito |
ca83af |
optional {
|
|
Chris PeBenito |
ca83af |
require { $1 }
|
|
Chris PeBenito |
ca83af |
$2
|
|
Chris PeBenito |
ca83af |
} else {
|
|
Chris PeBenito |
ca83af |
$3
|
|
Chris PeBenito |
ca83af |
}
|
|
Chris PeBenito |
ca83af |
') dnl end ifdef monolithic_policy
|
|
Chris PeBenito |
ca83af |
') dnl end tunable_policy
|