X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fcontainer%2Fservice.h;fp=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fcontainer%2Fservice.h;h=37450d19c2de03e0abce8f9ab8f976b798c24187;hb=e26c1ec581be598521517829adba8c8dd23a768f;hp=0000000000000000000000000000000000000000;hpb=6699c1aea74eeb0eb400e6299079f0c7576f716f;p=iec.git diff --git a/src/type3_AndroidCloud/anbox-master/src/anbox/container/service.h b/src/type3_AndroidCloud/anbox-master/src/anbox/container/service.h new file mode 100644 index 0000000..37450d1 --- /dev/null +++ b/src/type3_AndroidCloud/anbox-master/src/anbox/container/service.h @@ -0,0 +1,63 @@ +/* + * 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_SERVICE_H_ +#define ANBOX_CONTAINER_SERVICE_H_ + +#include "anbox/common/dispatcher.h" +#include "anbox/container/container.h" +#include "anbox/network/connections.h" +#include "anbox/network/credentials.h" +#include "anbox/network/published_socket_connector.h" +#include "anbox/network/socket_connection.h" +#include "anbox/runtime.h" + +namespace anbox { +namespace container { +class Service : public std::enable_shared_from_this { + public: + struct Configuration { + bool privileged = false; + bool rootfs_overlay = true; + std::string container_network_address; + std::string container_network_gateway; + std::vector container_network_dns_servers; + }; + + static std::shared_ptr create(const std::shared_ptr &rt, + const Configuration &config); + + ~Service(); + + private: + Service(const std::shared_ptr &rt, const Configuration &config); + + int next_id(); + void new_client(std::shared_ptr< + boost::asio::local::stream_protocol::socket> const &socket); + + std::shared_ptr dispatcher_; + std::shared_ptr connector_; + std::atomic next_connection_id_; + std::shared_ptr> connections_; + std::shared_ptr backend_; + Configuration config_; +}; +} // namespace container +} // namespace anbox + +#endif