• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _ETHERNET_RECOVERY_DEVICE_H
18 #define _ETHERNET_RECOVERY_DEVICE_H
19 
20 #include "device.h"
21 
22 #include <android-base/unique_fd.h>
23 
24 // Forward declaration to avoid including "ethernet_ui.h".
25 class EthernetRecoveryUI;
26 
27 class EthernetDevice : public Device {
28  public:
29   explicit EthernetDevice(EthernetRecoveryUI* ui);
30 
31   void PreRecovery() override;
32   void PreFastboot() override;
33 
34  private:
35   int SetInterfaceFlags(const unsigned set, const unsigned clr);
36   void SetTitleIPv6LinkLocalAddress(const bool interface_up);
37 
38   android::base::unique_fd ctl_sock_;
39   static const std::string interface;
40 };
41 
42 #endif  // _ETHERNET_RECOVERY_DEVICE_H
43