• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ANDROID_NET_HW_SERVICE_H
18 #define ANDROID_NET_HW_SERVICE_H
19 
20 #include <android/system/net/netd/1.1/INetd.h>
21 
22 namespace android {
23 namespace net {
24 
25 using android::hardware::Return;
26 using android::hardware::hidl_string;
27 using INetdHw = android::system::net::netd::V1_1::INetd;
28 using StatusCode = android::system::net::netd::V1_1::INetd::StatusCode;
29 
30 class NetdHwService : public INetdHw {
31   public:
32     // 1.0
33     status_t start();
34     Return<void> createOemNetwork(createOemNetwork_cb _hidl_cb) override;
35     Return<StatusCode> destroyOemNetwork(uint64_t netHandle) override;
36 
37     // 1.1
38     Return <StatusCode> addRouteToOemNetwork(
39             uint64_t networkHandle, const hidl_string& ifname, const hidl_string& destination,
40             const hidl_string& nexthop) override;
41     Return <StatusCode> removeRouteFromOemNetwork(
42             uint64_t networkHandle, const hidl_string& ifname, const hidl_string& destination,
43             const hidl_string& nexthop) override;
44     Return <StatusCode> addInterfaceToOemNetwork(uint64_t networkHandle,
45                                                  const hidl_string& ifname) override;
46     Return <StatusCode> removeInterfaceFromOemNetwork(uint64_t networkHandle,
47                                                       const hidl_string& ifname) override;
48     Return <StatusCode> setIpForwardEnable(bool enable) override;
49     Return <StatusCode> setForwardingBetweenInterfaces(const hidl_string& inputIfName,
50                                                        const hidl_string& outputIfName,
51                                                        bool enable) override;
52 };
53 
54 }  // namespace net
55 }  // namespace android
56 
57 #endif  // ANDROID_NET_HW_SERVICE_H
58 
59