xref: /aosp_15_r20/external/cronet/net/base/network_handle.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_BASE_NETWORK_HANDLE_H_
6 #define NET_BASE_NETWORK_HANDLE_H_
7 
8 #include <stdint.h>
9 
10 namespace net::handles {
11 
12 // Opaque handle for device-wide connection to a particular network. For
13 // example an association with a particular WiFi network with a particular
14 // SSID or a connection to particular cellular network.
15 // The meaning of this handle is target-dependent. On Android
16 // handles::NetworkHandles are equivalent to:
17 //   On Lollipop, the framework's concept of NetIDs (e.g. Network.netId), and
18 //   On Marshmallow and newer releases, network handles
19 //           (e.g. Network.getNetworkHandle()).
20 typedef int64_t NetworkHandle;
21 
22 // An invalid NetworkHandle.
23 inline constexpr NetworkHandle kInvalidNetworkHandle{-1};
24 
25 }  // namespace net::handles
26 
27 #endif  // NET_BASE_NETWORK_HANDLE_H_
28