• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 #ifndef HDC_EXT_CLIENT_H
16 #define HDC_EXT_CLIENT_H
17 
18 #include "host_common.h"
19 
20 extern std::map<std::string, std::string> g_lists;
21 extern bool g_show;
22 
23 namespace Hdc {
24 class ExtClient {
25 public:
26     std::string connectKey;
27     std::string containerInOut;
28     ExtClient();
29     virtual ~ExtClient();
30     void ExecuteCommand(const string &command);
31     static bool SharedLibraryExist();
32 
33 private:
34     uv_lib_t lib;
35     void Version(const std::string &str);
36     void Help(const std::string &str);
37     void Discover(const std::string &str);
38     void Start(const std::string &str);
39     void Kill(const std::string &str);
40     void ListTargets(const std::string &str);
41     void Connect(const std::string &str);
42     void Shell(const std::string &str);
43     void File(const std::string &str);
44     void Fport(const std::string &str);
45     void Rport(const std::string &str);
46     void Install(const std::string &str);
47     void Uninstall(const std::string &str);
48     void Jpid(const std::string &str);
49     void TrackJpid(const std::string &str);
50     void Utility(const std::string &str);
51     void Bugreport(const std::string &str);
52     void WaitFor(const std::string &str);
53     void UnknowCommand(const std::string &str);
54     std::string RemoveRemoteCwd(const std::string &str);
55     void UpdateList(const std::string &str);
56     void Handle(const std::string &str, const char *name);
57     string WithConnectKey(const string &str);
58     static void WaitForExtent(const std::string &str);
59     static void RegistExecFunc(uv_lib_t *lib);
60 };
61 }
62 #endif
63 
64