161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (C) 2022-2024 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit NetworkKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base';
2261847f8eSopenharmony_ciimport type connection from './@ohos.net.connection';
2361847f8eSopenharmony_ci
2461847f8eSopenharmony_ci/**
2561847f8eSopenharmony_ci * Provides interfaces to manage ethernet.
2661847f8eSopenharmony_ci * @namespace ethernet
2761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.Ethernet
2861847f8eSopenharmony_ci * @since 9
2961847f8eSopenharmony_ci */
3061847f8eSopenharmony_cideclare namespace ethernet {
3161847f8eSopenharmony_ci  /**
3261847f8eSopenharmony_ci   * @typedef { connection.HttpProxy }
3361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
3461847f8eSopenharmony_ci   * @since 10
3561847f8eSopenharmony_ci   */
3661847f8eSopenharmony_ci  type HttpProxy = connection.HttpProxy;
3761847f8eSopenharmony_ci
3861847f8eSopenharmony_ci  /**
3961847f8eSopenharmony_ci   * Get the specified network interface information.
4061847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
4161847f8eSopenharmony_ci   * @param { string } iface - Indicates the network interface name.
4261847f8eSopenharmony_ci   * @param { AsyncCallback<InterfaceConfiguration> } callback - the callback of getIfaceConfig.
4361847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
4461847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
4561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
4661847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
4761847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Failed to connect to the service.
4861847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
4961847f8eSopenharmony_ci   * @throws { BusinessError } 2201005 - Device information does not exist.
5061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
5161847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
5261847f8eSopenharmony_ci   * @since 9
5361847f8eSopenharmony_ci   */
5461847f8eSopenharmony_ci  function getIfaceConfig(iface: string, callback: AsyncCallback<InterfaceConfiguration>): void;
5561847f8eSopenharmony_ci
5661847f8eSopenharmony_ci  /**
5761847f8eSopenharmony_ci   * Get the specified network interface information.
5861847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
5961847f8eSopenharmony_ci   * @param { string } iface - Indicates the network interface name.
6061847f8eSopenharmony_ci   * @returns { Promise<InterfaceConfiguration> } the promise returned by the function.
6161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
6261847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
6361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
6461847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
6561847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Failed to connect to the service.
6661847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
6761847f8eSopenharmony_ci   * @throws { BusinessError } 2201005 - Device information does not exist.
6861847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
6961847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
7061847f8eSopenharmony_ci   * @since 9
7161847f8eSopenharmony_ci   */
7261847f8eSopenharmony_ci  function getIfaceConfig(iface: string): Promise<InterfaceConfiguration>;
7361847f8eSopenharmony_ci
7461847f8eSopenharmony_ci  /**
7561847f8eSopenharmony_ci   * Set the specified network interface parameters.
7661847f8eSopenharmony_ci   * @permission ohos.permission.CONNECTIVITY_INTERNAL
7761847f8eSopenharmony_ci   * @param { string } iface - Indicates the network interface name of the network parameter.
7861847f8eSopenharmony_ci   * @param { InterfaceConfiguration } ic - Indicates the ic. See {@link InterfaceConfiguration}.
7961847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - the callback of setIfaceConfig.
8061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
8161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
8261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
8361847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
8461847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Failed to connect to the service.
8561847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
8661847f8eSopenharmony_ci   * @throws { BusinessError } 2201004 - Invalid Ethernet profile.
8761847f8eSopenharmony_ci   * @throws { BusinessError } 2201005 - Device information does not exist.
8861847f8eSopenharmony_ci   * @throws { BusinessError } 2201006 - Ethernet device not connected.
8961847f8eSopenharmony_ci   * @throws { BusinessError } 2201007 - Ethernet failed to write user configuration information.
9061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
9161847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
9261847f8eSopenharmony_ci   * @since 9
9361847f8eSopenharmony_ci   */
9461847f8eSopenharmony_ci  function setIfaceConfig(iface: string, ic: InterfaceConfiguration, callback: AsyncCallback<void>): void;
9561847f8eSopenharmony_ci
9661847f8eSopenharmony_ci  /**
9761847f8eSopenharmony_ci   * Set the specified network interface parameters.
9861847f8eSopenharmony_ci   * @permission ohos.permission.CONNECTIVITY_INTERNAL
9961847f8eSopenharmony_ci   * @param { string } iface - Indicates the network interface name of the network parameter.
10061847f8eSopenharmony_ci   * @param { InterfaceConfiguration } ic - Indicates the ic. See {@link InterfaceConfiguration}.
10161847f8eSopenharmony_ci   * @returns { Promise<void> } the promise returned by the function.
10261847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
10361847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
10461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
10561847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
10661847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Failed to connect to the service.
10761847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
10861847f8eSopenharmony_ci   * @throws { BusinessError } 2201004 - Invalid Ethernet profile.
10961847f8eSopenharmony_ci   * @throws { BusinessError } 2201005 - Device information does not exist.
11061847f8eSopenharmony_ci   * @throws { BusinessError } 2201006 - Ethernet device not connected.
11161847f8eSopenharmony_ci   * @throws { BusinessError } 2201007 - Ethernet failed to write user configuration information.
11261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
11361847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
11461847f8eSopenharmony_ci   * @since 9
11561847f8eSopenharmony_ci   */
11661847f8eSopenharmony_ci  function setIfaceConfig(iface: string, ic: InterfaceConfiguration): Promise<void>;
11761847f8eSopenharmony_ci
11861847f8eSopenharmony_ci  /**
11961847f8eSopenharmony_ci   * Check whether the specified network is active.
12061847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
12161847f8eSopenharmony_ci   * @param { string } iface - Indicates the network interface name.
12261847f8eSopenharmony_ci   * @param { AsyncCallback<number> } callback - the callback of isIfaceActive.
12361847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
12461847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
12561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
12661847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
12761847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Failed to connect to the service.
12861847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
12961847f8eSopenharmony_ci   * @throws { BusinessError } 2201005 - Device information does not exist.
13061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
13161847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
13261847f8eSopenharmony_ci   * @since 9
13361847f8eSopenharmony_ci   */
13461847f8eSopenharmony_ci  function isIfaceActive(iface: string, callback: AsyncCallback<number>): void;
13561847f8eSopenharmony_ci
13661847f8eSopenharmony_ci  /**
13761847f8eSopenharmony_ci   * Check whether the specified network is active.
13861847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
13961847f8eSopenharmony_ci   * @param { string } iface - Indicates the network interface name.
14061847f8eSopenharmony_ci   * @returns { Promise<number> } the promise returned by the function. 
14161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
14261847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
14361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
14461847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
14561847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Failed to connect to the service.
14661847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
14761847f8eSopenharmony_ci   * @throws { BusinessError } 2201005 - Device information does not exist.
14861847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
14961847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
15061847f8eSopenharmony_ci   * @since 9
15161847f8eSopenharmony_ci   */
15261847f8eSopenharmony_ci  function isIfaceActive(iface: string): Promise<number>;
15361847f8eSopenharmony_ci
15461847f8eSopenharmony_ci  /**
15561847f8eSopenharmony_ci   * Gets the names of all active network interfaces.
15661847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
15761847f8eSopenharmony_ci   * @param { AsyncCallback<Array<string>> } callback - the callback of getAllActiveIfaces.
15861847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
15961847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
16061847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Failed to connect to the service.
16161847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
16261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
16361847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
16461847f8eSopenharmony_ci   * @since 9
16561847f8eSopenharmony_ci   */
16661847f8eSopenharmony_ci  function getAllActiveIfaces(callback: AsyncCallback<Array<string>>): void;
16761847f8eSopenharmony_ci
16861847f8eSopenharmony_ci  /**
16961847f8eSopenharmony_ci   * Gets the names of all active network interfaces.
17061847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
17161847f8eSopenharmony_ci   * @returns { Promise<Array<string>> } the promise returned by the function.
17261847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
17361847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
17461847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Failed to connect to the service.
17561847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
17661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
17761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
17861847f8eSopenharmony_ci   * @since 9
17961847f8eSopenharmony_ci   */
18061847f8eSopenharmony_ci  function getAllActiveIfaces(): Promise<Array<string>>;
18161847f8eSopenharmony_ci
18261847f8eSopenharmony_ci  /**
18361847f8eSopenharmony_ci   * Register a callback for the ethernet interface active state change.
18461847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
18561847f8eSopenharmony_ci   * @param { 'interfaceStateChange' } type - Indicates Event name.
18661847f8eSopenharmony_ci   * @param { Callback<{ iface: string, active: boolean }> } callback - Including iface Indicates the ethernet interface,
18761847f8eSopenharmony_ci   * and active Indicates whether the interface is active.
18861847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
18961847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
19061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
19161847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
19261847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
19361847f8eSopenharmony_ci   * @since 10
19461847f8eSopenharmony_ci   */
19561847f8eSopenharmony_ci  /**
19661847f8eSopenharmony_ci   * Register a callback for the ethernet interface active state change.
19761847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
19861847f8eSopenharmony_ci   * @param { 'interfaceStateChange' } type - Indicates Event name.
19961847f8eSopenharmony_ci   * @param { Callback<InterfaceStateInfo> } callback - Including iface Indicates the ethernet interface,
20061847f8eSopenharmony_ci   * and active Indicates whether the interface is active.
20161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
20261847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
20361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
20461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
20561847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
20661847f8eSopenharmony_ci   * @since 11
20761847f8eSopenharmony_ci   */
20861847f8eSopenharmony_ci  function on(type: 'interfaceStateChange', callback: Callback<InterfaceStateInfo>): void;
20961847f8eSopenharmony_ci
21061847f8eSopenharmony_ci  /**
21161847f8eSopenharmony_ci   * Unregister a callback from the ethernet interface active state change.
21261847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
21361847f8eSopenharmony_ci   * @param { 'interfaceStateChange' } type - Indicates Event name.
21461847f8eSopenharmony_ci   * @param { Callback<{ iface: string, active: boolean }> } callback - Including iface Indicates the ethernet interface,
21561847f8eSopenharmony_ci   * and active Indicates whether the interface is active.
21661847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
21761847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
21861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
21961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
22061847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
22161847f8eSopenharmony_ci   * @since 10
22261847f8eSopenharmony_ci   */
22361847f8eSopenharmony_ci  /**
22461847f8eSopenharmony_ci   * Unregister a callback from the ethernet interface active state change.
22561847f8eSopenharmony_ci   * @permission ohos.permission.GET_NETWORK_INFO
22661847f8eSopenharmony_ci   * @param { 'interfaceStateChange' } type - Indicates Event name.
22761847f8eSopenharmony_ci   * @param { Callback<InterfaceStateInfo> } callback - Including iface Indicates the ethernet interface,
22861847f8eSopenharmony_ci   * and active Indicates whether the interface is active.
22961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
23061847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
23161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
23261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
23361847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
23461847f8eSopenharmony_ci   * @since 11
23561847f8eSopenharmony_ci   */
23661847f8eSopenharmony_ci  function off(type: 'interfaceStateChange', callback?: Callback<InterfaceStateInfo>): void;
23761847f8eSopenharmony_ci
23861847f8eSopenharmony_ci  /**
23961847f8eSopenharmony_ci   * Get the ethernet mac address list.
24061847f8eSopenharmony_ci   * @permission ohos.permission.GET_ETHERNET_LOCAL_MAC
24161847f8eSopenharmony_ci   * @returns { Promise<Array<string>> } the promise returned by the function.
24261847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
24361847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
24461847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
24561847f8eSopenharmony_ci   * @throws { BusinessError } 2201005 - Device information does not exist.
24661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
24761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
24861847f8eSopenharmony_ci   * @since 13
24961847f8eSopenharmony_ci   */
25061847f8eSopenharmony_ci  function getMacAddress(): Promise<Array<MacAddressInfo>>;
25161847f8eSopenharmony_ci
25261847f8eSopenharmony_ci  /**
25361847f8eSopenharmony_ci   * Defines the network configuration for the Ethernet connection.
25461847f8eSopenharmony_ci   * @interface InterfaceConfiguration
25561847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
25661847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
25761847f8eSopenharmony_ci   * @since 9
25861847f8eSopenharmony_ci   */
25961847f8eSopenharmony_ci  export interface InterfaceConfiguration {
26061847f8eSopenharmony_ci    /**
26161847f8eSopenharmony_ci     * @type {IPSetMode}
26261847f8eSopenharmony_ci     * See {@link IPSetMode}
26361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
26461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
26561847f8eSopenharmony_ci     * @since 9
26661847f8eSopenharmony_ci     */
26761847f8eSopenharmony_ci    mode: IPSetMode;
26861847f8eSopenharmony_ci    /**
26961847f8eSopenharmony_ci     * Ethernet connection static configuration IP information.
27061847f8eSopenharmony_ci     * The address value range is 0-255.0-255.0-255.0-255.0-255
27161847f8eSopenharmony_ci     * (DHCP mode does not need to be configured)
27261847f8eSopenharmony_ci     * @type {string}
27361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
27461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
27561847f8eSopenharmony_ci     * @since 9
27661847f8eSopenharmony_ci     */
27761847f8eSopenharmony_ci    ipAddr: string;
27861847f8eSopenharmony_ci
27961847f8eSopenharmony_ci    /**
28061847f8eSopenharmony_ci     * Ethernet connection static configuration route information.
28161847f8eSopenharmony_ci     * The address value range is 0-255.0-255.0-255.0-255.0-255
28261847f8eSopenharmony_ci     * (DHCP mode does not need to be configured)
28361847f8eSopenharmony_ci     * @type {string}
28461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
28561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
28661847f8eSopenharmony_ci     * @since 9
28761847f8eSopenharmony_ci     */
28861847f8eSopenharmony_ci    route: string;
28961847f8eSopenharmony_ci
29061847f8eSopenharmony_ci    /**
29161847f8eSopenharmony_ci     * Ethernet connection static configuration gateway information.
29261847f8eSopenharmony_ci     * The address value range is 0-255.0-255.0-255.0-255.0-255
29361847f8eSopenharmony_ci     * (DHCP mode does not need to be configured)
29461847f8eSopenharmony_ci     * @type {string}
29561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
29661847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
29761847f8eSopenharmony_ci     * @since 9
29861847f8eSopenharmony_ci     */
29961847f8eSopenharmony_ci    gateway: string;
30061847f8eSopenharmony_ci
30161847f8eSopenharmony_ci    /**
30261847f8eSopenharmony_ci     * Ethernet connection static configuration netMask information.
30361847f8eSopenharmony_ci     * The address value range is 0-255.0-255.0-255.0-255.0-255
30461847f8eSopenharmony_ci     * (DHCP mode does not need to be configured)
30561847f8eSopenharmony_ci     * @type {string}
30661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
30761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
30861847f8eSopenharmony_ci     * @since 9
30961847f8eSopenharmony_ci     */
31061847f8eSopenharmony_ci    netMask: string;
31161847f8eSopenharmony_ci
31261847f8eSopenharmony_ci    /**
31361847f8eSopenharmony_ci     * The Ethernet connection is configured with the dns service address.
31461847f8eSopenharmony_ci     * The address value range is 0-255.0-255.0-255.0-255.0-255
31561847f8eSopenharmony_ci     * (DHCP mode does not need to be configured, Multiple addresses are separated by ",")
31661847f8eSopenharmony_ci     * @type {string}
31761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
31861847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
31961847f8eSopenharmony_ci     * @since 9
32061847f8eSopenharmony_ci     */
32161847f8eSopenharmony_ci    dnsServers: string;
32261847f8eSopenharmony_ci
32361847f8eSopenharmony_ci    /**
32461847f8eSopenharmony_ci     * Indicates the HttpProxy settings, no proxy is to be used as default.
32561847f8eSopenharmony_ci     * @type {?HttpProxy}
32661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
32761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
32861847f8eSopenharmony_ci     * @since 10
32961847f8eSopenharmony_ci     */
33061847f8eSopenharmony_ci    httpProxy?: HttpProxy;
33161847f8eSopenharmony_ci  }
33261847f8eSopenharmony_ci
33361847f8eSopenharmony_ci  /**
33461847f8eSopenharmony_ci   * The interface is used to monitor network interface status changes.
33561847f8eSopenharmony_ci   * @interface InterfaceStateInfo
33661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
33761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
33861847f8eSopenharmony_ci   * @since 11
33961847f8eSopenharmony_ci   */
34061847f8eSopenharmony_ci  export interface InterfaceStateInfo {
34161847f8eSopenharmony_ci    /**
34261847f8eSopenharmony_ci     * Define network card name.
34361847f8eSopenharmony_ci     * @type { string }
34461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
34561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
34661847f8eSopenharmony_ci     * @since 11
34761847f8eSopenharmony_ci     */
34861847f8eSopenharmony_ci    iface: string;
34961847f8eSopenharmony_ci    /**
35061847f8eSopenharmony_ci     * Check if it is active.
35161847f8eSopenharmony_ci     * @type { boolean }
35261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
35361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
35461847f8eSopenharmony_ci     * @since 11
35561847f8eSopenharmony_ci     */
35661847f8eSopenharmony_ci    active: boolean;
35761847f8eSopenharmony_ci  }
35861847f8eSopenharmony_ci
35961847f8eSopenharmony_ci  /**
36061847f8eSopenharmony_ci   * Defines the configuration mode of the Ethernet connection.
36161847f8eSopenharmony_ci   * @enum {number}
36261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
36361847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
36461847f8eSopenharmony_ci   * @since 9
36561847f8eSopenharmony_ci   */
36661847f8eSopenharmony_ci  export enum IPSetMode {
36761847f8eSopenharmony_ci    /**
36861847f8eSopenharmony_ci     * WAN Static configuration.
36961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
37061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
37161847f8eSopenharmony_ci     * @since 9
37261847f8eSopenharmony_ci     */
37361847f8eSopenharmony_ci    STATIC = 0,
37461847f8eSopenharmony_ci
37561847f8eSopenharmony_ci    /**
37661847f8eSopenharmony_ci     * WAN Dynamic configuration.
37761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
37861847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
37961847f8eSopenharmony_ci     * @since 9
38061847f8eSopenharmony_ci     */
38161847f8eSopenharmony_ci    DHCP = 1,
38261847f8eSopenharmony_ci
38361847f8eSopenharmony_ci    /**
38461847f8eSopenharmony_ci     * LAN Static configuration.
38561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
38661847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
38761847f8eSopenharmony_ci     * @since 11
38861847f8eSopenharmony_ci     */
38961847f8eSopenharmony_ci    LAN_STATIC = 2,
39061847f8eSopenharmony_ci
39161847f8eSopenharmony_ci    /**
39261847f8eSopenharmony_ci     * LAN Dynamic configuration.
39361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
39461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
39561847f8eSopenharmony_ci     * @since 11
39661847f8eSopenharmony_ci     */
39761847f8eSopenharmony_ci    LAN_DHCP = 3
39861847f8eSopenharmony_ci  }
39961847f8eSopenharmony_ci
40061847f8eSopenharmony_ci  /**
40161847f8eSopenharmony_ci   * Defines the mac address info of the Ethernet.
40261847f8eSopenharmony_ci   * @interface MacAddressInfo
40361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Ethernet
40461847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
40561847f8eSopenharmony_ci   * @since 13
40661847f8eSopenharmony_ci   */
40761847f8eSopenharmony_ci  export interface MacAddressInfo {
40861847f8eSopenharmony_ci    /**
40961847f8eSopenharmony_ci     * Ethernet interface name.
41061847f8eSopenharmony_ci     * @type { string }
41161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
41261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
41361847f8eSopenharmony_ci     * @since 13
41461847f8eSopenharmony_ci     */
41561847f8eSopenharmony_ci    iface: string;
41661847f8eSopenharmony_ci
41761847f8eSopenharmony_ci    /**
41861847f8eSopenharmony_ci     * Ethernet specific mac address.
41961847f8eSopenharmony_ci     * @type { string }
42061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Ethernet
42161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
42261847f8eSopenharmony_ci     * @since 13
42361847f8eSopenharmony_ci     */
42461847f8eSopenharmony_ci    macAddress: string;
42561847f8eSopenharmony_ci  }
42661847f8eSopenharmony_ci}
42761847f8eSopenharmony_ci
42861847f8eSopenharmony_ciexport default ethernet;