X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ap-utils.git;a=blobdiff_plain;f=ap-gl%2Fbridge.c;fp=ap-gl%2Fbridge.c;h=370a5ba345135a441f796a6781463f553c74ebed;hp=1ef881361031557067ff58d11de813d27a69f9d9;hb=1aac4ac30a9a0d6cd2182013d2b3fd48b65ed2fd;hpb=5c77e013a46530bb3650f61d768dfed0dd3b72cb diff --git a/ap-gl/bridge.c b/ap-gl/bridge.c index 1ef8813..370a5ba 100644 --- a/ap-gl/bridge.c +++ b/ap-gl/bridge.c @@ -33,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: ") @@ -41,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 @@ -77,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 @@ -88,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 }; @@ -120,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] = { @@ -166,11 +169,11 @@ 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; } @@ -435,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; @@ -469,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':