User Tools

Site Tools


cli_entry

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cli_entry [2009/06/13 20:26] andreicli_entry [2009/06/13 20:31] (current) andrei
Line 122: Line 122:
 The position of the entry in the code reflects its position in the actual menu. That is, if the first entry in the subtree of config_main is the struct menu_node rstp then it will also be the first entry in the CLI menu. Notice than when one of the entries is selected then the cmd_rstp_run routine is called. The position of the entry in the code reflects its position in the actual menu. That is, if the first entry in the subtree of config_main is the struct menu_node rstp then it will also be the first entry in the CLI menu. Notice than when one of the entries is selected then the cmd_rstp_run routine is called.
  
-== Step 3: implementing the called routine ==+== Step 3: implementing the global RSTP enable routine ==
  
 The //run// field from struct menu_node represents a pointer to a function having the following signature : int (struct cli_context *, int, char **, struct menu_node **). For a detailed description see the struct menu_node definition in **cli/cli.h**. So, first thing to do is define a routine called cmp_rstp_run having this signature in the **cli/command/config_if.h** header. The //run// field from struct menu_node represents a pointer to a function having the following signature : int (struct cli_context *, int, char **, struct menu_node **). For a detailed description see the struct menu_node definition in **cli/cli.h**. So, first thing to do is define a routine called cmp_rstp_run having this signature in the **cli/command/config_if.h** header.
Line 215: Line 215:
 Notice that the routine called when the entries are selected is cmd_rstp_if_set. So... Notice that the routine called when the entries are selected is cmd_rstp_if_set. So...
  
-== Step 5 : implementing called routine ==+== Step 5 : implementing the interface enable/disable routine == 
 + 
 +The cmd_rstp_if_set routine's job is to send a message to the daemon implementing the protocol that it wants a specific interface to be enabled/disabled. This requires an interprocess communication mechanism between the daemon and the CLI process. It involves the daemon creating a thread specifically for this task. The details are not related to the menu entries so they won't be described here.
  
-The cmd_rstp_if_set routine  
cli_entry.1244913968.txt.gz · Last modified: by andrei