acl/lib_acl/include/net/acl_access.h

53 lines
1.4 KiB
C
Raw Normal View History

#ifndef __ACL_ACCESS_INCLUDE_H__
#define __ACL_ACCESS_INCLUDE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "stdlib/acl_stdlib.h"
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ip <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>
* @param data <EFBFBD><EFBFBD><EFBFBD><EFBFBD> IP <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD>: 10.0.0.1:10.0.250.1, 192.168.0.1:192.168.0.255
* @param sep1 ÿ<EFBFBD><EFBFBD> IP <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD>ķָ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> "," <EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>
* @param sep2 ÿ<EFBFBD><EFBFBD> IP <EFBFBD><EFBFBD>ַ<EFBFBD>θߵ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>ַ֮<EFBFBD><EFBFBD><EFBFBD>ķָ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> ":" <EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>
* @return <EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. 0: <EFBFBD>ɹ<EFBFBD>; < 0: ʧ<EFBFBD><EFBFBD>
* ע: <EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̲߳<EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD>
*/
ACL_API int acl_access_add(const char *data, const char *sep1, const char *sep2);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>ж<EFBFBD>ȡ IP <EFBFBD><EFBFBD>ַ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IP <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
* @param xcp <EFBFBD>Ѿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param name xcp <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IP <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>صı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳɹ<EFBFBD>. 0: <EFBFBD>ɹ<EFBFBD>; < 0: ʧ<EFBFBD><EFBFBD>.
* ע: <EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̲߳<EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD>
*/
ACL_API int acl_access_cfg(ACL_XINETD_CFG_PARSER *xcp, const char *name);
/**
* <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD>򱾿<EFBFBD><EFBFBD>Զ<EFBFBD>ʹ<EFBFBD><EFBFBD> aclMsg.c<EFBFBD>еĿ<EFBFBD>.
* @param log_fn <EFBFBD>û<EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
* ע: <EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̲߳<EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD>
*/
ACL_API void acl_access_setup_logfn(void (*log_fn)(const char *fmt, ...));
/**
* <EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IP <EFBFBD><EFBFBD>ַ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD> IP <EFBFBD><EFBFBD>ַ<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>.
* @param ip <EFBFBD><EFBFBD>ʽ: 192.168.0.1
* @return <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>, != 0: <EFBFBD><EFBFBD>; == 0: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
*/
ACL_API int acl_access_permit(const char *ip);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
*/
ACL_API void acl_access_debug(void);
#ifdef __cplusplus
}
#endif
#endif