defines.cfg
The define config file specifies a set of logical "defines"--preprocessor conditional switches for including or excluding sections of the configuration files. You use these defines together with the '#ifdef <define>' preprocessor directive to customize your PIKT configurations according to certain conditions--those you specify directly, or conditions based on the current system or network state.
A define stanza takes the form
<define> TRUE|true|YES|yes|ON|on|1|FALSE|false|NO|no|OFF|off|0| [<proc>]where the TRUE, FALSE, etc. can follow on the same line or on a subsequent indented line.
You may also set a define according to the exit status (TRUE or FALSE) of any process, for example
dst // TRUE if Daylight Savings Time now applies, FALSE otherwise // at our site, `date +%Z` returns "CDT" if DST is in effect, // "CST" otherwise; use your own time zone string as needed [test `date +%Z` = "CDT"]Observe that you can set/unset defines on a per-machine basis in the defines.cfg file, for example
#if dbserver paranoid TRUE #else paranoid FALSE #endifOr, alternatively and equivalently,
paranoid #if dbserver TRUE #else FALSE #endifYou may use #ifdef, #ifndef, and #setdef in defines.cfg just so long as the referenced define is specified earlier in defines.cfg. For example, you may do this:
attentive TRUE // the lowest security level cautious // the second security level # if misscritsys | cssys TRUE # else FALSE # endif worried // the third security level #if misscritsys TRUE #else FALSE #endif paranoid FALSE // the fourth, and highest, security level #ifdef cautious # setdef attentive = TRUE // or: #define attentive #endifdef #ifdef worried # setdef attentive = TRUE # setdef cautious = TRUE #endifdef #ifdef paranoid # setdef attentive = TRUE # setdef cautious = TRUE # setdef worried = TRUE #endifdefThis code ensures that if you are in a certain security state, all lower security levels are also set to TRUE. (If you are paranoid, you are guaranteed also worried, cautious, and attentive.)
Refer to the sample defines.cfg for examples.
![]() | 1st page | next page ![]() |