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
24 #include "ap-curses.h"
27 #define RATES_RECORD "[%d] %02.1fM\t%s"
31 char smtStationDBTimeout[] = { 0x2b, 0x06, 0x01, 0x04, 0x01, 0x87, 0x29, 0x03, 0x01, 0x02, 0x01, 0x0F, 0x00 };
32 char smtACKWindow[] = { 0x2b, 0x06, 0x01, 0x04, 0x01, 0x87, 0x29, 0x03, 0x01, 0x02, 0x01, 22, 0x00 };
34 char m_dbtimeout=0, m_ackwindow=0, message[80], ackwindow;
35 unsigned int dbtimeout;
37 extern WINDOW *main_sub;
40 for (i = 0; i < 2; i++) {
41 varbinds[i].len_val = 0;
42 varbinds[i].type = NULL_VALUE;
44 varbinds[0].oid = smtStationDBTimeout;
45 varbinds[0].len_oid = sizeof(smtStationDBTimeout);
46 varbinds[1].oid = smtACKWindow;
47 varbinds[1].len_oid = sizeof(smtACKWindow);
49 if (snmp(varbinds, 2, GET) <= 0) {
50 print_helperr(ERR_RET);
54 if (varbinds[0].len_val == 2)
55 dbtimeout = varbinds[0].value[0]*256 + varbinds[0].value[1];
57 dbtimeout = *(varbinds[0].value);
59 ackwindow = *(varbinds[1].value);
61 sprintf(message, _("[D] DB Station Timeout: %d"), dbtimeout);
62 mvwaddstr(main_sub, 1, 0, message);
63 sprintf(message, _("[A] ACK Window: %d"), ackwindow);
64 mvwaddstr(main_sub, 2, 0, message);
66 print_title(_("Advanced Options"));
67 print_help(_("DA - options; W - write conf; Q - quit to menu"));
78 get_value(message, 1, 24, 6, INT_STRING, 0, 0, NULL);
79 dbtimeout = atoi(message);
84 get_value(message, 2, 16, 4, INT_STRING, 0, 0, NULL);
85 ackwindow = atoi(message);
92 if (dbtimeout / 256 >= 1) {
93 message[0] = (dbtimeout - dbtimeout % 256)/ 256;
94 message[1] = dbtimeout % 256;
99 message[0] = dbtimeout;
102 varbinds[i].oid = smtStationDBTimeout;
103 varbinds[i].len_oid = sizeof(smtStationDBTimeout);
104 varbinds[i].value = message;
105 varbinds[i].len_val = m_dbtimeout;
106 varbinds[i].type = INT_VALUE;
110 varbinds[i].oid = smtACKWindow;
111 varbinds[i].len_oid = sizeof(smtACKWindow);
112 varbinds[i].value = &ackwindow;
113 varbinds[i].len_val = 1;
114 varbinds[i].type = INT_VALUE;
118 print_help(WAIT_SET);
119 if (snmp(varbinds, i, SET) <= 0) {
120 print_helperr(ERR_SET);
123 print_help(DONE_SET);