Next: , Previous: Initialization, Up: Variables Overview



5.1.5 Attributes

When defining a variable, you can optionally specify a set of attributes associated with the variable, which specify additional properties associated with it. Attributes have two forms:

& attr
for attributes that are specified simply using their name, and
& attr = expr
for attributes that have a value associated with them.

The attributes &redef &add_func and &delete_func, pertain to redefining variables; they are discussed in Refinement.

The attributes &default, &create_expire, &read_expire, &write_expire, and &expire_func are for use with table's and set's. See XXX for discussion.

The attribute &optional specifies that a record field is optional. See for discussion.

Finall, to specify multiple attributes, you do not separate them with commas (doing so would actually make Bro's grammar ambiguous), but just list them one after another. For example:

         global a: table[port] of string &redef &default="missing";