]> git.sur5r.net Git - ngadmin/blobdiff - cli/commands.c
CLI: added the possibility to interrupt hanging commands with CTRL+C.
[ngadmin] / cli / commands.c
index 70740b2d64c6b9ece2d0c56f45b77b314676b20f..df13a580af0f1a966ce0a52492fcf08ae6b1006b 100644 (file)
@@ -22,6 +22,10 @@ bool do_firmware_show (int nb, const char **com, struct ngadmin *nga);
 bool do_firmware_upgrade (int nb, const char **com, struct ngadmin *nga);
 
 
+// help
+bool do_help (int nb, const char **com, struct ngadmin *nga);
+
+
 // igmp
 bool do_igmp_set (int nb, const char **com, struct ngadmin *nga);
 bool do_igmp_show (int nb, const char **com, struct ngadmin *nga);
@@ -92,8 +96,12 @@ bool do_tree (int nb, const char **com, struct ngadmin *nga);
 
 
 // vlan
+bool do_vlan_8021q_del (int nb, const char **com, struct ngadmin *nga);
+bool do_vlan_8021q_set (int nb, const char **com, struct ngadmin *nga);
 bool do_vlan_8021q_show (int nb, const char **com, struct ngadmin *nga);
+bool do_vlan_mode_set (int nb, const char **com, struct ngadmin *nga);
 bool do_vlan_mode_show (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga);
+bool do_vlan_pvid_set (int nb, const char **com, struct ngadmin *nga);
 bool do_vlan_pvid_show (int nb, const char **com, struct ngadmin *nga);
 
 
@@ -115,6 +123,8 @@ COM_ROOT_START(coms)
   COM_TERM(upgrade, do_firmware_upgrade, true)
  COM_END
  
+ COM_TERM(help, do_help, false)
  COM_START(igmp)
   COM_TERM(set, do_igmp_set, true)
   COM_TERM(show, do_igmp_show, false)
@@ -176,25 +186,20 @@ COM_ROOT_START(coms)
  
  COM_START(vlan)
   COM_START(802.1q)
-   COM_START(port)
-    COM_TERM(add, NULL, true)
-    COM_TERM(del, NULL, true)
-   COM_END
+   COM_TERM(del, do_vlan_8021q_del, true)
+   COM_TERM(set, do_vlan_8021q_set, true)
    COM_TERM(show, do_vlan_8021q_show, true)
-   COM_START(vlan)
-    COM_TERM(add, NULL, true)
-    COM_TERM(del, NULL, true)
-    COM_TERM(flush, NULL, true)
-   COM_END
   COM_END
   COM_START(mode)
-   COM_TERM(set, NULL, true)
+   COM_TERM(set, do_vlan_mode_set, true)
    COM_TERM(show, do_vlan_mode_show, false)
   COM_END
   COM_START(port)
+   COM_TERM(set, NULL, true)
+   COM_TERM(show, NULL, false)
   COM_END
   COM_START(pvid)
-   COM_TERM(set, NULL, true)
+   COM_TERM(set, do_vlan_pvid_set, true)
    COM_TERM(show, do_vlan_pvid_show, false)
   COM_END
  COM_END