2005-06-02 14:31:31 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Macros for switching between source policy
|
|
|
|
# and loadable policy module support
|
|
|
|
#
|
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# For adding the module statement
|
|
|
|
#
|
|
|
|
define(`policy_module',`
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`monolithic_policy',`',`
|
|
|
|
module $1 $2;
|
|
|
|
')
|
2005-06-02 14:31:31 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# For use in interfaces, to optionally insert a requires block
|
|
|
|
#
|
|
|
|
define(`requires_block_template',`
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`monolithic_policy',`',`
|
|
|
|
require {
|
|
|
|
$1
|
|
|
|
}
|
|
|
|
')
|
|
|
|
')
|
2005-06-02 14:31:31 +00:00
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Optional policy handling
|
|
|
|
#
|
|
|
|
define(`optional_policy',`
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`monolithic_policy',`
|
|
|
|
ifdef(`$1',$2,$3)
|
|
|
|
',`
|
|
|
|
optional {
|
|
|
|
$2
|
|
|
|
} else {
|
|
|
|
$3
|
|
|
|
}
|
|
|
|
')
|
|
|
|
')
|
2005-06-02 14:31:31 +00:00
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Tunable policy handling
|
|
|
|
#
|
|
|
|
define(`tunable_policy',`
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`monolithic_policy',`
|
|
|
|
if (`$1') {
|
|
|
|
$2
|
|
|
|
} else {
|
|
|
|
$3
|
|
|
|
}
|
|
|
|
',`
|
|
|
|
optional {
|
|
|
|
require { `$1' }
|
|
|
|
$2
|
|
|
|
} else {
|
|
|
|
$3
|
|
|
|
}
|
|
|
|
')
|
|
|
|
')
|