add async save data interface

Signed-off-by: jeosif <liubao6@huawei.com>
This commit is contained in:
jeosif 2024-06-05 14:50:36 +08:00
parent ab7a9520ee
commit d37115c591
4 changed files with 20 additions and 3 deletions

View File

@ -47,7 +47,7 @@
- [ ] 【安全函数】安全函数目标缓冲区大小入参与目标缓冲区实际大小必须一致;
- [ ] 【权限校验】新增sdk IPC接口必须有权限校验流程校验方案需经过MDEG评审
- [ ] 【外部输入校验】外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验;
- [ ] 【外部输入校验】按TLV格式解析数据时需校验解析获取len值是否小于等于缓冲区实际值,并校验是否符合业务数据范围;
- [ ] 【外部输入校验】按TLV格式解析时需校验解析长度值是否小于等于缓冲区实际值,并校验是否符合业务数据范围;
- [ ] 【外部输入校验】解析数据后拷贝时需校验源buffer实际缓冲区大小避免越界读写
- [ ] 【外部输入校验】新增外部输入处理需考虑完整校验方案方案需经过MDEG评审并有相应fuzz、UT用例
- [ ] 【常见问题】修改单个函数时如果涉及新增异常返回分支必须排查是否需要释放锁、内存、fd等资源

View File

@ -34,6 +34,7 @@ typedef enum {
} LnnDataType;
int32_t LnnSaveDeviceData(const char *data, LnnDataType dataType);
int32_t LnnAsyncSaveDeviceData(const char *data, LnnDataType dataType);
int32_t LnnRetrieveDeviceData(LnnDataType dataType, char **data, uint32_t *dataLen);
int32_t LnnUpdateDeviceData(const char *data, LnnDataType dataType);
int32_t LnnDeletaDeviceData(LnnDataType dataType);

View File

@ -30,11 +30,11 @@ static __thread char g_printAddr[LNN_MAX_PRINT_ADDR_LEN] = { 0 };
bool LnnIsSameConnectionAddr(const ConnectionAddr *addr1, const ConnectionAddr *addr2, bool isShort)
{
if (addr1 == NULL || addr2 == NULL) {
LNN_LOGW(LNN_STATE, "addr1 or addr2 is null");
LNN_LOGD(LNN_STATE, "addr1 or addr2 is null");
return false;
}
if (addr1->type != addr2->type) {
LNN_LOGW(LNN_STATE, "addr1 type not equal addr2 type");
LNN_LOGD(LNN_STATE, "addr1 type not equal addr2 type");
return false;
}
if (addr1->type == CONNECTION_ADDR_BR) {

View File

@ -19,19 +19,35 @@
int32_t LnnSaveDeviceData(const char *data, LnnDataType dataType)
{
(void)data;
(void)dataType;
return SOFTBUS_NOT_IMPLEMENT;
}
int32_t LnnAsyncSaveDeviceData(const char *data, LnnDataType dataType)
{
(void)data;
(void)dataType;
return SOFTBUS_NOT_IMPLEMENT;
}
int32_t LnnRetrieveDeviceData(LnnDataType dataType, char **data, uint32_t *dataLen)
{
(void)dataType;
(void)data;
(void)dataLen;
return SOFTBUS_NOT_IMPLEMENT;
}
int32_t LnnUpdateDeviceData(const char *data, LnnDataType dataType)
{
(void)data;
(void)dataType;
return SOFTBUS_NOT_IMPLEMENT;
}
int32_t LnnDeletaDeviceData(LnnDataType dataType)
{
(void)dataType;
return SOFTBUS_NOT_IMPLEMENT;
}