• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright 2018 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
17package android.system.net.netd@1.1;
18
19import @1.0::INetd;
20
21/**
22 * This is the root of the HAL module and is the interface returned when
23 * loading an implementation of the INetd HAL.
24 */
25interface INetd extends @1.0::INetd {
26    /**
27     * Add route to a specified OEM network
28     * Either both, or one of the ifname and nexthop must be specified.
29     *
30     * @param networkHandle Handle to the OEM network previously returned from
31     *                      @1.0::createOemNetwork.
32     * @param ifname        Interface name specified by the route, or an empty
33     *                      string for a route that does not specify an
34     *                      interface.
35     *                      For e.g. "dummy0"
36     * @param destination   The destination prefix of the route in CIDR notation.
37     *                      For e.g. 192.0.2.0/24 or 2001:db8:1::/48.
38     * @param nexthop       IP address of the gateway for the route, or an empty
39     *                      string for a directly-connected route. If non-empty,
40     *                      must be of the same address family as the
41     *                      destination.
42     *                      For e.g. 10.0.0.1 or 2001:db8:1::cafe.
43     */
44    @callflow(next={"*"})
45    addRouteToOemNetwork(uint64_t networkHandle, string ifname,
46                         string destination, string nexthop)
47              generates (StatusCode status);
48
49    /**
50     * Remove route from a specified OEM network.
51     * Either both, or one of the ifname and nexthop must be specified.
52     *
53     * @param networkHandle Handle to the OEM network previously returned from
54     *                      @1.0::createOemNetwork.
55     * @param ifname        Interface name specified by the route, or an empty
56     *                      string for a route that does not specify an
57     *                      interface.
58     *                      For e.g. "dummy0"
59     * @param destination   The destination prefix of the route in CIDR notation.
60     *                      For e.g. 192.0.2.0/24 or 2001:db8:1::/48.
61     * @param nexthop       IP address of the gateway for the route, or an empty
62     *                      string for a directly-connected route. If non-empty,
63     *                      must be of the same address family as the
64     *                      destination.
65     *                      For e.g. 10.0.0.1 or 2001:db8:1::cafe.
66     */
67    @callflow(next={"*"})
68    removeRouteFromOemNetwork(uint64_t networkHandle, string ifname,
69                              string destination, string nexthop)
70                   generates (StatusCode status);
71
72    /**
73     * Add interface to a specified OEM network
74     *
75     * @param networkHandle Handle to the OEM network previously returned from
76     *                      @1.0::createOemNetwork.
77     * @param ifname        Interface name to add to the OEM network.
78     *                      For e.g. "dummy0".
79     */
80    @callflow(next={"*"})
81    addInterfaceToOemNetwork(uint64_t networkHandle, string ifname)
82                  generates (StatusCode status);
83
84    /**
85     * Remove interface from a specified OEM network.
86     *
87     * @param networkHandle Handle to the OEM network previously returned from
88     *                      @1.0::createOemNetwork.
89     * @param ifname        Interface name to remove from the OEM network.
90     *                      For e.g. "dummy0".
91     */
92    @callflow(next={"*"})
93    removeInterfaceFromOemNetwork(uint64_t networkHandle, string ifname)
94                       generates (StatusCode status);
95
96    /**
97     * Enable IP forwarding on the system. Client must disable forwarding when
98     * it's no longer needed.
99     *
100     * @param enable    bool to enable or disable forwarding.
101     */
102    @callflow(next={"*"})
103    setIpForwardEnable(bool enable) generates (StatusCode status);
104
105    /**
106     * Enables forwarding between two interfaces, one of which must be in an
107     * OEM network.
108     *
109     * @param inputIfName  Input interface. For e.g. "dummy0".
110     * @param outputIfName Output interface. For e.g. "rmnet_data7".
111     * @param enable       bool to enable or disable forwarding between the
112     *                     two interfaces.
113     */
114    @callflow(next={"*"})
115    setForwardingBetweenInterfaces(string inputIfName, string outputIfName,
116                                   bool enable)
117                        generates (StatusCode status);
118};
119