blob: a814fe440baae1e32f3bf8758bb8ea126a55833e [file] [log] [blame]
Niranjan Pendharkar7e08f852017-07-24 11:40:05 -07001/*
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
Lorenzo Colittif91682c2018-02-07 17:43:31 +090020#include <android/system/net/netd/1.1/INetd.h>
Niranjan Pendharkar7e08f852017-07-24 11:40:05 -070021
22using android::hardware::Return;
Lorenzo Colittif91682c2018-02-07 17:43:31 +090023using android::hardware::hidl_string;
24using android::system::net::netd::V1_1::INetd;
25using StatusCode = android::system::net::netd::V1_1::INetd::StatusCode;
Niranjan Pendharkar7e08f852017-07-24 11:40:05 -070026
27namespace android {
28namespace net {
29
30class NetdHwService : public INetd {
31public:
Lorenzo Colittif91682c2018-02-07 17:43:31 +090032 // 1.0
Niranjan Pendharkar7e08f852017-07-24 11:40:05 -070033 status_t start();
34 Return<void> createOemNetwork(createOemNetwork_cb _hidl_cb) override;
Lorenzo Colittif91682c2018-02-07 17:43:31 +090035 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;
Niranjan Pendharkar7e08f852017-07-24 11:40:05 -070052};
53
54} // namespace net
55} // namespace android
56
57#endif // ANDROID_NET_HW_SERVICE_H
58