#include <stdlib.h>
#include <string.h>
#include "ap-utils.h"
-#include "ap-curses.h"
#define COMMUNITY_TOP_HEADER _("Set community/password")
#define COMMUNITY_HEADER1 _("Key Access level")
#define COMMUNITY_HEADER2 _("Community/Password")
-#define COMMUNITY_USER _("[U] User")
-#define COMMUNITY_ADMIN _("[A] Administrator")
+#define COMMUNITY_USER _("[U] User ")
+#define COMMUNITY_ADMIN _("[A] Administrator ")
+#define COMMUNITY_MANUF _("[M] Manufacturer ")
#define COMMUNITY_HELP _("[key] - set community/password; W - write config to AP; Q - quit to menu")
extern WINDOW *main_sub;
void AuthorizedSettings()
{
-
char AuthorizedUserPass[3][12] = {
{0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01, 0x09, 0x01,
0x00},
{0x2B, 0x06, 0x01, 0x04, 0x01, 0x87, 0x29, 0x02, 0x01, 0x02, 0x01,
0x00},
- {0x2B, 0x06, 0x01, 0x04, 0x01, 0xe0, 0x3e, 0x01, 0x01, 0x09, 0x01,
+ {0x2B, 0x06, 0x01, 0x04, 0x01, 0xE0, 0x3E, 0x01, 0x01, 0x09, 0x01,
0x00}
};
char AuthorizedAdminPass[3][12] = {
0x00},
{0x2B, 0x06, 0x01, 0x04, 0x01, 0x87, 0x29, 0x02, 0x01, 0x02, 0x02,
0x00},
- {0x2B, 0x06, 0x01, 0x04, 0x01, 0xe0, 0x3e, 0x01, 0x01, 0x09, 0x02,
+ {0x2B, 0x06, 0x01, 0x04, 0x01, 0xE0, 0x3E, 0x01, 0x01, 0x09, 0x02,
0x00}
};
char AuthorizedManufactPass[] =
}
user[0] = admin[0] = manufact[0] = '\0';
- print_title(COMMUNITY_TOP_HEADER);
+ print_top(NULL, COMMUNITY_TOP_HEADER);
mvwaddstr(main_sub, 0, 0, COMMUNITY_HEADER1);
mvwaddstr(main_sub, 0, 25, COMMUNITY_HEADER2);
mvwaddstr(main_sub, 2, 0, COMMUNITY_ADMIN);
if (ap_type == ATMEL410 || ap_type == ATMEL12350) {
- mvwaddstr(main_sub, 3, 0, _("[M] Manufacturer"));
+ mvwaddstr(main_sub, 3, 0, COMMUNITY_MANUF);
}
wrefresh(main_sub);
case 'U':
case 'u':
/* get_value(user, 1, 25, sizeof(user), ANY_STRING, 0, 0, NULL); */
- get_pass(user, 1, 25, sizeof(user));
+ get_pass(user, 1, strlen(COMMUNITY_USER), sizeof(user));
continue;
case 'A':
case 'a':
/* get_value(admin, 2, 25, sizeof(admin), ANY_STRING, 0, 0, NULL); */
- get_pass(admin, 2, 25, sizeof(admin));
+ get_pass(admin, 2, strlen(COMMUNITY_ADMIN), sizeof(admin));
continue;
case 'M':
case 'm':
get_value(manufact, 3, 25, sizeof(manufact), ANY_STRING,
0, 0, NULL);
*/
- get_pass(manufact, 3, 25, sizeof(manufact));
+ get_pass(manufact, 3, strlen(COMMUNITY_MANUF),
+ sizeof(manufact));
continue;
case 'Q':
case 'q':
getch();
quit:
print_help("");
- print_title("");
+ print_top(NULL, NULL);
clear_main(0);
}