1 /*
2  * Copyright (C) 2023 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 DEV_AUTH_DEV_SESSION_DEF_H
17 #define DEV_AUTH_DEV_SESSION_DEF_H
18 
19 #include "auth_sub_session.h"
20 #include "compatible_sub_session.h"
21 #include "expand_sub_session.h"
22 #include "identity_defines.h"
23 #include "dev_session_fwk.h"
24 #include "hc_vector.h"
25 
26 typedef struct {
27     int32_t type;
28     const CJson *data;
29 } SessionEvent;
30 
31 DECLARE_HC_VECTOR(EventList, SessionEvent)
32 DECLARE_HC_VECTOR(AuthSubSessionList, AuthSubSession *)
33 
34 typedef struct {
35     DevSession base;
36     bool isClient;
37     int32_t opCode;
38     int32_t channelType;
39     int64_t channelId;
40     CJson *context;
41     int32_t curState;
42     int32_t restartState;
43     uint32_t credCurIndex;
44     uint32_t credTotalNum;
45     Uint8Buff salt;
46     Uint8Buff sessionKey;
47     EventList eventList;
48     IdentityInfoVec credList;
49     ProtocolEntity protocolEntity;
50     AuthSubSessionList authSubSessionList;
51     ExpandSubSession *expandSubSession;
52     CompatibleBaseSubSession *compatibleSubSession;
53 } SessionImpl;
54 
55 #endif
56