/* ***************************************************************************** * * Copyright 1989,1990, Xylogics, Inc. ALL RIGHTS RESERVED. * * ALL RIGHTS RESERVED. Licensed Material - Property of Xylogics, Inc. * This software is made available solely pursuant to the terms of a * software license agreement which governs its use. * Unauthorized duplication, distribution or sale are strictly prohibited. * * Module Function: * %$(Description)$% * * Original Author: %$(author)$% Created on: %$(created-on)$% * ***************************************************************************** */ /* * Include Files */ #include "../inc/config.h" #include #include #ifndef _WIN32 #include #include #endif #include #include "../inc/na/na.h" #include "../inc/erpc/netadmp.h" #include "../inc/na/cmd.h" #include "../inc/na/help.h" extern char *split_string(); /* in do.c */ static char t1_inval_sym=0,pri_inval_sym=0; extern char *reset_modem_params[]; #ifdef NA void punt(); #endif int lex(); void prompt(); void free_annex_list(); void annex_list(); void boot_sub(); int lex_switch(); time_t delay_time(); void lex_string(); void warning_message(); void do_boot(); void free_port_set(); void port_set(); void message(); void do_broadcast(); int match(); int annex_name(); void single_printer(); void single_port(); void single_interface(); void free_printer_set(); void free_interface_set(); void do_copy_annex(); void do_copy(); void interface_set(); void interface_copy(); void printer_set(); void printer_copy(); void skip_white_space(); void set_global_password(); void do_read(); void do_reset_box(); void do_reset_printer(); void do_reset_interface(); void do_reset_port(); int annex_pair_list(); int port_pair_list(); int interface_pair_list(); int printer_pair_list(); void annex_show_list(); void port_show_list(); void interface_show_list(); void printer_show_list(); void do_write(); int adm_set_cmd(); void single_t1(); void free_t1_set(); void t1_set(); void do_copy_t1(); void free_intmod_set(); void intmod_set(); void do_reset_t1(); void do_reset_intmod(); int t1_pair_list(); void t1_show_list(); int adm_modem_cmd(); int adm_wan_cmd(); int adm_box_cmd() { /* Assign the default annex list. */ ANNEX_LIST *Ptemp_annex_list = NULL, *Ptemp_annex_tail = NULL; /* If no arguments were supplied, set prompt_mode so that they will be prompted for. */ prompt_mode = (lex() == LEX_EOS); if (prompt_mode) { if (script_input) punt("missing arguments", (char *)NULL); (void)setjmp(prompt_env); prompt("\tenter default %s list", BOX, FALSE); } /* Turn off prompt_mode so that subsequent errors will be punted back to the command prompt. */ prompt_mode = FALSE; /* Free the temp annex list in case you came back here after punting. */ free_annex_list(&Ptemp_annex_list); /* Let a temp point at the annex list in case the human makes a mistake, so that the old default will still be there after punting. */ annex_list(&Ptemp_annex_list, &Ptemp_annex_tail); /* No human mistakes, so move the temp annex list to the default annex list. Free the default first in case it had been previously entered. */ free_annex_list(&Pdef_annex_list); Pdef_annex_list = Ptemp_annex_list; Pdef_annex_tail = Ptemp_annex_tail; return 0; } /* adm_box_cmd() */ void MustBeSuperuser() { if (!is_super) #ifdef _WIN32 punt("must be administrator", (char *)NULL); #else punt("must be superuser", (char *)NULL); #endif } int adm_boot_cmd() { MustBeSuperuser(); /* FALSE argument to boot_sub() means no dump. */ boot_sub(FALSE); return 0; } /* adm_boot_cmd() */ /* ***************************************************************************** * * Function Name: * boot_sub * * Functional Description: * Used to implement both the boot and dumpboot coommands. * If no arguments were supplied, set prompt_mode so that they * will be prompted for. The syntax for the boot and dumpboot * command is : * [dump]boot [-a][-h][-d][-q]