• 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 EAP_DATA_H
17 #define EAP_DATA_H
18 
19 #include "parcel.h"
20 #include "refbase.h"
21 #include <climits>
22 
23 namespace OHOS {
24 namespace NetManagerStandard {
25 
26 #define EAP_CODE_MIN 1
27 #define EAP_CODE_MAX 4
28 #define EAP_TYPE_MIN 0
29 #define EAP_TYPE_MAX 255
30 
31 enum class NetEapIpcCode {
32     NET_EAP_POSTBACK = 0,
33     NET_REGISTER_CUSTOM_EAP_CALLBACK = 1,
34     NET_REPLY_CUSTOM_EAPDATA = 2,
35 };
36 
37 enum class CustomResult {
38     RESULT_FAIL = 0,
39     RESULT_NEXT = 1,
40     RESULT_FINISH = 2,
41 };
42 
43 enum class NetType {
44     WLAN0 = 1,
45     ETH0 = 2,
46     INVALID
47 };
48 
49 enum class RegTriggerMode {
50     SA_LAUNCH = 0,
51     USER_REGISTER = 1,
52     UNREGISTER = 2,
53     INVALID
54 };
55 
56 #define NET_SYMBOL_VISIBLE __attribute__ ((visibility("default")))
57 struct NET_SYMBOL_VISIBLE EapData final : public Parcelable {
58     uint32_t eapCode = UINT_MAX;
59     uint32_t eapType = UINT_MAX;
60     int32_t msgId = -1;
61     int32_t bufferLen = -1;
62     std::vector<uint8_t> eapBuffer;
63 
64     EapData();
65     ~EapData();
66     bool Marshalling(Parcel &parcel) const override;
67     static EapData* Unmarshalling(Parcel &parcel);
68     std::string PrintLogInfo();
69 };
70 } // namespace NetManagerStandard
71 } // namespace OHOS
72 #endif // EAP_DATA_H