X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ap-gl%2Fbridge.c;h=370a5ba345135a441f796a6781463f553c74ebed;hb=de41f9e3b34a50d3a579dfa62cfc6bc53ebdbeec;hp=d283e90b31c00548e5d1c1a7c948e0c6f8a4401d;hpb=09ed626f25fb3e7c57ad7a59e5261ea005aa498f;p=ap-utils.git diff --git a/ap-gl/bridge.c b/ap-gl/bridge.c index d283e90..370a5ba 100644 --- a/ap-gl/bridge.c +++ b/ap-gl/bridge.c @@ -22,7 +22,6 @@ #include #include #include "ap-utils.h" -#include "ap-curses.h" #define IPADDR _("[I] IP: ") #define NETMASK _("[N] Netmask: ") @@ -34,7 +33,7 @@ #define OPER _("[O] Operational mode: ") #define REMOTE_MAC _("[M] Preferred BSSID (remote MAC addr.): ") //#define CF_PORT _("[C] Configuration-enabled port(s): ") -#define TRAP_PORT _("[T] Trap-sending port(s): ") +#define TRAP_PORT _("[T] Trap-sending port: ") #define FW_BCAST _("[R] Forward broadcast traffic: ") //#define SB_BCAST _("[B] Isolate wireless clients (broadcast traffic): ") #define SB_UCAST _("[U] Isolate wireless clients: ") @@ -42,9 +41,20 @@ extern short ap_type; + void bridging() { +char *bridge_modes[6] = { + _("Wireless Bridge Point to MultiPoint"), + _("Access Point"), + _("Access Point client"), + _("Wireless Bridge Point to Point"), + _("Repeater"), + _("unknown") +}; + + char sysTrapSwitch[] = { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01, 0x01, 0x03, 0x00 @@ -78,7 +88,7 @@ void bridging() { 0x2B, 0x06, 0x01, 0x04, 0x01, 0xE0, 0x3E, 0x01, 0x01, 0x02, 0x07, 0x00 }; -*/ /* This one is ATMEL12350 TELLUS MIB specific. */ +*/ char TrapPort[] = { 0x2B, 0x06, 0x01, 0x04, 0x01, 0xE0, 0x3E, 0x01, 0x01, 0x02, 0x08, 0x00 @@ -89,8 +99,7 @@ void bridging() 0x00 }; - /* These 3 are ATMEL12350 MIB specific. */ - char ForwardBroadcast[] = + char ForwarbBcast[] = { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01, 0x03, 0x02, 0x00 }; @@ -121,14 +130,7 @@ void bridging() m_dhcp = 0, m_ip = 0, m_mask = 0, m_gw = 0, m_remote_bssid = 0, /*m_config_port = 0, */m_trap_port = 0, m_fw_bcast = 0, /*m_sb_bcast = 0,*/ m_sb_ucast = 0; - char *bridge_modes[6] = { - _("Wireless Bridge Point to MultiPoint"), - _("Access Point"), - _("Access Point client"), - _("Wireless Bridge Point to Point"), - _("Repeater"), - ("unknown") - }, *pr_ports[2] = { + char *pr_ports[2] = { _("Ethernet"), _("Wireless") } /*, *cf_trap_ports[3] = { @@ -167,16 +169,16 @@ void bridging() varbinds[7].oid = bridgeOperationalMode; varbinds[8].oid = sysTrapSwitch; varbinds[9].oid = bridgeRemoteBridgeBSSID; - varbinds[10].oid = ForwardBroadcast; + varbinds[10].oid = ForwarbBcast; varbinds[11].oid = SendBackUnicast; varbinds[12].oid = SendBackBcast; - if (snmp(varbinds, 13, GET) <= 0) { + if (snmp(varbinds, 13, GET) < 13) { print_helperr(ERR_RET); goto exit; } - print_title(_("Bridging")); + print_top(NULL, _("Bridging")); sb_ucast = *(varbinds[11].value); // sb_ucast = varbinds[11].len_val; @@ -436,8 +438,8 @@ void bridging() i++; } */ if (m_fw_bcast) { - varbinds[i].oid = ForwardBroadcast; - varbinds[i].len_oid = sizeof(ForwardBroadcast); + varbinds[i].oid = ForwarbBcast; + varbinds[i].len_oid = sizeof(ForwarbBcast); varbinds[i].type = INT_VALUE; varbinds[i].value = (char *) &fw_bcast; varbinds[i].len_val = 1; @@ -470,10 +472,13 @@ void bridging() } print_help(WAIT_SET); - if (snmp(varbinds, i, SET) <= 0) + if (snmp(varbinds, i, SET) <= 0) { print_helperr(ERR_SET); - else + } else { + wbkgd(main_sub, A_NORMAL); + wrefresh(main_sub); print_help(DONE_SET); + } goto exit; case 'Q': case 'q': @@ -484,7 +489,7 @@ void bridging() exit: getch(); quit: - print_title(""); + print_top(NULL, NULL); clear_main(0); }