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_SERVER_STUB_LITE_H
17 #define OHOS_DHCP_SERVER_STUB_LITE_H
18 
19 #include <map>
20 #include "i_dhcp_server.h"
21 #include "serializer.h"
22 namespace OHOS {
23 namespace DHCP {
24 
25 #define MAX_READ_EVENT_SIZE     512
26 
27 class DhcpServerStub : public IDhcpServer {
28 public:
29     DhcpServerStub();
30     virtual ~DhcpServerStub();
31     virtual int OnRemoteRequest(uint32_t code, IpcIo *req, IpcIo *reply);
32 
33 private:
34     int CheckInterfaceToken(uint32_t code, IpcIo *req);
35     int OnRegisterCallBack(uint32_t code, IpcIo *req, IpcIo *reply);
36     int OnStartDhcpServer(uint32_t code, IpcIo *req, IpcIo *reply);
37     int OnStopDhcpServer(uint32_t code, IpcIo *req, IpcIo *reply);
38     int OnSetDhcpName(uint32_t code, IpcIo *req, IpcIo *reply);
39     int OnSetDhcpRange(uint32_t code, IpcIo *req, IpcIo *reply);
40     int OnRemoveAllDhcpRange(uint32_t code, IpcIo *req, IpcIo *reply);
41     int OnRemoveDhcpRange(uint32_t code, IpcIo *req, IpcIo *reply);
42     int OnGetDhcpClientInfos(uint32_t code, IpcIo *req, IpcIo *reply);
43     int OnUpdateLeasesTime(uint32_t code, IpcIo *req, IpcIo *reply);
44     int OnPutDhcpRange(uint32_t code, IpcIo *req, IpcIo *reply);
45 private:
46     //sptr<IRemoteObject::DeathRecipient> deathRecipient_;
47 };
48 }  // namespace DHCP
49 }  // namespace OHOS
50 #endif