• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @addtogroup Ethernet
18 *
19 * @brief Provides APIs for the upper-layer Ethernet service.
20 *
21 * You can use the APIs to enable or disable Extensible Authentication Protocol(EAP) via Ethernet.
22 *
23 * @since 6.0
24 * @version 1.0
25 */
26
27/**
28 * @file IEthernet.idl
29 *
30 * @brief Provides APIs to enable or disable EAP via Ethernet.
31 *
32 * @since 6.0
33 * @version 1.0
34 */
35
36/**
37 * @brief Defines the package path of the Ethernet module interface.
38 *
39 * @since 6.0
40 * @version 1.0
41 */
42package ohos.hdi.ethernet.v1_0;
43
44import ohos.hdi.ethernet.v1_0.IEthernetCallback;
45
46/**
47 * @brief Defines an interface for the upper-layer Ethernet service.
48 *
49 * @since 6.0
50 * @version 1.0
51 */
52interface IEthernet {
53   /**
54   * @brief Creates a channel to start EAP via Ethernet.
55   *
56   * @param ifName indicates the interface to start EAP(eg: eth0).
57   *
58   * @return Returns <b>0</b> if the operation is successful.
59   * @return Returns a negative value if the operation fails.
60   *
61   * @since 6.0
62   * @version 1.0
63   */
64   StartEap([in] String ifName);
65
66   /**
67   * @brief Destroys the channel to stop EAP via Ethernet.
68   *
69   * @param ifName indicates the interface to stop EAP(eg: eth0).
70   *
71   * @return Returns <b>0</b> if the operation is successful.
72   * @return Returns a negative value if the operation fails.
73   *
74   * @since 6.0
75   * @version 1.0
76   */
77   StopEap([in] String ifName);
78
79   /**
80   * @brief Registers a callback to listen for asynchronous EAP events.
81   *
82   * @param cbFunc Indicates the callback to register.
83   * @param ifName Indicates the interface name.
84   *
85   * @return Returns <b>0</b> if the operation is successful.
86   * @return Returns a negative value if the operation fails.
87   *
88   * @since 6.0
89   * @version 1.0
90   */
91   RegisterEapEventCallback([in] IEthernetCallback cbFunc, [in] String ifName);
92
93   /**
94   * @brief Unregisters a callback.
95   *
96   * @param cbFunc Indicates the callback to unregister.
97   * @param ifName Indicates the interface name.
98   *
99   * @return Returns <b>0</b> if the operation is successful.
100   * @return Returns a negative value if the operation fails.
101   *
102   * @since 6.0
103   * @version 1.0
104   */
105   UnregisterEapEventCallback([in] IEthernetCallback cbFunc, [in] String ifName);
106
107   /**
108   * @brief Send EAP shell command.
109   *
110   * @param ifName Indicates the interface name.
111   * @param cmd Indicates shell command for EAP via Ethernet.
112   *
113   * @return Returns <b>0</b> if the operation is successful.
114   * @return Returns a negative value if the operation fails.
115   *
116   * @since 6.0
117   * @version 1.0
118   */
119   EapShellCmd([in] String ifName, [in] String cmd);
120}
121