⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cs427 zebra command system.htm

📁 zebra免费软件
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0050)http://wiki.cs.uiuc.edu/cs427/Zebra+Command+System -->
<HTML><HEAD><TITLE>cs427: Zebra Command System</TITLE>
<META http-equiv=Content-Type content="text/html; charset=big5">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY vLink=#000000 link=#0000ff bgColor=#ffffff><FONT color=#000000>
<TABLE cellSpacing=2 cellPadding=0 width="100%" bgColor=#ffffc0>
  <TBODY>
  <TR>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/EDIT/Zebra+Command+System">Edit</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/RENAME/Zebra+Command+System">Rename</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/DIFF/5/4/Zebra+Command+System">Changes</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/HISTORY/Zebra+Command+System">History</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/UPLOAD">Upload</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/DOWNLOAD/">Download</A></FONT></TD>
    <TD><FONT face=Arial><A href="http://wiki.cs.uiuc.edu/cs427">Back to 
      Top</A></FONT></TD></TR></TBODY></TABLE>
<H2><FONT face=Arial><A 
href="http://wiki.cs.uiuc.edu/cs427/SEARCH/Zebra+Command+System">Zebra Command 
System</A></FONT></H2><!-- unformatted page contents --


--------

[NEXT > http://wiki.cs.uiuc.edu/cs427/Talking+to+the+Zebra+daemon] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [HOME > http://wiki.cs.uiuc.edu/cs427/Software+Architecture+of+Zebra]

----------


<br>


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
* ....

<br>


[http://wiki.cs.uiuc.edu/cs427/DOWNLOAD/ZebraCommand.gif]

<br>

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] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [HOME > http://wiki.cs.uiuc.edu/cs427/Software+Architecture+of+Zebra]
//-- unformatted page contents -->
<P>
<P>
<HR>

<P><A href="http://wiki.cs.uiuc.edu/cs427/Talking+to+the+Zebra+daemon">NEXT</A> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A 
href="http://wiki.cs.uiuc.edu/cs427/Software+Architecture+of+Zebra">HOME</A> 
<P>
<HR>

<P>
<P><BR>
<P>
<P>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: 
<P>
<UL>
  <LI>AUTH_NODE, (Authentication mode of vty interface) 
  <LI>VIEW_NODE (View node. Default mode of vty interface) 
  <LI>AUTH_ENABLE_NODE (Authentication mode for change enable) 
  <LI>ENABLE_NODE (Enable node) 
  <LI>CONFIG_NODE (Config node. Default mode of config file) 
  <LI>DEBUG_NODE (Debug node) 
  <LI>AAA_NODE (AAA node) 
  <LI>KEYCHAIN_NODE (Key-chain node) 
  <LI>KEYCHAIN_KEY_NODE (Key-chain key node) 
  <LI>INTERFACE_NODE (Interface mode node) 
  <LI>ZEBRA_NODE (zebra connection node) 
  <LI>TABLE_NODE (rtm_table selection node) 
  <LI>RIP_NODE (RIP protocol mode node) 
  <LI>RIPNG_NODE (RIPng protocol mode node) 
  <LI>BGP_NODE (BGP protocol mode which includes BGP4+) 
  <LI>BGP_VPNV4_NODE (BGP MPLS-VPN PE exchange) 
  <LI>BGP_IPV4M_NODE (BGP IPv4 multicast address family) 
  <LI>BGP_IPV6_NODE (BGP IPv6 address family) 
  <LI>OSPF_NODE (OSPF protocol mode) 
  <LI>OSPF6_NODE (OSPF protocol for IPv6 mode) 
  <LI>MASC_NODE (MASC for multicast) 
  <LI>IRDP_NODE (ICMP Router Discovery Protocol mode) 
  <LI>IP_NODE (Static ip route node) 
  <LI>ACCESS_NODE (Access list node) 
  <LI>PREFIX_NODE (Prefix list node) 
  <LI>ACCESS_IPV6_NODE (Access list node) 
  <LI>PREFIX_IPV6_NODE (Prefix list node) 
  <LI>AS_LIST_NODE (AS list node) 
  <LI>COMMUNITY_LIST_NODE (Community list node) 
  <LI>RMAP_NODE (Route map node) 
  <LI>SMUX_NODE (SNMP configuration node) 
  <LI>DUMP_NODE (Packet dump node) 
  <LI>VTY_NODE (Vty node) </LI></UL>The data type of these command nodes is 
cmd_node , which is a structure that implements a command node. 
<P>
<P>The elements of the structure are as follows: 
<P>
<UL>
  <LI>node_type 
  <LI>prompt 
  <LI>function 
  <LI>vector cmd_vector; </LI></UL>The cmd_vector in the command node inturn 
contains the list of the commands installed in that node. 
<P>The particular commands themselves are implemented as a cmd_element structure 

<P>
<UL>
  <LI>string 
  <LI>function 
  <LI>name of the daemon to which the command belongs 
  <LI>.... </LI></UL><BR>
<P>
<P><IMG src="cs427 Zebra Command System_files/ZebraCommand.gif" border=0> 
<P><BR>
<P>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. 
<P>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. 
<P>
<P>
<P>
<HR>

<P><A href="http://wiki.cs.uiuc.edu/cs427/Talking+to+the+Zebra+daemon">NEXT</A> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A 
href="http://wiki.cs.uiuc.edu/cs427/Software+Architecture+of+Zebra">HOME</A>
<P>
<HR>

<FORM action=/cs427/SEARCH method=post><INPUT type=hidden value=SEARCH 
name=COMMAND> <INPUT type=submit value=Find...> <INPUT size=40 
name=SEARCHPATTERN> </FORM>
<TABLE cellSpacing=2 cellPadding=0 width="100%" bgColor=#ffffc0>
  <TBODY>
  <TR>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/EDIT/Zebra+Command+System">Edit</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/RENAME/Zebra+Command+System">Rename</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/DIFF/5/4/Zebra+Command+System">Changes</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/HISTORY/Zebra+Command+System">History</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/UPLOAD">Upload</A></FONT></TD>
    <TD><FONT face=Arial><A 
      href="http://wiki.cs.uiuc.edu/cs427/DOWNLOAD/">Download</A></FONT></TD>
    <TD><FONT face=Arial><A href="http://wiki.cs.uiuc.edu/cs427">Back to 
      Top</A></FONT></TD></TR></TBODY></TABLE></FONT></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -