OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [libnetworking/] [rtems_webserver/] [um.h] - Blame information for rev 1779

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 *      um.h -- GoAhead User Management public header
3
 *
4
 *      Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved.
5
 *
6
 *      See the file "license.txt" for information on usage and redistribution
7
 *
8
 * um.h,v 1.1 2000/09/01 10:57:21 joel Exp
9
 */
10
 
11
#ifndef _h_UM
12
#define _h_UM 1
13
 
14
/******************************** Description *********************************/
15
 
16
/*
17
 *      GoAhead User Management header. This defines the User Management
18
 *      public APIs.  Include this header for files that contain access to
19
 *      user inquiry or management.
20
 */
21
 
22
/********************************* Includes ***********************************/
23
 
24
#if ! UEMF
25
        #include        "basic/basic.h"
26
        #include        "emf/emf.h"
27
#else
28
        #include        "uemf.h"
29
#endif
30
 
31
/********************************** Defines ***********************************/
32
 
33
/*
34
 *      Error Return Flags
35
 */
36
#define UM_OK                           0
37
#define UM_ERR_GENERAL          -1
38
#define UM_ERR_NOT_FOUND        -2
39
#define UM_ERR_PROTECTED        -3
40
#define UM_ERR_DUPLICATE        -4
41
#define UM_ERR_IN_USE           -5
42
#define UM_ERR_BAD_NAME         -6
43
#define UM_ERR_BAD_PASSWORD -7
44
 
45
/*
46
 *      Privilege Masks
47
 */
48
#define PRIV_NONE       0x00
49
#define PRIV_READ       0x01
50
#define PRIV_WRITE      0x02
51
#define PRIV_ADMIN      0x04
52
 
53
/*
54
 *      User classes
55
 */
56
typedef short bool_t;
57
 
58
#ifndef TRUE
59
#define TRUE 1
60
#endif
61
 
62
#ifndef FALSE
63
#define FALSE 0
64
#endif
65
 
66
typedef enum {
67
        AM_NONE = 0,
68
        AM_FULL,
69
        AM_BASIC,
70
        AM_DIGEST,
71
        AM_INVALID
72
} accessMeth_t;
73
 
74
/********************************** Prototypes ********************************/
75
 
76
/*
77
 *      umOpen() must be called before accessing User Management functions
78
 */
79
extern int                              umOpen();
80
 
81
/*
82
 *      umClose() should be called before shutdown to free memory
83
 */
84
extern void                             umClose();
85
 
86
/*
87
 *      umCommit() persists the user management database
88
 */
89
extern int                              umCommit(char_t *filename);
90
 
91
/*
92
 *      umRestore() loads the user management database
93
 */
94
extern int                              umRestore(char_t *filename);
95
 
96
/*
97
 *      umUser functions use a user ID for a key
98
 */
99
extern int                              umAddUser(char_t *user, char_t *password,
100
                                                        char_t *group, bool_t protect, bool_t disabled);
101
 
102
extern int                              umDeleteUser(char_t *user);
103
 
104
extern char_t                   *umGetFirstUser();
105
extern char_t                   *umGetNextUser(char_t *lastUser);
106
 
107
extern bool_t                   umUserExists(char_t *user);
108
 
109
extern char_t                   *umGetUserPassword(char_t *user);
110
extern int                              umSetUserPassword(char_t *user, char_t *password);
111
 
112
extern char_t                   *umGetUserGroup(char_t *user);
113
extern int                              umSetUserGroup(char_t *user, char_t *password);
114
 
115
extern bool_t                   umGetUserEnabled(char_t *user);
116
extern int                              umSetUserEnabled(char_t *user, bool_t enabled);
117
 
118
extern bool_t                   umGetUserProtected(char_t *user);
119
extern int                              umSetUserProtected(char_t *user, bool_t protect);
120
 
121
/*
122
 *      umGroup functions use a group name for a key
123
 */
124
extern int                              umAddGroup(char_t *group, short privilege,
125
                                                        accessMeth_t am, bool_t protect, bool_t disabled);
126
 
127
extern int                              umDeleteGroup(char_t *group);
128
 
129
extern char_t                   *umGetFirstGroup();
130
extern char_t                   *umGetNextGroup(char_t *lastUser);
131
 
132
extern bool_t                   umGroupExists(char_t *group);
133
extern bool_t                   umGetGroupInUse(char_t *group);
134
 
135
extern accessMeth_t             umGetGroupAccessMethod(char_t *group);
136
extern int                              umSetGroupAccessMethod(char_t *group, accessMeth_t am);
137
 
138
extern bool_t                   umGetGroupEnabled(char_t *group);
139
extern int                              umSetGroupEnabled(char_t *group, bool_t enabled);
140
 
141
extern short                    umGetGroupPrivilege(char_t *group);
142
extern int                              umSetGroupPrivilege(char_t *group, short privileges);
143
 
144
extern bool_t                   umGetGroupProtected(char_t *group);
145
extern int                              umSetGroupProtected(char_t *group, bool_t protect);
146
 
147
/*
148
 *      umAccessLimit functions use a URL as a key
149
 */
150
extern int                      umAddAccessLimit(char_t *url, accessMeth_t am,
151
                                                short secure, char_t *group);
152
 
153
extern int                      umDeleteAccessLimit(char_t *url);
154
 
155
extern char_t           *umGetFirstAccessLimit();
156
extern char_t           *umGetNextAccessLimit(char_t *lastUser);
157
 
158
/*
159
 *      Returns the name of an ancestor access limit if
160
 */
161
extern char_t           *umGetAccessLimit(char_t *url);
162
 
163
extern bool_t           umAccessLimitExists(char_t *url);
164
 
165
extern accessMeth_t     umGetAccessLimitMethod(char_t *url);
166
extern int                      umSetAccessLimitMethod(char_t *url, accessMeth_t am);
167
 
168
extern short            umGetAccessLimitSecure(char_t *url);
169
extern int                      umSetAccessLimitSecure(char_t *url, short secure);
170
 
171
extern char_t           *umGetAccessLimitGroup(char_t *url);
172
extern int                      umSetAccessLimitGroup(char_t *url, char_t *group);
173
 
174
/*
175
 *      Convenience Functions
176
 */
177
 
178
extern accessMeth_t     umGetAccessMethodForURL(char_t *url);
179
extern bool_t           umUserCanAccessURL(char_t *user, char_t *url);
180
 
181
#endif /* _h_UM */
182
 
183
/******************************************************************************/
184
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.