X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fcontainer%2Flxc_container.h;fp=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fcontainer%2Flxc_container.h;h=48173db836982fd7e4bc7c32f45072babf0ada91;hb=e26c1ec581be598521517829adba8c8dd23a768f;hp=0000000000000000000000000000000000000000;hpb=6699c1aea74eeb0eb400e6299079f0c7576f716f;p=iec.git diff --git a/src/type3_AndroidCloud/anbox-master/src/anbox/container/lxc_container.h b/src/type3_AndroidCloud/anbox-master/src/anbox/container/lxc_container.h new file mode 100644 index 0000000..48173db --- /dev/null +++ b/src/type3_AndroidCloud/anbox-master/src/anbox/container/lxc_container.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + +#ifndef ANBOX_CONTAINER_LXC_CONTAINER_H_ +#define ANBOX_CONTAINER_LXC_CONTAINER_H_ + +#include "anbox/container/container.h" +#include "anbox/network/credentials.h" + +#include +#include + +#include + +namespace anbox { +namespace common { +class BinderDevice; +} // namespace common +namespace container { +class LxcContainer : public Container { + public: + LxcContainer(bool privileged, + bool rootfs_overlay, + const std::string &container_network_address, + const std::string &container_network_gateway, + const std::vector &container_network_dns_servers, + const network::Credentials &creds); + ~LxcContainer(); + + void start(const Configuration &configuration) override; + void stop() override; + State state() override; + + private: + void set_config_item(const std::string &key, const std::string &value); + void setup_id_map(); + void setup_network(); + void add_device(const std::string& device, const DeviceSpecification& spec); + bool create_binder_devices(unsigned int device_count, std::vector>& devices); + + State state_; + lxc_container *container_; + bool privileged_; + bool rootfs_overlay_; + std::string container_network_address_; + std::string container_network_gateway_; + std::vector container_network_dns_servers_; + network::Credentials creds_; + std::vector> binder_devices_; +}; +} // namespace container +} // namespace anbox + +#endif