2 * cmd.c from Access Point SNMP Utils for Linux
4 * Copyright (c) 2002 Roman Festchook <roma at polesye dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License Version 2 from
8 * June 1991 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "ap-curses.h"
25 #define ANSW_NO _("(Y - Yes; N - No (it's safer to answer No, unless you really need this.)")
27 extern WINDOW *main_sub;
32 char sysLoadDefaults[] =
33 { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01,
39 if (ap_type == ATMEL12350) {
40 sysLoadDefaults[5] = 0xE0;
41 sysLoadDefaults[6] = 0x3E;
44 print_title(_("Restore factory default configuration"));
45 mvwaddstr(main_sub, 3, 2,
47 ("After restoring factory defaults your current configuration."));
48 mvwaddstr(main_sub, 4, 2, _("will be lost."));
49 mvwaddstr(main_sub, 6, 20, _("Do you want to continue? "));
69 varbinds[0].oid = sysLoadDefaults;
70 varbinds[0].len_oid = sizeof(sysLoadDefaults);
71 varbinds[0].value = &enable;
72 varbinds[0].len_val = 1;
73 varbinds[0].type = INT_VALUE;
74 if (snmp(varbinds, 1, SET) <= 0)
75 print_helperr(ERR_SET);
79 ("Factory default settings loaded. Press any key to continue."));
88 print_title(_("Reset Access Point"));
89 if(ap_type == ATMEL410)
90 mvwaddstr(main_sub, 3, 5,
91 _("By reset you'll lose all non-uploaded configuration."));
92 mvwaddstr(main_sub, 5, 20, _("Do you want to continue? "));
109 print_help(WAIT_SET);
111 print_helperr(ERR_SET);
113 print_help(_("Access Point reset. Press any key to continue."));
122 { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01, 0x01, 0x06,
127 if (ap_type == ATMEL12350) {
132 varbinds[0].oid = sysUpload;
133 varbinds[0].len_oid = sizeof(sysUpload);
134 varbinds[0].value = &enable;
135 varbinds[0].len_val = 1;
136 varbinds[0].type = INT_VALUE;
137 if (snmp(varbinds, 1, SET) <= 0)
146 print_title(_("Upload configuration"));
147 mvwaddstr(main_sub, 3, 2,
149 ("You need to upload the configuration only if you've changed"));
150 mvwaddstr(main_sub, 4, 2,
152 ("some option values before. Using this option may cause loss"));
153 mvwaddstr(main_sub, 5, 2, _("of your current configuration."));
154 mvwaddstr(main_sub, 7, 20, ("Do you want to continue? "));
171 print_help(WAIT_SET);
173 print_helperr(ERR_SET);
176 (_("Configuration uploaded. Press any key to continue."));