1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-05-10 19:14:57 +02:00

refactor: Adhere to the ODR rule

This commit is contained in:
Sirius Bakke
2018-10-04 16:20:02 +02:00
parent 65a2009f97
commit e1409f0477
16 changed files with 39 additions and 39 deletions

View File

@@ -29,7 +29,7 @@
#include "OSConfigurator_linux24.h"
#include "OSData.h"
#include "OSData_ipt.h"
namespace fwcompiler {

View File

@@ -421,7 +421,7 @@ string OSConfigurator_linux24::printRunTimeAddressTablesCode()
return conf.expand().toStdString();
}
string OSConfigurator_linux24::getPathForATool(const std::string &os_variant, OSData::tools tool_name)
string OSConfigurator_linux24::getPathForATool(const std::string &os_variant, OSData_ipt::tools tool_name)
{
FWOptions* options = fw->getOptionsObject();
string attr = os_data.getAttributeNameForTool(tool_name);
@@ -444,9 +444,9 @@ string OSConfigurator_linux24::printPathForAllTools(const string &os)
list<int>::const_iterator i;
const list<int> &all_tools = os_data.getAllTools();
for (i=all_tools.begin(); i!=all_tools.end(); ++i)
res << os_data.getVariableName(OSData::tools(*i))
res << os_data.getVariableName(OSData_ipt::tools(*i))
<< "=\""
<< getPathForATool(os, OSData::tools(*i))
<< getPathForATool(os, OSData_ipt::tools(*i))
<< "\""
<< endl;
return res.str();

View File

@@ -29,7 +29,7 @@
#include "fwcompiler/OSConfigurator.h"
#include "OSData.h"
#include "OSData_ipt.h"
class QString;
class QStringList;
@@ -45,7 +45,7 @@ namespace fwcompiler {
class OSConfigurator_linux24 : public OSConfigurator {
OSData os_data;
OSData_ipt os_data;
Configlet *command_wrappers;
bool using_ipset;
@@ -60,7 +60,7 @@ namespace fwcompiler {
std::string getInterfaceVarName(libfwbuilder::FWObject *iface,
bool v6=false);
std::string getPathForATool(const std::string &os_variant, OSData::tools tool_name);
std::string getPathForATool(const std::string &os_variant, OSData_ipt::tools tool_name);
void setConfigletMacroForOptionStr(const std::string &opt,
Configlet *c,
const char *option_name);

View File

@@ -23,11 +23,11 @@
*/
#include "OSData.h"
#include "OSData_ipt.h"
using namespace std;
OSData::OSData(const std::string &ho)
OSData_ipt::OSData_ipt(const std::string &ho)
{
host_os = ho;

View File

@@ -23,15 +23,15 @@
*/
#ifndef __OSDATA_HH
#define __OSDATA_HH
#ifndef __OSDATA_IPT_HH
#define __OSDATA_IPT_HH
#include <string>
#include <map>
#include <list>
class OSData {
class OSData_ipt {
std::string host_os;
std::map<int, std::string> variable_names;
@@ -40,7 +40,7 @@ class OSData {
public:
OSData(const std::string &ho);
OSData_ipt(const std::string &ho);
typedef enum { LSMOD,
MODPROBE,

View File

@@ -30,7 +30,7 @@ FWBProduct {
"OSConfigurator_linux24.cpp",
"OSConfigurator_linux24_interfaces.cpp",
"OSConfigurator_secuwall.cpp",
"OSData.cpp",
"OSData_ipt.cpp",
"PolicyCompiler_PrintRule.cpp",
"PolicyCompiler_PrintRuleIptRst.cpp",
"PolicyCompiler_PrintRuleIptRstEcho.cpp",

View File

@@ -390,10 +390,10 @@ void CompilerDriver_pf::printStaticOptions(QTextStream &file, Firewall* fw)
void CompilerDriver_pf::setToolPathVar(Firewall* fw,
const string &os,
const string &var_path_suffix,
OSData::tools osdata_tool_type,
OSData_pf::tools osdata_tool_type,
Configlet *configlet)
{
OSData os_data;
OSData_pf os_data;
FWOptions* options = fw->getOptionsObject();
string s;
string path;
@@ -408,13 +408,13 @@ QString CompilerDriver_pf::printPathForAllTools(Firewall* fw, const string &os)
Configlet tools = Configlet(fw, "bsd", "tools");
tools.removeComments();
setToolPathVar(fw, os, "path_ifconfig", OSData::IFCONFIG, &tools);
setToolPathVar(fw, os, "path_ipf", OSData::IPF, &tools);
setToolPathVar(fw, os, "path_ipnat", OSData::IPNAT, &tools);
setToolPathVar(fw, os, "path_ipfw", OSData::IPFW, &tools);
setToolPathVar(fw, os, "path_pfctl", OSData::PFCTL, &tools);
setToolPathVar(fw, os, "path_sysctl", OSData::SYSCTL, &tools);
setToolPathVar(fw, os, "path_logger", OSData::LOGGER, &tools);
setToolPathVar(fw, os, "path_ifconfig", OSData_pf::IFCONFIG, &tools);
setToolPathVar(fw, os, "path_ipf", OSData_pf::IPF, &tools);
setToolPathVar(fw, os, "path_ipnat", OSData_pf::IPNAT, &tools);
setToolPathVar(fw, os, "path_ipfw", OSData_pf::IPFW, &tools);
setToolPathVar(fw, os, "path_pfctl", OSData_pf::PFCTL, &tools);
setToolPathVar(fw, os, "path_sysctl", OSData_pf::SYSCTL, &tools);
setToolPathVar(fw, os, "path_logger", OSData_pf::LOGGER, &tools);
return tools.expand();
}

View File

@@ -29,7 +29,7 @@
#include "CompilerDriver.h"
#include "OSConfigurator_bsd.h"
#include "TableFactory.h"
#include "OSData.h"
#include "OSData_pf.h"
#include "Configlet.h"
#include <string>
@@ -98,7 +98,7 @@ namespace fwcompiler
void setToolPathVar(libfwbuilder::Firewall* fw,
const std::string &os,
const std::string &var_path_suffix,
OSData::tools osdata_tool_type,
OSData_pf::tools osdata_tool_type,
Configlet *configlet);
QString composeActivationCommand(libfwbuilder::Firewall *fw,

View File

@@ -28,7 +28,7 @@
#include "OSConfigurator_bsd.h"
#include "OSData.h"
#include "OSData_pf.h"
#include <QMap>
#include <QStringList>

View File

@@ -28,7 +28,7 @@
#include "OSConfigurator_bsd.h"
#include "OSData.h"
#include "OSData_pf.h"
namespace fwcompiler
{

View File

@@ -28,7 +28,7 @@
#include "OSConfigurator_bsd.h"
#include "OSData.h"
#include "OSData_pf.h"
namespace fwcompiler
{

View File

@@ -32,7 +32,7 @@
#include <vector>
#include "OSConfigurator_bsd.h"
#include "OSData.h"
#include "OSData_pf.h"
/*
* Of course Solaris has nothing to do with BSD. Class
@@ -48,7 +48,7 @@ namespace fwcompiler
class OSConfigurator_solaris : public OSConfigurator_bsd
{
OSData os_data;
OSData_pf os_data;
std::vector<libfwbuilder::InetAddr> virtual_addresses;

View File

@@ -23,15 +23,15 @@
*/
#include "OSData.h"
#include "OSData_pf.h"
#include "fwbuilder/Resources.h"
using namespace std;
using namespace libfwbuilder;
OSData::OSData() {}
OSData_pf::OSData_pf() {}
string OSData::getPathForTool(const string &os,tools t)
string OSData_pf::getPathForTool(const string &os,tools t)
{
string r = "/FWBuilderResources/Target/tools/";
switch (t)

View File

@@ -23,19 +23,19 @@
*/
#ifndef __OSDATA_HH
#define __OSDATA_HH
#ifndef __OSDATA_PF_HH
#define __OSDATA_PF_HH
#include <string>
#include <map>
class OSData {
class OSData_pf {
public:
OSData();
OSData_pf();
typedef enum { IFCONFIG, SYSCTL, PFCTL, IPFW, IPF, IPNAT, LOGGER } tools;

View File

@@ -26,7 +26,7 @@
#include "definitions.h"
#include "PolicyCompiler_ipfw.h"
#include "OSData.h"
#include "OSData_pf.h"
#include "fwbuilder/AddressRange.h"
#include "fwbuilder/RuleElement.h"

View File

@@ -33,7 +33,7 @@ FWBProduct {
"OSConfigurator_macosx.cpp",
"OSConfigurator_openbsd.cpp",
"OSConfigurator_solaris.cpp",
"OSData.cpp",
"OSData_pf.cpp",
"PolicyCompiler_ipf.cpp",
"PolicyCompiler_ipf_optimizer.cpp",
"PolicyCompiler_ipfw.cpp",