• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *    http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef LIGHT_SESSION_MANAGER_H
17 #define LIGHT_SESSION_MANAGER_H
18 
19 #include <stdbool.h>
20 #include "hc_string.h"
21 #include "hc_string_vector.h"
22 #include "hc_tlv_parser.h"
23 #include "hc_vector.h"
24 #include "json_utils.h"
25 #include "device_auth.h"
26 
27 typedef struct {
28     int64_t requestId;
29     int32_t osAccountId;
30     char *serviceId;
31     uint8_t *randomVal;
32     uint32_t randomLen;
33 } LightSession;
34 
35 typedef struct {
36     char *serviceId;
37     uint8_t *randomVal;
38     uint32_t randomLen;
39 } LightSessionReturnData;
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 int32_t InitLightSessionManager(void);
46 
47 void DestroyLightSessionManager(void);
48 
49 int32_t QueryLightSession(int64_t requestId, int32_t osAccountId, uint8_t **randomVal,
50     uint32_t *randomLen, char **serviceId);
51 
52 int32_t AddLightSession(int64_t requestId, int32_t osAccountId, const char *serviceId, DataBuff randomBuff);
53 
54 int32_t DeleteLightSession(int64_t requestId, int32_t osAccountId);
55 
56 #ifdef __cplusplus
57 }
58 #endif
59 #endif
60