diff --git a/.gitignore b/.gitignore index a5ae22be5..385b955f0 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,7 @@ src/libfwbuilder/etc/fwbuilder.dtd src/res/objects_init.xml src/res/templates.xml VERSION.h +default/ +debug/ +release/ +*.qbs.user diff --git a/doc/doc.qbs b/doc/doc.qbs new file mode 100644 index 000000000..4d0d0bafd --- /dev/null +++ b/doc/doc.qbs @@ -0,0 +1,66 @@ +import qbs 1.0 +import qbs.FileInfo + +FWBProduct { + type: ["application", "man_pages"] + name: "doc" + + Group { + name: "Docs" + files: [ + "AUTHORS", + "ChangeLog", + "COPYING", + "Credits", + "FWBuilder-Routing-LICENSE.txt", + "PatchAcceptancePolicy.txt", + "README.*" + ] + qbs.install: qbs.targetOS.contains("linux") || qbs.targetOS.contains("windows") + qbs.installDir: qbs.targetOS.contains("unix") ? "share/doc/fwbuilder-"+versionStr : "doc" + } + + Group { + name: "Uncompressed man pages" + files: [ + "fwbedit.1", + "fwbuilder.1", + "fwb_iosacl.1", + "fwb_ipf.1", + "fwb_ipfw.1", + "fwb_ipt.1", + "fwb_pf.1", + "fwb_pix.1" + ] + fileTags: "source_man_pages" + } + + Rule { + inputs: ["source_man_pages"] + + Artifact { + filePath: input.fileName + ".gz" + fileTags: ["man_pages"] + } + + prepare: { + var outPath = FileInfo.path(output.filePath); + + var copyCmd = new Command("cp", [input.filePath, [outPath, output.completeBaseName].join('/')]); + copyCmd.silent = true; + + var compressCmd = new Command("gzip", [outPath, output.completeBaseName].join('/')); + compressCmd.description = "Compressing man page: " + input.fileName; + compressCmd.highlight = "codegen"; + + return [copyCmd, compressCmd]; + } + } + + Group { + name: "Man pages" + fileTagsFilter: "man_pages" + qbs.install: qbs.targetOS.contains("linux") + qbs.installDir: qbs.targetOS.contains("unix") ? "share/man/man1" : "" + } +} diff --git a/fwbuilder.qbs b/fwbuilder.qbs new file mode 100644 index 000000000..c8da3aac4 --- /dev/null +++ b/fwbuilder.qbs @@ -0,0 +1,52 @@ +import qbs 1.0 +import "qbs/imports/Git.qbs" as Git + +Project { + name: "fwbuilder" + qbsSearchPaths: "qbs" + + Git { id: git } + + property string version: git.version || "5.99.1" + property string xmlVersion: "24" + property string installPrefix: (qbs.installPrefix ? qbs.installPrefix : '/usr') + property string resourcesDir: { + if (qbs.targetOS.contains("windows")) + return "resources"; + else if (qbs.targetOS.contains("macos")) + return "../Resources" + else + return "share" + } + + references: [ + "src/libfwbuilder/src/fwbuilder/fwbuilder.qbs", + "src/libfwbuilder/src/fwcompiler/fwcompiler.qbs", + "src/libfwbuilder/etc/etc.qbs", + "src/libfwbuilder/migration/migration.qbs", + "src/antlr/antlr.qbs", + "src/import/import.qbs", + "src/parsers/parsers.qbs", + "src/common/common.qbs", + "src/compiler_lib/compiler_lib.qbs", + "src/juniper_lib/juniper_lib.qbs", + "src/cisco_lib/cisco_lib.qbs", + "src/pflib/pflib.qbs", + "src/iptlib/iptlib.qbs", + "src/ipfw/ipfw.qbs", + "src/pf/pf.qbs", + "src/iosacl/iosacl.qbs", + "src/ipf/ipf.qbs", + "src/nxosacl/nxosacl.qbs", + "src/procurve_acl/procurve_acl.qbs", + "src/ipt/ipt.qbs", + "src/pix/pix.qbs", + "src/junosacl/junosacl.qbs", + "src/libgui/libgui.qbs", + "src/gui/gui.qbs", + "src/fwbedit/fwbedit.qbs", + "src/res/res.qbs", + "doc/doc.qbs", + "packaging/packaging.qbs" + ] +} diff --git a/packaging/fwbuilder.nsi.in b/packaging/fwbuilder.nsi.in index cfd1385a5..006e7c2ce 100755 --- a/packaging/fwbuilder.nsi.in +++ b/packaging/fwbuilder.nsi.in @@ -12,7 +12,6 @@ Var STARTMENU_FOLDER ; with the path defined in FWBSettings class ; !define GENERATION "@GENERATION@" -!define GENERATION_SHORT "@GENERATION_SHORT@" !define VERSION "@VERSION@" @@ -178,8 +177,8 @@ FunctionEnd LicenseData "doc\COPYING" !define MUI_HEADERIMAGE - !define MUI_HEADERIMAGE_BITMAP packaging\fwbuilder-160x60.bmp - !define MUI_WELCOMEFINISHPAGE_BITMAP packaging\fwbuilder-164x314.bmp + !define MUI_HEADERIMAGE_BITMAP fwbuilder-160x60.bmp + !define MUI_WELCOMEFINISHPAGE_BITMAP fwbuilder-164x314.bmp ;**************************************************************************** ; The following macros add PageEx statements @@ -213,16 +212,16 @@ Section "FWBuilder (required)" SetOutPath $INSTDIR\resources - File src\res\resources.xml - File src\res\templates.xml - File src\res\objects_init.xml - File src\libfwbuilder\etc\fwbuilder.dtd + File resources\resources.xml + File resources\templates.xml + File resources\objects_init.xml + File resources\fwbuilder.dtd - File /r src\res\configlets - File /r src\res\help - File /r src\res\os - File /r src\res\platform - File /r src\libfwbuilder\migration + File /r resources\configlets + File /r resources\help + File /r resources\os + File /r resources\platform + File /r resources\migration SetOutPath $INSTDIR\resources\locale @@ -244,19 +243,19 @@ Section "FWBuilder (required)" File "doc\README.nxosacl" File "doc\README.junos" - File /oname=fwbuilder.ico "src\gui\fwbuilder-windows.ico" + File /oname=fwbuilder.ico "fwbuilder-windows.ico" - File /a "src\gui\release\fwbuilder.exe" - File /a "src\fwbedit\release\fwbedit.exe" - File /a "src\iosacl\release\fwb_iosacl.exe" - File /a "src\ipt\release\fwb_ipt.exe" - File /a "src\ipf\release\fwb_ipf.exe" - File /a "src\ipfw\release\fwb_ipfw.exe" - File /a "src\pf\release\fwb_pf.exe" - File /a "src\pix\release\fwb_pix.exe" - File /a "src\procurve_acl\release\fwb_procurve_acl.exe" - File /a "src\nxosacl\release\fwb_nxosacl.exe" - File /a "src\junosacl\release\fwb_junosacl.exe" + File /a "fwbuilder.exe" + File /a "fwbedit.exe" + File /a "fwb_iosacl.exe" + File /a "fwb_ipt.exe" + File /a "fwb_ipf.exe" + File /a "fwb_ipfw.exe" + File /a "fwb_pf.exe" + File /a "fwb_pix.exe" + File /a "fwb_procurve_acl.exe" + File /a "fwb_nxosacl.exe" + File /a "fwb_junosacl.exe" ; Install Qt and its dependencies diff --git a/packaging/packaging.qbs b/packaging/packaging.qbs new file mode 100644 index 000000000..f026588c9 --- /dev/null +++ b/packaging/packaging.qbs @@ -0,0 +1,33 @@ +import qbs 1.0 + +FWBProduct { + type: ["nsi"] + name: "packaging" + + Group { + files: ["fwbuilder.nsi.in"] + fileTags: "nsi.in" + } + + InputFileRule { + inputs: ["nsi.in"] + artifactFileTags: ["nsi"] + } + + Group { + condition: qbs.targetOS.contains("windows") + name: "NSIS Installer script" + fileTagsFilter: ["nsi"] + qbs.install: true + } + + Group { + condition: qbs.targetOS.contains("windows") + name: "NSIS Installer images" + files: [ + "fwbuilder-160x60.bmp", + "fwbuilder-164x314.bmp" + ] + qbs.install: true + } +} diff --git a/qbs/imports/FWBProduct.qbs b/qbs/imports/FWBProduct.qbs new file mode 100644 index 000000000..86960af1b --- /dev/null +++ b/qbs/imports/FWBProduct.qbs @@ -0,0 +1,42 @@ +import qbs 1.0 + +Product { + + Depends { name: "cpp" } + + property string resDir: { + if (qbs.targetOS.contains("windows")) + return "resources"; + else if (qbs.targetOS.contains("macos")) + return "../Resources"; + else + return project.installPrefix + '/share/fwbuilder-' + project.version; + } + + qbs.optimization: "fast" + cpp.discardUnusedData: true + cpp.cxxLanguageVersion: "c++14" + cpp.includePaths: [product.sourceDirectory] + + cpp.dynamicLibraries: { + if (qbs.targetOS.contains("windows")) + return ["pthread"]; + else + return []; + } + + cpp.defines: [ + 'WIN32_LEAN_AND_MEAN', + '__STDC_FORMAT_MACROS', + 'GENERATION="' + project.version.slice(0,project.version.lastIndexOf('.')) + '"', + 'VERSION="' + project.version + '"', + 'PREFIX="' + project.installPrefix + '"', + 'RES_DIR="' + resDir + '"', + 'FS_SEPARATOR="/"', + 'FWBUILDER_XML_VERSION="' + project.xmlVersion + '"' + ] + + cpp.cxxFlags: { + return base.concat(["-Wall", "-Wextra"]); + } +} diff --git a/qbs/imports/Git.qbs b/qbs/imports/Git.qbs new file mode 100644 index 000000000..6a75a1e32 --- /dev/null +++ b/qbs/imports/Git.qbs @@ -0,0 +1,18 @@ +import qbs 1.0 +import qbs.Process + +Probe { + property string version + property string generation + + configure: { + revision = undefined + var p = new Process() + if (p.exec("git", ["describe", "--tags", "--always"]) === 0) { + version = p.readStdOut().trim().slice(1); + generation = version.slice(0, version.lastIndexOf('.')) + } else { + console.error("Git not found") + } + } +} diff --git a/qbs/imports/InputFileRule.qbs b/qbs/imports/InputFileRule.qbs new file mode 100644 index 000000000..b1712d3e0 --- /dev/null +++ b/qbs/imports/InputFileRule.qbs @@ -0,0 +1,38 @@ +import qbs 1.0 +import qbs.TextFile + +Rule { + property stringList artifactFileTags + + Artifact { + filePath: input.completeBaseName + fileTags: artifactFileTags + } + + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = input.fileName + " -> " + output.fileName; + cmd.highlight = "codegen"; + cmd.sourceCode = function() { + var inFile = new TextFile(input.filePath, TextFile.ReadOnly) + var contents = inFile.readAll(); + inFile.close(); + + var vars = { + FWBUILDER_XML_VERSION: project.xmlVersion, + VERSION: project.version, + GENERATION: project.version.slice(0, project.version.lastIndexOf('.')), + GENERATION_SHORT: project.version.slice(0, project.version.lastIndexOf('.')).replace('.', '') + }; + + for (var i in vars) { + contents = contents.replace(new RegExp('@' + i + '@(?!\w)', 'g'), vars[i]); + } + + var file = new TextFile(output.filePath, TextFile.WriteOnly); + file.write(contents); + file.close(); + }; + return [cmd]; + } +} diff --git a/qbs/modules/libsnmp/libsnmp.qbs b/qbs/modules/libsnmp/libsnmp.qbs new file mode 100644 index 000000000..6f62cfa81 --- /dev/null +++ b/qbs/modules/libsnmp/libsnmp.qbs @@ -0,0 +1,65 @@ +import qbs 1.0 +import qbs.Process + +Module { + readonly property bool found: probe.found + readonly property string packageVersion: probe.modversion + + Depends { name: "cpp" } + + cpp.defines: probe.defines == undefined ? [] : probe.defines + cpp.commonCompilerFlags: probe.compilerFlags == undefined ? [] : probe.compilerFlags + cpp.includePaths: probe.includePaths == undefined ? [] : probe.includePaths + cpp.libraryPaths: probe.libraryPaths == undefined ? [] : probe.libraryPaths + cpp.dynamicLibraries: probe.libraries == undefined ? [] : probe.libraries + cpp.linkerFlags: probe.linkerFlags == undefined ? [] : probe.linkerFlags + + Probe { + id: probe + + property string executable: 'net-snmp-config' + + property stringList cflags + property stringList libs + + property stringList defines + property stringList libraries + property stringList libraryPaths + property stringList includePaths + property stringList compilerFlags + property stringList linkerFlags + property string modversion + + configure: { + var p = new Process() + try { + if (p.exec(executable, ['--version']) === 0) { + modversion = p.readStdOut().trim(); + if (p.exec(executable, ['--netsnmp-libs']) === 0) { + libs = p.readStdOut().trim() + libs = libs ? libs.split(/\s/) : []; + libraries = []; + libraryPaths = []; + linkerFlags = []; + for (var i = 0; i < libs.length; ++i) { + var flag = libs[i]; + if (flag.startsWith("-l")) + libraries.push(flag.slice(2)) + else if (flag.startsWith("-L")) + libraryPaths.push(flag.slice(2)) + else + linkerFlags.push(flag) + } + } + defines = ['HAVE_LIBSNMP=1', 'NET_SNMP=1'] + console.debug("Found net-snmp " + modversion); + found = true + } else { + found: false + } + } finally { + p.close(); + } + } + } +} diff --git a/qbs/modules/libxml2/libxml2.qbs b/qbs/modules/libxml2/libxml2.qbs new file mode 100644 index 000000000..a6e04a69a --- /dev/null +++ b/qbs/modules/libxml2/libxml2.qbs @@ -0,0 +1,33 @@ +import qbs 1.0 +import qbs.Probes + +Module { + readonly property bool found: probe.found + readonly property string packageVersion: probe.modversion + + Depends { name: "cpp" } + + cpp.defines: probe.defines == undefined ? [] : probe.defines + cpp.commonCompilerFlags: probe.compilerFlags == undefined ? [] : probe.compilerFlags + cpp.includePaths: probe.includePaths == undefined ? [] : probe.includePaths + cpp.libraryPaths: probe.libraryPaths == undefined ? [] : probe.libraryPaths + cpp.dynamicLibraries: probe.libraries == undefined ? [] : probe.libraries + cpp.linkerFlags: probe.linkerFlags == undefined ? [] : probe.linkerFlags + + Probes.PkgConfigProbe { + id: probe + name: "libxml-2.0" + executable: { + if (qbs.targetOS.contains("windows")) + return "i686-w64-mingw32.shared-pkg-config" + else + return "pkg-config" + } + sysroot: { + if (qbs.targetOS.contains("macos")) + return undefined; + else + return qbs.sysroot; + } + } +} diff --git a/qbs/modules/libxslt/libxslt.qbs b/qbs/modules/libxslt/libxslt.qbs new file mode 100644 index 000000000..e1208fdac --- /dev/null +++ b/qbs/modules/libxslt/libxslt.qbs @@ -0,0 +1,37 @@ +import qbs 1.0 +import qbs.Probes + +Module { + readonly property bool found: probe.found + readonly property string packageVersion: probe.modversion + + Depends { name: "cpp" } + + cpp.defines: probe.defines == undefined ? [] : probe.defines + cpp.commonCompilerFlags: probe.compilerFlags == undefined ? [] : probe.compilerFlags + cpp.includePaths: probe.includePaths == undefined ? [] : probe.includePaths + cpp.libraryPaths: probe.libraryPaths == undefined ? [] : probe.libraryPaths + cpp.dynamicLibraries: probe.libraries == undefined ? [] : probe.libraries + cpp.linkerFlags: { + if (qbs.targetOS.contains("windows")) + return []; + return (probe.linkerFlags == undefined ? [] : probe.linkerFlags); + } + + Probes.PkgConfigProbe { + id: probe + name: "libxslt" + executable: { + if (qbs.targetOS.contains("windows")) + return "i686-w64-mingw32.shared-pkg-config" + else + return "pkg-config" + } + sysroot: { + if (qbs.targetOS.contains("macos")) + return undefined; + else + return qbs.sysroot; + } + } +} diff --git a/qbs/modules/zlib/zlib.qbs b/qbs/modules/zlib/zlib.qbs new file mode 100644 index 000000000..c62d6806b --- /dev/null +++ b/qbs/modules/zlib/zlib.qbs @@ -0,0 +1,33 @@ +import qbs 1.0 +import qbs.Probes + +Module { + readonly property bool found: probe.found + readonly property string packageVersion: probe.modversion + + Depends { name: "cpp" } + + cpp.defines: probe.defines == undefined ? [] : probe.defines + cpp.commonCompilerFlags: probe.compilerFlags == undefined ? [] : probe.compilerFlags + cpp.includePaths: probe.includePaths == undefined ? [] : probe.includePaths + cpp.libraryPaths: probe.libraryPaths == undefined ? [] : probe.libraryPaths + cpp.dynamicLibraries: probe.libraries == undefined ? [] : probe.libraries + cpp.linkerFlags: probe.linkerFlags == undefined ? [] : probe.linkerFlags + + Probes.PkgConfigProbe { + id: probe + name: "zlib" + executable: { + if (qbs.targetOS.contains("windows")) + return "i686-w64-mingw32.shared-pkg-config" + else + return "pkg-config" + } + sysroot: { + if (qbs.targetOS.contains("macos")) + return undefined; + else + return qbs.sysroot; + } + } +} diff --git a/src/antlr/antlr.qbs b/src/antlr/antlr.qbs new file mode 100644 index 000000000..73229e8bc --- /dev/null +++ b/src/antlr/antlr.qbs @@ -0,0 +1,48 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "antlr" + + Depends { name: "Qt.core" } + Depends { name: "cpp" } + + cpp.includePaths: base.concat(['..']) + + Export { + Depends { name: "cpp" } + cpp.includePaths: [product.sourceDirectory, '..'] + } + + files: [ + "ANTLRUtil.cpp", + "ASTFactory.cpp", + "ASTNULLType.cpp", + "ASTRefCount.cpp", + "BaseAST.cpp", + "BitSet.cpp", + "CharBuffer.cpp", + "CharScanner.cpp", + "CommonAST.cpp", + "CommonASTWithHiddenTokens.cpp", + "CommonHiddenStreamToken.cpp", + "CommonToken.cpp", + "InputBuffer.cpp", + "LLkParser.cpp", + "MismatchedCharException.cpp", + "MismatchedTokenException.cpp", + "NoViableAltException.cpp", + "NoViableAltForCharException.cpp", + "Parser.cpp", + "RecognitionException.cpp", + "String.cpp", + "TokenBuffer.cpp", + "Token.cpp", + "TokenRefCount.cpp", + "TokenStreamBasicFilter.cpp", + "TokenStreamHiddenTokenFilter.cpp", + "TokenStreamRewriteEngine.cpp", + "TokenStreamSelector.cpp", + "TreeParser.cpp" + ] +} diff --git a/src/cisco_lib/cisco_lib.qbs b/src/cisco_lib/cisco_lib.qbs new file mode 100644 index 000000000..46748418a --- /dev/null +++ b/src/cisco_lib/cisco_lib.qbs @@ -0,0 +1,85 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "cisco_lib" + targetName: "fwbcisco" + + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "libfwbuilder" } + Depends { name: "compiler_lib" } + Depends { name: "libfwcompiler" } + Depends { name: "libxml2" } + + Export { + Depends { name: "cpp" } + cpp.includePaths: [product.sourceDirectory, '..'] + } + + files: [ + "PolicyCompiler_cisco.cpp", + "PolicyCompiler_cisco_acls.cpp", + "NamedObjectsAndGroupsSupport.cpp", + "NamedObjectsManager.cpp", + "NamedObjectsManagerNXOS.cpp", + "NamedObjectsManagerIOS.cpp", + "NamedObjectsManagerPIX.cpp", + "RoutingCompiler_cisco.cpp", + "RoutingCompiler_cisco_writers.cpp", + "splitByNetworkZonesForRE.cpp", + "specialServices.cpp", + "ACL.cpp", + "NamedObject.cpp", + "ASA8TwiceNatLogic.cpp", + "Helper.cpp", + "inspectionProtocol.cpp", + "inspectionClassMap.cpp", + "OSConfigurator_nxos.cpp", + "OSConfigurator_ios.cpp", + "CompilerDriver_nxosacl.cpp", + "CompilerDriver_nxosacl_run.cpp", + "CompilerDriver_iosacl.cpp", + "CompilerDriver_iosacl_run.cpp", + "PolicyCompiler_nxosacl.cpp", + "PolicyCompiler_nxosacl_writers.cpp", + "PolicyCompiler_iosacl.cpp", + "PolicyCompiler_iosacl_writers.cpp", + "RoutingCompiler_nxosacl.cpp", + "RoutingCompiler_nxosacl_writers.cpp", + "RoutingCompiler_iosacl.cpp", + "RoutingCompiler_iosacl_writers.cpp", + "CompilerDriver_pix.cpp", + "CompilerDriver_pix_run.cpp", + "NATCompiler_pix.cpp", + "NATCompiler_pix_find_translations.cpp", + "NATCompiler_pix_writers.cpp", + "NATCompiler_asa8.cpp", + "NATCompiler_asa8_writers.cpp", + "NATCompiler_pix_optimizers.cpp", + "OSConfigurator_pix_os.cpp", + "OSConfigurator_pix_os_fixups.cpp", + "OSConfigurator_pix_os_inspectors.cpp", + "OSConfigurator_pix_os_inspectors_pix8.cpp", + "CompilerDriver_procurve_acl.cpp", + "CompilerDriver_procurve_acl_run.cpp", + "OSConfigurator_procurve.cpp", + "PolicyCompiler_procurve_acl.cpp", + "PolicyCompiler_procurve_acl_writers.cpp", + "RoutingCompiler_procurve_acl.cpp", + "BaseObjectGroup.cpp", + "PIXObjectGroup.cpp", + "ASA8ObjectGroup.cpp", + "NXOSObjectGroup.cpp", + "IOSObjectGroup.cpp", + "PolicyCompiler_pix.cpp", + "PolicyCompiler_pix_writers.cpp", + "PolicyCompiler_pix_v6_acls.cpp", + "PolicyCompiler_pix_replace_translations.cpp", + "RoutingCompiler_pix.cpp", + "RoutingCompiler_pix_writers.cpp", + "AutomaticRules_cisco.cpp", + "AutomaticRules_iosacl.cpp", + "AutomaticRules_nxosacl.cpp" + ] +} diff --git a/src/common/common.qbs b/src/common/common.qbs new file mode 100644 index 000000000..1dff50887 --- /dev/null +++ b/src/common/common.qbs @@ -0,0 +1,24 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "common" + + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "libxml2" } + Depends { name: "libimport" } + + Export { + Depends { name: "cpp" } + cpp.includePaths: product.sourceDirectory + } + + files: [ + "init.cpp", + "init2.cpp" + ] + +} diff --git a/src/compiler_lib/compiler_lib.qbs b/src/compiler_lib/compiler_lib.qbs new file mode 100644 index 000000000..258198c2f --- /dev/null +++ b/src/compiler_lib/compiler_lib.qbs @@ -0,0 +1,36 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "compiler_lib" + targetName: "compilerdriver" + + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "libfwbuilder" } + Depends { name: "libxml2" } + + Export { + Depends { name: "cpp" } + cpp.includePaths: product.sourceDirectory + } + + files: [ + "CompilerDriver.cpp", + "CompilerDriver_files.cpp", + "CompilerDriver_compile.cpp", + "CompilerDriver_generators.cpp", + "Configlet.cpp", + "interfaceProperties.cpp", + "linux24Interfaces.cpp", + "openbsdInterfaces.cpp", + "freebsdInterfaces.cpp", + "nxosInterfaces.cpp", + "iosInterfaces.cpp", + "junosInterfaces.cpp", + "procurveInterfaces.cpp", + "pixInterfaces.cpp", + "interfacePropertiesObjectFactory.cpp", + "AutomaticRules.cpp" + ] +} diff --git a/src/fwbedit/fwbedit.cpp b/src/fwbedit/fwbedit.cpp index 070f60010..befd0edd3 100644 --- a/src/fwbedit/fwbedit.cpp +++ b/src/fwbedit/fwbedit.cpp @@ -108,7 +108,6 @@ using namespace std; FWWindow *mw = NULL; FWBSettings *st = NULL; FWBApplication *app = NULL; -int sig = FWB_SIG; string cmd_str = ""; command cmd = NONE; diff --git a/src/fwbedit/fwbedit.qbs b/src/fwbedit/fwbedit.qbs new file mode 100644 index 000000000..95775458a --- /dev/null +++ b/src/fwbedit/fwbedit.qbs @@ -0,0 +1,49 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "fwbedit" + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets", + "printsupport" + ] + } + + Depends { name: "cpp" } + Depends { name: "libfwbuilder" } + Depends { name: "compiler_lib" } + Depends { name: "libimport" } + Depends { name: "common" } + Depends { name: "libgui" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "fwbedit.cpp", + "new_object.cpp", + "repair_tree.cpp", + "list_object.cpp", + "merge.cpp", + "import.cpp", + "../libgui/FWBTree.cpp", + "../libgui/platforms.cpp" + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/gui/gui.qbs b/src/gui/gui.qbs new file mode 100644 index 000000000..8b16200ba --- /dev/null +++ b/src/gui/gui.qbs @@ -0,0 +1,76 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "gui" + targetName: "fwbuilder" + bundle.isBundle: qbs.targetOS.contains("macos") + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets", + "network", + "printsupport" + ] + } + + Depends { name: "bundle" } + Depends { name: "libfwbuilder" } + Depends { name: "common" } + Depends { name: "antlr" } + Depends { name: "parsers" } + Depends { name: "compiler_lib" } + Depends { name: "libimport" } + Depends { name: "libgui" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + Depends { name: "libsnmp" } + + cpp.dynamicLibraries: { + if (qbs.targetOS.contains("unix")) + return base.concat(["util"]); + return base; + } + + files: [ + "main.cpp" + ] + + Group { + condition: qbs.targetOS.contains("windows") + files: [ + "fwbuilder-windows.rc" + ] + } + + Group { + condition: qbs.targetOS.contains("windows") + files: [ + "fwbuilder-windows.ico" + ] + qbs.install: true + } + + Group { + fileTagsFilter: "application" + qbs.install: !bundle.isBundle + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return ""; + return "bin"; + } + } + + Group { + fileTagsFilter: ["bundle.content"] + qbs.install: true + qbs.installDir: '.' + qbs.installSourceBase: product.buildDirectory + } +} diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 4adabb25d..c9f35ee96 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -89,7 +89,6 @@ int fwbdebug = 0; bool safemode = false; bool cli_print = false; QString cli_print_fwname = ""; -int sig = FWB_SIG; void usage() { diff --git a/src/import/import.qbs b/src/import/import.qbs new file mode 100644 index 000000000..524913b8e --- /dev/null +++ b/src/import/import.qbs @@ -0,0 +1,41 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "libimport" + targetName: "import" + + Depends { name: "cpp" } + Depends { name: "Qt.gui" } + Depends { name: "libfwbuilder" } + Depends { name: "antlr" } + Depends { name: "parsers" } + Depends { name: "compiler_lib" } + Depends { name: "libxml2" } + + Export { + Depends { name: "cpp" } + cpp.includePaths: product.sourceDirectory + } + + files: [ + "QStringListOperators.cpp", + "PreImport.cpp", + "objectMaker.cpp", + "objectSignature.cpp", + "addressObjectMaker.cpp", + "serviceObjectMaker.cpp", + "getProtoByName.cpp", + "getServByName.cpp", + "Importer.cpp", + "IOSImporter.cpp", + "IOSImporterRun.cpp", + "IPTImporter.cpp", + "IPTImporterRun.cpp", + "PIXImporter.cpp", + "PIXImporterNat.cpp", + "PIXImporterRun.cpp", + "PFImporter.cpp", + "PFImporterRun.cpp" + ] +} diff --git a/src/iosacl/iosacl.qbs b/src/iosacl/iosacl.qbs new file mode 100644 index 000000000..6a103ded3 --- /dev/null +++ b/src/iosacl/iosacl.qbs @@ -0,0 +1,41 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "iosacl" + targetName: "fwb_iosacl" + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets" + ] + } + + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "compiler_lib" } + Depends { name: "cisco_lib" } + Depends { name: "common" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "iosacl.cpp", + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/ipf/ipf.qbs b/src/ipf/ipf.qbs new file mode 100644 index 000000000..e30d3ced5 --- /dev/null +++ b/src/ipf/ipf.qbs @@ -0,0 +1,39 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "ipf" + targetName: "fwb_ipf" + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets" + ] + } + Depends { name: "libfwbuilder" } + Depends { name: "compiler_lib" } + Depends { name: "common" } + Depends { name: "pflib" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "ipf.cpp", + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/ipfw/ipfw.qbs b/src/ipfw/ipfw.qbs new file mode 100644 index 000000000..0d720ecca --- /dev/null +++ b/src/ipfw/ipfw.qbs @@ -0,0 +1,39 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "ipfw" + targetName: "fwb_ipfw" + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets" + ] + } + Depends { name: "libfwbuilder" } + Depends { name: "compiler_lib" } + Depends { name: "common" } + Depends { name: "pflib" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "ipfw.cpp", + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/ipt/ipt.qbs b/src/ipt/ipt.qbs new file mode 100644 index 000000000..9f4c7022a --- /dev/null +++ b/src/ipt/ipt.qbs @@ -0,0 +1,41 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "ipt" + targetName: "fwb_ipt" + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets" + ] + } + + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "compiler_lib" } + Depends { name: "common" } + Depends { name: "iptlib" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "ipt.cpp", + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/iptlib/iptlib.qbs b/src/iptlib/iptlib.qbs new file mode 100644 index 000000000..71d637cc5 --- /dev/null +++ b/src/iptlib/iptlib.qbs @@ -0,0 +1,47 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "iptlib" + + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "libfwbuilder" } + Depends { name: "compiler_lib" } + Depends { name: "libfwcompiler" } + Depends { name: "libxml2" } + + Export { + Depends { name: "cpp" } + cpp.includePaths: product.sourceDirectory + } + + files: [ + "CompilerDriver_ipt.cpp", + "CompilerDriver_ipt_run.cpp", + "CompilerDriver_ipt_policy.cpp", + "CompilerDriver_ipt_nat.cpp", + "MangleTableCompiler_ipt.cpp", + "NATCompiler_PrintRule.cpp", + "NATCompiler_PrintRuleIptRst.cpp", + "NATCompiler_PrintRuleIptRstEcho.cpp", + "NATCompiler_ipt.cpp", + "OSConfigurator_ipcop.cpp", + "OSConfigurator_linux24.cpp", + "OSConfigurator_linux24_interfaces.cpp", + "OSConfigurator_secuwall.cpp", + "OSData.cpp", + "PolicyCompiler_PrintRule.cpp", + "PolicyCompiler_PrintRuleIptRst.cpp", + "PolicyCompiler_PrintRuleIptRstEcho.cpp", + "PolicyCompiler_ipt.cpp", + "PolicyCompiler_ipt_optimizer.cpp", + "PolicyCompiler_secuwall.cpp", + "RoutingCompiler_ipt.cpp", + "RoutingCompiler_ipt_writers.cpp", + "Preprocessor_ipt.cpp", + "combinedAddress.cpp", + "AutomaticRules_ipt.cpp", + "ipt_utils.cpp" + ] +} diff --git a/src/juniper_lib/juniper_lib.qbs b/src/juniper_lib/juniper_lib.qbs new file mode 100644 index 000000000..60aeab1e4 --- /dev/null +++ b/src/juniper_lib/juniper_lib.qbs @@ -0,0 +1,40 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "juniper_lib" + targetName: "fwbjuniper" + + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "compiler_lib" } + Depends { name: "cisco_lib" } + Depends { name: "libxml2" } + + Export { + Depends { name: "cpp" } + cpp.includePaths: product.sourceDirectory + } + + files: [ + "CompilerDriver_junosacl.cpp", + "CompilerDriver_junosacl_run.cpp", + "OSConfigurator_junos.cpp", + "../cisco_lib/PolicyCompiler_cisco.cpp", + "../cisco_lib/Helper.cpp", + "PolicyCompiler_junosacl.cpp", + "PolicyCompiler_junosacl_writers.cpp", + "../cisco_lib/NamedObjectsAndGroupsSupport.cpp", + "../cisco_lib/NamedObject.cpp", + "../cisco_lib/PolicyCompiler_cisco_acls.cpp", + "../cisco_lib/BaseObjectGroup.cpp", + "../cisco_lib/IOSObjectGroup.cpp", + "../cisco_lib/NamedObjectsManager.cpp", + "../cisco_lib/ACL.cpp", + "../cisco_lib/NXOSObjectGroup.cpp", + "../cisco_lib/PIXObjectGroup.cpp", + "../cisco_lib/ASA8ObjectGroup.cpp" + ] +} diff --git a/src/junosacl/junosacl.qbs b/src/junosacl/junosacl.qbs new file mode 100644 index 000000000..c3453801c --- /dev/null +++ b/src/junosacl/junosacl.qbs @@ -0,0 +1,40 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "junosacl" + targetName: "fwb_junosacl" + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets" + ] + } + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "compiler_lib" } + Depends { name: "juniper_lib" } + Depends { name: "common" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "junosacl.cpp", + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/libfwbuilder/etc/etc.qbs b/src/libfwbuilder/etc/etc.qbs new file mode 100644 index 000000000..e2ef7f97d --- /dev/null +++ b/src/libfwbuilder/etc/etc.qbs @@ -0,0 +1,30 @@ +import qbs 1.0 + +FWBProduct { + type: ["application", "dtd_files"] + name: "etc" + + Group { + files: ["fwbuilder.dtd.in"] + fileTags: "in_dtd_files" + } + + InputFileRule { + inputs: ["in_dtd_files"] + artifactFileTags: ["dtd_files"] + } + + Group { + name: "FWBuilder DTD" + fileTagsFilter: ["dtd_files"] + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/Resources/"; + else if (qbs.targetOS.contains("windows")) + return "resources"; + else + return "share/fwbuilder-"+versionStr; + } + } +} diff --git a/src/libfwbuilder/migration/migration.qbs b/src/libfwbuilder/migration/migration.qbs new file mode 100644 index 000000000..16917f233 --- /dev/null +++ b/src/libfwbuilder/migration/migration.qbs @@ -0,0 +1,25 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "migration" + + Git { + id: git + } + + Group { + name: "FWBuilder migration files" + files: ["*.xslt"] + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/Resources/"; + else if (qbs.targetOS.contains("windows")) + return "resources" + else + return "share/fwbuilder-"+versionStr + } + qbs.installSourceBase: ".." + } +} diff --git a/src/libfwbuilder/src/fwbuilder/Constants.cpp b/src/libfwbuilder/src/fwbuilder/Constants.cpp index f6ed77d21..041b522ab 100644 --- a/src/libfwbuilder/src/fwbuilder/Constants.cpp +++ b/src/libfwbuilder/src/fwbuilder/Constants.cpp @@ -26,7 +26,7 @@ #include "fwbuilder/Constants.h" -#if defined (__linux__) || defined (__FreeBSD_kernel__) +#if defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__MINGW64__) || defined (__MINGW32__) # include #endif diff --git a/src/libfwbuilder/src/fwbuilder/fwbuilder.qbs b/src/libfwbuilder/src/fwbuilder/fwbuilder.qbs new file mode 100644 index 000000000..fa9215ab6 --- /dev/null +++ b/src/libfwbuilder/src/fwbuilder/fwbuilder.qbs @@ -0,0 +1,95 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "libfwbuilder" + targetName: "fwbuilder" + + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "libxml2" } + Depends { name: "libsnmp" } + + Export { + Depends { name: "cpp" } + cpp.includePaths: product.sourceDirectory + "/.." + } + + cpp.includePaths: base.concat(['..']) + + files: [ + "InetAddr.cpp", + "InetAddrMask.cpp", + "Inet6AddrMask.cpp", + "IPRoute.cpp", + "Address.cpp", + "AddressRange.cpp", + "BackgroundOp.cpp", + "Constants.cpp", + "CustomService.cpp", + "dns.cpp", + "Firewall.cpp", + "Cluster.cpp", + "ClusterGroup.cpp", + "FailoverClusterGroup.cpp", + "StateSyncClusterGroup.cpp", + "FWException.cpp", + "FWIntervalReference.cpp", + "FWObject.cpp", + "FWObjectDatabase.cpp", + "FWObjectDatabase_create_object.cpp", + "FWObjectDatabase_tree_ops.cpp", + "FWObjectDatabase_search.cpp", + "FWObjectReference.cpp", + "FWOptions.cpp", + "FWReference.cpp", + "FWServiceReference.cpp", + "Group.cpp", + "Host.cpp", + "ICMPService.cpp", + "ICMP6Service.cpp", + "Interface.cpp", + "InterfaceData.cpp", + "Interval.cpp", + "IntervalGroup.cpp", + "IPService.cpp", + "IPv4.cpp", + "IPv6.cpp", + "Library.cpp", + "Logger.cpp", + "Management.cpp", + "MultiAddress.cpp", + "NAT.cpp", + "Network.cpp", + "NetworkIPv6.cpp", + "AttachedNetworks.cpp", + "ObjectGroup.cpp", + "DynamicGroup.cpp", + "physAddress.cpp", + "DNSName.cpp", + "AddressTable.cpp", + "Policy.cpp", + "Resources.cpp", + "Routing.cpp", + "Rule.cpp", + "RuleElement.cpp", + "RuleSet.cpp", + "SecuwallMgmtFile.cpp", + "Service.cpp", + "ServiceGroup.cpp", + "snmp.cpp", + "TCPService.cpp", + "ThreadTools.cpp", + "Tools.cpp", + "TCPUDPService.cpp", + "UDPService.cpp", + "UserService.cpp", + "TagService.cpp", + "XMLTools.cpp", + "ObjectMatcher.cpp", + "ObjectMirror.cpp", + "inet_net_ntop.c", + "inet_net_pton.c", + "uint128.cpp" + ] +} diff --git a/src/libfwbuilder/src/fwcompiler/fwcompiler.qbs b/src/libfwbuilder/src/fwcompiler/fwcompiler.qbs new file mode 100644 index 000000000..5e7a1f15b --- /dev/null +++ b/src/libfwbuilder/src/fwcompiler/fwcompiler.qbs @@ -0,0 +1,28 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "libfwcompiler" + targetName: "fwcompiler" + + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: 'libxml2' } + + cpp.includePaths: base.concat(['..']) + + files: [ + "BaseCompiler.cpp", + "Compiler.cpp", + "Compiler_helpers.cpp", + "Compiler_ops.cpp", + "Compiler_object_match.cpp", + "Preprocessor.cpp", + "NATCompiler.cpp", + "OSConfigurator.cpp", + "PolicyCompiler.cpp", + "ServiceRuleProcessors.cpp", + "RoutingCompiler.cpp", + "GroupRegistry.cpp" + ] +} diff --git a/src/libgui/RCS.cpp b/src/libgui/RCS.cpp index 7b899b827..dbaa0e08a 100644 --- a/src/libgui/RCS.cpp +++ b/src/libgui/RCS.cpp @@ -258,18 +258,18 @@ void RCS::init() { if (rcs_file_name=="") { - rcs_file_name = "rcs"; - rlog_file_name = "rlog"; - rcsdiff_file_name = "rcsdiff"; - ci_file_name = "ci"; - co_file_name = "co"; + rcs_file_name = QStringLiteral("rcs"); + rlog_file_name = QStringLiteral("rlog"); + rcsdiff_file_name = QStringLiteral("rcsdiff"); + ci_file_name = QStringLiteral("ci"); + co_file_name = QStringLiteral("co"); #ifdef _WIN32 - rcs_file_name = getPathToBinary(rcs_file_name.append(".exe")); - rlog_file_name = getPathToBinary(rlog_file_name.append(".exe")); - rcsdiff_file_name = getPathToBinary(rcsdiff_file_name.append(".exe")); - ci_file_name = getPathToBinary(ci_file_name.append(".exe")); - co_file_name = getPathToBinary(co_file_name.append(".exe")); + rcs_file_name = QStringLiteral("rcs.exe"); + rlog_file_name = QStringLiteral("rlog.exe"); + rcsdiff_file_name = QStringLiteral("rcsdiff.exe"); + ci_file_name = QStringLiteral("ci.exe"); + co_file_name = QStringLiteral("co.exe"); #endif } diff --git a/src/libgui/libgui.qbs b/src/libgui/libgui.qbs new file mode 100644 index 000000000..36d1b36ec --- /dev/null +++ b/src/libgui/libgui.qbs @@ -0,0 +1,600 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "libgui" + targetName: "gui" + + Depends { name: "cpp" } + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets", + "network", + "printsupport" + ] + } + Depends { name: "libxml2" } + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "compiler_lib" } + Depends { name: "cisco_lib" } + Depends { name: "juniper_lib" } + Depends { name: "iptlib" } + Depends { name: "pflib" } + Depends { name: "libsnmp" } + + cpp.includePaths: base.concat(['../import']) + + Export { + Depends { + name: "cpp" + } + cpp.includePaths: [product.sourceDirectory, product.buildDirectory + '/qt.headers'] + } + + files: [ + "events.h", + "FWWindow.h", + "ProjectPanel.h", + "BaseObjectDialog.h", + "TextEditWidget.h", + "utils.h", + "utils_no_qt.h", + "SSHSession.h", + "SSHUnx.h", + "SSHCisco.h", + "SSHPIX.h", + "SSHIOS.h", + "SSHNXOS.h", + "SSHJUNOS.h", + "SSHProcurve.h", + "debugDialog.h", + "findDialog.h", + "listOfLibrariesModel.h", + "longTextDialog.h", + "newGroupDialog.h", + "filePropDialog.h", + "DialogData.h", + "SimpleTextEditor.h", + "SimpleIntEditor.h", + "TextFileEditor.h", + "FWBSettings.h", + "FWBTree.h", + "RCS.h", + "RCSFilePreview.h", + "FWObjectClipboard.h", + "platforms.h", + "global.h", + "printerStream.h", + "PrintingProgressDialog.h", + "PrintingController.h", + "FWObjectPropertiesFactory.h", + "ObjectManipulator.h", + "ObjectEditor.h", + "ObjectEditorDockWidget.h", + "FWObjectDrag.h", + "ObjectTreeView.h", + "ObjectListView.h", + "ObjectIconView.h", + "ObjectTreeViewItem.h", + "ObjectSelectorWidget.h", + "InstallFirewallViewItem.h", + "DialogFactory.h", + "HostDialog.h", + "FirewallDialog.h", + "ClusterDialog.h", + "ClusterGroupDialog.h", + "InterfaceDialog.h", + "AddressRangeDialog.h", + "AddressTableDialog.h", + "IPv4Dialog.h", + "IPv6Dialog.h", + "PhysicalAddressDialog.h", + "AttachedNetworksDialog.h", + "NetworkDialog.h", + "NetworkDialogIPv6.h", + "UserDialog.h", + "RuleSetDialog.h", + "LibraryDialog.h", + "CustomServiceDialog.h", + "IPServiceDialog.h", + "ICMPServiceDialog.h", + "TCPServiceDialog.h", + "UDPServiceDialog.h", + "GroupObjectDialog.h", + "ObjectIconViewItem.h", + "TimeDialog.h", + "ColDesc.h", + "FWObjectSelectionModel.h", + "RuleNode.h", + "RuleSetModel.h", + "RuleSetView.h", + "RuleSetViewDelegate.h", + "iptAdvancedDialog.h", + "ipcopAdvancedDialog.h", + "ipfAdvancedDialog.h", + "ipfwAdvancedDialog.h", + "pfAdvancedDialog.h", + "pixAdvancedDialog.h", + "pixosAdvancedDialog.h", + "iosaclAdvancedDialog.h", + "iosAdvancedDialog.h", + "nxosaclAdvancedDialog.h", + "nxosAdvancedDialog.h", + "junosaclAdvancedDialog.h", + "junosAdvancedDialog.h", + "ipcoposAdvancedDialog.h", + "linux24AdvancedDialog.h", + "linksysAdvancedDialog.h", + "freebsdAdvancedDialog.h", + "openbsdAdvancedDialog.h", + "procurveaclAdvancedDialog.h", + "solarisAdvancedDialog.h", + "macosxAdvancedDialog.h", + "secuwallAdvancedDialog.h", + "secuwallosAdvancedDialog.h", + "secuwallIfaceOptsDialog.h", + "vlanOnlyIfaceOptsDialog.h", + "linux24IfaceOptsDialog.h", + "pixosIfaceOptsDialog.h", + "bsdIfaceOptsDialog.h", + "clusterMembersDialog.h", + "CompilerOutputPanel.h", + "CompilerDriverFactory.h", + "RuleOptionsDialog.h", + "RoutingRuleOptionsDialog.h", + "NATRuleOptionsDialog.h", + "LibExportDialog.h", + "PrefsDialog.h", + "instConf.h", + "instDialog.h", + "FirewallInstaller.h", + "FirewallInstallerCisco.h", + "FirewallInstallerJuniper.h", + "FirewallInstallerProcurve.h", + "FirewallInstallerUnx.h", + "newFirewallDialog.h", + "newClusterDialog.h", + "newHostDialog.h", + "ObjConflictResolutionDialog.h", + "ColorLabelMenuItem.h", + "TagServiceDialog.h", + "ActionsDialog.h", + "SimpleTextView.h", + "BlankDialog.h", + "DNSNameDialog.h", + "instOptionsDialog.h", + "instBatchOptionsDialog.h", + "FilterDialog.h", + "FindObjectWidget.h", + "FWObjectDropArea.h", + "CommentEditorPanel.h", + "MetricEditorPanel.h", + "FindWhereUsedWidget.h", + "ConfirmDeleteObjectDialog.h", + "fakeWizard.h", + "AskLibForCopyDialog.h", + "FWBAboutDialog.h", + "Help.h", + "StartTipDialog.h", + "vrrpOptionsDialog.h", + "carpOptionsDialog.h", + "pixFailoverOptionsDialog.h", + "conntrackOptionsDialog.h", + "heartbeatOptionsDialog.h", + "openaisOptionsDialog.h", + "pfsyncOptionsDialog.h", + "InterfaceEditorWidget.h", + "FWCmdBasic.h", + "FWCmdChange.h", + "FWCmdAddObject.h", + "FWCmdDeleteObject.h", + "FWCmdMoveObject.h", + "InterfacesTabWidget.h", + "FirewallSelectorWidget.h", + "ClusterInterfacesSelectorWidget.h", + "ClusterInterfaceWidget.h", + "FWCmdRule.h", + "UsageResolver.h", + "IconSetter.h", + "TutorialDialog.h", + "MDIEventFilter.h", + "FWBApplication.h", + "WorkflowIcons.h", + "FirewallCodeViewer.h", + "networkZoneManager.h", + "KeywordsDialog.h", + "CommentKeywords.h", + "DynamicGroupDialog.h", + "FilterLineEdit.h", + "ObjectDescriptor.h", + "QThreadLogger.h", + "importAddressListWizard/ChooseObjectsPage.h", + "importAddressListWizard/CreateObjectsPage.h", + "importAddressListWizard/FileNamePage.h", + "importAddressListWizard/SelectLibraryPage.h", + "importAddressListWizard/ImportAddressListWizard.h", + "importAddressListWizard/HostsFile.h", + "snmpNetworkDiscoveryWizard/ND_ChooseNetworksPage.h", + "snmpNetworkDiscoveryWizard/ND_ChooseObjectsPage.h", + "snmpNetworkDiscoveryWizard/ND_ChooseObjectTypePage.h", + "snmpNetworkDiscoveryWizard/ND_CreateObjectsPage.h", + "snmpNetworkDiscoveryWizard/ND_DiscoveryParametersPage.h", + "snmpNetworkDiscoveryWizard/ND_ProgressPage.h", + "snmpNetworkDiscoveryWizard/ND_SelectLibraryPage.h", + "snmpNetworkDiscoveryWizard/ND_SetupPage.h", + "snmpNetworkDiscoveryWizard/ND_SNMPParametersPage.h", + "snmpNetworkDiscoveryWizard/SNMPNetworkDiscoveryWizard.h", + "snmpNetworkDiscoveryWizard/SNMPCrawlerThread.h", + "importFirewallConfigurationWizard/IC_FileNamePage.h", + "importFirewallConfigurationWizard/IC_FirewallNamePage.h", + "importFirewallConfigurationWizard/IC_PlatformWarningPage.h", + "importFirewallConfigurationWizard/IC_ProgressPage.h", + "importFirewallConfigurationWizard/IC_NetworkZonesPage.h", + "importFirewallConfigurationWizard/ImportFirewallConfigurationWizard.h", + "importFirewallConfigurationWizard/ImporterThread.h", + "RuleSetDiffDialog.h", + "RuleSetDiffDelegate.h", + "RuleSetDiffModel.h", + "BackgroundCompileInfoWidget.h", + "temporarydir.h", + "ProjectPanel.cpp", + "ProjectPanel_events.cpp", + "ProjectPanel_file_ops.cpp", + "ProjectPanel_state_ops.cpp", + "BaseObjectDialog.cpp", + "FWWindow.cpp", + "FWWindow_editor.cpp", + "FWWIndow_single_rule_compile.cpp", + "FWWindow_wrappers.cpp", + "FWWindowPrint.cpp", + "TextEditWidget.cpp", + "ObjectEditorDockWidget.cpp", + "ssh_wrappers.cpp", + "utils.cpp", + "utils_no_qt.cpp", + "SSHSession.cpp", + "SSHUnx.cpp", + "SSHCisco.cpp", + "SSHPIX.cpp", + "SSHIOS.cpp", + "SSHNXOS.cpp", + "SSHJUNOS.cpp", + "SSHProcurve.cpp", + "debugDialog.cpp", + "findDialog.cpp", + "listOfLibrariesModel.cpp", + "longTextDialog.cpp", + "newGroupDialog.cpp", + "filePropDialog.cpp", + "DialogData.cpp", + "SimpleTextEditor.cpp", + "SimpleIntEditor.cpp", + "TextFileEditor.cpp", + "FWBSettings.cpp", + "FWBTree.cpp", + "RCS.cpp", + "RCSFilePreview.cpp", + "FWObjectClipboard.cpp", + "platforms.cpp", + "printerStream.cpp", + "PrintingProgressDialog.cpp", + "PrintingController.cpp", + "FWObjectPropertiesFactory.cpp", + "ObjectManipulator.cpp", + "ObjectManipulator_ops.cpp", + "ObjectManipulator_tree_ops.cpp", + "ObjectManipulator_create_new.cpp", + "ObjectManipulator_slots.cpp", + "ObjectManipulator_new_object_checks.cpp", + "ObjectEditor.cpp", + "FWObjectDrag.cpp", + "ObjectTreeView.cpp", + "ObjectListView.cpp", + "ObjectIconView.cpp", + "ObjectSelectorWidget.cpp", + "DialogFactory.cpp", + "HostDialog.cpp", + "FirewallDialog.cpp", + "ClusterDialog.cpp", + "ClusterGroupDialog.cpp", + "InterfaceDialog.cpp", + "AddressRangeDialog.cpp", + "AddressTableDialog.cpp", + "IPv4Dialog.cpp", + "IPv6Dialog.cpp", + "PhysicalAddressDialog.cpp", + "AttachedNetworksDialog.cpp", + "NetworkDialog.cpp", + "NetworkDialogIPv6.cpp", + "UserDialog.cpp", + "LibraryDialog.cpp", + "CustomServiceDialog.cpp", + "IPServiceDialog.cpp", + "ICMPServiceDialog.cpp", + "TCPServiceDialog.cpp", + "UDPServiceDialog.cpp", + "GroupObjectDialog.cpp", + "TimeDialog.cpp", + "RuleSetDialog.cpp", + "FWObjectSelectionModel.cpp", + "ColDesc.cpp", + "RuleNode.cpp", + "RuleSetModel.cpp", + "RuleSetView.cpp", + "RuleSetViewDelegate.cpp", + "iptAdvancedDialog.cpp", + "ipcopAdvancedDialog.cpp", + "ipfAdvancedDialog.cpp", + "ipfwAdvancedDialog.cpp", + "pfAdvancedDialog.cpp", + "pixAdvancedDialog.cpp", + "pixosAdvancedDialog.cpp", + "iosaclAdvancedDialog.cpp", + "iosAdvancedDialog.cpp", + "nxosaclAdvancedDialog.cpp", + "nxosAdvancedDialog.cpp", + "junosaclAdvancedDialog.cpp", + "junosAdvancedDialog.cpp", + "ipcoposAdvancedDialog.cpp", + "linux24AdvancedDialog.cpp", + "linksysAdvancedDialog.cpp", + "freebsdAdvancedDialog.cpp", + "openbsdAdvancedDialog.cpp", + "procurveaclAdvancedDialog.cpp", + "solarisAdvancedDialog.cpp", + "macosxAdvancedDialog.cpp", + "secuwallAdvancedDialog.cpp", + "secuwallosAdvancedDialog.cpp", + "secuwallIfaceOptsDialog.cpp", + "vlanOnlyIfaceOptsDialog.cpp", + "linux24IfaceOptsDialog.cpp", + "pixosIfaceOptsDialog.cpp", + "bsdIfaceOptsDialog.cpp", + "clusterMembersDialog.cpp", + "CompilerOutputPanel.cpp", + "CompilerDriverFactory.cpp", + "RuleOptionsDialog.cpp", + "RoutingRuleOptionsDialog.cpp", + "NATRuleOptionsDialog.cpp", + "LibExportDialog.cpp", + "PrefsDialog.cpp", + "instConf.cpp", + "instDialog.cpp", + "instDialog_ui_ops.cpp", + "instDialog_compile.cpp", + "instDialog_installer.cpp", + "FirewallInstaller.cpp", + "FirewallInstallerCisco.cpp", + "FirewallInstallerJuniper.cpp", + "FirewallInstallerProcurve.cpp", + "FirewallInstallerUnx.cpp", + "newFirewallDialog.cpp", + "newFirewallDialog_from_template.cpp", + "newClusterDialog.cpp", + "newClusterDialog_create.cpp", + "newHostDialog.cpp", + "ObjConflictResolutionDialog.cpp", + "ColorLabelMenuItem.cpp", + "TagServiceDialog.cpp", + "ActionsDialog.cpp", + "SimpleTextView.cpp", + "BlankDialog.cpp", + "DNSNameDialog.cpp", + "ObjectTreeViewItem.cpp", + "InstallFirewallViewItem.cpp", + "instOptionsDialog.cpp", + "instBatchOptionsDialog.cpp", + "FilterDialog.cpp", + "FindObjectWidget.cpp", + "FWObjectDropArea.cpp", + "CommentEditorPanel.cpp", + "MetricEditorPanel.cpp", + "FindWhereUsedWidget.cpp", + "ConfirmDeleteObjectDialog.cpp", + "fakeWizard.cpp", + "AskLibForCopyDialog.cpp", + "ObjectListViewItem.cpp", + "Help.cpp", + "StartTipDialog.cpp", + "FWBAboutDialog.cpp", + "vrrpOptionsDialog.cpp", + "carpOptionsDialog.cpp", + "pixFailoverOptionsDialog.cpp", + "conntrackOptionsDialog.cpp", + "pfsyncOptionsDialog.cpp", + "heartbeatOptionsDialog.cpp", + "openaisOptionsDialog.cpp", + "InterfaceEditorWidget.cpp", + "FWCmdBasic.cpp", + "FWCmdChange.cpp", + "FWCmdAddObject.cpp", + "FWCmdDeleteObject.cpp", + "FWCmdMoveObject.cpp", + "InterfacesTabWidget.cpp", + "FirewallSelectorWidget.cpp", + "ClusterInterfacesSelectorWidget.cpp", + "ClusterInterfaceWidget.cpp", + "FWCmdRule.cpp", + "IconSetter.cpp", + "UsageResolver.cpp", + "TutorialDialog.cpp", + "MDIEventFilter.cpp", + "FWBApplication.cpp", + "WorkflowIcons.cpp", + "FirewallCodeViewer.cpp", + "networkZoneManager.cpp", + "KeywordsDialog.cpp", + "CommentKeywords.cpp", + "DynamicGroupDialog.cpp", + "FilterLineEdit.cpp", + "ObjectDescriptor.cpp", + "QThreadLogger.cpp", + "importAddressListWizard/ChooseObjectsPage.cpp", + "importAddressListWizard/CreateObjectsPage.cpp", + "importAddressListWizard/FileNamePage.cpp", + "importAddressListWizard/SelectLibraryPage.cpp", + "importAddressListWizard/ImportAddressListWizard.cpp", + "importAddressListWizard/HostsFile.cpp", + "snmpNetworkDiscoveryWizard/ND_ChooseNetworksPage.cpp", + "snmpNetworkDiscoveryWizard/ND_ChooseObjectsPage.cpp", + "snmpNetworkDiscoveryWizard/ND_ChooseObjectTypePage.cpp", + "snmpNetworkDiscoveryWizard/ND_CreateObjectsPage.cpp", + "snmpNetworkDiscoveryWizard/ND_DiscoveryParametersPage.cpp", + "snmpNetworkDiscoveryWizard/ND_ProgressPage.cpp", + "snmpNetworkDiscoveryWizard/ND_SelectLibraryPage.cpp", + "snmpNetworkDiscoveryWizard/ND_SetupPage.cpp", + "snmpNetworkDiscoveryWizard/ND_SNMPParametersPage.cpp", + "snmpNetworkDiscoveryWizard/SNMPNetworkDiscoveryWizard.cpp", + "snmpNetworkDiscoveryWizard/SNMPCrawlerThread.cpp", + "importFirewallConfigurationWizard/IC_FileNamePage.cpp", + "importFirewallConfigurationWizard/IC_FirewallNamePage.cpp", + "importFirewallConfigurationWizard/IC_PlatformWarningPage.cpp", + "importFirewallConfigurationWizard/IC_ProgressPage.cpp", + "importFirewallConfigurationWizard/IC_NetworkZonesPage.cpp", + "importFirewallConfigurationWizard/ImportFirewallConfigurationWizard.cpp", + "importFirewallConfigurationWizard/ImporterThread.cpp", + "RuleSetDiffDialog.cpp", + "RuleSetDiffDelegate.cpp", + "RuleSetDiffModel.cpp", + "BackgroundCompileInfoWidget.cpp", + "temporarydir.cpp", + "FWBMainWindow_q.ui", + "compileroutputpanel_q.ui", + "customservicedialog_q.ui", + "ipservicedialog_q.ui", + "icmpservicedialog_q.ui", + "tcpservicedialog_q.ui", + "udpservicedialog_q.ui", + "groupobjectdialog_q.ui", + "librarydialog_q.ui", + "ipv4dialog_q.ui", + "ipv6dialog_q.ui", + "rulesetdialog_q.ui", + "addressrangedialog_q.ui", + "addresstabledialog_q.ui", + "attachednetworksdialog_q.ui", + "networkdialog_q.ui", + "networkdialogipv6_q.ui", + "userdialog_q.ui", + "hostdialog_q.ui", + "firewalldialog_q.ui", + "clusterdialog_q.ui", + "clustergroupdialog_q.ui", + "interfacedialog_q.ui", + "physaddressdialog_q.ui", + "timedialog_q.ui", + "rcsfilepreview_q.ui", + "rcsfilesavedialog_q.ui", + "iptadvanceddialog_q.ui", + "ipcopadvanceddialog_q.ui", + "ipcoposadvanceddialog_q.ui", + "objectmanipulator_q.ui", + "prefsdialog_q.ui", + "pixadvanceddialog_q.ui", + "pixosadvanceddialog_q.ui", + "iosacladvanceddialog_q.ui", + "iosadvanceddialog_q.ui", + "nxosacladvanceddialog_q.ui", + "nxosadvanceddialog_q.ui", + "junosacladvanceddialog_q.ui", + "junosadvanceddialog_q.ui", + "procurveacladvanceddialog_q.ui", + "simpletexteditor_q.ui", + "simpleinteditor_q.ui", + "textfileeditor_q.ui", + "aboutdialog_q.ui", + "libexport_q.ui", + "ruleoptionsdialog_q.ui", + "routingruleoptionsdialog_q.ui", + "instdialog_q.ui", + "objconflictresolutiondialog_q.ui", + "newfirewalldialog_q.ui", + "newclusterdialog_q.ui", + "finddialog_q.ui", + "ipfadvanceddialog_q.ui", + "ipfwadvanceddialog_q.ui", + "pfadvanceddialog_q.ui", + "linux24advanceddialog_q.ui", + "solarisadvanceddialog_q.ui", + "freebsdadvanceddialog_q.ui", + "openbsdadvanceddialog_q.ui", + "macosxadvanceddialog_q.ui", + "secuwalladvanceddialog_q.ui", + "secuwallosadvanceddialog_q.ui", + "secuwallifaceoptsdialog_q.ui", + "clustermembersdialog_q.ui", + "bsdifaceoptsdialog_q.ui", + "colorlabelmenuitem_q.ui", + "debugdialog_q.ui", + "filepropdialog_q.ui", + "askrulenumberdialog_q.ui", + "newgroupdialog_q.ui", + "newhostdialog_q.ui", + "longtextdialog_q.ui", + "linksysadvanceddialog_q.ui", + "printingprogressdialog_q.ui", + "pagesetupdialog_q.ui", + "blankdialog_q.ui", + "dnsnamedialog_q.ui", + "tagservicedialog_q.ui", + "actionsdialog_q.ui", + "simpletextview_q.ui", + "helpview_q.ui", + "filterdialog_q.ui", + "natruleoptionsdialog_q.ui", + "instoptionsdialog_q.ui", + "findobjectwidget_q.ui", + "fwobjectdroparea_q.ui", + "commenteditorpanel_q.ui", + "metriceditorpanel_q.ui", + "findwhereusedwidget_q.ui", + "confirmdeleteobjectdialog_q.ui", + "projectpanel_q.ui", + "asklibforcopydialog_q.ui", + "starttipdialog_q.ui", + "vrrpoptionsdialog_q.ui", + "carpoptionsdialog_q.ui", + "pixfailoveroptionsdialog_q.ui", + "conntrackoptionsdialog_q.ui", + "heartbeatoptionsdialog_q.ui", + "openaisoptionsdialog_q.ui", + "pfsyncoptionsdialog_q.ui", + "vlanonlyifaceoptsdialog_q.ui", + "linux24ifaceoptsdialog_q.ui", + "pixosifaceoptsdialog_q.ui", + "InterfaceEditorWidget.ui", + "InterfacesTabWidget.ui", + "ClusterInterfaceWidget.ui", + "TutorialDialog.ui", + "WorkflowIcons.ui", + "FirewallCodeViewer.ui", + "objectselectorwidget_q.ui", + "keywordsdialog_q.ui", + "commentkeywords_q.ui", + "dynamicgroupdialog_q.ui", + "importAddressListWizard/chooseobjectspage_q.ui", + "importAddressListWizard/createobjectspage_q.ui", + "importAddressListWizard/filenamepage_q.ui", + "importAddressListWizard/selectlibrarypage_q.ui", + "snmpNetworkDiscoveryWizard/nd_choosenetworkspage_q.ui", + "snmpNetworkDiscoveryWizard/nd_chooseobjectspage_q.ui", + "snmpNetworkDiscoveryWizard/nd_chooseobjecttypepage_q.ui", + "snmpNetworkDiscoveryWizard/nd_createobjectspage_q.ui", + "snmpNetworkDiscoveryWizard/nd_discoveryparameterspage_q.ui", + "snmpNetworkDiscoveryWizard/nd_progresspage_q.ui", + "snmpNetworkDiscoveryWizard/nd_selectlibrarypage_q.ui", + "snmpNetworkDiscoveryWizard/nd_setuppage_q.ui", + "snmpNetworkDiscoveryWizard/nd_snmpparameterspage_q.ui", + "importFirewallConfigurationWizard/ic_filenamepage_q.ui", + "importFirewallConfigurationWizard/ic_firewallnamepage_q.ui", + "importFirewallConfigurationWizard/ic_platformwarningpage_q.ui", + "importFirewallConfigurationWizard/ic_progresspage_q.ui", + "importFirewallConfigurationWizard/ic_networkzonespage_q.ui", + "rulesetdiffdialog_q.ui", + "MainRes.qrc" + ] +} diff --git a/src/nxosacl/nxosacl.qbs b/src/nxosacl/nxosacl.qbs new file mode 100644 index 000000000..1581dfdf5 --- /dev/null +++ b/src/nxosacl/nxosacl.qbs @@ -0,0 +1,40 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "nxosacl" + targetName: "fwb_nxosacl" + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets" + ] + } + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "compiler_lib" } + Depends { name: "cisco_lib" } + Depends { name: "common" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "nxosacl.cpp", + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/parsers/parsers.qbs b/src/parsers/parsers.qbs new file mode 100644 index 000000000..712a19d2d --- /dev/null +++ b/src/parsers/parsers.qbs @@ -0,0 +1,31 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "parsers" + targetName: "fwbparser" + + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "libfwbuilder" } + Depends { name: "antlr" } + Depends { name: "libxml2" } + + cpp.includePaths: base.concat(['../import']) + + Export { + Depends { name: "cpp" } + cpp.includePaths: product.sourceDirectory + } + + files: [ + "IOSCfgLexer.cpp", + "IOSCfgParser.cpp", + "IPTCfgLexer.cpp", + "IPTCfgParser.cpp", + "PIXCfgLexer.cpp", + "PIXCfgParser.cpp", + "PFCfgLexer.cpp", + "PFCfgParser.cpp", + ] +} diff --git a/src/pf/pf.qbs b/src/pf/pf.qbs new file mode 100644 index 000000000..d0c880940 --- /dev/null +++ b/src/pf/pf.qbs @@ -0,0 +1,40 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "pf" + targetName: "fwb_pf" + consoleApplication: true + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets" + ] + } + Depends { name: "libfwbuilder" } + Depends { name: "compiler_lib" } + Depends { name: "common" } + Depends { name: "pflib" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "pf.cpp", + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/pflib/pflib.qbs b/src/pflib/pflib.qbs new file mode 100644 index 000000000..9e7c0f5ef --- /dev/null +++ b/src/pflib/pflib.qbs @@ -0,0 +1,56 @@ +import qbs 1.0 + +FWBProduct { + type: "staticlibrary" + name: "pflib" + targetName: "fwbpf" + + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "libxml2" } + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "compiler_lib" } + + Export { + Depends { name: "cpp" } + cpp.includePaths: product.sourceDirectory + } + + files: [ + "TableFactory.cpp", + "Preprocessor_pf.cpp", + "NATCompiler_ipf.cpp", + "NATCompiler_ipfw.cpp", + "NATCompiler_ipf_writers.cpp", + "NATCompiler_ipfw_writers.cpp", + "NATCompiler_pf.cpp", + "NATCompiler_pf_negation.cpp", + "NATCompiler_pf_writers.cpp", + "OSConfigurator_bsd.cpp", + "OSConfigurator_bsd_interfaces.cpp", + "OSConfigurator_freebsd.cpp", + "OSConfigurator_macosx.cpp", + "OSConfigurator_openbsd.cpp", + "OSConfigurator_solaris.cpp", + "OSData.cpp", + "PolicyCompiler_ipf.cpp", + "PolicyCompiler_ipf_optimizer.cpp", + "PolicyCompiler_ipfw.cpp", + "PolicyCompiler_ipf_writers.cpp", + "PolicyCompiler_ipfw_writers.cpp", + "PolicyCompiler_pf.cpp", + "PolicyCompiler_pf_writers.cpp", + "CompilerDriver_pf.cpp", + "CompilerDriver_pf_run.cpp", + "CompilerDriver_ipf.cpp", + "CompilerDriver_ipf_run.cpp", + "CompilerDriver_ipfw.cpp", + "CompilerDriver_ipfw_run.cpp", + "RoutingCompiler_openbsd.cpp", + "RoutingCompiler_openbsd_writers.cpp", + "RoutingCompiler_freebsd.cpp", + "RoutingCompiler_freebsd_writers.cpp", + "AutomaticRules_pf.cpp" + ] +} diff --git a/src/pix/pix.qbs b/src/pix/pix.qbs new file mode 100644 index 000000000..8025508e4 --- /dev/null +++ b/src/pix/pix.qbs @@ -0,0 +1,40 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "pix" + targetName: "fwb_pix" + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets" + ] + } + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "compiler_lib" } + Depends { name: "common" } + Depends { name: "cisco_lib" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "pix.cpp", + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/procurve_acl/procurve_acl.qbs b/src/procurve_acl/procurve_acl.qbs new file mode 100644 index 000000000..a0e551138 --- /dev/null +++ b/src/procurve_acl/procurve_acl.qbs @@ -0,0 +1,41 @@ +import qbs 1.0 + +FWBProduct { + type: "application" + name: "procurve_acl" + targetName: "fwb_procurve_acl" + + Depends { + name: "Qt" + submodules: [ + "core", + "gui", + "widgets" + ] + } + + Depends { name: "libfwbuilder" } + Depends { name: "libfwcompiler" } + Depends { name: "compiler_lib" } + Depends { name: "common" } + Depends { name: "cisco_lib" } + Depends { name: "libxml2" } + Depends { name: "libxslt" } + Depends { name: "zlib" } + + files: [ + "procurve_acl.cpp", + ] + + Group { + fileTagsFilter: "application" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("windows")) + return ""; + if (qbs.targetOS.contains("macos")) + return project.name + ".app/Contents/MacOS/"; + return "bin"; + } + } +} diff --git a/src/res/res.qbs b/src/res/res.qbs new file mode 100644 index 000000000..22d36a9e0 --- /dev/null +++ b/src/res/res.qbs @@ -0,0 +1,119 @@ +import qbs 1.0 +import qbs.File +import qbs.TextFile + +FWBProduct { + type: ["application", "object_def_files"] + name: "res" + + property string installDir: { + if (qbs.targetOS.contains("macos")) + return "fwbuilder.app/Contents/Resources" + else if (qbs.targetOS.contains("windows")) + return "resources" + else + return "share/fwbuilder-"+versionStr + } + + Group { + files: ["objects_init.xml.in", "templates.xml.in"] + fileTags: "in_object_def_files" + } + + InputFileRule { + inputs: ["in_object_def_files"] + artifactFileTags: ["object_def_files"] + + } + + Group { + name: "Objects definitions" + files: ["resources.xml"] + qbs.install: true + qbs.installDir: installDir + + Group { + fileTagsFilter: "object_def_files" + } + } + + Group { + name: "OS files" + files: "os/*.xml" + qbs.install: true + qbs.installDir: installDir + qbs.installSourceBase: "." + } + + Group { + name: "Platform files" + files: "platform/*.xml" + qbs.install: true + qbs.installDir: installDir + qbs.installSourceBase: "." + } + + Group { + name: "Help files" + files: ["help/en_US/*.html", "help/en_US/*.png", "help/en_US/*.jpg"] + qbs.install: true + qbs.installDir: installDir + qbs.installSourceBase: "." + } + + Group { + name: "Configlets" + files: ["configlets/**/*"] + qbs.install: true + qbs.installDir: installDir + qbs.installSourceBase: "." + } + + Group { + name: "Freedesktop Shortcut" + files: ["fwbuilder.desktop"] + qbs.install: qbs.targetOS.contains("linux") + qbs.installDir: "share/applications" + } + + Group { + name: "Icons" + qbs.install: qbs.targetOS.contains("linux") + qbs.installDir: "share/icons/hicolor" + + Group { + files: ["Icons/16x16/fwbuilder.png"] + qbs.installDir: outer.concat("/16x16/apps/") + } + + Group { + files: ["Icons/24x24/fwbuilder.png"] + qbs.installDir: outer.concat("/24x24/apps/") + } + + Group { + files: ["Icons/32x32/fwbuilder.png"] + qbs.installDir: outer.concat("/32x32/apps/") + } + + Group { + files: ["Icons/48x48/fwbuilder.png"] + qbs.installDir: outer.concat("/48x48/apps/") + } + + Group { + files: ["Icons/72x72/fwbuilder.png"] + qbs.installDir: outer.concat("/72x72/apps/") + } + + Group { + files: ["Icons/256x256/fwbuilder.png"] + qbs.installDir: outer.concat("/256x256/apps/") + } + + Group { + files: ["Icons/512x512/fwbuilder.png"] + qbs.installDir: outer.concat("/512x512/apps/") + } + } +}