diff options
author | Bob Gilligan <gilligan@sydney.vyatta.com> | 2007-12-14 18:26:36 -0800 |
---|---|---|
committer | Bob Gilligan <gilligan@sydney.vyatta.com> | 2007-12-14 18:26:36 -0800 |
commit | 543de3ad1e144d0ab8f31a47bee8b21bb1fae264 (patch) | |
tree | 6d3b8ec7df301c01c1a0e9b203a0ce50ea03064d /README | |
download | vyatta-op-firewall-543de3ad1e144d0ab8f31a47bee8b21bb1fae264.tar.gz vyatta-op-firewall-543de3ad1e144d0ab8f31a47bee8b21bb1fae264.zip |
Initial commit of operational mode templates and scripts for the
firewall subsystem.
Diffstat (limited to 'README')
-rw-r--r-- | README | 48 |
1 files changed, 48 insertions, 0 deletions
@@ -0,0 +1,48 @@ +This package has the Vyatta operational command completion script and +base template tree. The default root of this tree is: + /opt/vyatta/share/vyatta-op/templates + +Each directory within this tree is a respective command line argument; +for example, the .../templates/show/interfaces/ethernet directory +completes the command line "show interfaces ethernet". Thus, the +directory name is generally equivalent to the command or argument +name. The only exception are directories named "node.tag"; these +represent dynamic or variable command arguments. For example, +.../templates/show/interfaces/ethernet/node.tag completes the active +system interfaces like "show interfaces ethernet eth0". + +Every template directory must have one and only one file named +"node.def". This file defines the node help string and run command, +like .../templates/show/interfaces/node.def: + +help: "Show network interface information" +run: ${vyatta_bindir}/vyatta-show-interfaces + +Notes: + - field tags (i.e. help and run) must be at the start of line + - try to limit help strings to 64 characters + - run commands may span multiple lines but subsequent lines must + not begin with "WORD:" + +The run command is an evaluated shell expression that may contain the +positional command line argument variables (i.e. $1, $*, $@). +However, since the command itself, is evaluated through an aliased +function, $1 is the command name rather than the usual $0. So, the +command "show interfaces ethernet eth0" would evaluate the respective +run command with $4 == eth0. + +The variable argument .../node.tag/node.def files may also define an +"allowed" field. This is a misnomer since it's really used to produce +a list of possible completions rather than what is allowed during +execution. The fields contents are evaluated shell expression that +outputs (stdout) the list of possible completion values; like +.../templates/show/interfaces/ethernet/node.tag/node.def: + +help: "Show given ethernet interface information" +allowed: local -a array=( /sys/class/net/{eth,vmnet}* ) ; + echo -n ${array[@]##*/} +run: ${vyatta_bindir}/vyatta-show-interfaces ethernet $4 + +A blank or missing "allowed" field means that there is no completion +for the respective node; for such nodes a '*' placeholder tag is +displayed with the help text. |