1 Star 0 Fork 7

f1nder/CGuard

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CGuard.h 2.19 KB
一键复制 编辑 原始数据 按行查看 历史
ChannelGuard 提交于 2020-05-09 19:06 . update
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "CGuardRightConfig.h"
#define CHANNEL_HOMEKIT 1
#define CHANNEL_ZIGBEE 2
/**
*END
*/
#define AuthorizationDataLength 32
#define base64AuthorizationDataLength ( (AuthorizationDataLength%3) ? ( (AuthorizationDataLength/3+1)*4 ) : (AuthorizationDataLength/3*4) )
typedef char typeAuthorizationData[AuthorizationDataLength];
typedef char typebase64AuthorizationData[base64AuthorizationDataLength];
typedef unsigned short typeRight;
typedef struct ACLListNode
{
typeAuthorizationData ad;
struct ACLListNode *next;
} ACLListNode;
/**
* Enable the channel. This function may block the caller.
*
* @param channel the channel to enable
*/
int CS_EnableChannel(unsigned short * channel);
/**
* Disable the channel.
*
* @param channel the channel to disable
*/
int CS_DisableChannel(unsigned short channel);
/**
* Implemented by device manufacturer.
* Homekit main function
*/
int HomekitMainFunction(int argc, char* argv[]);
int InitSecurityEnforcement(void);
/**
* Security: Check the right of authorization data.
*
* @param ad original additional authorization data.
* @param right The Right subject is going to access.
*
* @return 0 If checking successfully passed.
* @return 1 If checking failed.
*/
int CC_CheckAuthData(typeAuthorizationData ad, typeRight right);
/**
* Security: Add authorization data to ACL.
*
* @param ad original additional authorization data.
* @param right The Right of ad to be added.
*
* @return 0 If successful.
*/
int CC_AppendACL(typeAuthorizationData ad, typeRight right);
/**
* Security: Delete right of authorization data from ACL.
*
* @param ad original additional authorization data.
* @param right The Right of ad to be deleted.
*
* @return 0 If successful.
*/
int CC_DeleteACL(typeAuthorizationData ad, typeRight right);
void CM_GetChannelStatus(void);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/f1nder/CGuard.git
git@gitee.com:f1nder/CGuard.git
f1nder
CGuard
CGuard
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385