]> git.decadent.org.uk Git - ap-utils.git/blobdiff - ap-gl/ap-gl.c
Handle missing Makefile correctly in clean rule
[ap-utils.git] / ap-gl / ap-gl.c
index 62004294732d5578f200dd7b353fc454eb1609b9..b947255bb6c69c408bd7ff175778753dc0522c91 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *      ap-config.c from Wireless Access Point Utilites for Unix
+ *      ap-gl.c from Wireless Access Point Utilites for Unix
  *
  * Copyright (c) 2002 Roman Festchook <roma at polesye dot net>
  *
 #include "ap-utils.h"
 
 WINDOW *win_for_menu, *sub_for_menu, *win_for_help, *main_win, *main_sub;
-short ap_type;
-char *community;
-int sockfd, atmel410_filter=1;
+char *community, *name;
+int atmel410_filter = 1, wait_mode = WAIT_FOREVER;
 struct in_addr ap_ip;
-
-char *ap_types[3] = {
-    "ATMEL_PRISM",
-    "NWN",
-    "ATMEL12350"
-};
-
 char *prog_title = "Wireless AP Configurator for GlobalSun";
+char set_oeminfo_allowed = 0;
+extern char *ap_types[];
 
 void config_menu()
 {
@@ -48,7 +42,7 @@ void config_menu()
         0},
        {_("Wireless"), _("Set wireless options"), atmel_wireless, 0},
        {_("Privacy"), MENU_ENCRYPT, wep, 0},
-       {_("MAC auth"), MENU_MAC, atmel_auth_mac, 0},
+       {_("Auth"), MENU_AUTH, atmel_auth, 0},
        {_("Community"), MENU_COMMUNITY, AuthorizedSettings, 0},
        {_("Radio"), _("Set radio signal power and antenna options"),
         power, 0},
@@ -56,35 +50,36 @@ void config_menu()
        {0, 0, NULL, 0}
     };
 
+   set_oeminfo_allowed++;
    uni_menu(umenu_atmel, sizeof(umenu_atmel) / sizeof(umenu_atmel[0]));
+   set_oeminfo_allowed--;
 }
 
 
 void command_menu()
 {
     struct umitems command_umenu_atmel[] = {
-       {_("Upload"), _("Make current configuration active"), upload, 0},
-       {_("Defaults"), _("Restore factory default settings"), defaults,
-        0},
+       {_("Upload"), _("Activate current configuration"), upload, 0},
+       {_("Defaults"), _("Restore factory default settings"), defaults, 0},
        {_("Reset"),
-        _("Reset AP. All not uploaded configuration will be lost"),
-        reset, 0},
+        _("Reset AP. All not uploaded configuration will be lost"), reset, 0},
        {_("TestMode"), _("Put Access Point in test mode"), test, 0},
        {"..", MAIN_MENU, NULL, 0},
        {0, 0, NULL, 0}
     };
+
+    ap_types[1] = "ATMEL_PRISM";
+
     uni_menu(command_umenu_atmel, sizeof(command_umenu_atmel) / sizeof(command_umenu_atmel[0]));
 }
 
-
 void stat_menu()
 {
     struct umitems umenu_atmel[] = {
        {_("SysInfo"), MENU_SYSINFO, atmel_sysinfo, 0},
        {_("Ethernet"), _("Get ethernet port statistics"), EthStat, 0},
        {_("Wireless"), MENU_WIRELESS, WirelessStat, 0},
-       {_("Stations"), MENU_STAS, stations,
-        0},
+       {_("Stations"), MENU_STAS, atmel_stations, 0},
        {_("KnownAPs"), _("Get info about known Access Points"), APs, 0},
        {"..", MAIN_MENU, NULL, 0},
        {0, 0, NULL, 0}
@@ -95,8 +90,8 @@ void stat_menu()
 
 void _auth()
 {
-       if(get_opts() == 0)
-               connect_options((unsigned long) NULL, ATMEL410+1);
+    if (get_opts() == 0)
+       connect_options((unsigned long) NULL, ATMEL410+1);
 }
 
 void main_menu()
@@ -124,6 +119,7 @@ int main( /*int argc, char **argv */ )
     WINDOW *win_for_title;
     char message[100];
 
+    ap_types[0]="ATMEL_PRISM";
 
 #ifdef HAVE_GETTEXT
     /* locale support init */
@@ -135,10 +131,19 @@ int main( /*int argc, char **argv */ )
     initscr();
     if (has_colors()) {
        start_color();
-       init_pair(1, COLOR_BLACK, COLOR_CYAN);
-       init_pair(2, COLOR_BLACK, COLOR_WHITE);
-       init_pair(3, COLOR_BLACK, COLOR_GREEN);
-       init_pair(4, COLOR_WHITE, COLOR_RED);
+
+       /* Never trust that these are defined by default. */
+       init_pair (COLOR_RED, COLOR_RED, COLOR_BLACK );
+       init_pair (COLOR_GREEN, COLOR_GREEN, COLOR_BLACK);
+       init_pair (COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK);
+       init_pair (COLOR_BLUE, COLOR_BLUE, COLOR_BLACK);
+       init_pair (COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK );
+       init_pair (COLOR_CYAN, COLOR_CYAN, COLOR_BLACK);
+
+       init_pair(11, COLOR_BLACK, COLOR_CYAN);
+       init_pair(12, COLOR_BLACK, COLOR_WHITE);
+       init_pair(13, COLOR_BLACK, COLOR_GREEN);
+       init_pair(14, COLOR_WHITE, COLOR_RED);
     }
 
     noraw();
@@ -151,12 +156,12 @@ int main( /*int argc, char **argv */ )
 
 /* draw help win */
     win_for_help = newwin(1, COLS, LINES - 1, 0);
-    wattrset(win_for_help, COLOR_PAIR(1));
+    wattrset(win_for_help, COLOR_PAIR(11));
     print_help("");
 
 /* draw title win */
     win_for_title = newwin(1, COLS, 0, 0);
-    wattrset(win_for_title, COLOR_PAIR(1));
+    wattrset(win_for_title, COLOR_PAIR(11));
     for (i = 0; i < COLS; i++)
        waddch(win_for_title, ' ');
     sprintf(message, _("Wireless Access Point Configurator ver. %s"),
@@ -169,7 +174,7 @@ int main( /*int argc, char **argv */ )
     sub_for_menu = derwin(win_for_menu, LINES - 5, MCOLS - 2, 2, 1);
     set_menu_win(NULL, win_for_menu);
     set_menu_sub(NULL, sub_for_menu);
-    attrset(COLOR_PAIR(1));
+    attrset(COLOR_PAIR(11));
 
     /* íÁÌÀÀ ÒÁÍËÕ */
     waddch(win_for_menu, ACS_BSSB);
@@ -202,10 +207,9 @@ int main( /*int argc, char **argv */ )
     wrefresh(main_win);
 
     about();
-    if (get_opts() == 0) {
-               connect_options((unsigned long) NULL, ATMEL410+1);
+    if (get_opts() == 0)
+       connect_options((unsigned long) NULL, ATMEL410+1);
 
-    }
     while (1)
        main_menu();