Cisco Cisco Broadband Access Center for Cable 4.1

Page of 267
 
8-7
Cisco Broadband Access Center for Cable Administrator’s Guide
OL-2445-02
Chapter 8      Broadband Access Center for Cable Support Tools and Advanced Concepts
Developing Template Files
${var-name}—This syntax is a straight substitution. If the variable is not found, the parser will 
generate an error.
${var-name, ignore}—This syntax lets the template parser ignore this option if the variable value is 
not found in the properties hierarchy.
${var-name, default-value}—This syntax provides a default value if the variable is not found in the 
properties hierarchy.
Examples 
 illustrate both correct and incorrect usage of option 11.
Example 8-10 Correct Macro Variables Usage
# Valid, using macro variable for max CPE's, straight substitution
option 18 ${MAX_CPES}
# Valid, using macro variable for max CPE's, ignore option if variable not found
# option 18 will not be defined in the DOCSIS configuration file if MAX_CPES
# is not found in the properties hierarchy
option 18 ${MAX_CPES, ignore}
# Valid, using macro variable for max CPE's with a default value
option 18 ${MAX_CPES, 1}
# Valid, using macro variable for vendor option
option 43.200 hex ${MACRO_VAR_HEX}
# Valid, using macro variable for vendor option
option 43.201 ascii ${MACRO_VAR_ASCII}
# Valid, using macro variable for vendor option
option 43.202 ip ${MACRO_VAR_IP}
# Valid, using macro variable in double quotes
option 18 "${MAX_CPES}"
# Valid, using macro variable within a value
option 43.131 ascii "hostname ${HOSTNAME}"
# Valid, using macro variables in multi-valued options
option 11 ${ACCESS_CONTROL_MIB, 
.mib-2.docsDev.docsDevMIBObjects.docsDevNmAccessTable.docsDevNmAccessEntry.docsDevNmAccess
Control.1}, Integer, ${ACCESS_CONTROL_VAL, 3}
# Valid, using macro variable in an include statement
include "${EXTRA_TEMPLATE}"
# Valid, using macro variable in an include statement with a default value
include "${EXTRA_TEMPLATE, modem_reset.tmpl}"
# Valid, using macro variable in an include statement with a default value
include "${EXTRA_TEMPLATE, modem_reset}.tmpl"
# Valid, using macro variable in an include statement with an ignore clause
include "${MY_TEMPLATE, ignore}"
Example 8-11 Incorrect Macro Variables Usage
# Invalid, using macro variable as the option number
option ${MAX_CPES} 1
# Invalid, using macro variable with space in name
option 18 ${MAX CPES}