cs427: Zebra Command System
href="http://wiki.cs.uiuc.edu/cs427/EDIT/Zebra+Command+System">Edit
href="http://wiki.cs.uiuc.edu/cs427/RENAME/Zebra+Command+System">Rename
href="http://wiki.cs.uiuc.edu/cs427/DIFF/5/4/Zebra+Command+System">Changes
href="http://wiki.cs.uiuc.edu/cs427/HISTORY/Zebra+Command+System">History
href="http://wiki.cs.uiuc.edu/cs427/UPLOAD">Upload
href="http://wiki.cs.uiuc.edu/cs427/DOWNLOAD/">Download
Back to
Top
href="http://wiki.cs.uiuc.edu/cs427/SEARCH/Zebra+Command+System">Zebra Command
System
--------
[NEXT > http://wiki.cs.uiuc.edu/cs427/Talking+to+the+Zebra+daemon] [HOME > http://wiki.cs.uiuc.edu/cs427/Software+Architecture+of+Zebra]
----------
Zebra has a command structure that maintains the list of command in the system. Each daemon normally maintains its own command vector, typically named cmdvec. Command vector comprises of particular command nodes. There are only some particular types of command nodes that can be declared. They are:
* AUTH_NODE, (Authentication mode of vty interface)
* VIEW_NODE (View node. Default mode of vty interface)
* AUTH_ENABLE_NODE (Authentication mode for change enable)
* ENABLE_NODE (Enable node)
* CONFIG_NODE (Config node. Default mode of config file)
* DEBUG_NODE (Debug node)
* AAA_NODE (AAA node)
* KEYCHAIN_NODE (Key-chain node)
* KEYCHAIN_KEY_NODE (Key-chain key node)
* INTERFACE_NODE (Interface mode node)
* ZEBRA_NODE (zebra connection node)
* TABLE_NODE (rtm_table selection node)
* RIP_NODE (RIP protocol mode node)
* RIPNG_NODE (RIPng protocol mode node)
* BGP_NODE (BGP protocol mode which includes BGP4+)
* BGP_VPNV4_NODE (BGP MPLS-VPN PE exchange)
* BGP_IPV4M_NODE (BGP IPv4 multicast address family)
* BGP_IPV6_NODE (BGP IPv6 address family)
* OSPF_NODE (OSPF protocol mode)
* OSPF6_NODE (OSPF protocol for IPv6 mode)
* MASC_NODE (MASC for multicast)
* IRDP_NODE (ICMP Router Discovery Protocol mode)
* IP_NODE (Static ip route node)
* ACCESS_NODE (Access list node)
* PREFIX_NODE (Prefix list node)
* ACCESS_IPV6_NODE (Access list node)
* PREFIX_IPV6_NODE (Prefix list node)
* AS_LIST_NODE (AS list node)
* COMMUNITY_LIST_NODE (Community list node)
* RMAP_NODE (Route map node)
* SMUX_NODE (SNMP configuration node)
* DUMP_NODE (Packet dump node)
* VTY_NODE (Vty node)
The data type of these command nodes is cmd_node , which is a structure that implements a command node.
The elements of the structure are as follows:
* node_type
* prompt
* function
* vector cmd_vector;
The cmd_vector in the command node inturn contains the list of the commands installed in that node.
The particular commands themselves are implemented as a cmd_element structure
* string
* function
* name of the daemon to which the command belongs
* ....
[http://wiki.cs.uiuc.edu/cs427/DOWNLOAD/ZebraCommand.gif]
Every daemon in Zebra first initializes the top level vector ?the cmdvec and then uses install_node() to install the command nodes in the vector. They use install_element() function to installs a command into a particular node.
The VTY program continuously looks for input from the user. Whenever a user gives a command over the VTY interface, a method vtysh_execute() is called passing it the string read from the interface. This function uses the command facility provided in the library to execute the command. It first calls cmd_make_strvec() to convert the string into a vector. It then calls cmd_execute_command() passing him the command vector. The cmd_execute_command() first verifies the command from the top level vector cmdvec and if the command is a valid one, fetches the command element from the command node and returns it to the VTY interface, or if it was called from somewhere else then executes the function.
----------
[NEXT > http://wiki.cs.uiuc.edu/cs427/Talking+to+the+Zebra+daemon] [HOME > http://wiki.cs.uiuc.edu/cs427/Software+Architecture+of+Zebra]
//-- unformatted page contents -->
NEXT
href="http://wiki.cs.uiuc.edu/cs427/Software+Architecture+of+Zebra">HOME
Zebra has a command structure that maintains the list of command in the
system. Each daemon normally maintains its own command vector, typically named
cmdvec. Command vector comprises of particular command nodes. There are only
some particular types of command nodes that can be declared. They are:
AUTH_NODE, (Authentication mode of vty interface)
VIEW_NODE (View node. Default mode of vty interface)
AUTH_ENABLE_NODE (Authentication mode for change enable)
ENABLE_NODE (Enable node)
CONFIG_NODE (Config node. Default mode of config file)
DEBUG_NODE (Debug node)
AAA_NODE (AAA node)
KEYCHAIN_NODE (Key-chain node)
KEYCHAIN_KEY_NODE (Key-chain key node)
INTERFACE_NODE (Interface mode node)
ZEBRA_NODE (zebra connection node)
TABLE_NODE (rtm_table selection node)
RIP_NODE (RIP protocol mode node)
RIPNG_NODE (RIPng protocol mode node)
BGP_NODE (BGP protocol mode which includes BGP4+)
BGP_VPNV4_NODE (BGP MPLS-VPN PE exchange)
BGP_IPV4M_NODE (BGP IPv4 multicast address family)
BGP_IPV6_NODE (BGP IPv6 address family)
OSPF_NODE (OSPF protocol mode)
OSPF6_NODE (OSPF protocol for IPv6 mode)
MASC_NODE (MASC for multicast)
IRDP_NODE (ICMP Router Discovery Protocol mode)
IP_NODE (Static ip route node)
ACCESS_NODE (Access list node)
PREFIX_NODE (Prefix list node)
ACCESS_IPV6_NODE (Access list node)
PREFIX_IPV6_NODE (Prefix list node)
AS_LIST_NODE (AS list node)
COMMUNITY_LIST_NODE (Community list node)
RMAP_NODE (Route map node)
SMUX_NODE (SNMP configuration node)
DUMP_NODE (Packet dump node)
VTY_NODE (Vty node) The data type of these command nodes is
cmd_node , which is a structure that implements a command node.
The elements of the structure are as follows:
node_type
prompt
function
vector cmd_vector; The cmd_vector in the command node inturn
contains the list of the commands installed in that node.
The particular commands themselves are implemented as a cmd_element structure
string
function
name of the daemon to which the command belongs
....
Every daemon in Zebra first initializes the top level vector ?the cmdvec and
then uses install_node() to install the command nodes in the vector. They use
install_element() function to installs a command into a particular node.
The VTY program continuously looks for input from the user. Whenever a user
gives a command over the VTY interface, a method vtysh_execute() is called
passing it the string read from the interface. This function uses the command
facility provided in the library to execute the command. It first calls
cmd_make_strvec() to convert the string into a vector. It then calls
cmd_execute_command() passing him the command vector. The cmd_execute_command()
first verifies the command from the top level vector cmdvec and if the command
is a valid one, fetches the command element from the command node and returns it
to the VTY interface, or if it was called from somewhere else then executes the
function.
NEXT
href="http://wiki.cs.uiuc.edu/cs427/Software+Architecture+of+Zebra">HOME
name=COMMAND> name=SEARCHPATTERN>
href="http://wiki.cs.uiuc.edu/cs427/EDIT/Zebra+Command+System">Edit
href="http://wiki.cs.uiuc.edu/cs427/RENAME/Zebra+Command+System">Rename
href="http://wiki.cs.uiuc.edu/cs427/DIFF/5/4/Zebra+Command+System">Changes
href="http://wiki.cs.uiuc.edu/cs427/HISTORY/Zebra+Command+System">History
href="http://wiki.cs.uiuc.edu/cs427/UPLOAD">Upload
href="http://wiki.cs.uiuc.edu/cs427/DOWNLOAD/">Download
Back to
Top