summaryrefslogtreecommitdiff
path: root/common/netd/binder/android/net/INetdUnsolicitedEventListener.aidl
blob: 652a79cb6817b7f37db7aa6ee8bdb8ceaabba017 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/**
 * Copyright (c) 2018, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net;

/**
 * Unsolicited netd events which are reported by the kernel via netlink.
 * This one-way interface groups asynchronous notifications sent
 * by netd to any process that registered itself via INetd.registerUnsolEventListener.
 *
 * {@hide}
 */
oneway interface INetdUnsolicitedEventListener {

    /**
     * Notifies that an interface has been idle/active for a certain period of time.
     * It is the event for idletimer.
     *
     * @param isActive true for active status, false for idle
     * @param timerLabel unique identifier of the idletimer.
     *              Since NMS only set the identifier as int, only report event with int label.
     * @param timestampNs kernel timestamp of this event, 0 for no timestamp
     * @param uid uid of this event, -1 for no uid.
     *            It represents the uid that was responsible for waking the radio.
     */
    void onInterfaceClassActivityChanged(
            boolean isActive,
            int timerLabel,
            long timestampNs,
            int uid);

    /**
     * Notifies that a specific interface reached its quota limit.
     *
     * @param alertName alert name of the quota limit
     * @param ifName interface which reached the limit
     */
    void onQuotaLimitReached(@utf8InCpp String alertName, @utf8InCpp String ifName);

    /**
     * Provides information on IPv6 DNS servers on a specific interface.
     *
     * @param ifName interface name
     * @param lifetimeS lifetime for the DNS servers in seconds
     * @param servers the address of servers.
     *                  e.g. IpV6: "2001:4860:4860::6464"
     *
     */
    void onInterfaceDnsServerInfo(
            @utf8InCpp String ifName, long lifetimeS, in @utf8InCpp String[] servers);

    /**
     * Notifies that an address has updated on a specific interface.
     *
     * @param addr address that is being updated
     * @param ifName the name of the interface on which the address is configured
     * @param flags address flags, see ifa_flags in if_addr.h
     * @param scope current scope of the address
     */
    void onInterfaceAddressUpdated(
            @utf8InCpp String addr,
            @utf8InCpp String ifName,
            int flags,
            int scope);

    /**
     * Notifies that an address has been removed on a specific interface.
     *
     * @param addr address of this change
     * @param ifName the name of the interface that changed addresses
     * @param flags address flags, see ifa_flags in if_addr.h
     * @param scope address address scope
     */
    void onInterfaceAddressRemoved(
            @utf8InCpp String addr,
            @utf8InCpp String ifName,
            int flags,
            int scope);

    /**
     * Notifies that an interface has been added.
     *
     * @param ifName the name of the added interface
     */
    void onInterfaceAdded(@utf8InCpp String ifName);

    /**
     * Notifies that an interface has been removed.
     *
     * @param ifName the name of the removed interface
     */
    void onInterfaceRemoved(@utf8InCpp String ifName);

    /**
     * Notifies that the status of the specific interface has changed.
     *
     * @param ifName the name of the interface that changed status
     * @param up true for interface up, false for down
     */
    void onInterfaceChanged(@utf8InCpp String ifName, boolean up);

    /**
     * Notifies that the link state of the specific interface has changed.
     *
     * @param ifName the name of the interface whose link state has changed
     * @param up true for interface link state up, false for link state down
     */
    void onInterfaceLinkStateChanged(@utf8InCpp String ifName, boolean up);

    /**
     * Notifies that an IP route has changed.
     *
     * @param updated true for update, false for remove
     * @param route destination prefix of this route, e.g., "2001:db8::/64"
     * @param gateway address of gateway, empty string for no gateway
     * @param ifName interface name of this route, empty string for no interface
     */
    void onRouteChanged(
            boolean updated,
            @utf8InCpp String route,
            @utf8InCpp String gateway,
            @utf8InCpp String ifName);

    /**
     * Notifies that kernel has detected a socket sending data not wrapped
     * inside a layer of SSL/TLS encryption.
     *
     * @param uid uid of this event
     * @param hex packet content in hex format
     */
    void onStrictCleartextDetected(int uid, @utf8InCpp String hex);
}