1 /*
2  * Copyright (C) 2021 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 OHOS_DHCP_CLIENT_STUB_LITE_H
17 #define OHOS_DHCP_CLIENT_STUB_LITE_H
18 
19 #include <map>
20 #include "i_dhcp_client.h"
21 #ifndef  OHOS_EUPDATER
22 #include "serializer.h"
23 #endif
24 
25 namespace OHOS {
26 namespace DHCP {
27 class DhcpClientStub : public IDhcpClient {
28 public:
29     DhcpClientStub();
30     virtual ~DhcpClientStub();
31 #ifndef OHOS_EUPDATER
32     using handleFunc = int (DhcpClientStub::*)(uint32_t code, IpcIo *req, IpcIo *reply);
33     using HandleFuncMap = std::map<int, handleFunc>;
34     virtual int OnRemoteRequest(uint32_t code, IpcIo *req, IpcIo *reply);
35 private:
36     void InitHandleMap(void);
37     int OnRegisterCallBack(uint32_t code, IpcIo *req, IpcIo *reply);
38     int OnStartDhcpClient(uint32_t code, IpcIo *req, IpcIo *reply);
39     int OnSetConfiguration(uint32_t code, IpcIo *req, IpcIo *reply);
40     int OnStopDhcpClient(uint32_t code, IpcIo *req, IpcIo *reply);
41     int OnGetDhcpInfo(uint32_t code, IpcIo *req, IpcIo *reply);
42 private:
43     HandleFuncMap handleFuncMap;
44 #endif
45 };
46 }  // namespace DHCP
47 }  // namespace OHOS
48 #endif