network_handle.h 970 B

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