• 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 NET_EAP_CALLBACK_STUB_H
17 #define NET_EAP_CALLBACK_STUB_H
18 
19 #include <map>
20 #include "iremote_stub.h"
21 #include "inet_register_eap_callback.h"
22 #include "inet_eap_postback_callback.h"
23 
24 namespace OHOS {
25 namespace NetManagerStandard {
26 class NetEapPostbackCallbackStub : public IRemoteStub<INetEapPostbackCallback> {
27 public:
28     using NetEapPostbackCallbackFunc = int32_t (NetEapPostbackCallbackStub::*)(MessageParcel &, MessageParcel &);
29     NetEapPostbackCallbackStub();
30     virtual ~NetEapPostbackCallbackStub();
31 
32     int32_t OnRemoteRequest(
33         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
34 
35     int32_t OnEapSupplicantPostback(NetType netType, const sptr<EapData> &eapData) override;
36 
37 private:
38     int32_t OnEapSupplicantResult(MessageParcel &data, MessageParcel &reply);
39 
40 private:
41     std::map<uint32_t, NetEapPostbackCallbackFunc> memberFuncMap_;
42 };
43 
44 class NetRegisterEapCallbackStub : public IRemoteStub<INetRegisterEapCallback> {
45 public:
46     using NetRegisterEapCallbackFunc = int32_t (NetRegisterEapCallbackStub::*)(MessageParcel &, MessageParcel &);
47     NetRegisterEapCallbackStub();
48     virtual ~NetRegisterEapCallbackStub();
49 
50     int32_t OnRemoteRequest(
51         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
52 
53     int32_t OnRegisterCustomEapCallback(const std::string &regCmd) override;
54     int32_t OnReplyCustomEapDataEvent(int result, const sptr<EapData> &eapData) override;
55 
56 private:
57     int32_t OnRegisterCustomEapCallback(MessageParcel &data, MessageParcel &reply);
58     int32_t OnReplyCustomEapDataEvent(MessageParcel &data, MessageParcel &reply);
59 
60 private:
61     std::map<uint32_t, NetRegisterEapCallbackFunc> memberFuncMap_;
62 };
63 
64 } // namespace NetManagerStandard
65 } // namespace OHOS
66 #endif // NET_EAP_CALLBACK_STUB_H