Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
attach.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License version 2.1 as published by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  */
17 
24 #ifndef LXCPP_COMMANDS_ATTACH_HPP
25 #define LXCPP_COMMANDS_ATTACH_HPP
26 
29 #include "lxcpp/container-impl.hpp"
30 #include "utils/channel.hpp"
31 
32 #include <sys/types.h>
33 
34 #include <string>
35 
36 namespace lxcpp {
37 
38 class Attach final: Command {
39 public:
40 
59  Attach(const ContainerConfig& config,
60  const std::vector<std::string>& argv,
61  const uid_t uid,
62  const gid_t gid,
63  const std::string& ttyPath,
64  const std::vector<gid_t>& supplementaryGids,
65  const int capsToKeep,
66  const std::string& workDirInContainer,
67  const std::vector<std::string>& envToKeep,
68  const std::vector<std::pair<std::string, std::string>>& envToSet,
69  const LoggerConfig & logger);
70  ~Attach();
71 
72  void execute();
73 
74  int getExitCode() const;
75 private:
78  int mExitCode;
79 
80  void parent(const pid_t pid);
81 
82 };
83 
84 } // namespace lxcpp
85 
86 #endif // LXCPP_COMMANDS_ATTACH_HPP
int mExitCode
Definition: attach.hpp:78
utils::Channel mIntermChannel
Definition: attach.hpp:76
int getExitCode() const
Definition: attach.cpp:110
~Attach()
Definition: attach.cpp:69
IPC implementation for related processes.
Internal structure sent between Attach command and AttachHelper.
void parent(const pid_t pid)
Definition: attach.cpp:97
void execute()
Definition: attach.cpp:74
Definition: container-config.hpp:51
ContainerImpl main class.
Command interface definition.
Definition: attach-config.hpp:39
Attach(const ContainerConfig &config, const std::vector< std::string > &argv, const uid_t uid, const gid_t gid, const std::string &ttyPath, const std::vector< gid_t > &supplementaryGids, const int capsToKeep, const std::string &workDirInContainer, const std::vector< std::string > &envToKeep, const std::vector< std::pair< std::string, std::string >> &envToSet, const LoggerConfig &logger)
Runs call in the container's context.
Definition: attach.cpp:36
Definition: command.hpp:29
AttachConfig mConfig
Definition: attach.hpp:77
Definition: attach.hpp:38
Logger configuration.
Definition: logger-config.hpp:38
Channel is implemented with a pair of anonymous sockets.
Definition: channel.hpp:38