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