secgateway/Common/usermanager/ug_common.h

55 lines
1.4 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef UG_COMMON_H_
#define UG_COMMON_H_
#include <time.h>
#define USER_INDEX_MAX (100 + 2)
#define GROUP_INDEX_MAX (20 + 2)
#define UNAMESIZE (63)
#define UDESIZE (63)
#define UPWDSIZE (63)
#define UTIME (20)
#define GNAMESIZE (63)
#define GDESIZE (63)
#define LOCKNUM (10)
typedef struct user_group
{
unsigned short ID; //用户组id
char gname[GNAMESIZE+1]; //用户组名
char gdescription[GDESIZE+1]; //用户组描述
}USERGROUP;
typedef struct user_account
{
unsigned short ID; //用户id
unsigned short GID; //用户组ID
unsigned short multi_valid; //多人登陆、永久有效
char uname[UNAMESIZE+1]; //用户名
char passwd[UPWDSIZE+1]; //密码
char udescription[UDESIZE+1]; //用户描述
time_t valid_begin_time; //有效期开始时间
time_t valid_end_time; //有效期结束时间
}USERACCOUNT;
typedef struct user_authlist
{
time_t fail_time[LOCKNUM+1]; //循环队列存储认证失败时间点
int front; //循环队列头
int rear; //循环队列尾
int max_size; //循环队列的最大存储空间,锁定次数+1config_fail_num + 1
unsigned int online_num; //用户上线数量
time_t lock_time; //用户锁定时间
unsigned short group_id; //用户组id
} USERAUTHLIST;
typedef struct user_cache
{
USERACCOUNT user;
USERAUTHLIST authlist;
}USERCACHE;
#endif