2 * wlan.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
26 #define RATES_RECORD "[%d] %02.1fM\t%s"
30 char smtStationDBTimeout[] = { 0x2b, 0x06, 0x01, 0x04, 0x01, 0x87, 0x29, 0x03, 0x01, 0x02, 0x01, 0x0F, 0x00 };
31 char smtACKWindow[] = { 0x2b, 0x06, 0x01, 0x04, 0x01, 0x87, 0x29, 0x03, 0x01, 0x02, 0x01, 22, 0x00 };
33 char m_dbtimeout=0, m_ackwindow=0, message[80], ackwindow;
34 unsigned int dbtimeout;
36 extern WINDOW *main_sub;
39 for (i = 0; i < 2; i++) {
40 varbinds[i].len_val = 0;
41 varbinds[i].type = NULL_VALUE;
43 varbinds[0].oid = smtStationDBTimeout;
44 varbinds[0].len_oid = sizeof(smtStationDBTimeout);
45 varbinds[1].oid = smtACKWindow;
46 varbinds[1].len_oid = sizeof(smtACKWindow);
48 if (snmp(varbinds, 2, GET) < 2) {
49 print_helperr(ERR_RET);
53 if (varbinds[0].len_val == 2)
54 dbtimeout = varbinds[0].value[0]*256 + varbinds[0].value[1];
56 dbtimeout = *(varbinds[0].value);
58 ackwindow = *(varbinds[1].value);
60 sprintf(message, _("[D] DB Station Timeout: %d"), dbtimeout);
61 mvwaddstr(main_sub, 1, 0, message);
62 sprintf(message, _("[A] ACK Window: %d"), ackwindow);
63 mvwaddstr(main_sub, 2, 0, message);
65 print_top(NULL, _("Advanced Options"));
66 print_help(_("DA - options; W - write conf; Q - quit to menu"));
77 get_value(message, 1, 24, 6, INT_STRING, 0, 0, NULL);
78 dbtimeout = atoi(message);
83 get_value(message, 2, 16, 4, INT_STRING, 0, 0, NULL);
84 ackwindow = atoi(message);
91 if (dbtimeout / 256 >= 1) {
92 message[0] = (dbtimeout - dbtimeout % 256)/ 256;
93 message[1] = dbtimeout % 256;
98 message[0] = dbtimeout;
101 varbinds[i].oid = smtStationDBTimeout;
102 varbinds[i].len_oid = sizeof(smtStationDBTimeout);
103 varbinds[i].value = message;
104 varbinds[i].len_val = m_dbtimeout;
105 varbinds[i].type = INT_VALUE;
109 varbinds[i].oid = smtACKWindow;
110 varbinds[i].len_oid = sizeof(smtACKWindow);
111 varbinds[i].value = &ackwindow;
112 varbinds[i].len_val = 1;
113 varbinds[i].type = INT_VALUE;
117 print_help(WAIT_SET);
118 if (snmp(varbinds, i, SET) <= 0) {
119 print_helperr(ERR_SET);
122 wbkgd(main_sub, A_NORMAL);
124 print_help(DONE_SET);
134 print_top(NULL, NULL);