Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Loading...
Searching...
No Matches
DnsmasqSetup.h
1/*
2* If not stated otherwise in this file or this component's LICENSE file the
3* following copyright and licenses apply:
4*
5* Copyright 2020 Sky UK
6*
7* Licensed under the Apache License, Version 2.0 (the "License");
8* you may not use this file except in compliance with the License.
9* You may obtain a copy of the License at
10*
11* http://www.apache.org/licenses/LICENSE-2.0
12*
13* Unless required by applicable law or agreed to in writing, software
14* distributed under the License is distributed on an "AS IS" BASIS,
15* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16* See the License for the specific language governing permissions and
17* limitations under the License.
18*/
19
20#ifndef DNSMASQSETUP_H
21#define DNSMASQSETUP_H
22
23#include "NetworkingHelper.h"
24#include "DobbyRdkPluginUtils.h"
25#include "Netfilter.h"
26
27#include <arpa/inet.h>
28
29#include <map>
30#include <list>
31#include <string>
32#include <memory>
33#include <mutex>
34#include <queue>
35
36// -----------------------------------------------------------------------------
46namespace DnsmasqSetup
47{
48 bool set(const std::shared_ptr<DobbyRdkPluginUtils> &utils,
49 const std::shared_ptr<Netfilter> &netfilter,
50 const std::shared_ptr<NetworkingHelper> &helper,
51 const std::string &rootfsPath,
52 const std::string &containerId,
53 const NetworkType networkType);
54
55 bool removeRules(const std::shared_ptr<Netfilter> &netfilter,
56 const std::shared_ptr<NetworkingHelper> &helper,
57 const std::string &containerId);
58};
59
60#endif // !defined(DNSMASQSETUP_H)
Sets up iptables routing to allow apps within a network namespace to talk to the dnsmasq server runni...
bool set(const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::shared_ptr< Netfilter > &netfilter, const std::shared_ptr< NetworkingHelper > &helper, const std::string &rootfsPath, const std::string &containerId, const NetworkType networkType)
Add iptables rules and create the /etc/resolv.conf file.
Definition DnsmasqSetup.cpp:173
bool removeRules(const std::shared_ptr< Netfilter > &netfilter, const std::shared_ptr< NetworkingHelper > &helper, const std::string &containerId)
Deletes dnsmasq rules for the container.
Definition DnsmasqSetup.cpp:256