quagga-0.99.19 vtysh quagga-0.99.19 vtysh quagga-0.99.19 vtysh
2021-12-06 22:15:59 2.13MB quagga-0.99. vtysh
1
/* VTY shell main routine. */ int main (int argc, char **argv, char **env) { char *line; int opt; int eval_flag = 0; int boot_flag = 0; char *eval_line = NULL; char *config_file = CONFIG_DIR "/" CONFIG_FILE; if(getenv("VTYSH_CONFIG")) config_file = getenv("VTYSH_CONFIG"); while (1) { opt = getopt_long (argc, argv, "be:c:hv", longopts, 0); if (opt == EOF) break; switch (opt) { case 0: break; case 'b': boot_flag = 1; break; case 'e': eval_flag = 1; eval_line = optarg; break; case 'h': usage (argv[0], 0); break; case 'c': config_file = optarg; break; case 'v': printf("Ver:%s %s\n", __DATE__, __TIME__); exit(0); default: usage (argv[0], 1); break; } } /* Signal and others. */ signal_init (); /* Init config. */ config_init(); /* Init the cmd */ cmd_init(); /* Init the vtysh */ vtysh_init_vty (); /* Install command and node view */ cmd_parse_init(); //TODO load the dynamic so /* sort the node */ cmd_sort_node(); /* If eval mode */ if (eval_flag) { vtysh_execute("enable"); vtysh_execute("config terminal"); exit(vtysh_execute(eval_line)); } /* Boot startup configuration file. */ if (boot_flag) exit(vtysh_boot_config (config_file)); in_show_welcome(); host.config = config_file; vtysh_load_config(config_file); /* Main command loop. */ while ((line = vtysh_readline()) != NULL) vtysh_execute (line); printf ("\n"); exit (0); }
2021-11-03 17:54:52 38KB zebra vtysh
1
简要介绍了zebra-vtysh的架构以及相关的命令实现
2021-02-24 14:21:55 157KB zebra、vtysh
1