chromium/chrome/common/extensions/api/enterprise_networking_attributes.idl

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Use the <code>chrome.enterprise.networkingAttributes</code> API to read
// information about your current network.
// Note: This API is only available to extensions force-installed by enterprise
// policy.
[platforms = ("chromeos", "lacros"),
 implemented_in = "chrome/browser/extensions/api/enterprise_networking_attributes/enterprise_networking_attributes_api.h"]
namespace enterprise.networkingAttributes {
  [noinline_doc] dictionary NetworkDetails {
    // The device's MAC address.
    DOMString macAddress;

    // The device's local IPv4 address (undefined if not configured).
    DOMString? ipv4;

    // The device's local IPv6 address (undefined if not configured).
    DOMString? ipv6;
  };

  callback GetNetworkDetailsCallback = void(NetworkDetails networkAddresses);

  interface Functions {
    // Retrieves the network details of the device's default network.
    // If the user is not affiliated or the device is not connected to a
    // network, $(ref:runtime.lastError) will be set with a failure reason.
    // |callback| : Called with the device's default network's
    // $(ref:NetworkDetails).
    void getNetworkDetails(
        GetNetworkDetailsCallback callback);
  };
};