Download CROCODILE User Manual

Transcript
Framework Architecture and Internal Operation
To make the evaluation run finish without error, the user must refine the objectionable pattern such that a unique interpretation results. In the given case, the
following refinement might be useful:
enable secret [level NUM] !level STRING
In this version, the optional part '[level NUM]' may be omitted only if the
remainder of the text line does not start with the keyword 'level'. This solves the
ambiguity problem. A foolproof solution, though probably unnecessarily
complex in this example, would be
enable secret [level NUM] !{level NUM} STRING
This version has the advantage of being derivable in a schematic way from the
objectionable pattern without much thinking.7
Macros
Some IOS configuration clauses are very complex and varying. Consequently, the
corresponding pattern becomes rather lengthy. In order to specify even complex
text patterns as clearly as possible, macros may be used. A macro is a pair
(<macro name>, <macro pattern>) with the macro name consisting of capital
letters, digits, and underscore characters, with the initial character not being a
digit (see Table 1). After its definition, a macro may be used like an atom.
Whenever a pattern specification '… <macro name> …' is used, the pattern
{<macro pattern>} is silently substituted in this place. Note that every non-atomic
macro pattern is surrounded with braces before the substitution. This ensures
that the substitution is really processed as an atomic unit and cannot cause
confusion within compounds. An example for a macro is
SUBNET => "{ IPADDR IPMASK | any | host IPADDR }"
This macro might be used in a comprehensive pattern in order to simplify its
formulation. For example, the macro use
deny ip SUBNET SUBNET
is equivalent to the explicit pattern
deny ip {IPADDR IPMASK|any|host IPADDR}{IPADDR IPMASK|any|host IPADDR}.
7
Copyright © Fraunhofer IESE 2008
Note that 'enable secret [level NUM] ![level NUM] STRING' would not work: The negation of an
optional pattern — here: '![level NUM]' — will never match, because the optional part '[…]' will
always match at least the empty string.
23