Context
Variables
|
bcast-addr
|
Derived from
the broadcast address in the subnet, such as 192.168.50.255. Use in any
expression field.
|
first-addr
|
Derived from
the first address in the subnet, such as the first address in 192.168.50.64/26
is 192.168.50.65. Use in any expression field.
|
last-addr
|
Derived from
the last address in the subnet, such as the last address in 192.168.50.64/26 is
192.168.50.127. Use in any expression field.
|
mask-addr
|
Derived from
the network mask address in the subnet, such as 255.255.255.0. Use in any
expression field.
|
mask-count
|
Derived from
the number of bits in the network address of the subnet, such as 24. Use in the
Scope Name Expression or Embedded Policy Option Expression field.
|
naddrs
|
Derived from
the number of IP addresses in the subnet, such as 255. Use in the Scope Name
Expression field.
|
nhosts
|
Derived number
of usable hosts in the subnet, such as 254. Use in any expression field.
|
subnet
|
Derived from
the IP address and mask of the subnet, such as 192.168.50.0/24. Use in the
Scope Name Expression or Embedded Policy Option Expression field.
|
subnet-addr
|
Derived from
the subnet address, such as 192.168.50.0. Use in any expression field.
|
template .attribute
|
Attribute of
the scope template, such as template.ping-timeout. Use in the Embedded Policy
Option Expression field.
Note
|
The
attribute must be explicitly set. Otherwise, the expression will fail to
evaluate.
|
|
this .attribute
|
Attribute of
the scope.
Note
|
The
attribute must be explicitly set. Otherwise, the expression will fail to
evaluate.
|
|
Arithmetic
Operations (unsigned integer arguments only)
|
(+
arg1
arg2)
|
Adds the two
argument values, such as (+ 2 3).
|
(–
arg1
arg2)
|
Subtracts
the second argument value from the first one, such as with
ping-timeout defined as 100, (– template.ping-timeout 10)
yields 90.
|
(*
arg1
arg2)
|
Multiplies
the values of two arguments.
|
(/
arg1 arg2)
|
Divides the
value of the first argument by that of the second one (which cannot be zero).
|
Concatenation
Operation
|
(concat
arg1 ...
argn)
|
Concatenates the arguments into a string, to be used in the Scope Name
Expression field. Examples: With subnet=192.168.50.0/24 and
template.ping-timeout=100:
(concat "ISP-" subnet)
--> ISP-192.168.50.0/24
(concat subnet "-" (+ template.ping-timeout 10))
--> 192.168.50.0/24-110
(concat "ISP-" subnet "-" (+ template.ping-timeout 10))
--> ISP-192.168.50.0/24-110
See also
Scope Name Expression Example.
|
Create
Option
Operation
|
(create-option
opt
val)
|
Use
create-option in the Embedded Policy Option Expression field to create new DHCP
options for the scope. The first argument can be an integer or string to
represent the option number or name. The second argument can be a string or
blob to give the option a value.
You can
also specify custom defined and unknown options. For undefined options, the
option number must be specified and the data is used as is (as blob data). If
the data is a string, the string is used as is and if the data is a number or
address, it is used as is.
Examples:
(list (create-option "domain-name" "example.com")
(create-option 3 "10.10.10.1"))
(create-option "routers" "10.10.10.1,10.10.10.2,10.10.10.3")
(create-option "routers" (create-ipaddr subnet 10))
See also Embedded Policy Option Expression Example.
|
Create
Vendor
Option
Operation
|
(create-vendor-option
set-name
opt val)
|
Use the
create-vendor-option in the Embedded Policy Option Expression field to creates
a DHCP vendor option. The set-name specifies the option definition set for the
vendor option. The opt can be the literal string or integer identifying the
vendor option in the set. The val is representation of the option value.
Examples:
(list (create-option "routers" (create-ipaddr subnet 1))
(create-vendor-option "dhcp-cablelabs-config" 125
(concat "(tftp-servers 2 " (create-ipaddr subnet 2)")")))
|
Create
Range
Operation
|
(create-range
start
end)
|
Use this operation in the Range Expression field. It creates an IP address range for the scope. The first argument is the
start of the address range and can be an integer or IP address string. The second argument is the end of the range and can
be an integer or IP address string. Do not include the local host or broadcast address determined by the mask (such as 0 and
255 for /24 subnets) in the range. Validation ensures that the range must be in the subnet defined by the template and that
the first argument value must be lower than the second. An integer value determines the position of the address in the given
subnet.
Examples (with subnet=192.168.50.0/26):
(create-range "192.168.50.65" "192.168.50.74")
--> 192.168.50.65 - 192.168.50.74
(create-range 1 10)
--> 192.168.50.65 - 192.168.50.74
See also
Range Expression Example.
|
Create
IP
Operation
|
(create-ipaddr
net
host)
|
Use this operation in the Embedded Policy Option Expression or Range Expression fields. It creates an IP address string.
The net argument is a string or variable. The host argument is an integer.
Example:
(create-ipaddr subnet 4)
|
List
Operation
|
(list
oper1 ...
opern)
|
Arguments must all be create-option or create-range operations. Nesting is not supported.
Examples:
(list (create-option "routers" "10.10.10.1")
(create-option "domain-name" "example.com"))
(list (create-range 1 5) (create-range 10 20))
|