2019-07-02 09:16:43 +00:00
|
|
|
|
#ifndef USERLOCK_H_
|
|
|
|
|
#define USERLOCK_H_
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <sys/socket.h>
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
#include <net/if.h>
|
|
|
|
|
#include "../../../../common/rpc/rpc_common.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define FAIL_MIN_NUM 0 /*失败次数的最小值*/
|
|
|
|
|
#define LOCK_MIN_TIME 0 /*锁定的最小时间 */
|
|
|
|
|
#define HORIZON_MIN_VALUE 0 /*认证时间范围的最小值 */
|
|
|
|
|
|
|
|
|
|
/*配置消息 */
|
|
|
|
|
typedef struct {
|
|
|
|
|
time_t logintime;
|
|
|
|
|
int timehorizon;
|
|
|
|
|
int failcount;
|
|
|
|
|
int locktime;
|
|
|
|
|
}userlock_configure_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*全局变量初始化 失败为1 成功为0*/
|
2019-07-19 09:57:55 +00:00
|
|
|
|
int Init(userlock_configure_t **userlock);
|
2019-07-02 09:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*判断锁定配置信息是否有效,时间范围大于0,失败的次数大于0,锁定时间大于0 */
|
2019-07-06 06:27:30 +00:00
|
|
|
|
ret_code userlock_config_chk(uint source, uint *config_type,
|
|
|
|
|
pointer input, int *input_len,
|
2019-07-02 09:16:43 +00:00
|
|
|
|
pointer output, int *output_len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*系统管理模块将数据内容(IP地址、端口号)发送给web server */
|
2019-07-02 11:48:55 +00:00
|
|
|
|
ret_code userlock_config_proc(uint source, uint config_type,
|
2019-07-02 09:16:43 +00:00
|
|
|
|
pointer input, int input_len,
|
|
|
|
|
pointer output, int *output_len);
|
|
|
|
|
|
|
|
|
|
#endif
|