~ubuntu-branches/ubuntu/edgy/ap-utils/edgy

« back to all changes in this revision

Viewing changes to lib/set_community.c

  • Committer: Bazaar Package Importer
  • Author(s): Celso González
  • Date: 2004-12-05 19:40:10 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041205194010-4sbpbou1f4nn5xh9
Tags: 1.4.1+1.5pre1-1
* The "Freedom Of Ukraine" release
* New upstream release (closes: #243208 fix little incorrection in man page)
  - added two new programs ap-auth and ap-gl
  - added support for VERNET AP extension
  - lots of ui improvement
  - Some lintian fixes about utf8 encoding
  

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <stdlib.h>
24
24
#include <string.h>
25
25
#include "ap-utils.h"
26
 
#include "ap-curses.h"
27
26
 
28
27
#define COMMUNITY_TOP_HEADER _("Set community/password")
29
28
#define COMMUNITY_HEADER1 _("Key Access level")
30
29
#define COMMUNITY_HEADER2 _("Community/Password")
31
 
#define COMMUNITY_USER  _("[U] User")
32
 
#define COMMUNITY_ADMIN  _("[A] Administrator")
 
30
#define COMMUNITY_USER  _("[U] User ")
 
31
#define COMMUNITY_ADMIN  _("[A] Administrator ")
 
32
#define COMMUNITY_MANUF  _("[M] Manufacturer ")
33
33
#define COMMUNITY_HELP _("[key] - set community/password; W - write config to AP; Q - quit to menu")
34
34
 
35
35
extern WINDOW *main_sub;
37
37
 
38
38
void AuthorizedSettings()
39
39
{
40
 
 
41
40
    char AuthorizedUserPass[3][12] = {
42
41
        {0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01, 0x09, 0x01,
43
42
         0x00},
44
43
        {0x2B, 0x06, 0x01, 0x04, 0x01, 0x87, 0x29, 0x02, 0x01, 0x02, 0x01,
45
44
         0x00},
46
 
       {0x2B, 0x06, 0x01, 0x04, 0x01, 0xe0, 0x3e, 0x01, 0x01, 0x09, 0x01,
 
45
       {0x2B, 0x06, 0x01, 0x04, 0x01, 0xE0, 0x3E, 0x01, 0x01, 0x09, 0x01,
47
46
         0x00}
48
47
    };
49
48
    char AuthorizedAdminPass[3][12] = {
51
50
         0x00},
52
51
        {0x2B, 0x06, 0x01, 0x04, 0x01, 0x87, 0x29, 0x02, 0x01, 0x02, 0x02,
53
52
         0x00},
54
 
        {0x2B, 0x06, 0x01, 0x04, 0x01, 0xe0, 0x3e, 0x01, 0x01, 0x09, 0x02,
 
53
        {0x2B, 0x06, 0x01, 0x04, 0x01, 0xE0, 0x3E, 0x01, 0x01, 0x09, 0x02,
55
54
         0x00}
56
55
    };
57
56
    char AuthorizedManufactPass[] =
69
68
    }
70
69
 
71
70
    user[0] = admin[0] = manufact[0] = '\0';
72
 
    print_title(COMMUNITY_TOP_HEADER);
 
71
    print_top(NULL, COMMUNITY_TOP_HEADER);
73
72
 
74
73
    mvwaddstr(main_sub, 0, 0, COMMUNITY_HEADER1);
75
74
    mvwaddstr(main_sub, 0, 25, COMMUNITY_HEADER2);
77
76
    mvwaddstr(main_sub, 2, 0, COMMUNITY_ADMIN);
78
77
 
79
78
    if (ap_type == ATMEL410 || ap_type == ATMEL12350) {
80
 
        mvwaddstr(main_sub, 3, 0, _("[M] Manufacturer"));
 
79
        mvwaddstr(main_sub, 3, 0, COMMUNITY_MANUF);
81
80
    }
82
81
    wrefresh(main_sub);
83
82
 
90
89
        case 'U':
91
90
        case 'u':
92
91
/*          get_value(user, 1, 25, sizeof(user), ANY_STRING, 0, 0, NULL); */
93
 
            get_pass(user, 1, 25, sizeof(user));
 
92
            get_pass(user, 1, strlen(COMMUNITY_USER), sizeof(user));
94
93
            continue;
95
94
        case 'A':
96
95
        case 'a':
97
96
/*          get_value(admin, 2, 25, sizeof(admin), ANY_STRING, 0, 0, NULL); */
98
 
            get_pass(admin, 2, 25, sizeof(admin));
 
97
            get_pass(admin, 2, strlen(COMMUNITY_ADMIN), sizeof(admin));
99
98
            continue;
100
99
        case 'M':
101
100
        case 'm':
104
103
                get_value(manufact, 3, 25, sizeof(manufact), ANY_STRING,
105
104
                    0, 0, NULL);
106
105
*/
107
 
                get_pass(manufact, 3, 25, sizeof(manufact));
 
106
                get_pass(manufact, 3, strlen(COMMUNITY_MANUF),
 
107
                    sizeof(manufact));
108
108
            continue;
109
109
        case 'Q':
110
110
        case 'q':
151
151
    getch();
152
152
  quit:
153
153
    print_help("");
154
 
    print_title("");
 
154
    print_top(NULL, NULL);
155
155
    clear_main(0);
156
156
}