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
24 extern WINDOW *main_sub;
29 char sysLoadDefaults[] =
30 { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01,
35 if (ap_type == ATMEL12350) {
36 sysLoadDefaults[5] = 0xE0;
37 sysLoadDefaults[6] = 0x3E;
40 print_top(NULL, _("Restore factory default configuration"));
41 mvwaddstr(main_sub, 3, 2,
43 ("After restoring factory defaults your current configuration"));
44 mvwaddstr(main_sub, 4, 2, _("will be lost."));
45 mvwaddstr(main_sub, 6, 20, _("Do you want to continue? "));
53 varbinds[0].oid = sysLoadDefaults;
54 varbinds[0].len_oid = sizeof(sysLoadDefaults);
55 varbinds[0].value = &enable;
56 varbinds[0].len_val = 1;
57 varbinds[0].type = INT_VALUE;
58 if (snmp(varbinds, 1, SET) <= 0)
59 print_helperr(ERR_SET);
63 ("Factory default settings loaded. Press any key to continue."));
66 print_top(NULL, NULL);
71 print_top(NULL, _("Reset Access Point"));
72 if(ap_type == ATMEL410)
73 mvwaddstr(main_sub, 3, 5,
74 _("By reset you'll lose all non-uploaded configuration."));
75 mvwaddstr(main_sub, 5, 20, _("Do you want to continue? "));
83 print_helperr(ERR_SET);
85 print_help(_("Access Point reset. Press any key to continue."));
88 print_top(NULL, NULL);
94 { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01, 0x01, 0x06,
99 if (ap_type == ATMEL12350) {
104 varbinds[0].oid = sysUpload;
105 varbinds[0].len_oid = sizeof(sysUpload);
106 varbinds[0].value = &enable;
107 varbinds[0].len_val = 1;
108 varbinds[0].type = INT_VALUE;
109 if (snmp(varbinds, 1, SET) <= 0)
117 print_top(NULL, _("Upload configuration"));
118 mvwaddstr(main_sub, 3, 2,
119 _("You may need to upload the configuration only if you've"));
120 mvwaddstr(main_sub, 4, 2,
121 _("changed some option values before. Using this option may"));
122 mvwaddstr(main_sub, 5, 2,
123 _("cause loss of your current configuration."));
124 mvwaddstr(main_sub, 7, 20, ("Do you want to continue? "));
130 print_help(WAIT_SET);
132 print_helperr(ERR_SET);
135 (_("Configuration uploaded. Press any key to continue."));
138 print_top(NULL, NULL);