From e273cef39f66acb6e96cb298e6baea5ccdf3c019 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 13 Jan 2021 23:44:18 +0200 Subject: [PATCH 01/26] add base mode security preset --- modsecurity/cppbuild.sh | 51 +++++++ modsecurity/platform/pom.xml | 139 ++++++++++++++++++ modsecurity/pom.xml | 51 +++++++ .../modsecurity/presets/modsecurity.java | 63 ++++++++ modsecurity/src/main/java9/module-info.java | 6 + pom.xml | 3 + 6 files changed, 313 insertions(+) create mode 100755 modsecurity/cppbuild.sh create mode 100644 modsecurity/platform/pom.xml create mode 100644 modsecurity/pom.xml create mode 100644 modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java create mode 100644 modsecurity/src/main/java9/module-info.java diff --git a/modsecurity/cppbuild.sh b/modsecurity/cppbuild.sh new file mode 100755 index 00000000000..659ffcbb00d --- /dev/null +++ b/modsecurity/cppbuild.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# This file is meant to be included by the parent cppbuild.sh script +if [[ -z "$PLATFORM" ]]; then + pushd .. + bash cppbuild.sh "$@" modsecurity + popd + exit +fi + + +sudo apt-get install g++ flex bison curl doxygen libyajl-dev libgeoip-dev libtool dh-autoreconf libcurl4-gnutls-dev libxml2 libpcre++-dev libxml2-dev +mkdir -p $PLATFORM +cd $PLATFORM +INSTALL_PATH=`pwd` + +if [ ! -d "ModSecurity" ]; +then + git clone https://github.com/SpiderLabs/ModSecurity + cd ModSecurity + git checkout origin/v3/master + git submodule init + git submodule update +else + cd ModSecurity +fi + +case $PLATFORM in + linux-x86) + sh build.sh + ./configure --prefix=$INSTALL_PATH + make + make install + ;; + linux-x86_64) + sh build.sh + ./configure --prefix=$INSTALL_PATH + make + make install + ;; + macosx-x86_64) + sh build.sh + ./configure --prefix=$INSTALL_PATH + make + make install + ;; + *) + echo "Error: Platform \"$PLATFORM\" is not supported" + ;; +esac + +cd ../.. \ No newline at end of file diff --git a/modsecurity/platform/pom.xml b/modsecurity/platform/pom.xml new file mode 100644 index 00000000000..18a28fa904c --- /dev/null +++ b/modsecurity/platform/pom.xml @@ -0,0 +1,139 @@ + + + 4.0.0 + + + org.bytedeco + javacpp-presets + 1.5.5-SNAPSHOT + ../../ + + + org.bytedeco + modsecurity-platform + 1.12.0-${project.parent.version} + JavaCPP Presets Platform for modsecurity + + + modsecurity + + + + + org.bytedeco + javacpp-platform + ${project.parent.version} + + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-x86} + + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-x86_64} + + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-armhf} + + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-arm64} + + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-ppc64le} + + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.macosx-x86_64} + + + + + + + maven-jar-plugin + + + default-jar + + + + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-macosx-x86_64.jar + + + + + + empty-javadoc-jar + + jar + + + javadoc + + + + empty-sources-jar + + jar + + + sources + + + + + + org.moditect + moditect-maven-plugin + + + add-module-infos + none + + + add-platform-module-info + package + + add-module-info + + + + + ${project.build.directory}/${project.artifactId}.jar + + module org.bytedeco.${javacpp.moduleId}.platform { + requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; + requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; + } + + + + + + + + + + + diff --git a/modsecurity/pom.xml b/modsecurity/pom.xml new file mode 100644 index 00000000000..02af522653b --- /dev/null +++ b/modsecurity/pom.xml @@ -0,0 +1,51 @@ + + + + javacpp-presets + org.bytedeco + 1.5.5-SNAPSHOT + + 4.0.0 + + modsecurity + + + + org.bytedeco + javacpp + + + + + + + maven-resources-plugin + + + maven-compiler-plugin + + + org.bytedeco + javacpp + + + maven-jar-plugin + + + org.moditect + moditect-maven-plugin + + + maven-dependency-plugin + + + maven-source-plugin + + + maven-javadoc-plugin + + + + \ No newline at end of file diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java new file mode 100644 index 00000000000..af6db58424e --- /dev/null +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -0,0 +1,63 @@ +package org.bytedeco.modsecurity.presets; + +import org.bytedeco.javacpp.Loader; +import org.bytedeco.javacpp.annotation.Platform; +import org.bytedeco.javacpp.annotation.Properties; +import org.bytedeco.javacpp.tools.Info; +import org.bytedeco.javacpp.tools.InfoMap; +import org.bytedeco.javacpp.tools.InfoMapper; + +/** + * @author Artem Martynenko artem7mag@gmail.com + **/ +@Properties(value = { + @Platform(include = { + "modsecurity/actions/action.h", + "modsecurity/collection/collection.h", + "modsecurity/collection/collections.h", + "modsecurity/anchored_set_variable.h", + "modsecurity/anchored_variable.h", + "modsecurity/audit_log.h", + "modsecurity/debug_log.h", + "modsecurity/intervention.h", + "modsecurity/modsecurity.h", + "modsecurity/rule.h", + "modsecurity/rule_marker.h", + "modsecurity/rule_message.h", + "modsecurity/rule_unconditional.h", + "modsecurity/rule_with_actions.h", + "modsecurity/rule_with_operator.h", + "modsecurity/rules.h", + "modsecurity/rules_exceptions.h", + "modsecurity/rules_set.h", + "modsecurity/rules_set_phases.h", + "modsecurity/rules_set_properties.h", + "modsecurity/transaction.h", + "modsecurity/variable_origin.h", + "modsecurity/variable_value.h"}) +}, + target = "org.bytedeco.modsecurity", + global = "org.bytedeco.modsecurity.global" +) +public class modsecurity implements InfoMapper { + static { + Loader.checkVersion( "org.bytedeco" , "modsecurity"); + } + @Override + public void map(InfoMap infoMap) { + infoMap.put(new Info("std::list").pointerTypes("StringList").define()); + infoMap.put(new Info("std::list").pointerTypes("IntList").define()); + infoMap.put(new Info("std::list >").pointerTypes("IntIntPairList").define()); + infoMap.put(new Info("std::list >").pointerTypes("IntIntPairList").define()); + infoMap.put(new Info("std::list >").pointerTypes("StringStringPairList").define()); + infoMap.put(new Info("std::list >").pointerTypes("StringStringPairList").define()); + infoMap.put(new Info("std::list >").pointerTypes("IntStringPairList").define()); + infoMap.put(new Info("std::list").pointerTypes("RuleMessageList").define()); + infoMap.put(new Info("std::map").pointerTypes("StringStringMap").define()); + infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("MultipartPartTmpFile")); + infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("Rule")); + infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("Action")); + } +} + + diff --git a/modsecurity/src/main/java9/module-info.java b/modsecurity/src/main/java9/module-info.java new file mode 100644 index 00000000000..3a8c85cb531 --- /dev/null +++ b/modsecurity/src/main/java9/module-info.java @@ -0,0 +1,6 @@ +module org.bytedeco.modsecurity { + requires transitive org.bytedeco.javacpp; + exports org.bytedeco.modsecurity.global; + exports org.bytedeco.modsecurity.presets; + exports org.bytedeco.modsecurity; +} diff --git a/pom.xml b/pom.xml index ea38c7dd9ea..45e883fb35c 100644 --- a/pom.xml +++ b/pom.xml @@ -627,6 +627,7 @@ skia cpu_features systems + modsecurity ${os.name}-${os.arch} @@ -1352,6 +1353,7 @@ skia cpu_features systems + modsecurity @@ -1427,6 +1429,7 @@ skia cpu_features systems + modsecurity From bb2400b3e575dc29a9e3dfcfe3ce5f03d4678943 Mon Sep 17 00:00:00 2001 From: Martynenko Date: Fri, 15 Jan 2021 08:57:51 +0200 Subject: [PATCH 02/26] continue adding definitions --- .../modsecurity/presets/modsecurity.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index af6db58424e..5ef62cd8557 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -45,18 +45,31 @@ public class modsecurity implements InfoMapper { } @Override public void map(InfoMap infoMap) { + infoMap.put(new Info("clock_t").cast().valueTypes("long").pointerTypes("SizeTPointer")); + infoMap.put(new Info("ostringstream").cast().pointerTypes("Pointer")); infoMap.put(new Info("std::list").pointerTypes("StringList").define()); + infoMap.put(new Info("std::basic_string").pointerTypes("StdString").define()); + infoMap.put(new Info("std::set").pointerTypes("StringSet").define()); infoMap.put(new Info("std::list").pointerTypes("IntList").define()); infoMap.put(new Info("std::list >").pointerTypes("IntIntPairList").define()); - infoMap.put(new Info("std::list >").pointerTypes("IntIntPairList").define()); - infoMap.put(new Info("std::list >").pointerTypes("StringStringPairList").define()); + infoMap.put(new Info("std::pair").pointerTypes("IntIntPair").define()); infoMap.put(new Info("std::list >").pointerTypes("StringStringPairList").define()); + infoMap.put(new Info("std::pair").pointerTypes("StringStringPair").define()); infoMap.put(new Info("std::list >").pointerTypes("IntStringPairList").define()); + infoMap.put(new Info("std::pair").pointerTypes("IntStringPair").define()); infoMap.put(new Info("std::list").pointerTypes("RuleMessageList").define()); infoMap.put(new Info("std::map").pointerTypes("StringStringMap").define()); infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("MultipartPartTmpFile")); infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("Rule")); infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("Action")); + infoMap.put(new Info("std::unordered_multimap").skip()); + infoMap.put(new Info("std::vector >").skip()); + infoMap.put(new Info("std::vector >").skip()); + infoMap.put(new Info("std::unordered_multimap,std::shared_ptr >").skip()); + infoMap.put(new Info("std::unordered_multimap >").skip()); + infoMap.put(new Info("std::unordered_multimap >").skip()); + infoMap.put(new Info("std::unordered_multimap >").skip()); + } } From 78a8b3620803cb710d017e582bdecfb5ef326fef Mon Sep 17 00:00:00 2001 From: Martynenko Date: Mon, 18 Jan 2021 17:07:57 +0200 Subject: [PATCH 03/26] add ostreamstring mapper --- .../presets/OStringStreamPointer.java | 29 +++++++++++++++++++ .../modsecurity/presets/modsecurity.java | 16 +++++----- 2 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 modsecurity/src/main/java/org/bytedeco/modsecurity/presets/OStringStreamPointer.java diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/OStringStreamPointer.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/OStringStreamPointer.java new file mode 100644 index 00000000000..895506d2f78 --- /dev/null +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/OStringStreamPointer.java @@ -0,0 +1,29 @@ +package org.bytedeco.modsecurity.presets; + +import org.bytedeco.javacpp.BytePointer; +import org.bytedeco.javacpp.Loader; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.annotation.ByRef; +import org.bytedeco.javacpp.annotation.Name; +import org.bytedeco.javacpp.annotation.Properties; +import org.bytedeco.javacpp.annotation.StdString; + +@Name("std::ostringstream") @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class OStringStreamPointer extends Pointer { + static { Loader.load(); } + + public OStringStreamPointer() { + allocate(); + } + + public OStringStreamPointer(Pointer p) { + super(p); + } + + private native void allocate(); + + public native @Name("operator =") @ByRef OStringStreamPointer put(@ByRef OStringStreamPointer x); + + public native void str(@StdString BytePointer value); + public native @StdString BytePointer str(); +} diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index 5ef62cd8557..1d8c2fbec23 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -46,7 +46,7 @@ public class modsecurity implements InfoMapper { @Override public void map(InfoMap infoMap) { infoMap.put(new Info("clock_t").cast().valueTypes("long").pointerTypes("SizeTPointer")); - infoMap.put(new Info("ostringstream").cast().pointerTypes("Pointer")); + infoMap.put(new Info("std::ostringstream").pointerTypes("OStringStreamPointer").define()); infoMap.put(new Info("std::list").pointerTypes("StringList").define()); infoMap.put(new Info("std::basic_string").pointerTypes("StdString").define()); infoMap.put(new Info("std::set").pointerTypes("StringSet").define()); @@ -62,13 +62,13 @@ public void map(InfoMap infoMap) { infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("MultipartPartTmpFile")); infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("Rule")); infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("Action")); - infoMap.put(new Info("std::unordered_multimap").skip()); - infoMap.put(new Info("std::vector >").skip()); - infoMap.put(new Info("std::vector >").skip()); - infoMap.put(new Info("std::unordered_multimap,std::shared_ptr >").skip()); - infoMap.put(new Info("std::unordered_multimap >").skip()); - infoMap.put(new Info("std::unordered_multimap >").skip()); - infoMap.put(new Info("std::unordered_multimap >").skip()); + infoMap.put(new Info("std::unordered_multimap").cast().pointerTypes("Pointer")); + infoMap.put(new Info("std::vector >").cast().pointerTypes("Pointer")); + infoMap.put(new Info("std::vector >").cast().pointerTypes("Pointer")); + infoMap.put(new Info("std::unordered_multimap,std::shared_ptr >").cast().pointerTypes("Pointer")); + infoMap.put(new Info("std::unordered_multimap >").cast().pointerTypes("Pointer")); + infoMap.put(new Info("std::unordered_multimap >").cast().pointerTypes("Pointer")); + infoMap.put(new Info("std::unordered_multimap >").cast().pointerTypes("Pointer")); } } From df8343ef8c37cbe898e7edc331c5e18d1250a3bd Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 18 Jan 2021 22:27:42 +0200 Subject: [PATCH 04/26] fixed InfoMapping; need to clarify jni compilation errors --- .../{presets => }/OStringStreamPointer.java | 2 +- .../modsecurity/presets/modsecurity.java | 100 +++++++++++------- 2 files changed, 61 insertions(+), 41 deletions(-) rename modsecurity/src/main/java/org/bytedeco/modsecurity/{presets => }/OStringStreamPointer.java (95%) diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/OStringStreamPointer.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/OStringStreamPointer.java similarity index 95% rename from modsecurity/src/main/java/org/bytedeco/modsecurity/presets/OStringStreamPointer.java rename to modsecurity/src/main/java/org/bytedeco/modsecurity/OStringStreamPointer.java index 895506d2f78..4e08f10ead9 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/OStringStreamPointer.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/OStringStreamPointer.java @@ -1,4 +1,4 @@ -package org.bytedeco.modsecurity.presets; +package org.bytedeco.modsecurity; import org.bytedeco.javacpp.BytePointer; import org.bytedeco.javacpp.Loader; diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index 1d8c2fbec23..1dd75355d88 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -10,65 +10,85 @@ /** * @author Artem Martynenko artem7mag@gmail.com **/ -@Properties(value = { - @Platform(include = { - "modsecurity/actions/action.h", - "modsecurity/collection/collection.h", - "modsecurity/collection/collections.h", - "modsecurity/anchored_set_variable.h", - "modsecurity/anchored_variable.h", - "modsecurity/audit_log.h", - "modsecurity/debug_log.h", - "modsecurity/intervention.h", - "modsecurity/modsecurity.h", - "modsecurity/rule.h", - "modsecurity/rule_marker.h", - "modsecurity/rule_message.h", - "modsecurity/rule_unconditional.h", - "modsecurity/rule_with_actions.h", - "modsecurity/rule_with_operator.h", - "modsecurity/rules.h", - "modsecurity/rules_exceptions.h", - "modsecurity/rules_set.h", - "modsecurity/rules_set_phases.h", - "modsecurity/rules_set_properties.h", - "modsecurity/transaction.h", - "modsecurity/variable_origin.h", - "modsecurity/variable_value.h"}) -}, +@Properties(value = @Platform( + include = { + "modsecurity/actions/action.h", + "modsecurity/collection/collection.h", + "modsecurity/collection/collections.h", + "modsecurity/anchored_set_variable.h", + "modsecurity/anchored_variable.h", + "modsecurity/audit_log.h", + "modsecurity/debug_log.h", + "modsecurity/intervention.h", + "modsecurity/modsecurity.h", + "modsecurity/rule.h", + "modsecurity/rule_marker.h", + "modsecurity/rule_message.h", + "modsecurity/rule_unconditional.h", + "modsecurity/rule_with_actions.h", + "modsecurity/rule_with_operator.h", + "modsecurity/rules.h", + "modsecurity/rules_exceptions.h", + "modsecurity/rules_set.h", + "modsecurity/rules_set_phases.h", + "modsecurity/rules_set_properties.h", + "modsecurity/transaction.h", + "modsecurity/variable_origin.h", + "modsecurity/variable_value.h" }, + cinclude = "modsecurity/intervention.h"), + target = "org.bytedeco.modsecurity", - global = "org.bytedeco.modsecurity.global" -) + global = "org.bytedeco.modsecurity.global") public class modsecurity implements InfoMapper { static { - Loader.checkVersion( "org.bytedeco" , "modsecurity"); + Loader.checkVersion("org.bytedeco", "modsecurity"); } + @Override public void map(InfoMap infoMap) { infoMap.put(new Info("clock_t").cast().valueTypes("long").pointerTypes("SizeTPointer")); - infoMap.put(new Info("std::ostringstream").pointerTypes("OStringStreamPointer").define()); + infoMap.put( + new Info("std::ostringstream").pointerTypes("org.bytedeco.modsecurity.OStringStreamPointer").define()); infoMap.put(new Info("std::list").pointerTypes("StringList").define()); + infoMap.put(new Info("ModSecurityIntervention_t").pointerTypes("ModSecurityIntervention").define()); infoMap.put(new Info("std::basic_string").pointerTypes("StdString").define()); infoMap.put(new Info("std::set").pointerTypes("StringSet").define()); infoMap.put(new Info("std::list").pointerTypes("IntList").define()); infoMap.put(new Info("std::list >").pointerTypes("IntIntPairList").define()); infoMap.put(new Info("std::pair").pointerTypes("IntIntPair").define()); - infoMap.put(new Info("std::list >").pointerTypes("StringStringPairList").define()); + infoMap.put(new Info("std::list >").pointerTypes("StringStringPairList") + .define()); infoMap.put(new Info("std::pair").pointerTypes("StringStringPair").define()); infoMap.put(new Info("std::list >").pointerTypes("IntStringPairList").define()); infoMap.put(new Info("std::pair").pointerTypes("IntStringPair").define()); infoMap.put(new Info("std::list").pointerTypes("RuleMessageList").define()); infoMap.put(new Info("std::map").pointerTypes("StringStringMap").define()); - infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("MultipartPartTmpFile")); + infoMap.put(new Info("std::shared_ptr") + .annotations("@SharedPtr").pointerTypes("MultipartPartTmpFile")); infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("Rule")); - infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("Action")); - infoMap.put(new Info("std::unordered_multimap").cast().pointerTypes("Pointer")); - infoMap.put(new Info("std::vector >").cast().pointerTypes("Pointer")); - infoMap.put(new Info("std::vector >").cast().pointerTypes("Pointer")); - infoMap.put(new Info("std::unordered_multimap,std::shared_ptr >").cast().pointerTypes("Pointer")); - infoMap.put(new Info("std::unordered_multimap >").cast().pointerTypes("Pointer")); - infoMap.put(new Info("std::unordered_multimap >").cast().pointerTypes("Pointer")); - infoMap.put(new Info("std::unordered_multimap >").cast().pointerTypes("Pointer")); + infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr") + .pointerTypes("Action")); + infoMap.put( + new Info("std::unordered_multimap") + .cast().pointerTypes("Pointer")); + infoMap.put(new Info("std::vector >").cast().pointerTypes( + "Pointer")); + infoMap.put( + new Info("std::vector >").cast().pointerTypes("Pointer")); + infoMap.put(new Info( + "std::unordered_multimap,std::shared_ptr >") + .cast().pointerTypes("Pointer")); + infoMap.put( + new Info("std::unordered_multimap >").cast() + .pointerTypes( + "Pointer")); + infoMap.put( + new Info("std::unordered_multimap >").cast() + .pointerTypes( + "Pointer")); + infoMap.put(new Info("std::unordered_multimap >").cast() + .pointerTypes( + "Pointer")); } } From 6a29b7ded0e67d6b3c29d59f68c9f849215040c4 Mon Sep 17 00:00:00 2001 From: Martynenko Date: Tue, 19 Jan 2021 16:15:24 +0200 Subject: [PATCH 05/26] add compiler configuration --- modsecurity/pom.xml | 6 ++++++ .../java/org/bytedeco/modsecurity/presets/modsecurity.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modsecurity/pom.xml b/modsecurity/pom.xml index 02af522653b..a31a0a22a66 100644 --- a/modsecurity/pom.xml +++ b/modsecurity/pom.xml @@ -29,6 +29,12 @@ org.bytedeco javacpp + + + -std=c++11 + + + maven-jar-plugin diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index 1dd75355d88..44c03e3394c 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -11,6 +11,7 @@ * @author Artem Martynenko artem7mag@gmail.com **/ @Properties(value = @Platform( + compiler = "cpp11", include = { "modsecurity/actions/action.h", "modsecurity/collection/collection.h", @@ -51,7 +52,7 @@ public void map(InfoMap infoMap) { new Info("std::ostringstream").pointerTypes("org.bytedeco.modsecurity.OStringStreamPointer").define()); infoMap.put(new Info("std::list").pointerTypes("StringList").define()); infoMap.put(new Info("ModSecurityIntervention_t").pointerTypes("ModSecurityIntervention").define()); - infoMap.put(new Info("std::basic_string").pointerTypes("StdString").define()); + infoMap.put(new Info("std::basic_string").annotations("@StdString").pointerTypes("BytePointer")); infoMap.put(new Info("std::set").pointerTypes("StringSet").define()); infoMap.put(new Info("std::list").pointerTypes("IntList").define()); infoMap.put(new Info("std::list >").pointerTypes("IntIntPairList").define()); From e9d8997af1b80ff19a938eb28cf04644a76314c0 Mon Sep 17 00:00:00 2001 From: Martynenko Date: Fri, 22 Jan 2021 15:10:37 +0200 Subject: [PATCH 06/26] fixed Shared pointer and Unique pointer definitions --- modsecurity/pom.xml | 6 ------ .../org/bytedeco/modsecurity/presets/modsecurity.java | 9 +++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/modsecurity/pom.xml b/modsecurity/pom.xml index a31a0a22a66..02af522653b 100644 --- a/modsecurity/pom.xml +++ b/modsecurity/pom.xml @@ -29,12 +29,6 @@ org.bytedeco javacpp - - - -std=c++11 - - - maven-jar-plugin diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index 44c03e3394c..cb7f3ddddcc 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -3,6 +3,7 @@ import org.bytedeco.javacpp.Loader; import org.bytedeco.javacpp.annotation.Platform; import org.bytedeco.javacpp.annotation.Properties; +import org.bytedeco.javacpp.presets.javacpp; import org.bytedeco.javacpp.tools.Info; import org.bytedeco.javacpp.tools.InfoMap; import org.bytedeco.javacpp.tools.InfoMapper; @@ -10,8 +11,8 @@ /** * @author Artem Martynenko artem7mag@gmail.com **/ -@Properties(value = @Platform( - compiler = "cpp11", +@Properties(inherit = javacpp.class , value = @Platform( + define = {"UNIQUE_PTR_NAMESPACE std", "SHARED_PTR_NAMESPACE std"}, include = { "modsecurity/actions/action.h", "modsecurity/collection/collection.h", @@ -36,7 +37,7 @@ "modsecurity/transaction.h", "modsecurity/variable_origin.h", "modsecurity/variable_value.h" }, - cinclude = "modsecurity/intervention.h"), + cinclude = "modsecurity/intervention.h", includepath = {"lib","include"}, linkpath = {"lib","include"}, link = "modsecurity"), target = "org.bytedeco.modsecurity", global = "org.bytedeco.modsecurity.global") @@ -52,7 +53,7 @@ public void map(InfoMap infoMap) { new Info("std::ostringstream").pointerTypes("org.bytedeco.modsecurity.OStringStreamPointer").define()); infoMap.put(new Info("std::list").pointerTypes("StringList").define()); infoMap.put(new Info("ModSecurityIntervention_t").pointerTypes("ModSecurityIntervention").define()); - infoMap.put(new Info("std::basic_string").annotations("@StdString").pointerTypes("BytePointer")); + infoMap.put(new Info("std::basic_string").annotations("@StdString").valueTypes("BytePointer").pointerTypes("@Cast({\"char*\"}) BytePointer")); infoMap.put(new Info("std::set").pointerTypes("StringSet").define()); infoMap.put(new Info("std::list").pointerTypes("IntList").define()); infoMap.put(new Info("std::list >").pointerTypes("IntIntPairList").define()); From 1f2a98025a914988ce38bcb7459a0211b23d2c85 Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 25 Jan 2021 22:31:28 +0200 Subject: [PATCH 07/26] 1st compilable version --- .../modsecurity/OStringStreamPointer.java | 29 ----- .../modsecurity/presets/modsecurity.java | 118 +++++++----------- 2 files changed, 47 insertions(+), 100 deletions(-) delete mode 100644 modsecurity/src/main/java/org/bytedeco/modsecurity/OStringStreamPointer.java diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/OStringStreamPointer.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/OStringStreamPointer.java deleted file mode 100644 index 4e08f10ead9..00000000000 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/OStringStreamPointer.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.bytedeco.modsecurity; - -import org.bytedeco.javacpp.BytePointer; -import org.bytedeco.javacpp.Loader; -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.annotation.ByRef; -import org.bytedeco.javacpp.annotation.Name; -import org.bytedeco.javacpp.annotation.Properties; -import org.bytedeco.javacpp.annotation.StdString; - -@Name("std::ostringstream") @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) -public class OStringStreamPointer extends Pointer { - static { Loader.load(); } - - public OStringStreamPointer() { - allocate(); - } - - public OStringStreamPointer(Pointer p) { - super(p); - } - - private native void allocate(); - - public native @Name("operator =") @ByRef OStringStreamPointer put(@ByRef OStringStreamPointer x); - - public native void str(@StdString BytePointer value); - public native @StdString BytePointer str(); -} diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index cb7f3ddddcc..ae0324527a6 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -11,34 +11,25 @@ /** * @author Artem Martynenko artem7mag@gmail.com **/ -@Properties(inherit = javacpp.class , value = @Platform( - define = {"UNIQUE_PTR_NAMESPACE std", "SHARED_PTR_NAMESPACE std"}, - include = { - "modsecurity/actions/action.h", - "modsecurity/collection/collection.h", - "modsecurity/collection/collections.h", - "modsecurity/anchored_set_variable.h", - "modsecurity/anchored_variable.h", - "modsecurity/audit_log.h", - "modsecurity/debug_log.h", - "modsecurity/intervention.h", - "modsecurity/modsecurity.h", - "modsecurity/rule.h", - "modsecurity/rule_marker.h", - "modsecurity/rule_message.h", - "modsecurity/rule_unconditional.h", - "modsecurity/rule_with_actions.h", - "modsecurity/rule_with_operator.h", - "modsecurity/rules.h", - "modsecurity/rules_exceptions.h", - "modsecurity/rules_set.h", - "modsecurity/rules_set_phases.h", - "modsecurity/rules_set_properties.h", - "modsecurity/transaction.h", - "modsecurity/variable_origin.h", - "modsecurity/variable_value.h" }, - cinclude = "modsecurity/intervention.h", includepath = {"lib","include"}, linkpath = {"lib","include"}, link = "modsecurity"), - +@Properties( + inherit = javacpp.class, + value = @Platform( + define = {"UNIQUE_PTR_NAMESPACE std", "SHARED_PTR_NAMESPACE std"}, + include = { + "modsecurity/audit_log.h", + "modsecurity/debug_log.h", + "modsecurity/intervention.h", + "modsecurity/rule_message.h", + "modsecurity/rules_set.h", + "modsecurity/rules_set_phases.h", + "modsecurity/rules_set_properties.h", + "modsecurity/collection/collection.h", + "modsecurity/modsecurity.h", + "modsecurity/transaction.h"}, + cinclude = "modsecurity/intervention.h", + linkpath = {"lib","include"}, + includepath = {"lib","include"}, + link = "modsecurity"), target = "org.bytedeco.modsecurity", global = "org.bytedeco.modsecurity.global") public class modsecurity implements InfoMapper { @@ -48,50 +39,35 @@ public class modsecurity implements InfoMapper { @Override public void map(InfoMap infoMap) { - infoMap.put(new Info("clock_t").cast().valueTypes("long").pointerTypes("SizeTPointer")); - infoMap.put( - new Info("std::ostringstream").pointerTypes("org.bytedeco.modsecurity.OStringStreamPointer").define()); - infoMap.put(new Info("std::list").pointerTypes("StringList").define()); - infoMap.put(new Info("ModSecurityIntervention_t").pointerTypes("ModSecurityIntervention").define()); - infoMap.put(new Info("std::basic_string").annotations("@StdString").valueTypes("BytePointer").pointerTypes("@Cast({\"char*\"}) BytePointer")); infoMap.put(new Info("std::set").pointerTypes("StringSet").define()); - infoMap.put(new Info("std::list").pointerTypes("IntList").define()); - infoMap.put(new Info("std::list >").pointerTypes("IntIntPairList").define()); - infoMap.put(new Info("std::pair").pointerTypes("IntIntPair").define()); - infoMap.put(new Info("std::list >").pointerTypes("StringStringPairList") - .define()); - infoMap.put(new Info("std::pair").pointerTypes("StringStringPair").define()); - infoMap.put(new Info("std::list >").pointerTypes("IntStringPairList").define()); - infoMap.put(new Info("std::pair").pointerTypes("IntStringPair").define()); - infoMap.put(new Info("std::list").pointerTypes("RuleMessageList").define()); - infoMap.put(new Info("std::map").pointerTypes("StringStringMap").define()); - infoMap.put(new Info("std::shared_ptr") - .annotations("@SharedPtr").pointerTypes("MultipartPartTmpFile")); - infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr").pointerTypes("Rule")); - infoMap.put(new Info("std::shared_ptr").annotations("@SharedPtr") - .pointerTypes("Action")); - infoMap.put( - new Info("std::unordered_multimap") - .cast().pointerTypes("Pointer")); - infoMap.put(new Info("std::vector >").cast().pointerTypes( - "Pointer")); - infoMap.put( - new Info("std::vector >").cast().pointerTypes("Pointer")); - infoMap.put(new Info( - "std::unordered_multimap,std::shared_ptr >") - .cast().pointerTypes("Pointer")); - infoMap.put( - new Info("std::unordered_multimap >").cast() - .pointerTypes( - "Pointer")); - infoMap.put( - new Info("std::unordered_multimap >").cast() - .pointerTypes( - "Pointer")); - infoMap.put(new Info("std::unordered_multimap >").cast() - .pointerTypes( - "Pointer")); - + infoMap.put(new Info("clock_t").skip()); + infoMap.put(new Info("std::list").skip()); + infoMap.put(new Info("std::list >").skip()); + infoMap.put(new Info("std::list").skip()); + infoMap.put(new Info("std::list >").skip()); + infoMap.put(new Info("std::list >").skip()); + infoMap.put(new Info("std::ostringstream").skip()); + infoMap.put(new Info("Collections").skip()); + infoMap.put(new Info("collection::Collections").skip()); + infoMap.put(new Info("Collection").skip()); + infoMap.put(new Info("std::map").skip()); + infoMap.put(new Info("std::shared_ptr").skip()); + infoMap.put(new Info("AnchoredSetVariable").skip()); + infoMap.put(new Info("AnchoredVariable").skip()); + infoMap.put(new Info("VariableOrigin").skip()); + infoMap.put(new Info("VariableValue").skip()); + infoMap.put(new Info("Origins").skip()); + infoMap.put(new Info("Rules").skip()); + infoMap.put(new Info("Rule").skip()); + infoMap.put(new Info("RulesSetPhases").skip()); + infoMap.put(new Info("RuleWithActions").skip()); + infoMap.put(new Info("std::shared_ptr").skip()); + infoMap.put(new Info("std::shared_ptr").skip()); + infoMap.put(new Info("std::unique_ptr").skip()); + infoMap.put(new Info("std::shared_ptr").skip()); + infoMap.put(new Info("ModSecurityIntervention_t").pointerTypes("ModSecurityIntervention").define()); + infoMap.put(new Info("std::basic_string").annotations("@StdString").valueTypes("BytePointer").pointerTypes("@Cast({\"char*\", \"std::string\"}) BytePointer")); + infoMap.put(new Info("string", "std::string").annotations("@StdString").valueTypes("BytePointer", "String").pointerTypes("@Cast({\"char*\", \"std::string*\"}) BytePointer")); } } From f83343616fe01f0c934d01d5411e5326687a492f Mon Sep 17 00:00:00 2001 From: Martynenko Date: Wed, 27 Jan 2021 16:30:36 +0200 Subject: [PATCH 08/26] tmp add c4isr repository --- modsecurity/pom.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modsecurity/pom.xml b/modsecurity/pom.xml index 02af522653b..3319d91139f 100644 --- a/modsecurity/pom.xml +++ b/modsecurity/pom.xml @@ -18,6 +18,10 @@ + + https://nexus.volvo.mito:8443 + + @@ -48,4 +52,15 @@ + + + + c4isr.nexus.releases + ${nexus.url}/repository/maven-releases/ + + + c4isr.nexus.snapshots + ${nexus.url}/repository/maven-snapshots/ + + \ No newline at end of file From c6604635488eda0f2e79b4e6b2aaad0657c26190 Mon Sep 17 00:00:00 2001 From: Martynenko Date: Mon, 8 Feb 2021 14:45:58 +0200 Subject: [PATCH 09/26] modify according to mod security update --- .../java/org/bytedeco/modsecurity/presets/modsecurity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index ae0324527a6..a0a7e3fa645 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -53,6 +53,9 @@ public void map(InfoMap infoMap) { infoMap.put(new Info("std::map").skip()); infoMap.put(new Info("std::shared_ptr").skip()); infoMap.put(new Info("AnchoredSetVariable").skip()); + infoMap.put(new Info("AnchoredSetVariableTranslationProxycd").skip()); + infoMap.put(new Info("TransactionSecMarkerManagement").skip()); + infoMap.put(new Info("TransactionAnchoredVariables").skip()); infoMap.put(new Info("AnchoredVariable").skip()); infoMap.put(new Info("VariableOrigin").skip()); infoMap.put(new Info("VariableValue").skip()); From 71e45980f3c1a854f2422cc22d1b154acc5bf76d Mon Sep 17 00:00:00 2001 From: Martynenko Date: Tue, 9 Feb 2021 17:03:20 +0200 Subject: [PATCH 10/26] add list definition for tags --- .../java/org/bytedeco/modsecurity/presets/modsecurity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index a0a7e3fa645..5fb75b65e9c 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -43,7 +43,7 @@ public void map(InfoMap infoMap) { infoMap.put(new Info("clock_t").skip()); infoMap.put(new Info("std::list").skip()); infoMap.put(new Info("std::list >").skip()); - infoMap.put(new Info("std::list").skip()); + infoMap.put(new Info("std::list").pointerTypes("StringList").define()); infoMap.put(new Info("std::list >").skip()); infoMap.put(new Info("std::list >").skip()); infoMap.put(new Info("std::ostringstream").skip()); @@ -53,7 +53,7 @@ public void map(InfoMap infoMap) { infoMap.put(new Info("std::map").skip()); infoMap.put(new Info("std::shared_ptr").skip()); infoMap.put(new Info("AnchoredSetVariable").skip()); - infoMap.put(new Info("AnchoredSetVariableTranslationProxycd").skip()); + infoMap.put(new Info("AnchoredSetVariableTranslationProxy").skip()); infoMap.put(new Info("TransactionSecMarkerManagement").skip()); infoMap.put(new Info("TransactionAnchoredVariables").skip()); infoMap.put(new Info("AnchoredVariable").skip()); From 6da20ed306fc57ca35dd76fc842d2da35755242c Mon Sep 17 00:00:00 2001 From: Martynenko Date: Wed, 10 Feb 2021 12:27:23 +0200 Subject: [PATCH 11/26] add rule message list for transactions --- .../org/bytedeco/modsecurity/presets/modsecurity.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index 5fb75b65e9c..05edc1a75d6 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -40,10 +40,14 @@ public class modsecurity implements InfoMapper { @Override public void map(InfoMap infoMap) { infoMap.put(new Info("std::set").pointerTypes("StringSet").define()); + infoMap.put(new Info("std::list").pointerTypes("StringList").define()); + infoMap.put(new Info("std::list").pointerTypes("RuleMessageList").define()); + infoMap.put(new Info("ModSecurityIntervention_t").pointerTypes("ModSecurityIntervention").define()); + infoMap.put(new Info("std::basic_string").annotations("@StdString").valueTypes("BytePointer").pointerTypes("@Cast({\"char*\", \"std::string\"}) BytePointer")); + infoMap.put(new Info("string", "std::string").annotations("@StdString").valueTypes("BytePointer", "String").pointerTypes("@Cast({\"char*\", \"std::string*\"}) BytePointer")); infoMap.put(new Info("clock_t").skip()); infoMap.put(new Info("std::list").skip()); infoMap.put(new Info("std::list >").skip()); - infoMap.put(new Info("std::list").pointerTypes("StringList").define()); infoMap.put(new Info("std::list >").skip()); infoMap.put(new Info("std::list >").skip()); infoMap.put(new Info("std::ostringstream").skip()); @@ -68,9 +72,6 @@ public void map(InfoMap infoMap) { infoMap.put(new Info("std::shared_ptr").skip()); infoMap.put(new Info("std::unique_ptr").skip()); infoMap.put(new Info("std::shared_ptr").skip()); - infoMap.put(new Info("ModSecurityIntervention_t").pointerTypes("ModSecurityIntervention").define()); - infoMap.put(new Info("std::basic_string").annotations("@StdString").valueTypes("BytePointer").pointerTypes("@Cast({\"char*\", \"std::string\"}) BytePointer")); - infoMap.put(new Info("string", "std::string").annotations("@StdString").valueTypes("BytePointer", "String").pointerTypes("@Cast({\"char*\", \"std::string*\"}) BytePointer")); } } From b9af2e066397378ddfcb720da3c5b3c64d11c674 Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 22 Feb 2021 22:27:31 +0200 Subject: [PATCH 12/26] prepare for pull request --- modsecurity/LICENSE | 201 ++++++++++++++++++ modsecurity/README.md | 118 ++++++++++ modsecurity/pom.xml | 16 +- .../ModSecuritySimpleIntervention.java | 72 +++++++ modsecurity/samples/pom.xml | 19 ++ .../modsecurity/presets/modsecurity.java | 22 ++ 6 files changed, 434 insertions(+), 14 deletions(-) create mode 100644 modsecurity/LICENSE create mode 100644 modsecurity/README.md create mode 100644 modsecurity/samples/ModSecuritySimpleIntervention.java create mode 100644 modsecurity/samples/pom.xml diff --git a/modsecurity/LICENSE b/modsecurity/LICENSE new file mode 100644 index 00000000000..f49a4e16e68 --- /dev/null +++ b/modsecurity/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/modsecurity/README.md b/modsecurity/README.md new file mode 100644 index 00000000000..9ba244a3f15 --- /dev/null +++ b/modsecurity/README.md @@ -0,0 +1,118 @@ +JavaCPP Presets for ModSecurity +================================ + +[![Gitter](https://badges.gitter.im/bytedeco/javacpp.svg)](https://gitter.im/bytedeco/javacpp) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/modsecurity/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/modsecurity) [![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/org.bytedeco/modsecurity.svg)](http://bytedeco.org/builds/) +Build status for all platforms: [![modsecurity](https://github.com/bytedeco/javacpp-presets/workflows/modsecurity/badge.svg)](https://github.com/bytedeco/javacpp-presets/actions?query=workflow%3Acpu_features) Commercial support: [![xscode](https://img.shields.io/badge/Available%20on-xs%3Acode-blue?style=?style=plastic&logo=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAAlUlEQVR42uzXSwqAMAwE0Mn9L+3Ggtgkk35QwcnSJo9S+yGwM9DCooCbgn4YrJ4CIPUcQF7/XSBbx2TEz4sAZ2q1RAECBAiYBlCtvwN+KiYAlG7UDGj59MViT9hOwEqAhYCtAsUZvL6I6W8c2wcbd+LIWSCHSTeSAAECngN4xxIDSK9f4B9t377Wd7H5Nt7/Xz8eAgwAvesLRjYYPuUAAAAASUVORK5CYII=)](https://xscode.com/bytedeco/javacpp-presets) + + +Introduction +------------ +This directory contains the JavaCPP Presets module for: + +* ModSecurity 3.0.4 https://github.com/SpiderLabs/ModSecurity + +Please refer to the parent README.md file for more detailed information about the JavaCPP Presets. + + +Documentation +------------- +Java API documentation is available here: + +* http://bytedeco.org/javacpp-presets/modsecurity/apidocs/ + + +Sample Usage +------------ +Here is a simple example of ModSecurity ported to Java from this C source file: + +* https://github.com/SpiderLabs/ModSecurity#simple-example-using-c + +We can use [Maven 3](http://maven.apache.org/) to download and install automatically all the class files as well as the native binaries. To run this sample code, after creating the `pom.xml` and `ModSecuritySimpleIntervention.java.java` source files below, simply execute on the command line: +```bash + $ mvn compile exec:java +``` + +### The `pom.xml` build file +```xml + + 4.0.0 + org.bytedeco.modsecurity + modsecurity-sample + 1.5.5-SNAPSHOT + + ModSecuritySimpleIntervention + + + + org.bytedeco + modsecurity-platform + 3.0.4-1.5.5-SNAPSHOT + + + + . + + + +``` + +### The `ModSecuritySimpleIntervention.java` source file +```java +import org.bytedeco.javacpp.*;import org.bytedeco.modsecurity.*; +import org.bytedeco.javacpp.*; + +public class ModSecuritySimpleIntervention { + + + private static final String BASIC_RULE = + "SecRuleEngine On\n" + + "SecRule REQUEST_URI \"@streq /attack\" \"id:1,phase:1,msg: \' Attack detected\' t:lowercase,deny\""; + + + + + public static void main(String[]args){ + + ModSecurity modSecurity = new ModSecurity(); + + RulesSet rulesSet = new RulesSet(); + rulesSet.load(BASIC_RULE); + + Transaction transaction = new Transaction(modSecurity, rulesSet, null); + transaction.processConnection("127.0.0.1", 4455, "", 80); + transaction.processURI("https://modsecurity.org/attack", "GET", "1.0"); + transaction.addResponseHeader("HTTP/1.1", "200 OK"); + transaction.processResponseHeaders(200, "HTTP/1.1"); + transaction.processRequestBody(); + transaction.processRequestHeaders(); + + ModSecurityIntervention modSecurityIntervention = new ModSecurityIntervention(); + boolean isIntervention = transaction.intervention(modSecurityIntervention); + + if(isIntervention){ + System.out.println("There is intervention !!!"); + logRuleMessages(transaction.m_rulesMessages()); + } + } + + + private static void logRuleMessages(RuleMessageList messageList){ + if (messageList != null && !messageList.isNull() && !messageList.empty()) { + long size = messageList.size(); + System.out.println("MessageRuleSize " + size); + RuleMessageList.Iterator iterator = messageList.begin(); + for (int i = 0; i < size; i++) { + logRuleMessage(iterator.get()); + iterator.increment(); + } + } + } + + private static void logRuleMessage(RuleMessage ruleMessage){ + System.out.println("RuleMessage id = "+ ruleMessage.m_ruleId()+ " message = " + Optional.ofNullable(ruleMessage.m_message()).map(BytePointer::getString).orElse("NO_MESSAGE")); + } + + + +} +``` diff --git a/modsecurity/pom.xml b/modsecurity/pom.xml index 3319d91139f..939c0778c88 100644 --- a/modsecurity/pom.xml +++ b/modsecurity/pom.xml @@ -10,6 +10,8 @@ 4.0.0 modsecurity + 3.0.4-${project.parent.version} + JavaCPP Presets for ModSecurity @@ -18,10 +20,6 @@ - - https://nexus.volvo.mito:8443 - - @@ -53,14 +51,4 @@ - - - c4isr.nexus.releases - ${nexus.url}/repository/maven-releases/ - - - c4isr.nexus.snapshots - ${nexus.url}/repository/maven-snapshots/ - - \ No newline at end of file diff --git a/modsecurity/samples/ModSecuritySimpleIntervention.java b/modsecurity/samples/ModSecuritySimpleIntervention.java new file mode 100644 index 00000000000..7d601141d48 --- /dev/null +++ b/modsecurity/samples/ModSecuritySimpleIntervention.java @@ -0,0 +1,72 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +import org.bytedeco.modsecurity.*; +import org.bytedeco.javacpp.*; + +public class ModSecuritySimpleIntervention { + + + private static final String BASIC_RULE = + "SecRuleEngine On\n" + + "SecRule REQUEST_URI \"@streq /attack\" \"id:1,phase:1,msg: \' Attack detected\' t:lowercase,deny\""; + + + + + public static void main(String[]args){ + + ModSecurity modSecurity = new ModSecurity(); + + RulesSet rulesSet = new RulesSet(); + rulesSet.load(BASIC_RULE); + + Transaction transaction = new Transaction(modSecurity, rulesSet, null); + transaction.processConnection("127.0.0.1", 4455, "", 80); + transaction.processURI("https://modsecurity.org/attack", "GET", "1.0"); + transaction.addResponseHeader("HTTP/1.1", "200 OK"); + transaction.processResponseHeaders(200, "HTTP/1.1"); + transaction.processRequestBody(); + transaction.processRequestHeaders(); + + ModSecurityIntervention modSecurityIntervention = new ModSecurityIntervention(); + boolean isIntervention = transaction.intervention(modSecurityIntervention); + + if(isIntervention){ + System.out.println("There is intervention !!!"); + logRuleMessages(transaction.m_rulesMessages()); + } + } + + + private static void logRuleMessages(RuleMessageList messageList){ + if (messageList != null && !messageList.isNull() && !messageList.empty()) { + long size = messageList.size(); + System.out.println("MessageRuleSize " + size); + RuleMessageList.Iterator iterator = messageList.begin(); + for (int i = 0; i < size; i++) { + logRuleMessage(iterator.get()); + iterator.increment(); + } + } + } + + private static void logRuleMessage(RuleMessage ruleMessage){ + System.out.println("RuleMessage id = "+ ruleMessage.m_ruleId()+ " message = " + Optional.ofNullable(ruleMessage.m_message()).map(BytePointer::getString).orElse("NO_MESSAGE")); + } + + + +} diff --git a/modsecurity/samples/pom.xml b/modsecurity/samples/pom.xml new file mode 100644 index 00000000000..39b710ccc8f --- /dev/null +++ b/modsecurity/samples/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + org.bytedeco.modsecurity + modsecurity-sample + 1.5.5-SNAPSHOT + + ModSecuritySimpleIntervention + + + + org.bytedeco + modsecurity-platform + 3.0.4-1.5.5-SNAPSHOT + + + + . + + diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index 05edc1a75d6..d1eda659ff0 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -1,3 +1,25 @@ +/* + * Copyright (C) 2021 Samuel Audet, Artem Martynenko + * + * Licensed either under the Apache License, Version 2.0, or (at your option) + * under the terms of the GNU General Public License as published by + * the Free Software Foundation (subject to the "Classpath" exception), + * either version 2, or any later version (collectively, the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/ + * http://www.gnu.org/software/classpath/license.html + * + * or as provided in the LICENSE.txt file that accompanied this code. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.bytedeco.modsecurity.presets; import org.bytedeco.javacpp.Loader; From ec9f21773b3ffb660d70906bc65822ff647e857c Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 22 Feb 2021 23:01:54 +0200 Subject: [PATCH 13/26] remove installation of system dependencies from cppbuild.sh; remove unsupported platform builds --- modsecurity/README.md | 8 ++++++++ modsecurity/cppbuild.sh | 8 -------- modsecurity/platform/pom.xml | 24 ------------------------ 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/modsecurity/README.md b/modsecurity/README.md index 9ba244a3f15..ba2d77ed23a 100644 --- a/modsecurity/README.md +++ b/modsecurity/README.md @@ -20,6 +20,14 @@ Java API documentation is available here: * http://bytedeco.org/javacpp-presets/modsecurity/apidocs/ +Build Notes +------------ + +To Build JavaCPP ModSecurity Preset libraries requred by ModSecurity should be installed. + +Detailed information can be found here: + +* https://github.com/SpiderLabs/ModSecurity/wiki/Compilation-recipes-for-v3.x Sample Usage ------------ diff --git a/modsecurity/cppbuild.sh b/modsecurity/cppbuild.sh index 659ffcbb00d..3dfc3a944d3 100755 --- a/modsecurity/cppbuild.sh +++ b/modsecurity/cppbuild.sh @@ -7,8 +7,6 @@ if [[ -z "$PLATFORM" ]]; then exit fi - -sudo apt-get install g++ flex bison curl doxygen libyajl-dev libgeoip-dev libtool dh-autoreconf libcurl4-gnutls-dev libxml2 libpcre++-dev libxml2-dev mkdir -p $PLATFORM cd $PLATFORM INSTALL_PATH=`pwd` @@ -25,12 +23,6 @@ else fi case $PLATFORM in - linux-x86) - sh build.sh - ./configure --prefix=$INSTALL_PATH - make - make install - ;; linux-x86_64) sh build.sh ./configure --prefix=$INSTALL_PATH diff --git a/modsecurity/platform/pom.xml b/modsecurity/platform/pom.xml index 18a28fa904c..b316430ba39 100644 --- a/modsecurity/platform/pom.xml +++ b/modsecurity/platform/pom.xml @@ -30,36 +30,12 @@ ${javacpp.moduleId} ${project.version} - - ${project.groupId} - ${javacpp.moduleId} - ${project.version} - ${javacpp.platform.linux-x86} - ${project.groupId} ${javacpp.moduleId} ${project.version} ${javacpp.platform.linux-x86_64} - - ${project.groupId} - ${javacpp.moduleId} - ${project.version} - ${javacpp.platform.linux-armhf} - - - ${project.groupId} - ${javacpp.moduleId} - ${project.version} - ${javacpp.platform.linux-arm64} - - - ${project.groupId} - ${javacpp.moduleId} - ${project.version} - ${javacpp.platform.linux-ppc64le} - ${project.groupId} ${javacpp.moduleId} From e9280d4fee9aa280bb00648f36b3d3d4dc704a70 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 24 Feb 2021 22:22:10 +0200 Subject: [PATCH 14/26] add github workflow for modsecurity and needed deps to actions --- .github/actions/deploy-centos/action.yml | 2 +- .github/actions/deploy-macosx/action.yml | 4 +++- .github/workflows/modsecurity.yml | 29 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/modsecurity.yml diff --git a/.github/actions/deploy-centos/action.yml b/.github/actions/deploy-centos/action.yml index 236d896e5ed..47d7a301de9 100644 --- a/.github/actions/deploy-centos/action.yml +++ b/.github/actions/deploy-centos/action.yml @@ -20,7 +20,7 @@ runs: if [[ "$CENTOS_VERSION" == "6" ]]; then sed -i 's/mirror\.centos\.org\/centos/vault.centos.org/g;s/6\/sclo/6.10\/sclo/g;s/mirrorlist/#mirrorlist/g;s/#baseurl/baseurl/g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo fi - yum -y install $SCL_ENABLE rh-java-common-ant boost-devel ccache clang gcc-c++ gcc-gfortran java-1.8.0-openjdk-devel ant python python36-devel python36-pip swig file which wget unzip tar bzip2 gzip xz patch autoconf-archive automake make libtool bison flex perl nasm alsa-lib-devel freeglut-devel gtk2-devel libusb-devel libusb1-devel curl-devel expat-devel gettext-devel openssl-devel bzip2-devel zlib-devel SDL-devel libva-devel libxkbcommon-devel libxkbcommon-x11-devel xcb-util* fontconfig-devel libffi-devel ragel ocl-icd-devel + yum -y install $SCL_ENABLE rh-java-common-ant boost-devel ccache clang gcc-c++ gcc-gfortran java-1.8.0-openjdk-devel ant python python36-devel python36-pip swig file which wget unzip tar bzip2 gzip xz patch autoconf-archive automake make libtool bison flex perl nasm alsa-lib-devel freeglut-devel gtk2-devel libusb-devel libusb1-devel curl-devel expat-devel gettext-devel openssl-devel bzip2-devel zlib-devel SDL-devel libva-devel libxkbcommon-devel libxkbcommon-x11-devel xcb-util* fontconfig-devel libffi-devel ragel ocl-icd-devel yajl yajl-devel GeoIP-devel doxygen pcre-devel # https://gcc.gnu.org/legacy-ml/gcc-patches/2018-01/msg01962.html sed -i 's/_mm512_abs_pd (__m512 __A)/_mm512_abs_pd (__m512d __A)/g' /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/include/avx512fintrin.h source scl_source enable $SCL_ENABLE || true diff --git a/.github/actions/deploy-macosx/action.yml b/.github/actions/deploy-macosx/action.yml index 7ee0d3bd36e..d8492250748 100644 --- a/.github/actions/deploy-macosx/action.yml +++ b/.github/actions/deploy-macosx/action.yml @@ -10,7 +10,9 @@ runs: export MACOSX_DEPLOYMENT_TARGET=10.13 echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" >> $GITHUB_ENV - brew install boost ccache gcc swig autoconf-archive automake cmake libomp libtool libusb ant maven nasm xz pkg-config sdl gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr + brew install boost ccache gcc swig autoconf-archive automake cmake libomp libtool libusb ant maven nasm xz pkg-config sdl gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr zlib curl pcre libffi yajl ssdeep luarocks + brew install geoip --with-geoipupdate + brew install doxygen --with-llvm if [[ -n ${CI_DEPLOY_NEED_GCC:-} ]]; then brew install gcc@7 diff --git a/.github/workflows/modsecurity.yml b/.github/workflows/modsecurity.yml new file mode 100644 index 00000000000..c9f38ce62e0 --- /dev/null +++ b/.github/workflows/modsecurity.yml @@ -0,0 +1,29 @@ +name: modsecurity +on: + push: + paths: + - modsecurity/** + pull_request: + paths: + - modsecurity/** + workflow_dispatch: +env: + CI_DEPLOY_MODULE: ${{ github.workflow }} + CI_DEPLOY_PLATFORM: ${{ github.job }} + CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} + CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} +jobs: + linux-x86_64: + runs-on: ubuntu-16.04 + container: centos:6 + steps: + - uses: bytedeco/javacpp-presets/.github/actions/deploy-centos@actions + macosx-x86_64: + runs-on: macos-10.15 + steps: + - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions + redeploy: + needs: [linux-x86_64, macosx-x86_64] + runs-on: ubuntu-16.04 + steps: + - uses: bytedeco/javacpp-presets/.github/actions/redeploy@actions From d22ce7cbfd5eae835e222b3bbdb319f5c547a255 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 25 Feb 2021 22:23:52 +0200 Subject: [PATCH 15/26] change build containers --- .github/workflows/modsecurity.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/modsecurity.yml b/.github/workflows/modsecurity.yml index c9f38ce62e0..6b69c7981ae 100644 --- a/.github/workflows/modsecurity.yml +++ b/.github/workflows/modsecurity.yml @@ -15,11 +15,11 @@ env: jobs: linux-x86_64: runs-on: ubuntu-16.04 - container: centos:6 + container: centos:7 steps: - uses: bytedeco/javacpp-presets/.github/actions/deploy-centos@actions macosx-x86_64: - runs-on: macos-10.15 + runs-on: macos-10.13 steps: - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions redeploy: From d70087da28db54742c33f06634a819fdadf8c9d4 Mon Sep 17 00:00:00 2001 From: Martynenko Date: Fri, 26 Feb 2021 16:16:58 +0200 Subject: [PATCH 16/26] fixed modsecurity platform version --- modsecurity/platform/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modsecurity/platform/pom.xml b/modsecurity/platform/pom.xml index b316430ba39..00c8515001d 100644 --- a/modsecurity/platform/pom.xml +++ b/modsecurity/platform/pom.xml @@ -12,7 +12,7 @@ org.bytedeco modsecurity-platform - 1.12.0-${project.parent.version} + 3.0.4-${project.parent.version} JavaCPP Presets Platform for modsecurity From 4632064dab689d589ba76ddcc377cd0c073683f0 Mon Sep 17 00:00:00 2001 From: Martynenko Date: Fri, 26 Feb 2021 16:31:59 +0200 Subject: [PATCH 17/26] fixed macos version --- .github/workflows/modsecurity.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/modsecurity.yml b/.github/workflows/modsecurity.yml index 6b69c7981ae..1382cdbb282 100644 --- a/.github/workflows/modsecurity.yml +++ b/.github/workflows/modsecurity.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: bytedeco/javacpp-presets/.github/actions/deploy-centos@actions macosx-x86_64: - runs-on: macos-10.13 + runs-on: macos-10.15 steps: - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions redeploy: From 58da3346ab8b111febac57ea3d3538751d1de258 Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 1 Mar 2021 21:59:19 +0200 Subject: [PATCH 18/26] change preset class name to avoid conflict during macOS builds --- .../presets/{modsecurity.java => libmodsecurity.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename modsecurity/src/main/java/org/bytedeco/modsecurity/presets/{modsecurity.java => libmodsecurity.java} (98%) diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java similarity index 98% rename from modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java rename to modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java index d1eda659ff0..b9725d31832 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java @@ -54,7 +54,7 @@ link = "modsecurity"), target = "org.bytedeco.modsecurity", global = "org.bytedeco.modsecurity.global") -public class modsecurity implements InfoMapper { +public class libmodsecurity implements InfoMapper { static { Loader.checkVersion("org.bytedeco", "modsecurity"); } From 109e542aed5dcc9c59a3e4cc064c9ad3a5358cc5 Mon Sep 17 00:00:00 2001 From: Martynenko Date: Sat, 6 Mar 2021 11:48:12 +0200 Subject: [PATCH 19/26] fix empty modsecurity pointer generation --- .../java/org/bytedeco/modsecurity/presets/libmodsecurity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java index b9725d31832..0b35bd58021 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java @@ -65,6 +65,7 @@ public void map(InfoMap infoMap) { infoMap.put(new Info("std::list").pointerTypes("StringList").define()); infoMap.put(new Info("std::list").pointerTypes("RuleMessageList").define()); infoMap.put(new Info("ModSecurityIntervention_t").pointerTypes("ModSecurityIntervention").define()); + infoMap.put(new Info("modsecurity").pointerTypes("ModSecurity").define()); infoMap.put(new Info("std::basic_string").annotations("@StdString").valueTypes("BytePointer").pointerTypes("@Cast({\"char*\", \"std::string\"}) BytePointer")); infoMap.put(new Info("string", "std::string").annotations("@StdString").valueTypes("BytePointer", "String").pointerTypes("@Cast({\"char*\", \"std::string*\"}) BytePointer")); infoMap.put(new Info("clock_t").skip()); From 1abc277761ffb9053e3b729a60947bf56232f701 Mon Sep 17 00:00:00 2001 From: Martynenko Date: Sat, 6 Mar 2021 11:49:56 +0200 Subject: [PATCH 20/26] remove extra import --- modsecurity/samples/ModSecuritySimpleIntervention.java | 1 - 1 file changed, 1 deletion(-) diff --git a/modsecurity/samples/ModSecuritySimpleIntervention.java b/modsecurity/samples/ModSecuritySimpleIntervention.java index 7d601141d48..5a66b3bd72d 100644 --- a/modsecurity/samples/ModSecuritySimpleIntervention.java +++ b/modsecurity/samples/ModSecuritySimpleIntervention.java @@ -14,7 +14,6 @@ */ import org.bytedeco.modsecurity.*; -import org.bytedeco.javacpp.*; public class ModSecuritySimpleIntervention { From d98e9d87f59dad0eb98baf6b1b8d0ac11dd87d41 Mon Sep 17 00:00:00 2001 From: Martynenko Date: Sat, 6 Mar 2021 19:31:59 +0200 Subject: [PATCH 21/26] add modsecurity to main cppbuild.sh --- cppbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cppbuild.sh b/cppbuild.sh index afe6ca84144..3916ad7047c 100755 --- a/cppbuild.sh +++ b/cppbuild.sh @@ -164,7 +164,7 @@ function sedinplace { } if [[ -z ${PROJECTS:-} ]]; then - PROJECTS=(opencv ffmpeg flycapture spinnaker libdc1394 libfreenect libfreenect2 librealsense librealsense2 videoinput artoolkitplus chilitags flandmark arrow hdf5 hyperscan mkl mkl-dnn dnnl openblas arpack-ng cminpack fftw gsl cpython numpy scipy gym llvm libpostal leptonica tesseract caffe openpose cuda opencl mxnet tensorflow tensorrt ale onnx ngraph onnxruntime tvm liquidfun qt skia cpu_features systems) + PROJECTS=(opencv ffmpeg flycapture spinnaker libdc1394 libfreenect libfreenect2 librealsense librealsense2 videoinput artoolkitplus chilitags flandmark arrow hdf5 hyperscan mkl mkl-dnn dnnl openblas arpack-ng cminpack fftw gsl cpython numpy scipy gym llvm libpostal leptonica tesseract caffe openpose cuda opencl mxnet tensorflow tensorrt ale onnx ngraph onnxruntime tvm liquidfun qt skia cpu_features systems modsecurity) fi for PROJECT in ${PROJECTS[@]}; do From ed612b09d6581803d646e75f975fa922cc5abe2d Mon Sep 17 00:00:00 2001 From: Martynenko Date: Fri, 26 Mar 2021 14:21:23 +0200 Subject: [PATCH 22/26] set version to master-1.5.6-SNAPSHOT --- modsecurity/platform/pom.xml | 4 ++-- modsecurity/pom.xml | 4 ++-- modsecurity/samples/pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modsecurity/platform/pom.xml b/modsecurity/platform/pom.xml index 00c8515001d..6234bec84f5 100644 --- a/modsecurity/platform/pom.xml +++ b/modsecurity/platform/pom.xml @@ -6,13 +6,13 @@ org.bytedeco javacpp-presets - 1.5.5-SNAPSHOT + 1.5.6-SNAPSHOT ../../ org.bytedeco modsecurity-platform - 3.0.4-${project.parent.version} + master-${project.parent.version} JavaCPP Presets Platform for modsecurity diff --git a/modsecurity/pom.xml b/modsecurity/pom.xml index 939c0778c88..755ed327f16 100644 --- a/modsecurity/pom.xml +++ b/modsecurity/pom.xml @@ -5,12 +5,12 @@ javacpp-presets org.bytedeco - 1.5.5-SNAPSHOT + 1.5.6-SNAPSHOT 4.0.0 modsecurity - 3.0.4-${project.parent.version} + master-${project.parent.version} JavaCPP Presets for ModSecurity diff --git a/modsecurity/samples/pom.xml b/modsecurity/samples/pom.xml index 39b710ccc8f..641a55cad25 100644 --- a/modsecurity/samples/pom.xml +++ b/modsecurity/samples/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.bytedeco.modsecurity modsecurity-sample - 1.5.5-SNAPSHOT + 1.5.6-SNAPSHOT ModSecuritySimpleIntervention @@ -10,7 +10,7 @@ org.bytedeco modsecurity-platform - 3.0.4-1.5.5-SNAPSHOT + master-1.5.6-SNAPSHOT From 045c7f5e114509fd442e0a34f5f5287bb33daa24 Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 5 Apr 2021 12:33:14 +0300 Subject: [PATCH 23/26] fix version mismatches in README.md --- modsecurity/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modsecurity/README.md b/modsecurity/README.md index ba2d77ed23a..6cfadeb76e9 100644 --- a/modsecurity/README.md +++ b/modsecurity/README.md @@ -46,7 +46,7 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic 4.0.0 org.bytedeco.modsecurity modsecurity-sample - 1.5.5-SNAPSHOT + 1.5.6-SNAPSHOT ModSecuritySimpleIntervention @@ -54,7 +54,7 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic org.bytedeco modsecurity-platform - 3.0.4-1.5.5-SNAPSHOT + master-1.5.6-SNAPSHOT @@ -66,8 +66,7 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic ### The `ModSecuritySimpleIntervention.java` source file ```java -import org.bytedeco.javacpp.*;import org.bytedeco.modsecurity.*; -import org.bytedeco.javacpp.*; +import org.bytedeco.modsecurity.*; public class ModSecuritySimpleIntervention { From 00ca2527ab26e7633f43cbebce68b8412ed6853a Mon Sep 17 00:00:00 2001 From: Artem Date: Sat, 10 Apr 2021 12:22:44 +0300 Subject: [PATCH 24/26] change version of modsecurity to `master` in README.md --- modsecurity/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modsecurity/README.md b/modsecurity/README.md index 6cfadeb76e9..56d2a81f6cb 100644 --- a/modsecurity/README.md +++ b/modsecurity/README.md @@ -9,7 +9,7 @@ Introduction ------------ This directory contains the JavaCPP Presets module for: -* ModSecurity 3.0.4 https://github.com/SpiderLabs/ModSecurity +* ModSecurity `master` https://github.com/SpiderLabs/ModSecurity Please refer to the parent README.md file for more detailed information about the JavaCPP Presets. From db3acce0fe96f9e94c7fecdbc30500988f70ec00 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Sun, 11 Apr 2021 08:12:23 +0900 Subject: [PATCH 25/26] Update CHANGELOG.md and fix nits --- CHANGELOG.md | 2 +- README.md | 2 + cppbuild.sh | 2 +- modsecurity/LICENSE | 2 +- modsecurity/README.md | 65 +- modsecurity/cppbuild.sh | 15 +- modsecurity/platform/pom.xml | 2 +- .../ModSecuritySimpleIntervention.java | 14 +- modsecurity/samples/pom.xml | 36 +- .../java/org/bytedeco/modsecurity/Action.java | 22 + .../org/bytedeco/modsecurity/AuditLog.java | 180 +++ .../org/bytedeco/modsecurity/Collection.java | 101 ++ .../bytedeco/modsecurity/ConfigDouble.java | 36 + .../org/bytedeco/modsecurity/ConfigInt.java | 36 + .../org/bytedeco/modsecurity/ConfigSet.java | 35 + .../bytedeco/modsecurity/ConfigString.java | 36 + .../modsecurity/ConfigUnicodeMap.java | 41 + .../org/bytedeco/modsecurity/DebugLog.java | 49 + .../java/org/bytedeco/modsecurity/Driver.java | 19 + .../java/org/bytedeco/modsecurity/JSON.java | 19 + .../bytedeco/modsecurity/KeyExclusions.java | 22 + .../org/bytedeco/modsecurity/ModSecLogCb.java | 38 + .../org/bytedeco/modsecurity/ModSecurity.java | 74 ++ .../modsecurity/ModSecurityIntervention.java | 38 + .../modsecurity/MultipartPartTmpFile.java | 19 + .../org/bytedeco/modsecurity/Operator.java | 19 + .../org/bytedeco/modsecurity/RuleMessage.java | 73 ++ .../bytedeco/modsecurity/RuleMessageList.java | 38 + .../modsecurity/RuleWithOperator.java | 21 + .../bytedeco/modsecurity/RulesExceptions.java | 21 + .../org/bytedeco/modsecurity/RulesSet.java | 59 + .../bytedeco/modsecurity/RulesSetPhases.java | 35 + .../modsecurity/RulesSetProperties.java | 168 +++ .../org/bytedeco/modsecurity/StringList.java | 38 + .../org/bytedeco/modsecurity/StringSet.java | 38 + .../org/bytedeco/modsecurity/Transaction.java | 341 ++++++ .../TransactionAnchoredVariables.java | 25 + .../TransactionSecMarkerManagement.java | 35 + .../modsecurity/UnicodeMapHolder.java | 40 + .../org/bytedeco/modsecurity/Variables.java | 21 + .../java/org/bytedeco/modsecurity/Writer.java | 22 + .../java/org/bytedeco/modsecurity/XML.java | 19 + .../modsecurity/global/modsecurity.java | 1058 +++++++++++++++++ .../{libmodsecurity.java => modsecurity.java} | 4 +- platform/pom.xml | 6 + pom.xml | 6 +- 46 files changed, 2911 insertions(+), 81 deletions(-) create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/Action.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/AuditLog.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/Collection.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigDouble.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigInt.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigSet.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigString.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigUnicodeMap.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/DebugLog.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/Driver.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/JSON.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/KeyExclusions.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecLogCb.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecurity.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecurityIntervention.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/MultipartPartTmpFile.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/Operator.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleMessage.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleMessageList.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleWithOperator.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesExceptions.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSet.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSetPhases.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSetProperties.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/StringList.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/StringSet.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/Transaction.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/TransactionAnchoredVariables.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/TransactionSecMarkerManagement.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/UnicodeMapHolder.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/Variables.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/Writer.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/XML.java create mode 100644 modsecurity/src/gen/java/org/bytedeco/modsecurity/global/modsecurity.java rename modsecurity/src/main/java/org/bytedeco/modsecurity/presets/{libmodsecurity.java => modsecurity.java} (97%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b6d338e92..9402809fa88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ * Include `cudaGL.h` and `cuda_gl_interop.h` header files in presets for CUDA ([pull #1027](https://github.com/bytedeco/javacpp-presets/pull/1027)) - * Add presets for NVIDIA Video Codec SDK 11.0.10 ([pull #1020](https://github.com/bytedeco/javacpp-presets/pull/1020)), PyTorch 1.8.1 ([issue #623](https://github.com/bytedeco/javacpp-presets/issues/623)) + * Add presets for NVIDIA Video Codec SDK 11.0.10 ([pull #1020](https://github.com/bytedeco/javacpp-presets/pull/1020)), PyTorch 1.8.1 ([issue #623](https://github.com/bytedeco/javacpp-presets/issues/623)), ModSecurity ([pull #1012](https://github.com/bytedeco/javacpp-presets/pull/1012)) * Map `std::vector` to `RangeVector` in `opencv_core.Mat` for convenience ([issue bytedeco/javacv#1607](https://github.com/bytedeco/javacv/issues/1607)) * Include `genericaliasobject.h`, `context.h`, `tracemalloc.h`, and `datetime.h` for CPython ([issue #1017](https://github.com/bytedeco/javacpp-presets/issues/1017)) * Add samples using LLVM modules to deal with bitcode and object files ([pull #1016](https://github.com/bytedeco/javacpp-presets/pull/1016)) diff --git a/README.md b/README.md index 20643525d35..e3bc95496ae 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ JavaCPP Presets [![qt](https://github.com/bytedeco/javacpp-presets/workflows/qt/badge.svg)](https://github.com/bytedeco/javacpp-presets/actions?query=workflow%3Aqt) [![skia](https://github.com/bytedeco/javacpp-presets/workflows/skia/badge.svg)](https://github.com/bytedeco/javacpp-presets/actions?query=workflow%3Askia) [![cpu_features](https://github.com/bytedeco/javacpp-presets/workflows/cpu_features/badge.svg)](https://github.com/bytedeco/javacpp-presets/actions?query=workflow%3Acpu_features) +[![modsecurity](https://github.com/bytedeco/javacpp-presets/workflows/modsecurity/badge.svg)](https://github.com/bytedeco/javacpp-presets/actions?query=workflow%3Amodsecurity) [![systems](https://github.com/bytedeco/javacpp-presets/workflows/systems/badge.svg)](https://github.com/bytedeco/javacpp-presets/actions?query=workflow%3Asystems) Commercial support and paid services for custom presets: [![xscode](https://img.shields.io/badge/Available%20on-xs%3Acode-blue?style=?style=plastic&logo=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAAlUlEQVR42uzXSwqAMAwE0Mn9L+3Ggtgkk35QwcnSJo9S+yGwM9DCooCbgn4YrJ4CIPUcQF7/XSBbx2TEz4sAZ2q1RAECBAiYBlCtvwN+KiYAlG7UDGj59MViT9hOwEqAhYCtAsUZvL6I6W8c2wcbd+LIWSCHSTeSAAECngN4xxIDSK9f4B9t377Wd7H5Nt7/Xz8eAgwAvesLRjYYPuUAAAAASUVORK5CYII=)](https://xscode.com/bytedeco/javacpp-presets) @@ -217,6 +218,7 @@ Each child module in turn relies by default on the included [`cppbuild.sh` scrip * Qt 5.15.x https://download.qt.io/archive/qt/ * Mono/Skia 2.80.x https://github.com/mono/skia * cpu_features 0.6.0 https://github.com/google/cpu_features + * ModSecurity https://github.com/SpiderLabs/ModSecurity * System APIs of the build environments: * Linux (glibc) https://www.gnu.org/software/libc/ * Mac OS X (XNU libc) https://opensource.apple.com/ diff --git a/cppbuild.sh b/cppbuild.sh index f7a17d93211..5130774d5a5 100755 --- a/cppbuild.sh +++ b/cppbuild.sh @@ -164,7 +164,7 @@ function sedinplace { } if [[ -z ${PROJECTS:-} ]]; then - PROJECTS=(opencv ffmpeg flycapture spinnaker libdc1394 libfreenect libfreenect2 librealsense librealsense2 videoinput artoolkitplus chilitags flandmark arrow hdf5 hyperscan mkl mkl-dnn dnnl openblas arpack-ng cminpack fftw gsl cpython numpy scipy gym llvm libpostal leptonica tesseract caffe openpose cuda nvcodec opencl mxnet pytorch tensorflow tensorrt ale onnx ngraph onnxruntime tvm liquidfun qt skia cpu_features systems modsecurity) + PROJECTS=(opencv ffmpeg flycapture spinnaker libdc1394 libfreenect libfreenect2 librealsense librealsense2 videoinput artoolkitplus chilitags flandmark arrow hdf5 hyperscan mkl mkl-dnn dnnl openblas arpack-ng cminpack fftw gsl cpython numpy scipy gym llvm libpostal leptonica tesseract caffe openpose cuda nvcodec opencl mxnet pytorch tensorflow tensorrt ale onnx ngraph onnxruntime tvm liquidfun qt skia cpu_features modsecurity systems) fi for PROJECT in ${PROJECTS[@]}; do diff --git a/modsecurity/LICENSE b/modsecurity/LICENSE index f49a4e16e68..261eeb9e9f8 100644 --- a/modsecurity/LICENSE +++ b/modsecurity/LICENSE @@ -198,4 +198,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/modsecurity/README.md b/modsecurity/README.md index 56d2a81f6cb..44f08384da9 100644 --- a/modsecurity/README.md +++ b/modsecurity/README.md @@ -2,14 +2,14 @@ JavaCPP Presets for ModSecurity ================================ [![Gitter](https://badges.gitter.im/bytedeco/javacpp.svg)](https://gitter.im/bytedeco/javacpp) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/modsecurity/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/modsecurity) [![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/org.bytedeco/modsecurity.svg)](http://bytedeco.org/builds/) -Build status for all platforms: [![modsecurity](https://github.com/bytedeco/javacpp-presets/workflows/modsecurity/badge.svg)](https://github.com/bytedeco/javacpp-presets/actions?query=workflow%3Acpu_features) Commercial support: [![xscode](https://img.shields.io/badge/Available%20on-xs%3Acode-blue?style=?style=plastic&logo=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAAlUlEQVR42uzXSwqAMAwE0Mn9L+3Ggtgkk35QwcnSJo9S+yGwM9DCooCbgn4YrJ4CIPUcQF7/XSBbx2TEz4sAZ2q1RAECBAiYBlCtvwN+KiYAlG7UDGj59MViT9hOwEqAhYCtAsUZvL6I6W8c2wcbd+LIWSCHSTeSAAECngN4xxIDSK9f4B9t377Wd7H5Nt7/Xz8eAgwAvesLRjYYPuUAAAAASUVORK5CYII=)](https://xscode.com/bytedeco/javacpp-presets) +Build status for all platforms: [![modsecurity](https://github.com/bytedeco/javacpp-presets/workflows/modsecurity/badge.svg)](https://github.com/bytedeco/javacpp-presets/actions?query=workflow%3Amodsecurity) Commercial support: [![xscode](https://img.shields.io/badge/Available%20on-xs%3Acode-blue?style=?style=plastic&logo=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAAlUlEQVR42uzXSwqAMAwE0Mn9L+3Ggtgkk35QwcnSJo9S+yGwM9DCooCbgn4YrJ4CIPUcQF7/XSBbx2TEz4sAZ2q1RAECBAiYBlCtvwN+KiYAlG7UDGj59MViT9hOwEqAhYCtAsUZvL6I6W8c2wcbd+LIWSCHSTeSAAECngN4xxIDSK9f4B9t377Wd7H5Nt7/Xz8eAgwAvesLRjYYPuUAAAAASUVORK5CYII=)](https://xscode.com/bytedeco/javacpp-presets) Introduction ------------ This directory contains the JavaCPP Presets module for: -* ModSecurity `master` https://github.com/SpiderLabs/ModSecurity + * ModSecurity https://github.com/SpiderLabs/ModSecurity Please refer to the parent README.md file for more detailed information about the JavaCPP Presets. @@ -18,22 +18,24 @@ Documentation ------------- Java API documentation is available here: -* http://bytedeco.org/javacpp-presets/modsecurity/apidocs/ + * http://bytedeco.org/javacpp-presets/modsecurity/apidocs/ + Build Notes ------------ -To Build JavaCPP ModSecurity Preset libraries requred by ModSecurity should be installed. +To build the JavaCPP Presets for ModSecurity, libraries required by ModSecurity should be installed. Detailed information can be found here: -* https://github.com/SpiderLabs/ModSecurity/wiki/Compilation-recipes-for-v3.x + * https://github.com/SpiderLabs/ModSecurity/wiki/Compilation-recipes-for-v3.x + Sample Usage ------------ -Here is a simple example of ModSecurity ported to Java from this C source file: +Here is a simple example of ModSecurity ported to Java from this C++ source file: -* https://github.com/SpiderLabs/ModSecurity#simple-example-using-c + * https://github.com/SpiderLabs/ModSecurity#simple-example-using-c We can use [Maven 3](http://maven.apache.org/) to download and install automatically all the class files as well as the native binaries. To run this sample code, after creating the `pom.xml` and `ModSecuritySimpleIntervention.java.java` source files below, simply execute on the command line: ```bash @@ -43,43 +45,38 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic ### The `pom.xml` build file ```xml - 4.0.0 - org.bytedeco.modsecurity - modsecurity-sample - 1.5.6-SNAPSHOT - - ModSecuritySimpleIntervention - - - - org.bytedeco - modsecurity-platform - master-1.5.6-SNAPSHOT - - - - . - + 4.0.0 + org.bytedeco.modsecurity + samples + 1.5.6-SNAPSHOT + + ModSecuritySimpleIntervention + + + + org.bytedeco + modsecurity-platform + master-1.5.6-SNAPSHOT + + + + . + - ``` ### The `ModSecuritySimpleIntervention.java` source file ```java +import java.util.Optional; +import org.bytedeco.javacpp.*; import org.bytedeco.modsecurity.*; public class ModSecuritySimpleIntervention { - - private static final String BASIC_RULE = "SecRuleEngine On\n" + "SecRule REQUEST_URI \"@streq /attack\" \"id:1,phase:1,msg: \' Attack detected\' t:lowercase,deny\""; - - - public static void main(String[]args){ - ModSecurity modSecurity = new ModSecurity(); RulesSet rulesSet = new RulesSet(); @@ -96,13 +93,12 @@ public class ModSecuritySimpleIntervention { ModSecurityIntervention modSecurityIntervention = new ModSecurityIntervention(); boolean isIntervention = transaction.intervention(modSecurityIntervention); - if(isIntervention){ + if (isIntervention){ System.out.println("There is intervention !!!"); logRuleMessages(transaction.m_rulesMessages()); } } - private static void logRuleMessages(RuleMessageList messageList){ if (messageList != null && !messageList.isNull() && !messageList.empty()) { long size = messageList.size(); @@ -118,8 +114,5 @@ public class ModSecuritySimpleIntervention { private static void logRuleMessage(RuleMessage ruleMessage){ System.out.println("RuleMessage id = "+ ruleMessage.m_ruleId()+ " message = " + Optional.ofNullable(ruleMessage.m_message()).map(BytePointer::getString).orElse("NO_MESSAGE")); } - - - } ``` diff --git a/modsecurity/cppbuild.sh b/modsecurity/cppbuild.sh index 3dfc3a944d3..e050d7a7bac 100755 --- a/modsecurity/cppbuild.sh +++ b/modsecurity/cppbuild.sh @@ -11,13 +11,12 @@ mkdir -p $PLATFORM cd $PLATFORM INSTALL_PATH=`pwd` -if [ ! -d "ModSecurity" ]; -then - git clone https://github.com/SpiderLabs/ModSecurity - cd ModSecurity - git checkout origin/v3/master - git submodule init - git submodule update +if [[ ! -d "ModSecurity" ]]; then + git clone https://github.com/SpiderLabs/ModSecurity + cd ModSecurity + git checkout origin/v3/master + git submodule init + git submodule update else cd ModSecurity fi @@ -40,4 +39,4 @@ case $PLATFORM in ;; esac -cd ../.. \ No newline at end of file +cd ../.. diff --git a/modsecurity/platform/pom.xml b/modsecurity/platform/pom.xml index 6234bec84f5..0f7737b9b9e 100644 --- a/modsecurity/platform/pom.xml +++ b/modsecurity/platform/pom.xml @@ -13,7 +13,7 @@ org.bytedeco modsecurity-platform master-${project.parent.version} - JavaCPP Presets Platform for modsecurity + JavaCPP Presets Platform for ModSecurity modsecurity diff --git a/modsecurity/samples/ModSecuritySimpleIntervention.java b/modsecurity/samples/ModSecuritySimpleIntervention.java index 5a66b3bd72d..7aed62d6df9 100644 --- a/modsecurity/samples/ModSecuritySimpleIntervention.java +++ b/modsecurity/samples/ModSecuritySimpleIntervention.java @@ -13,20 +13,16 @@ * */ +import java.util.Optional; +import org.bytedeco.javacpp.*; import org.bytedeco.modsecurity.*; public class ModSecuritySimpleIntervention { - - private static final String BASIC_RULE = "SecRuleEngine On\n" + "SecRule REQUEST_URI \"@streq /attack\" \"id:1,phase:1,msg: \' Attack detected\' t:lowercase,deny\""; - - - public static void main(String[]args){ - ModSecurity modSecurity = new ModSecurity(); RulesSet rulesSet = new RulesSet(); @@ -43,13 +39,12 @@ public static void main(String[]args){ ModSecurityIntervention modSecurityIntervention = new ModSecurityIntervention(); boolean isIntervention = transaction.intervention(modSecurityIntervention); - if(isIntervention){ + if (isIntervention){ System.out.println("There is intervention !!!"); logRuleMessages(transaction.m_rulesMessages()); } } - private static void logRuleMessages(RuleMessageList messageList){ if (messageList != null && !messageList.isNull() && !messageList.empty()) { long size = messageList.size(); @@ -65,7 +60,4 @@ private static void logRuleMessages(RuleMessageList messageList){ private static void logRuleMessage(RuleMessage ruleMessage){ System.out.println("RuleMessage id = "+ ruleMessage.m_ruleId()+ " message = " + Optional.ofNullable(ruleMessage.m_message()).map(BytePointer::getString).orElse("NO_MESSAGE")); } - - - } diff --git a/modsecurity/samples/pom.xml b/modsecurity/samples/pom.xml index 641a55cad25..2c4d68bc33e 100644 --- a/modsecurity/samples/pom.xml +++ b/modsecurity/samples/pom.xml @@ -1,19 +1,21 @@ - 4.0.0 - org.bytedeco.modsecurity - modsecurity-sample - 1.5.6-SNAPSHOT - - ModSecuritySimpleIntervention - - - - org.bytedeco - modsecurity-platform - master-1.5.6-SNAPSHOT - - - - . - + 4.0.0 + org.bytedeco.modsecurity + samples + 1.5.6-SNAPSHOT + + ModSecuritySimpleIntervention + 1.8 + 1.8 + + + + org.bytedeco + modsecurity-platform + master-1.5.6-SNAPSHOT + + + + . + diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/Action.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Action.java new file mode 100644 index 00000000000..c87e98dedf9 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Action.java @@ -0,0 +1,22 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +/* few forwarded declarations */ +@Namespace("modsecurity::actions") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class Action extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public Action() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Action(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/AuditLog.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/AuditLog.java new file mode 100644 index 00000000000..c136595a219 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/AuditLog.java @@ -0,0 +1,180 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +/** \ingroup ModSecurity_CPP_API */ +@Namespace("modsecurity::audit_log") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class AuditLog extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public AuditLog(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public AuditLog(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public AuditLog position(long position) { + return (AuditLog)super.position(position); + } + @Override public AuditLog getPointer(long i) { + return new AuditLog((Pointer)this).position(position + i); + } + + public AuditLog() { super((Pointer)null); allocate(); } + private native void allocate(); + + + + /** enum modsecurity::audit_log::AuditLog::AuditLogType */ + public static final int + NotSetAuditLogType = 0, + SerialAuditLogType = 1, + ParallelAuditLogType = 2, + HttpsAuditLogType = 3; + + /** enum modsecurity::audit_log::AuditLog::AuditLogStatus */ + public static final int + NotSetLogStatus = 0, + OnAuditLogStatus = 1, + OffAuditLogStatus = 2, + RelevantOnlyAuditLogStatus = 3; + + /** enum modsecurity::audit_log::AuditLog::AuditLogFormat */ + public static final int + NotSetAuditLogFormat = 0, + JSONAuditLogFormat = 1, + NativeAuditLogFormat = 2; + + /** enum modsecurity::audit_log::AuditLog::AuditLogParts */ + public static final int + /** + * Audit log header (mandatory). + * + */ + AAuditLogPart = 2, + + /** + * Request headers. + * + */ + BAuditLogPart = 4, + + /** + * Request body (present only if the request body exists and ModSecurity + * is configured to intercept it). + * + */ + CAuditLogPart = 8, + + /** + * Reserved for intermediary response headers; not implemented yet. + * + */ + DAuditLogPart = 16, + + /** + * Intermediary response body (present only if ModSecurity is configured + * to intercept response bodies, and if the audit log engine is + * configured to record it). Intermediary response body is the same as the + * actual response body unless ModSecurity intercepts the intermediary + * response body, in which case the actual response body will contain the + * error message (either the Apache default error message, or the + * ErrorDocument page). + * + */ + EAuditLogPart = 32, + + /** + * Final response headers (excluding the Date and Server headers, which + * are always added by Apache in the late stage of content delivery). + * + */ + FAuditLogPart = 64, + + /** + * Reserved for the actual response body; not implemented yet. + * + */ + GAuditLogPart = 128, + + /** + * Audit log trailer. + * + */ + HAuditLogPart = 256, + + /** + * This part is a replacement for part C. It will log the same data as C + * in all cases except when multipart/form-data encoding in used. In this + * case, it will log a fake application/x-www-form-urlencoded body that + * contains the information about parameters but not about the files. This + * is handy if you don’t want to have (often large) files stored in your + * audit logs. + * + */ + IAuditLogPart = 512, + + /** + * This part contains information about the files uploaded using + * multipart/form-data encoding. + */ + JAuditLogPart = 1024, + + /** + * This part contains a full list of every rule that matched (one per + * line) in the order they were matched. The rules are fully qualified and + * will thus show inherited actions and default operators. Supported as of + * v2.5.0. + * + */ + KAuditLogPart = 2048, + + /** + * Final boundary, signifies the end of the entry (mandatory). + * + */ + ZAuditLogPart = 4096; + + public native @Cast("bool") boolean setStorageDirMode(int permission); + public native @Cast("bool") boolean setFileMode(int permission); + public native @Cast("bool") boolean setStatus(@Cast("modsecurity::audit_log::AuditLog::AuditLogStatus") int new_status); + public native @Cast("bool") boolean setRelevantStatus(@StdString BytePointer new_relevant_status); + public native @Cast("bool") boolean setFilePath1(@StdString BytePointer path); + public native @Cast("bool") boolean setFilePath2(@StdString BytePointer path); + public native @Cast("bool") boolean setStorageDir(@StdString BytePointer path); + public native @Cast("bool") boolean setFormat(@Cast("modsecurity::audit_log::AuditLog::AuditLogFormat") int fmt); + + public native int getDirectoryPermission(); + public native int getFilePermission(); + public native int getParts(); + + public native @Cast("bool") boolean setParts(@StdString BytePointer new_parts); + public native @Cast("bool") boolean setType(@Cast("modsecurity::audit_log::AuditLog::AuditLogType") int audit_type); + + public native @Cast("bool") boolean init(@StdString @Cast({"char*", "std::string*"}) BytePointer error); + public native @Cast("bool") @Name("close") boolean _close(); + + public native @Cast("bool") boolean saveIfRelevant(Transaction transaction); + public native @Cast("bool") boolean saveIfRelevant(Transaction transaction, int parts); + public native @Cast("bool") boolean isRelevant(int status); + + public static native int addParts(int parts, @StdString BytePointer new_parts); + public static native int addParts(int parts, @StdString String new_parts); + public static native int removeParts(int parts, @StdString BytePointer new_parts); + public static native int removeParts(int parts, @StdString String new_parts); + + public native @Cast("bool") boolean merge(AuditLog from, @StdString @Cast({"char*", "std::string*"}) BytePointer error); + + public native @StdString BytePointer m_path1(); public native AuditLog m_path1(BytePointer setter); + public native @StdString BytePointer m_path2(); public native AuditLog m_path2(BytePointer setter); + public native @StdString BytePointer m_storage_dir(); public native AuditLog m_storage_dir(BytePointer setter); + + public native @Cast("modsecurity::audit_log::AuditLog::AuditLogFormat") int m_format(); public native AuditLog m_format(int setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/Collection.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Collection.java new file mode 100644 index 00000000000..b27d3655158 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Collection.java @@ -0,0 +1,101 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +@Namespace("modsecurity::collection") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class Collection extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Collection(Pointer p) { super(p); } + + public native void store(@StdString BytePointer key, @StdString BytePointer value); + public native void store(@StdString String key, @StdString String value); + + public native @Cast("bool") boolean storeOrUpdateFirst(@StdString BytePointer key, + @StdString BytePointer value); + public native @Cast("bool") boolean storeOrUpdateFirst(@StdString String key, + @StdString String value); + + public native @Cast("bool") boolean updateFirst(@StdString BytePointer key, + @StdString BytePointer value); + public native @Cast("bool") boolean updateFirst(@StdString String key, + @StdString String value); + + public native void del(@StdString BytePointer key); + public native void del(@StdString String key); + + + /* store */ + public native void store(@StdString BytePointer key, @StdString BytePointer compartment, + @StdString BytePointer value); + public native void store(@StdString String key, @StdString String compartment, + @StdString String value); + + + public native void store(@StdString BytePointer key, @StdString BytePointer compartment, + @StdString BytePointer compartment2, @StdString BytePointer value); + public native void store(@StdString String key, @StdString String compartment, + @StdString String compartment2, @StdString String value); + + + /* storeOrUpdateFirst */ + public native @Cast("bool") boolean storeOrUpdateFirst(@StdString BytePointer key, + @StdString BytePointer compartment, @StdString BytePointer value); + public native @Cast("bool") boolean storeOrUpdateFirst(@StdString String key, + @StdString String compartment, @StdString String value); + + + public native @Cast("bool") boolean storeOrUpdateFirst(@StdString BytePointer key, + @StdString BytePointer compartment, @StdString BytePointer compartment2, + @StdString BytePointer value); + public native @Cast("bool") boolean storeOrUpdateFirst(@StdString String key, + @StdString String compartment, @StdString String compartment2, + @StdString String value); + + + /* updateFirst */ + public native @Cast("bool") boolean updateFirst(@StdString BytePointer key, @StdString BytePointer compartment, + @StdString BytePointer value); + public native @Cast("bool") boolean updateFirst(@StdString String key, @StdString String compartment, + @StdString String value); + + + public native @Cast("bool") boolean updateFirst(@StdString BytePointer key, @StdString BytePointer compartment, + @StdString BytePointer compartment2, @StdString BytePointer value); + public native @Cast("bool") boolean updateFirst(@StdString String key, @StdString String compartment, + @StdString String compartment2, @StdString String value); + + + /* del */ + public native void del(@StdString BytePointer key, @StdString BytePointer compartment); + public native void del(@StdString String key, @StdString String compartment); + + + public native void del(@StdString BytePointer key, @StdString BytePointer compartment, + @StdString BytePointer compartment2); + public native void del(@StdString String key, @StdString String compartment, + @StdString String compartment2); + + + /* resolveFirst */ + + + /* resolveSingleMatch */ + + + /* resolveMultiMatches */ + + + /* resolveRegularExpression */ + + public native @StdString BytePointer m_name(); public native Collection m_name(BytePointer setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigDouble.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigDouble.java new file mode 100644 index 00000000000..9c72338b5cf --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigDouble.java @@ -0,0 +1,36 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class ConfigDouble extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public ConfigDouble(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public ConfigDouble(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public ConfigDouble position(long position) { + return (ConfigDouble)super.position(position); + } + @Override public ConfigDouble getPointer(long i) { + return new ConfigDouble((Pointer)this).position(position + i); + } + + public ConfigDouble() { super((Pointer)null); allocate(); } + private native void allocate(); + public native @Cast("bool") boolean m_set(); public native ConfigDouble m_set(boolean setter); + public native double m_value(); public native ConfigDouble m_value(double setter); + + public native void merge(ConfigDouble from); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigInt.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigInt.java new file mode 100644 index 00000000000..c0fea96ed73 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigInt.java @@ -0,0 +1,36 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +/** \ingroup ModSecurity_CPP_API */ +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class ConfigInt extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public ConfigInt(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public ConfigInt(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public ConfigInt position(long position) { + return (ConfigInt)super.position(position); + } + @Override public ConfigInt getPointer(long i) { + return new ConfigInt((Pointer)this).position(position + i); + } + + public ConfigInt() { super((Pointer)null); allocate(); } + private native void allocate(); + public native @Cast("bool") boolean m_set(); public native ConfigInt m_set(boolean setter); + public native int m_value(); public native ConfigInt m_value(int setter); + + public native void merge(ConfigInt from); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigSet.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigSet.java new file mode 100644 index 00000000000..c37fdc5724d --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigSet.java @@ -0,0 +1,35 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class ConfigSet extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public ConfigSet(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public ConfigSet(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public ConfigSet position(long position) { + return (ConfigSet)super.position(position); + } + @Override public ConfigSet getPointer(long i) { + return new ConfigSet((Pointer)this).position(position + i); + } + + public ConfigSet() { super((Pointer)null); allocate(); } + private native void allocate(); + public native @Cast("bool") boolean m_set(); public native ConfigSet m_set(boolean setter); + public native @Cast("bool") boolean m_clear(); public native ConfigSet m_clear(boolean setter); + public native @ByRef StringSet m_value(); public native ConfigSet m_value(StringSet setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigString.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigString.java new file mode 100644 index 00000000000..1a8f9b9f25f --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigString.java @@ -0,0 +1,36 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class ConfigString extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public ConfigString(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public ConfigString(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public ConfigString position(long position) { + return (ConfigString)super.position(position); + } + @Override public ConfigString getPointer(long i) { + return new ConfigString((Pointer)this).position(position + i); + } + + public ConfigString() { super((Pointer)null); allocate(); } + private native void allocate(); + public native @Cast("bool") boolean m_set(); public native ConfigString m_set(boolean setter); + public native @StdString BytePointer m_value(); public native ConfigString m_value(BytePointer setter); + + public native void merge(ConfigString from); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigUnicodeMap.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigUnicodeMap.java new file mode 100644 index 00000000000..420f323c2bf --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ConfigUnicodeMap.java @@ -0,0 +1,41 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class ConfigUnicodeMap extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public ConfigUnicodeMap(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public ConfigUnicodeMap(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public ConfigUnicodeMap position(long position) { + return (ConfigUnicodeMap)super.position(position); + } + @Override public ConfigUnicodeMap getPointer(long i) { + return new ConfigUnicodeMap((Pointer)this).position(position + i); + } + + public ConfigUnicodeMap() { super((Pointer)null); allocate(); } + private native void allocate(); + + public static native void loadConfig(@StdString BytePointer f, double codePage, + RulesSetProperties driver, @StdString @Cast({"char*", "std::string*"}) BytePointer errg); + public static native void loadConfig(@StdString String f, double codePage, + RulesSetProperties driver, @StdString @Cast({"char*", "std::string*"}) BytePointer errg); + + public native void merge(ConfigUnicodeMap from); + + public native @Cast("bool") boolean m_set(); public native ConfigUnicodeMap m_set(boolean setter); + public native double m_unicodeCodePage(); public native ConfigUnicodeMap m_unicodeCodePage(double setter); + public native @SharedPtr UnicodeMapHolder m_unicodeMapTable(); public native ConfigUnicodeMap m_unicodeMapTable(UnicodeMapHolder setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/DebugLog.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/DebugLog.java new file mode 100644 index 00000000000..b4c6b87f16f --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/DebugLog.java @@ -0,0 +1,49 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +/** \ingroup ModSecurity_CPP_API */ +@Namespace("modsecurity::debug_log") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class DebugLog extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public DebugLog(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public DebugLog(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public DebugLog position(long position) { + return (DebugLog)super.position(position); + } + @Override public DebugLog getPointer(long i) { + return new DebugLog((Pointer)this).position(position + i); + } + + public DebugLog() { super((Pointer)null); allocate(); } + private native void allocate(); + + public native void write(int level, @StdString BytePointer msg); + public native void write(int level, @StdString String msg); + public native void write(int level, @StdString BytePointer id, + @StdString BytePointer uri, @StdString BytePointer msg); + public native void write(int level, @StdString String id, + @StdString String uri, @StdString String msg); + public native @Cast("bool") boolean isLogFileSet(); + public native @Cast("bool") boolean isLogLevelSet(); + public native void setDebugLogLevel(int level); + public native void setDebugLogFile(@StdString BytePointer fileName, @StdString @Cast({"char*", "std::string*"}) BytePointer error); + public native void setDebugLogFile(@StdString String fileName, @StdString @Cast({"char*", "std::string*"}) BytePointer error); + public native @StdString BytePointer getDebugLogFile(); + public native int getDebugLogLevel(); + + public native int m_debugLevel(); public native DebugLog m_debugLevel(int setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/Driver.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Driver.java new file mode 100644 index 00000000000..d10d959362f --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Driver.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +@Namespace("modsecurity::Parser") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class Driver extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public Driver() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Driver(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/JSON.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/JSON.java new file mode 100644 index 00000000000..fca1e8741f3 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/JSON.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +@Namespace("modsecurity::RequestBodyProcessor") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class JSON extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public JSON() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public JSON(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/KeyExclusions.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/KeyExclusions.java new file mode 100644 index 00000000000..1d5ac49fe62 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/KeyExclusions.java @@ -0,0 +1,22 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +// #endif + +// #ifdef __cplusplus +@Namespace("modsecurity::variables") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class KeyExclusions extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public KeyExclusions() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public KeyExclusions(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecLogCb.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecLogCb.java new file mode 100644 index 00000000000..e8a2e336cb4 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecLogCb.java @@ -0,0 +1,38 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +/* + * @name ModSecLogCb + * @brief Callback to be function on every log generation + * + * + * The callback is going to be called on every log request. + * + * + * void * Internal reference to be used by the API consumer. Whatever + * is set here will be passed on every call. + * void * Pointer to a const char * or RuleMessage class. The returned + * data is selected on the log register property. + * + * @note Vide LogProperty enum to learn more about Log Properties. + * + */ +@Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class ModSecLogCb extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public ModSecLogCb(Pointer p) { super(p); } + protected ModSecLogCb() { allocate(); } + private native void allocate(); + public native void call(Pointer arg0, @Const Pointer arg1); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecurity.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecurity.java new file mode 100644 index 00000000000..de73ca09266 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecurity.java @@ -0,0 +1,74 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +// #endif + + +/** \ingroup ModSecurity_CPP_API */ +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class ModSecurity extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public ModSecurity(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public ModSecurity(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public ModSecurity position(long position) { + return (ModSecurity)super.position(position); + } + @Override public ModSecurity getPointer(long i) { + return new ModSecurity((Pointer)this).position(position + i); + } + + public ModSecurity() { super((Pointer)null); allocate(); } + private native void allocate(); + + + + + public native @StdString BytePointer whoAmI(); + public native void setConnectorInformation(@StdString BytePointer connector); + public native void setConnectorInformation(@StdString String connector); + public native void setServerLogCb(ModSecLogCb cb); + /** + * + * properties Properties to inform ModSecurity what kind of infornation + * is expected be returned. + * + */ + public native void setServerLogCb(ModSecLogCb cb, int properties); + + public native void serverLog(Pointer data, @SharedPtr RuleMessage rm); + + public native @StdString BytePointer getConnectorInformation(); + + public static native int processContentOffset(@Cast("const char*") BytePointer content, @Cast("size_t") long len, + @Cast("const char*") BytePointer matchString, @StdString @Cast({"char*", "std::string*"}) BytePointer json, @Cast("const char**") PointerPointer err); + public static native int processContentOffset(@Cast("const char*") BytePointer content, @Cast("size_t") long len, + @Cast("const char*") BytePointer matchString, @StdString @Cast({"char*", "std::string*"}) BytePointer json, @Cast("const char**") @ByPtrPtr BytePointer err); + public static native int processContentOffset(String content, @Cast("size_t") long len, + String matchString, @StdString @Cast({"char*", "std::string*"}) BytePointer json, @Cast("const char**") @ByPtrPtr ByteBuffer err); + public static native int processContentOffset(@Cast("const char*") BytePointer content, @Cast("size_t") long len, + @Cast("const char*") BytePointer matchString, @StdString @Cast({"char*", "std::string*"}) BytePointer json, @Cast("const char**") @ByPtrPtr byte[] err); + public static native int processContentOffset(String content, @Cast("size_t") long len, + String matchString, @StdString @Cast({"char*", "std::string*"}) BytePointer json, @Cast("const char**") @ByPtrPtr BytePointer err); + public static native int processContentOffset(@Cast("const char*") BytePointer content, @Cast("size_t") long len, + @Cast("const char*") BytePointer matchString, @StdString @Cast({"char*", "std::string*"}) BytePointer json, @Cast("const char**") @ByPtrPtr ByteBuffer err); + public static native int processContentOffset(String content, @Cast("size_t") long len, + String matchString, @StdString @Cast({"char*", "std::string*"}) BytePointer json, @Cast("const char**") @ByPtrPtr byte[] err); + + public native Collection m_global_collection(); public native ModSecurity m_global_collection(Collection setter); + public native Collection m_resource_collection(); public native ModSecurity m_resource_collection(Collection setter); + public native Collection m_ip_collection(); public native ModSecurity m_ip_collection(Collection setter); + public native Collection m_session_collection(); public native ModSecurity m_session_collection(Collection setter); + public native Collection m_user_collection(); public native ModSecurity m_user_collection(Collection setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecurityIntervention.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecurityIntervention.java new file mode 100644 index 00000000000..d8015b04251 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/ModSecurityIntervention.java @@ -0,0 +1,38 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +// #endif + +@Namespace("modsecurity") @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class ModSecurityIntervention extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public ModSecurityIntervention() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public ModSecurityIntervention(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public ModSecurityIntervention(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public ModSecurityIntervention position(long position) { + return (ModSecurityIntervention)super.position(position); + } + @Override public ModSecurityIntervention getPointer(long i) { + return new ModSecurityIntervention((Pointer)this).position(position + i); + } + + public native int status(); public native ModSecurityIntervention status(int setter); + public native int pause(); public native ModSecurityIntervention pause(int setter); + public native @Cast("char*") BytePointer url(); public native ModSecurityIntervention url(BytePointer setter); + public native @Cast("char*") BytePointer log(); public native ModSecurityIntervention log(BytePointer setter); + public native int disruptive(); public native ModSecurityIntervention disruptive(int setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/MultipartPartTmpFile.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/MultipartPartTmpFile.java new file mode 100644 index 00000000000..ac21b29e903 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/MultipartPartTmpFile.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +@Namespace("modsecurity::RequestBodyProcessor") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class MultipartPartTmpFile extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public MultipartPartTmpFile() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public MultipartPartTmpFile(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/Operator.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Operator.java new file mode 100644 index 00000000000..d361d6e89e9 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Operator.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +@Namespace("modsecurity::operators") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class Operator extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public Operator() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Operator(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleMessage.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleMessage.java new file mode 100644 index 00000000000..f3d7ba58a6f --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleMessage.java @@ -0,0 +1,73 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +// #ifdef __cplusplus + + + +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class RuleMessage extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public RuleMessage(Pointer p) { super(p); } + + /** enum modsecurity::RuleMessage::LogMessageInfo */ + public static final int + ErrorLogTailLogMessageInfo = 2, + ClientLogMessageInfo = 4; + + /** + * + * FIXME: RuleMessage is currently too big, doing a lot of + * unnecessary data duplication. Needs to be shrink down. + * + */ + + public RuleMessage(RuleMessage rule) { super((Pointer)null); allocate(rule); } + private native void allocate(RuleMessage rule); + + public native @ByRef @Name("operator =") RuleMessage put(@Const @ByRef RuleMessage ruleMessage); + + public native void clean(); + + public native @StdString BytePointer log(); + public native @StdString BytePointer log(int props); + public native @StdString BytePointer log(int props, int responseCode); + public native @StdString BytePointer errorLog(); + + public static native @StdString BytePointer log(@Const RuleMessage rm, int props, int code); + public static native @StdString BytePointer log(@Const RuleMessage rm, int props); + public static native @StdString BytePointer log(@Const RuleMessage rm); + + public static native @StdString BytePointer _details(@Const RuleMessage rm); + public static native @StdString BytePointer _errorLogTail(@Const RuleMessage rm); + + public native int m_accuracy(); public native RuleMessage m_accuracy(int setter); + public native @StdString BytePointer m_data(); public native RuleMessage m_data(BytePointer setter); + public native @Cast("bool") boolean m_isDisruptive(); public native RuleMessage m_isDisruptive(boolean setter); + public native @StdString BytePointer m_match(); public native RuleMessage m_match(BytePointer setter); + public native int m_maturity(); public native RuleMessage m_maturity(int setter); + public native @StdString BytePointer m_message(); public native RuleMessage m_message(BytePointer setter); + public native @Cast("bool") boolean m_noAuditLog(); public native RuleMessage m_noAuditLog(boolean setter); + public native int m_phase(); public native RuleMessage m_phase(int setter); + public native @StdString BytePointer m_reference(); public native RuleMessage m_reference(BytePointer setter); + public native @StdString BytePointer m_rev(); public native RuleMessage m_rev(BytePointer setter); + public native int m_ruleId(); public native RuleMessage m_ruleId(int setter); + public native int m_ruleLine(); public native RuleMessage m_ruleLine(int setter); + public native @Cast("bool") boolean m_saveMessage(); public native RuleMessage m_saveMessage(boolean setter); + public native int m_severity(); public native RuleMessage m_severity(int setter); + public native @StdString BytePointer m_ver(); public native RuleMessage m_ver(BytePointer setter); + + public native @ByRef StringList m_tags(); public native RuleMessage m_tags(StringList setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleMessageList.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleMessageList.java new file mode 100644 index 00000000000..cf54b23590a --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleMessageList.java @@ -0,0 +1,38 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +@Name("std::list") @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class RuleMessageList extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public RuleMessageList(Pointer p) { super(p); } + public RuleMessageList() { allocate(); } + private native void allocate(); + public native @Name("operator =") @ByRef RuleMessageList put(@ByRef RuleMessageList x); + + public boolean empty() { return size() == 0; } + public native long size(); + + public native @ByVal Iterator insert(@ByVal Iterator pos, @ByRef RuleMessage value); + public native @ByVal Iterator erase(@ByVal Iterator pos); + public native @ByVal Iterator begin(); + public native @ByVal Iterator end(); + @NoOffset @Name("iterator") public static class Iterator extends Pointer { + public Iterator(Pointer p) { super(p); } + public Iterator() { } + + public native @Name("operator ++") @ByRef Iterator increment(); + public native @Name("operator ==") boolean equals(@ByRef Iterator it); + public native @Name("operator *") @ByRef @Const RuleMessage get(); + } +} + diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleWithOperator.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleWithOperator.java new file mode 100644 index 00000000000..344d5aa3c6e --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RuleWithOperator.java @@ -0,0 +1,21 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +// #ifdef __cplusplus +@Namespace("modsecurity") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class RuleWithOperator extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public RuleWithOperator() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public RuleWithOperator(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesExceptions.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesExceptions.java new file mode 100644 index 00000000000..624f8a572a7 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesExceptions.java @@ -0,0 +1,21 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +// #ifdef __cplusplus +@Namespace("modsecurity") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class RulesExceptions extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public RulesExceptions() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public RulesExceptions(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSet.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSet.java new file mode 100644 index 00000000000..2e6fff1ac06 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSet.java @@ -0,0 +1,59 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + + +/** \ingroup ModSecurity_CPP_API */ +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class RulesSet extends RulesSetProperties { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public RulesSet(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public RulesSet(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public RulesSet position(long position) { + return (RulesSet)super.position(position); + } + @Override public RulesSet getPointer(long i) { + return new RulesSet((Pointer)this).position(position + i); + } + + public RulesSet() { super((Pointer)null); allocate(); } + private native void allocate(); + + public RulesSet(DebugLog customLog) { super((Pointer)null); allocate(customLog); } + private native void allocate(DebugLog customLog); + + public native int loadFromUri(@Cast("const char*") BytePointer uri); + public native int loadFromUri(String uri); + public native int loadRemote(@Cast("const char*") BytePointer key, @Cast("const char*") BytePointer uri); + public native int loadRemote(String key, String uri); + public native int load(@Cast("const char*") BytePointer rules); + public native int load(String rules); + public native int load(@Cast("const char*") BytePointer rules, @StdString BytePointer ref); + public native int load(String rules, @StdString String ref); + + public native void dump(); + + public native int merge(Driver driver); + public native int merge(RulesSet rules); + + public native int evaluate(int phase, Transaction transaction); + public native @StdString BytePointer getParserError(); + + public native void debug(int level, @StdString BytePointer id, @StdString BytePointer uri, + @StdString BytePointer msg); + public native void debug(int level, @StdString String id, @StdString String uri, + @StdString String msg); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSetPhases.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSetPhases.java new file mode 100644 index 00000000000..b7c630d6f26 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSetPhases.java @@ -0,0 +1,35 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +/** \ingroup ModSecurity_CPP_API */ +@Namespace("modsecurity") @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class RulesSetPhases extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public RulesSetPhases() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public RulesSetPhases(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public RulesSetPhases(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public RulesSetPhases position(long position) { + return (RulesSetPhases)super.position(position); + } + @Override public RulesSetPhases getPointer(long i) { + return new RulesSetPhases((Pointer)this).position(position + i); + } + + public native void dump(); + +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSetProperties.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSetProperties.java new file mode 100644 index 00000000000..869b0e79ad8 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/RulesSetProperties.java @@ -0,0 +1,168 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class RulesSetProperties extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public RulesSetProperties(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public RulesSetProperties(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public RulesSetProperties position(long position) { + return (RulesSetProperties)super.position(position); + } + @Override public RulesSetProperties getPointer(long i) { + return new RulesSetProperties((Pointer)this).position(position + i); + } + + public RulesSetProperties() { super((Pointer)null); allocate(); } + private native void allocate(); + + + public RulesSetProperties(DebugLog debugLog) { super((Pointer)null); allocate(debugLog); } + private native void allocate(DebugLog debugLog); + + + + + + /** + * + * + */ + /** enum modsecurity::RulesSetProperties::ConfigBoolean */ + public static final int + TrueConfigBoolean = 0, + FalseConfigBoolean = 1, + PropertyNotSetConfigBoolean = 2; + + + /** + * + * The RuleEngine enumerator consists in mapping the different states + * of the rule engine. + * + */ + /** enum modsecurity::RulesSetProperties::RuleEngine */ + public static final int + /** + * + * Rules won't be evaluated if Rule Engine is set to DisabledRuleEngine + * + */ + DisabledRuleEngine = 0, + /** + * + * Rules will be evaluated and disturb actions will take place if needed. + * + */ + EnabledRuleEngine = 1, + /** + * Rules will be evaluated but it won't generate any disruptive action. + * + */ + DetectionOnlyRuleEngine = 2, + /** + * + */ + PropertyNotSetRuleEngine = 3; + + + /** + * + * Defines what actions should be taken in case the body (response or + * request) is bigger than the expected size. + * + */ + /** enum modsecurity::RulesSetProperties::BodyLimitAction */ + public static final int + /** + * + * Process partial + * + */ + ProcessPartialBodyLimitAction = 0, + /** + * + * Reject the request + * + */ + RejectBodyLimitAction = 1, + /** + * + */ + PropertyNotSetBodyLimitAction = 2; + + + /** + * + * Defines what actions should be taken in case the remote rules failed to + * be downloaded (independent of the circumstances) + * + * + */ + /** enum modsecurity::RulesSetProperties::OnFailedRemoteRulesAction */ + public static final int + /** + * + * Abort + * + */ + AbortOnFailedRemoteRulesAction = 0, + /** + * + * Warn on logging + * + */ + WarnOnFailedRemoteRulesAction = 1, + /** + * + */ + PropertyNotSetRemoteRulesAction = 2; + + + public static native @Cast("const char*") BytePointer ruleEngineStateString(@Cast("modsecurity::RulesSetProperties::RuleEngine") int i); + + + public static native @StdString BytePointer configBooleanString(@Cast("modsecurity::RulesSetProperties::ConfigBoolean") int i); + + + public native AuditLog m_auditLog(); public native RulesSetProperties m_auditLog(AuditLog setter); + public native @Cast("modsecurity::RulesSetProperties::BodyLimitAction") int m_requestBodyLimitAction(); public native RulesSetProperties m_requestBodyLimitAction(int setter); + public native @Cast("modsecurity::RulesSetProperties::BodyLimitAction") int m_responseBodyLimitAction(); public native RulesSetProperties m_responseBodyLimitAction(int setter); + public native @Cast("modsecurity::RulesSetProperties::ConfigBoolean") int m_secRequestBodyAccess(); public native RulesSetProperties m_secRequestBodyAccess(int setter); + public native @Cast("modsecurity::RulesSetProperties::ConfigBoolean") int m_secResponseBodyAccess(); public native RulesSetProperties m_secResponseBodyAccess(int setter); + public native @Cast("modsecurity::RulesSetProperties::ConfigBoolean") int m_secXMLExternalEntity(); public native RulesSetProperties m_secXMLExternalEntity(int setter); + public native @Cast("modsecurity::RulesSetProperties::ConfigBoolean") int m_tmpSaveUploadedFiles(); public native RulesSetProperties m_tmpSaveUploadedFiles(int setter); + public native @Cast("modsecurity::RulesSetProperties::ConfigBoolean") int m_uploadKeepFiles(); public native RulesSetProperties m_uploadKeepFiles(int setter); + public native @ByRef ConfigDouble m_argumentsLimit(); public native RulesSetProperties m_argumentsLimit(ConfigDouble setter); + public native @ByRef ConfigDouble m_requestBodyLimit(); public native RulesSetProperties m_requestBodyLimit(ConfigDouble setter); + public native @ByRef ConfigDouble m_requestBodyNoFilesLimit(); public native RulesSetProperties m_requestBodyNoFilesLimit(ConfigDouble setter); + public native @ByRef ConfigDouble m_responseBodyLimit(); public native RulesSetProperties m_responseBodyLimit(ConfigDouble setter); + public native @ByRef ConfigInt m_uploadFileLimit(); public native RulesSetProperties m_uploadFileLimit(ConfigInt setter); + public native @ByRef ConfigInt m_uploadFileMode(); public native RulesSetProperties m_uploadFileMode(ConfigInt setter); + public native DebugLog m_debugLog(); public native RulesSetProperties m_debugLog(DebugLog setter); + public native @Cast("modsecurity::RulesSetProperties::OnFailedRemoteRulesAction") int m_remoteRulesActionOnFailed(); public native RulesSetProperties m_remoteRulesActionOnFailed(int setter); + public native @Cast("modsecurity::RulesSetProperties::RuleEngine") int m_secRuleEngine(); public native RulesSetProperties m_secRuleEngine(int setter); + public native @ByRef RulesExceptions m_exceptions(); public native RulesSetProperties m_exceptions(RulesExceptions setter); + public native @ByRef StringList m_components(); public native RulesSetProperties m_components(StringList setter); + public native @ByRef ConfigSet m_responseBodyTypeToBeInspected(); public native RulesSetProperties m_responseBodyTypeToBeInspected(ConfigSet setter); + public native @ByRef ConfigString m_httpblKey(); public native RulesSetProperties m_httpblKey(ConfigString setter); + public native @ByRef ConfigString m_uploadDirectory(); public native RulesSetProperties m_uploadDirectory(ConfigString setter); + public native @ByRef ConfigString m_uploadTmpDirectory(); public native RulesSetProperties m_uploadTmpDirectory(ConfigString setter); + public native @ByRef ConfigString m_secArgumentSeparator(); public native RulesSetProperties m_secArgumentSeparator(ConfigString setter); + public native @ByRef ConfigString m_secWebAppId(); public native RulesSetProperties m_secWebAppId(ConfigString setter); + public native @ByRef ConfigUnicodeMap m_unicodeMapTable(); public native RulesSetProperties m_unicodeMapTable(ConfigUnicodeMap setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/StringList.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/StringList.java new file mode 100644 index 00000000000..5f013f32e1c --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/StringList.java @@ -0,0 +1,38 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +@Name("std::list") @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class StringList extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public StringList(Pointer p) { super(p); } + public StringList() { allocate(); } + private native void allocate(); + public native @Name("operator =") @ByRef StringList put(@ByRef StringList x); + + public boolean empty() { return size() == 0; } + public native long size(); + + public native @ByVal Iterator insert(@ByVal Iterator pos, @StdString BytePointer value); + public native @ByVal Iterator erase(@ByVal Iterator pos); + public native @ByVal Iterator begin(); + public native @ByVal Iterator end(); + @NoOffset @Name("iterator") public static class Iterator extends Pointer { + public Iterator(Pointer p) { super(p); } + public Iterator() { } + + public native @Name("operator ++") @ByRef Iterator increment(); + public native @Name("operator ==") boolean equals(@ByRef Iterator it); + public native @Name("operator *") @StdString BytePointer get(); + } +} + diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/StringSet.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/StringSet.java new file mode 100644 index 00000000000..5e146f73a2e --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/StringSet.java @@ -0,0 +1,38 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +@Name("std::set") @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class StringSet extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public StringSet(Pointer p) { super(p); } + public StringSet() { allocate(); } + private native void allocate(); + public native @Name("operator =") @ByRef StringSet put(@ByRef StringSet x); + + public boolean empty() { return size() == 0; } + public native long size(); + + public native void insert(@StdString BytePointer value); + public native void erase(@StdString BytePointer value); + public native @ByVal Iterator begin(); + public native @ByVal Iterator end(); + @NoOffset @Name("iterator") public static class Iterator extends Pointer { + public Iterator(Pointer p) { super(p); } + public Iterator() { } + + public native @Name("operator ++") @ByRef Iterator increment(); + public native @Name("operator ==") boolean equals(@ByRef Iterator it); + public native @Name("operator *") @StdString BytePointer get(); + } +} + diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/Transaction.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Transaction.java new file mode 100644 index 00000000000..5e543c146e1 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Transaction.java @@ -0,0 +1,341 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +/** \ingroup ModSecurity_CPP_API */ +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class Transaction extends TransactionAnchoredVariables { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Transaction(Pointer p) { super(p); } + public TransactionSecMarkerManagement asTransactionSecMarkerManagement() { return asTransactionSecMarkerManagement(this); } + @Namespace public static native @Name("static_cast") TransactionSecMarkerManagement asTransactionSecMarkerManagement(Transaction pointer); + + public Transaction(ModSecurity transaction, RulesSet rules, Pointer logCbData) { super((Pointer)null); allocate(transaction, rules, logCbData); } + private native void allocate(ModSecurity transaction, RulesSet rules, Pointer logCbData); + public Transaction(ModSecurity transaction, RulesSet rules, @Cast("char*") BytePointer id, + Pointer logCbData) { super((Pointer)null); allocate(transaction, rules, id, logCbData); } + private native void allocate(ModSecurity transaction, RulesSet rules, @Cast("char*") BytePointer id, + Pointer logCbData); + public Transaction(ModSecurity transaction, RulesSet rules, @Cast("char*") ByteBuffer id, + Pointer logCbData) { super((Pointer)null); allocate(transaction, rules, id, logCbData); } + private native void allocate(ModSecurity transaction, RulesSet rules, @Cast("char*") ByteBuffer id, + Pointer logCbData); + public Transaction(ModSecurity transaction, RulesSet rules, @Cast("char*") byte[] id, + Pointer logCbData) { super((Pointer)null); allocate(transaction, rules, id, logCbData); } + private native void allocate(ModSecurity transaction, RulesSet rules, @Cast("char*") byte[] id, + Pointer logCbData); + + + public native @Cast("bool") @Name("operator ==") boolean equals(@Const @ByRef Transaction b); + + + /** TODO: Should be an structure that fits an IP address */ + public native int processConnection(@Cast("const char*") BytePointer client, int cPort, + @Cast("const char*") BytePointer server, int sPort); + public native int processConnection(String client, int cPort, + String server, int sPort); + public native int processURI(@Cast("const char*") BytePointer uri, @Cast("const char*") BytePointer protocol, + @Cast("const char*") BytePointer http_version); + public native int processURI(String uri, String protocol, + String http_version); + + /** + * Types of request body that ModSecurity may give a special treatment + * for the data. + */ + /** enum modsecurity::Transaction::RequestBodyType */ + public static final int + /** + * + */ + UnknownFormat = 0, + /** + * + */ + MultiPartRequestBody = 1, + /** + * + */ + WWWFormUrlEncoded = 2, + /** + * + */ + JSONRequestBody = 3, + /** + * + */ + XMLRequestBody = 4; + + public native int processRequestHeaders(); + public native int addRequestHeader(@StdString BytePointer key, @StdString BytePointer value); + public native int addRequestHeader(@StdString String key, @StdString String value); + public native int addRequestHeader(@Cast("const unsigned char*") ByteBuffer key, @Cast("const unsigned char*") ByteBuffer value); + public native int addRequestHeader(@Cast("const unsigned char*") byte[] key, @Cast("const unsigned char*") byte[] value); + public native int addRequestHeader(@Cast("const unsigned char*") BytePointer key, @Cast("size_t") long len_key, + @Cast("const unsigned char*") BytePointer value, @Cast("size_t") long len_value); + public native int addRequestHeader(@Cast("const unsigned char*") ByteBuffer key, @Cast("size_t") long len_key, + @Cast("const unsigned char*") ByteBuffer value, @Cast("size_t") long len_value); + public native int addRequestHeader(@Cast("const unsigned char*") byte[] key, @Cast("size_t") long len_key, + @Cast("const unsigned char*") byte[] value, @Cast("size_t") long len_value); + + public native int processRequestBody(); + public native int appendRequestBody(@Cast("const unsigned char*") BytePointer body, @Cast("size_t") long size); + public native int appendRequestBody(@Cast("const unsigned char*") ByteBuffer body, @Cast("size_t") long size); + public native int appendRequestBody(@Cast("const unsigned char*") byte[] body, @Cast("size_t") long size); + public native int requestBodyFromFile(@Cast("const char*") BytePointer path); + public native int requestBodyFromFile(String path); + + public native int processResponseHeaders(int code, @StdString BytePointer proto); + public native int processResponseHeaders(int code, @StdString String proto); + public native int addResponseHeader(@StdString BytePointer key, @StdString BytePointer value); + public native int addResponseHeader(@StdString String key, @StdString String value); + public native int addResponseHeader(@Cast("const unsigned char*") ByteBuffer key, @Cast("const unsigned char*") ByteBuffer value); + public native int addResponseHeader(@Cast("const unsigned char*") byte[] key, @Cast("const unsigned char*") byte[] value); + public native int addResponseHeader(@Cast("const unsigned char*") BytePointer key, @Cast("size_t") long len_key, + @Cast("const unsigned char*") BytePointer value, @Cast("size_t") long len_value); + public native int addResponseHeader(@Cast("const unsigned char*") ByteBuffer key, @Cast("size_t") long len_key, + @Cast("const unsigned char*") ByteBuffer value, @Cast("size_t") long len_value); + public native int addResponseHeader(@Cast("const unsigned char*") byte[] key, @Cast("size_t") long len_key, + @Cast("const unsigned char*") byte[] value, @Cast("size_t") long len_value); + + public native int processResponseBody(); + public native int appendResponseBody(@Cast("const unsigned char*") BytePointer body, @Cast("size_t") long size); + public native int appendResponseBody(@Cast("const unsigned char*") ByteBuffer body, @Cast("size_t") long size); + public native int appendResponseBody(@Cast("const unsigned char*") byte[] body, @Cast("size_t") long size); + + public native int processLogging(); + public native int updateStatusCode(int status); + + public native @Cast("bool") boolean intervention(ModSecurityIntervention it); + + public native @Cast("bool") boolean addArgument(@StdString BytePointer orig, @StdString BytePointer key, + @StdString BytePointer value, @Cast("size_t") long offset); + public native @Cast("bool") boolean addArgument(@StdString String orig, @StdString String key, + @StdString String value, @Cast("size_t") long offset); + public native @Cast("bool") boolean extractArguments(@StdString BytePointer orig, @StdString BytePointer buf, + @Cast("size_t") long offset); + public native @Cast("bool") boolean extractArguments(@StdString String orig, @StdString String buf, + @Cast("size_t") long offset); + + public native @Cast("const char*") BytePointer getResponseBody(); + public native @Cast("size_t") long getResponseBodyLength(); + public native @Cast("size_t") long getRequestBodyLength(); + +// #ifndef NO_LOGS + public native void debug(int arg0, @StdString BytePointer arg1); + public native void debug(int arg0, @StdString String arg1); +// #endif + public native void serverLog(@SharedPtr RuleMessage rm); + + public native int getRuleEngineState(); + + public native @StdString BytePointer toJSON(int parts); + public native @StdString BytePointer toOldAuditLogFormat(int parts, @StdString BytePointer trailer); + public native @StdString String toOldAuditLogFormat(int parts, @StdString String trailer); + public native @StdString BytePointer toOldAuditLogFormatIndex(@StdString BytePointer filename, + double size, @StdString BytePointer md5); + public native @StdString String toOldAuditLogFormatIndex(@StdString String filename, + double size, @StdString String md5); + + /** + * Filled during the class instantiation, this variable can be later + * used to fill the SecRule variable {@code duration'. The variable }duration' + * is dynamic calculated, it is always relative to the value found in + * m_creationTimeStamp. + * + * \note There is space for performance improvement. This value don't + * need to be filled if there is no rule using the variable + * {@code duration'. + */ + + /** + * Holds the client IP address. + */ + + /** + * Holds the HTTP version: 1.2, 2.0, 3.0 and so on.... + */ + public native @StdString BytePointer m_httpVersion(); public native Transaction m_httpVersion(BytePointer setter); + + /** + * Holds the server IP Address + */ + + /** + * Holds the raw URI that was requested. + */ + public native @StdString BytePointer m_uri(); public native Transaction m_uri(BytePointer setter); + + /** + * Holds the URI that was requests (without the query string). + */ + + /** + * Holds the combined size of all arguments, later used to fill the + * variable ARGS_COMBINED_SIZE. + */ + public native double m_ARGScombinedSizeDouble(); public native Transaction m_ARGScombinedSizeDouble(double setter); + + /** + * Client tcp port. + */ + public native int m_clientPort(); public native Transaction m_clientPort(int setter); + + /** + * This variable is set by the action {@code severity' and later can be + * consulted via the SecLanguage variable HIGHEST_SEVERITY. + */ + public native int m_highestSeverityAction(); public native Transaction m_highestSeverityAction(int setter); + + /** + * Holds the HTTP return code when it is known. If 0 nothing was + * set. + */ + public native int m_httpCodeReturned(); public native Transaction m_httpCodeReturned(int setter); + + /** + * Holds the server port. + */ + public native int m_serverPort(); public native Transaction m_serverPort(int setter); + + /** + * ModSecurity instance used to start this transaction. Basically used + * to fill the server log whenever is needed. + */ + public native ModSecurity m_ms(); public native Transaction m_ms(ModSecurity setter); + + /** + * Holds the type of the request body, in case there is one. + */ + public native @Cast("modsecurity::Transaction::RequestBodyType") int m_requestBodyType(); public native Transaction m_requestBodyType(int setter); + + /** + * Holds the request body "processor" + */ + public native @Cast("modsecurity::Transaction::RequestBodyType") int m_requestBodyProcessor(); public native Transaction m_requestBodyProcessor(int setter); + + /** + * Rules object utilized during this specific transaction. + */ + public native RulesSet m_rules(); public native Transaction m_rules(RulesSet setter); + + /** + * + */ + + /** + * + */ + public native @ByRef StringList m_ruleRemoveByTag(); public native Transaction m_ruleRemoveByTag(StringList setter); + + /** + * + */ + + /** + * + */ + + /** + * + */ + public native int m_requestBodyAccess(); public native Transaction m_requestBodyAccess(int setter); + + /** + * The list m_auditLogModifier contains modifications to the {@code auditlogs' + * for this specific request, those modifications can happens via the + * utilization of the action: }ctl:auditLogParts=' + * + */ + + /** + * This variable holds all the messages asked to be save by the utilization + * of the actions: {@code log_data' and }msg'. These should be included on the + * auditlogs. + */ + public native @ByRef RuleMessageList m_rulesMessages(); public native Transaction m_rulesMessages(RuleMessageList setter); + + /** + * Holds the request body, in case of any. + */ + + /** + * Holds the response body, in case of any. + */ + + /** + * Contains the unique ID of the transaction. Use by the variable + * {@code UNIQUE_ID'. This unique id is also saved as part of the AuditLog. + */ + + /** + * Holds the amount of rules that should be skipped. If bigger than 0 the + * current rule should be skipped and the number needs to be decreased. + */ + public native int m_skip_next(); public native Transaction m_skip_next(int setter); + + /** + * If allow action was utilized, this variable holds the allow type. + */ + public native @Cast("modsecurity::actions::disruptive::AllowType") int m_allowType(); public native Transaction m_allowType(int setter); + + /** + * Holds the decode URI. Notice that m_uri holds the raw version + * of the URI. + */ + public native @StdString BytePointer m_uri_decoded(); public native Transaction m_uri_decoded(BytePointer setter); + + /** + * Actions (disruptive?) that should be taken by the connector related to + * that transaction. + */ + public native @StdVector ModSecurityIntervention m_actions(); public native Transaction m_actions(ModSecurityIntervention setter); + public native @ByRef ModSecurityIntervention m_it(); public native Transaction m_it(ModSecurityIntervention setter); + + /** + * Holds the creation time stamp, using std::time. + * + * TODO: m_timeStamp and m_creationTimeStamp may be merged into a single + * variable. + */ + public native @ByRef @Cast("time_t*") Pointer m_timeStamp(); public native Transaction m_timeStamp(Pointer setter); + + + /** + * Holds all the collections related to that transaction. + */ + + /** + * Holds the whatever matched in the operation utilization. + * That variable will be further used by the capture action. + * + */ + public native @ByRef StringList m_matched(); public native Transaction m_matched(StringList setter); + + public native XML m_xml(); public native Transaction m_xml(XML setter); + public native JSON m_json(); public native Transaction m_json(JSON setter); + + public native int m_secRuleEngine(); public native Transaction m_secRuleEngine(int setter); + + public native @StdString BytePointer m_variableDuration(); public native Transaction m_variableDuration(BytePointer setter); + public native @StdString BytePointer m_variableHighestSeverityAction(); public native Transaction m_variableHighestSeverityAction(BytePointer setter); + public native @StdString BytePointer m_variableRemoteUser(); public native Transaction m_variableRemoteUser(BytePointer setter); + public native @StdString BytePointer m_variableTime(); public native Transaction m_variableTime(BytePointer setter); + public native @StdString BytePointer m_variableTimeDay(); public native Transaction m_variableTimeDay(BytePointer setter); + public native @StdString BytePointer m_variableTimeEpoch(); public native Transaction m_variableTimeEpoch(BytePointer setter); + public native @StdString BytePointer m_variableTimeHour(); public native Transaction m_variableTimeHour(BytePointer setter); + public native @StdString BytePointer m_variableTimeMin(); public native Transaction m_variableTimeMin(BytePointer setter); + public native @StdString BytePointer m_variableTimeSec(); public native Transaction m_variableTimeSec(BytePointer setter); + public native @StdString BytePointer m_variableTimeWDay(); public native Transaction m_variableTimeWDay(BytePointer setter); + public native @StdString BytePointer m_variableTimeYear(); public native Transaction m_variableTimeYear(BytePointer setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/TransactionAnchoredVariables.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/TransactionAnchoredVariables.java new file mode 100644 index 00000000000..82fc0a3d7d2 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/TransactionAnchoredVariables.java @@ -0,0 +1,25 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class TransactionAnchoredVariables extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TransactionAnchoredVariables(Pointer p) { super(p); } + + public TransactionAnchoredVariables(Transaction t) { super((Pointer)null); allocate(t); } + private native void allocate(Transaction t); + + public native int m_variableOffset(); public native TransactionAnchoredVariables m_variableOffset(int setter); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/TransactionSecMarkerManagement.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/TransactionSecMarkerManagement.java new file mode 100644 index 00000000000..2ee7e3a309c --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/TransactionSecMarkerManagement.java @@ -0,0 +1,35 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +@Namespace("modsecurity") @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class TransactionSecMarkerManagement extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TransactionSecMarkerManagement() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TransactionSecMarkerManagement(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TransactionSecMarkerManagement(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TransactionSecMarkerManagement position(long position) { + return (TransactionSecMarkerManagement)super.position(position); + } + @Override public TransactionSecMarkerManagement getPointer(long i) { + return new TransactionSecMarkerManagement((Pointer)this).position(position + i); + } + + public native @Cast("bool") boolean isInsideAMarker(); + + public native void removeMarker(); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/UnicodeMapHolder.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/UnicodeMapHolder.java new file mode 100644 index 00000000000..6944bd68d74 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/UnicodeMapHolder.java @@ -0,0 +1,40 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +@Namespace("modsecurity") @NoOffset @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class UnicodeMapHolder extends Pointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public UnicodeMapHolder(Pointer p) { super(p); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public UnicodeMapHolder(long size) { super((Pointer)null); allocateArray(size); } + private native void allocateArray(long size); + @Override public UnicodeMapHolder position(long position) { + return (UnicodeMapHolder)super.position(position); + } + @Override public UnicodeMapHolder getPointer(long i) { + return new UnicodeMapHolder((Pointer)this).position(position + i); + } + + public UnicodeMapHolder() { super((Pointer)null); allocate(); } + private native void allocate(); + + public native @ByRef @Name("operator []") IntPointer get(int index); + + public native int at(int index); + public native void change(int i, int a); + + public native int m_data(int i); public native UnicodeMapHolder m_data(int i, int setter); + @MemberGetter public native IntPointer m_data(); +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/Variables.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Variables.java new file mode 100644 index 00000000000..fa143e3cb9c --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Variables.java @@ -0,0 +1,21 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + +// #ifndef __cplusplus +@Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class Variables extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public Variables() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Variables(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/Writer.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Writer.java new file mode 100644 index 00000000000..9f64004d209 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/Writer.java @@ -0,0 +1,22 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + + + +// #ifdef __cplusplus +@Namespace("modsecurity::audit_log::writer") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class Writer extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public Writer() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Writer(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/XML.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/XML.java new file mode 100644 index 00000000000..1a60873c997 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/XML.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.modsecurity.global.modsecurity.*; + +@Namespace("modsecurity::RequestBodyProcessor") @Opaque @Properties(inherit = org.bytedeco.modsecurity.presets.modsecurity.class) +public class XML extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public XML() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public XML(Pointer p) { super(p); } +} diff --git a/modsecurity/src/gen/java/org/bytedeco/modsecurity/global/modsecurity.java b/modsecurity/src/gen/java/org/bytedeco/modsecurity/global/modsecurity.java new file mode 100644 index 00000000000..b6024e07a45 --- /dev/null +++ b/modsecurity/src/gen/java/org/bytedeco/modsecurity/global/modsecurity.java @@ -0,0 +1,1058 @@ +// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.modsecurity.global; + +import org.bytedeco.modsecurity.*; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +public class modsecurity extends org.bytedeco.modsecurity.presets.modsecurity { + static { Loader.load(); } + +// Targeting ../StringList.java + + +// Targeting ../RuleMessageList.java + + +// Targeting ../StringSet.java + + +// Parsed from modsecurity/audit_log.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +// #ifdef __cplusplus +// #include +// #include +// #include +// #endif + +// #ifndef HEADERS_MODSECURITY_AUDIT_LOG_H_ +// #define HEADERS_MODSECURITY_AUDIT_LOG_H_ + +// #include "modsecurity/transaction.h" +// Targeting ../Writer.java + + + +// Targeting ../AuditLog.java + + + + + // namespace audit_log + // namespace modsecurity +// #endif + +// #endif // HEADERS_MODSECURITY_AUDIT_LOG_H_ + + +// Parsed from modsecurity/debug_log.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +// #ifdef __cplusplus +// #include +// #endif + +// #ifndef HEADERS_MODSECURITY_DEBUG_LOG_H_ +// #define HEADERS_MODSECURITY_DEBUG_LOG_H_ + + +// #ifndef __cplusplus +// #endif + +// #ifdef __cplusplus +// Targeting ../DebugLog.java + + + + + // namespace debug_log + // namespace modsecurity +// #endif + +// #endif // HEADERS_MODSECURITY_DEBUG_LOG_H_ + + +// Parsed from modsecurity/intervention.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +// #ifndef HEADERS_MODSECURITY_INTERVENTION_H_ +// #define HEADERS_MODSECURITY_INTERVENTION_H_ + +// #ifdef __cplusplus +// Targeting ../ModSecurityIntervention.java + + + +// #ifdef __cplusplus + @Namespace("modsecurity::intervention") @NoException public static native void reset(ModSecurityIntervention i); + + @Namespace("modsecurity::intervention") @NoException public static native void clean(ModSecurityIntervention i); + + @Namespace("modsecurity::intervention") @NoException public static native void freeUrl(ModSecurityIntervention i); + + @Namespace("modsecurity::intervention") @NoException public static native void freeLog(ModSecurityIntervention i); + + @Namespace("modsecurity::intervention") @NoException public static native @Name("free") void _free(ModSecurityIntervention i); + + // namespace intervention +// #endif + +// #ifdef __cplusplus + // namespace modsecurity +// #endif + +// #endif // HEADERS_MODSECURITY_INTERVENTION_H_ + + +// Parsed from modsecurity/rule_message.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +// #ifdef __cplusplus +// #include +// #include +// #include +// #include +// #include +// #endif + +// #ifndef HEADERS_MODSECURITY_RULE_MESSAGE_H_ +// #define HEADERS_MODSECURITY_RULE_MESSAGE_H_ + +// #include "modsecurity/transaction.h" +// #include "modsecurity/rule.h" +// #include "modsecurity/rule_with_operator.h" +// Targeting ../RuleMessage.java + + + + + // namespace modsecurity +// #endif + + +// #endif // HEADERS_MODSECURITY_RULE_MESSAGE_H_ + + +// Parsed from modsecurity/rules_set.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +// #include +// #include + +// #ifdef __cplusplus +// #include +// #include +// #include +// #include +// #include +// #endif + + +// #ifndef HEADERS_MODSECURITY_RULES_SET_H_ +// #define HEADERS_MODSECURITY_RULES_SET_H_ + +// #include "modsecurity/rules_set_properties.h" +// #include "modsecurity/modsecurity.h" +// #include "modsecurity/transaction.h" +// #include "modsecurity/rule.h" +// #include "modsecurity/rules_set_phases.h" +// Targeting ../RuleWithOperator.java + + +// Targeting ../Driver.java + + + +// Targeting ../RulesSet.java + + + +// #endif + +// #ifdef __cplusplus +// #endif + +@Namespace("modsecurity") public static native RulesSet msc_create_rules_set(); +@Namespace("modsecurity") public static native void msc_rules_dump(RulesSet rules); +@Namespace("modsecurity") public static native int msc_rules_merge(RulesSet rules_dst, RulesSet rules_from, @Cast("const char**") PointerPointer error); +@Namespace("modsecurity") public static native int msc_rules_merge(RulesSet rules_dst, RulesSet rules_from, @Cast("const char**") @ByPtrPtr BytePointer error); +@Namespace("modsecurity") public static native int msc_rules_merge(RulesSet rules_dst, RulesSet rules_from, @Cast("const char**") @ByPtrPtr ByteBuffer error); +@Namespace("modsecurity") public static native int msc_rules_merge(RulesSet rules_dst, RulesSet rules_from, @Cast("const char**") @ByPtrPtr byte[] error); +@Namespace("modsecurity") public static native int msc_rules_add_remote(RulesSet rules, @Cast("const char*") BytePointer key, @Cast("const char*") BytePointer uri, + @Cast("const char**") PointerPointer error); +@Namespace("modsecurity") public static native int msc_rules_add_remote(RulesSet rules, @Cast("const char*") BytePointer key, @Cast("const char*") BytePointer uri, + @Cast("const char**") @ByPtrPtr BytePointer error); +@Namespace("modsecurity") public static native int msc_rules_add_remote(RulesSet rules, String key, String uri, + @Cast("const char**") @ByPtrPtr ByteBuffer error); +@Namespace("modsecurity") public static native int msc_rules_add_remote(RulesSet rules, @Cast("const char*") BytePointer key, @Cast("const char*") BytePointer uri, + @Cast("const char**") @ByPtrPtr byte[] error); +@Namespace("modsecurity") public static native int msc_rules_add_remote(RulesSet rules, String key, String uri, + @Cast("const char**") @ByPtrPtr BytePointer error); +@Namespace("modsecurity") public static native int msc_rules_add_remote(RulesSet rules, @Cast("const char*") BytePointer key, @Cast("const char*") BytePointer uri, + @Cast("const char**") @ByPtrPtr ByteBuffer error); +@Namespace("modsecurity") public static native int msc_rules_add_remote(RulesSet rules, String key, String uri, + @Cast("const char**") @ByPtrPtr byte[] error); +@Namespace("modsecurity") public static native int msc_rules_add_file(RulesSet rules, @Cast("const char*") BytePointer file, @Cast("const char**") PointerPointer error); +@Namespace("modsecurity") public static native int msc_rules_add_file(RulesSet rules, @Cast("const char*") BytePointer file, @Cast("const char**") @ByPtrPtr BytePointer error); +@Namespace("modsecurity") public static native int msc_rules_add_file(RulesSet rules, String file, @Cast("const char**") @ByPtrPtr ByteBuffer error); +@Namespace("modsecurity") public static native int msc_rules_add_file(RulesSet rules, @Cast("const char*") BytePointer file, @Cast("const char**") @ByPtrPtr byte[] error); +@Namespace("modsecurity") public static native int msc_rules_add_file(RulesSet rules, String file, @Cast("const char**") @ByPtrPtr BytePointer error); +@Namespace("modsecurity") public static native int msc_rules_add_file(RulesSet rules, @Cast("const char*") BytePointer file, @Cast("const char**") @ByPtrPtr ByteBuffer error); +@Namespace("modsecurity") public static native int msc_rules_add_file(RulesSet rules, String file, @Cast("const char**") @ByPtrPtr byte[] error); +@Namespace("modsecurity") public static native int msc_rules_add(RulesSet rules, @Cast("const char*") BytePointer plain_rules, @Cast("const char**") PointerPointer error); +@Namespace("modsecurity") public static native int msc_rules_add(RulesSet rules, @Cast("const char*") BytePointer plain_rules, @Cast("const char**") @ByPtrPtr BytePointer error); +@Namespace("modsecurity") public static native int msc_rules_add(RulesSet rules, String plain_rules, @Cast("const char**") @ByPtrPtr ByteBuffer error); +@Namespace("modsecurity") public static native int msc_rules_add(RulesSet rules, @Cast("const char*") BytePointer plain_rules, @Cast("const char**") @ByPtrPtr byte[] error); +@Namespace("modsecurity") public static native int msc_rules_add(RulesSet rules, String plain_rules, @Cast("const char**") @ByPtrPtr BytePointer error); +@Namespace("modsecurity") public static native int msc_rules_add(RulesSet rules, @Cast("const char*") BytePointer plain_rules, @Cast("const char**") @ByPtrPtr ByteBuffer error); +@Namespace("modsecurity") public static native int msc_rules_add(RulesSet rules, String plain_rules, @Cast("const char**") @ByPtrPtr byte[] error); +@Namespace("modsecurity") public static native int msc_rules_cleanup(RulesSet rules); + +// #ifdef __cplusplus + // namespace modsecurity +// #endif + +// #endif // HEADERS_MODSECURITY_RULES_SET_H_ + + +// Parsed from modsecurity/rules_set_phases.h + + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +// #include +// #include + +// #ifdef __cplusplus +// #include +// #include +// #include +// #include +// #include +// #endif + + +// #ifndef HEADERS_MODSECURITY_RULES_SET_PHASES_H_ +// #define HEADERS_MODSECURITY_RULES_SET_PHASES_H_ + +// #include "modsecurity/rules.h" + +// #ifdef __cplusplus + +// Targeting ../RulesSetPhases.java + + + + + // namespace modsecurity +// #endif + +// #endif // HEADERS_MODSECURITY_RULES_SET_PHASES_H_ + +// Parsed from modsecurity/rules_set_properties.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + + +// #ifdef __cplusplus +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #endif + + +// #ifndef HEADERS_MODSECURITY_RULES_SET_PROPERTIES_H_ +// #define HEADERS_MODSECURITY_RULES_SET_PROPERTIES_H_ + + +// #include "modsecurity/modsecurity.h" +// #include "modsecurity/rule.h" +// #include "modsecurity/rules_exceptions.h" +// #include "modsecurity/actions/action.h" +// #include "modsecurity/audit_log.h" + +public static final String CODEPAGE_SEPARATORS = " \t\n\r"; + +// #define merge_boolean_value(to, from, default) +// if (to == PropertyNotSetConfigBoolean) { +// to = (from == PropertyNotSetConfigBoolean) ? default : from; +// } + +// #define merge_ruleengine_value(to, from, default) +// if (to == PropertyNotSetRuleEngine) { +// to = (from == PropertyNotSetRuleEngine) ? default : from; +// } + +// #define merge_bodylimitaction_value(to, from, default) +// if (to == PropertyNotSetBodyLimitAction) { +// to = (from == PropertyNotSetBodyLimitAction) ? default : from; +// } +// Targeting ../RulesExceptions.java + + + +// Targeting ../ConfigInt.java + + +// Targeting ../ConfigDouble.java + + +// Targeting ../ConfigString.java + + +// Targeting ../ConfigSet.java + + +// Targeting ../UnicodeMapHolder.java + + +// Targeting ../ConfigUnicodeMap.java + + +// Targeting ../RulesSetProperties.java + + + + +// #endif + +// #ifdef __cplusplus + // namespace modsecurity +// #endif + +// #endif // HEADERS_MODSECURITY_RULES_SET_PROPERTIES_H_ + + +// Parsed from modsecurity/collection/collection.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + + +// #ifdef __cplusplus +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #endif + + +// #include "modsecurity/variable_value.h" + + +// #ifndef HEADERS_MODSECURITY_COLLECTION_COLLECTION_H_ +// #define HEADERS_MODSECURITY_COLLECTION_COLLECTION_H_ +// Targeting ../Variables.java + + +// Targeting ../KeyExclusions.java + + + +// Targeting ../Collection.java + + + + // namespace collection + // namespace modsecurity +// #endif + + +// #endif // HEADERS_MODSECURITY_COLLECTION_COLLECTION_H_ + + +// Parsed from modsecurity/modsecurity.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +/** \file modsecurity.h Main ModSecurity header file */ + +/** \mainpage ModSecurity - open source, cross platform web application firewall + * + * Example Usage: + *
{@code
+ *
+ * using ModSecurity::ModSecurity;
+ * using ModSecurity::Rules;
+ * using ModSecurity::Transaction;
+ *
+ * ModSecurity *modsec;
+ * ModSecurity::Rules *rules;
+ *
+ * modsec = new ModSecurity();
+ * rules = new Rules();
+ * rules->loadFromUri(rules_file);
+ *
+ * Transaction *modsecTransaction = new Transaction(modsec, rules);
+ * modsecTransaction->processConnection("127.0.0.1");
+ *
+ * if (modsecTransaction->intervention()) {
+ *     std::cout << "There is an intervention" << std::endl;
+ * }
+ *
+ * ...      
+ *
+ * }
+ * + */ + +/** + * \defgroup ModSecurity_C_API ModSecurity C API + * + * This is the ModSecurity C API description + * + * At this page you can get information on how the extend your C + * application, by embedding ModSecurity. + * + */ + + +/** + * \defgroup ModSecurity_CPP_API ModSecurity CPP API + * + * This is the ModSecurity CPP API description. + * + * At this page you can get information on how the extend your CPP + * application, by embedding ModSecurity. + * + */ + + +/** + * \defgroup ModSecurity_Operator ModSecurity Operators + * + * SecLanguage operator + */ + + +// #ifdef __cplusplus +// #include +// #include +// #include +// #include +// #endif + + +// #ifndef HEADERS_MODSECURITY_MODSECURITY_H_ +// #define HEADERS_MODSECURITY_MODSECURITY_H_ + + +// #ifndef __cplusplus +// #else + /** + * + * The Phases enumerator consists in mapping the different stages of a + * given request. ModSecurity is expected to inspect data based on those + * "phases". If your module/application use this in a different order, it + * will lead ModSecurity to act in an unexpected behavior. + * + * It is mandatory to call all the phases, even if you don't have this + * phases segmented in your end. + * + */ + /** enum modsecurity::Phases */ + public static final int + /** + * + * The connection is the very first information that ModSecurity can + * inspect. It is expected to happens before the virtual host name be + * resolved. This phase is expected to happen immediately after a + * connection is established. + * + */ + ConnectionPhase = 0, + /** + * + * The "URI" phase happens just after the web server (or any other + * application that you may use with ModSecurity) have the acknowledgement + * of the full request URI. + * + */ + UriPhase = 1, + /** + * + * The "RequestHeaders" phase happens when the server has all the + * information about the headers. Notice however, that it is expected to + * happen prior to the reception of the request body (if any). + * + */ + RequestHeadersPhase = 2, + /** + * + * At the "RequestHeaders" phase, ModSecurity is expected to inspect the + * content of a request body, that does not happens when the server has all + * the content but prior to that, when the body transmission started. + * ModSecurity can ask the webserver to block (or make any other disruptive + * action) while the client is still transmitting the data. + * + */ + RequestBodyPhase = 3, + /** + * + * The "ResponseHeaders" happens just before all the response headers are + * ready to be delivery to the client. + * + */ + ResponseHeadersPhase = 4, + /** + * + * Same as "RequestBody" the "ResponseBody" phase perform a stream + * inspection which may result in a disruptive action. + * + */ + ResponseBodyPhase = 5, + /** + * + * The last phase is the logging phase. At this phase ModSecurity will + * generate the internal logs, there is no need to hold the request at + * this point as this phase does not produce any kind of action. + * + */ + LoggingPhase = 6, + /** + * Just a marking for the expected number of phases. + * + */ + NUMBER_OF_PHASES = 7; + + + // namespace modsecurity +// #endif + + + +// #include "modsecurity/intervention.h" +// #include "modsecurity/transaction.h" +// #include "modsecurity/debug_log.h" + +/** + * TAG_NUM: + * + * Alpha - 001 + * Beta - 002 + * Dev - 010 + * Rc1 - 051 + * Rc2 - 052 + * ... - ... + * Release- 100 + * + */ + +public static final String MODSECURITY_MAJOR = "3"; +public static final String MODSECURITY_MINOR = "0"; +public static final String MODSECURITY_PATCHLEVEL = "4"; +public static final String MODSECURITY_TAG = ""; +public static final String MODSECURITY_TAG_NUM = "100"; + +public static final String MODSECURITY_VERSION = MODSECURITY_MAJOR + "." + + MODSECURITY_MINOR + "." + MODSECURITY_PATCHLEVEL + + MODSECURITY_TAG; + +public static final int MODSECURITY_VERSION_NUM = 3040100; + +// #define MODSECURITY_CHECK_VERSION(a) (MODSECURITY_VERSION_NUM <= a) +// Targeting ../ModSecLogCb.java + + + + +// #ifdef __cplusplus +// Targeting ../Action.java + + + + +// #ifdef __cplusplus +// #endif + /** + * + * Properties used to configure the general log callback. + * + */ + /** enum modsecurity::LogProperty */ + public static final int + /** + * + * Original ModSecurity text log entry. The same entry that can be found + * within the Apache error_log (in the 2.x family) + * + */ + TextLogProperty = 1, + /** + * + * Instead of return the text log entry an instance of the class + * RuleMessages is returned. + * + */ + RuleMessageLogProperty = 2, + /** + * This property only makes sense with the utilization of the + * RuleMessageLogProperty. Without this property set the RuleMessage + * structure will not be filled with the information of the hightlight. + * + * Notice that the highlight can be calculate post-analisys. Calculate it + * during the analisys may delay the analisys process. + * + */ + IncludeFullHighlightLogProperty = 4; + + +// #ifdef __cplusplus +// Targeting ../ModSecurity.java + + + + +// #endif + +// #ifdef __cplusplus +// #endif + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native ModSecurity msc_init(); +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native @Cast("const char*") BytePointer msc_who_am_i(ModSecurity msc); +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native void msc_set_connector_info(ModSecurity msc, @Cast("const char*") BytePointer connector); +@Namespace("modsecurity") public static native void msc_set_connector_info(ModSecurity msc, String connector); +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native void msc_set_log_cb(ModSecurity msc, ModSecLogCb cb); +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native void msc_cleanup(ModSecurity msc); + +// #ifdef __cplusplus + + + // namespace modsecurity +// #endif + +// #endif // HEADERS_MODSECURITY_MODSECURITY_H_ + + +// Parsed from modsecurity/transaction.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +// #ifdef __cplusplus +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #endif + +// #include +// #include + +// #ifndef HEADERS_MODSECURITY_TRANSACTION_H_ +// #define HEADERS_MODSECURITY_TRANSACTION_H_ + +// #ifndef __cplusplus +// #endif + +// #include "modsecurity/anchored_set_variable.h" +// #include "modsecurity/anchored_variable.h" +// #include "modsecurity/intervention.h" +// #include "modsecurity/collection/collections.h" +// #include "modsecurity/variable_value.h" +// #include "modsecurity/collection/collection.h" +// #include "modsecurity/variable_origin.h" +// #include "modsecurity/anchored_set_variable_translation_proxy.h" + + +// #ifndef NO_LOGS +// #define ms_dbg(b, c) +// do { +// if (m_rules && m_rules->m_debugLog && m_rules->m_debugLog->m_debugLevel >= b) { +// m_rules->debug(b, *m_id.get(), m_uri, c); +// } +// } while (0); +// #else +// #define ms_dbg(b, c) +// do { } while (0); +// #endif + +// #ifndef NO_LOGS +// #define ms_dbg_a(t, b, c) +// do { +// if (t && t->m_rules && t->m_rules->m_debugLog && t->m_rules->m_debugLog->m_debugLevel >= b) { +// t->debug(b, c); +// } +// } while (0); +// #else +// #define ms_dbg_a(t, b, c) +// do { } while (0); +// #endif + + +// #define LOGFY_ADD(a, b) +// yajl_gen_string(g, reinterpret_cast(a), strlen(a)); +// if (b == NULL) { +// yajl_gen_string(g, reinterpret_cast(""), +// strlen("")); +// } else { +// yajl_gen_string(g, reinterpret_cast(b), +// strlen(b)); +// } + + +// #define LOGFY_ADD_INT(a, b) +// yajl_gen_string(g, reinterpret_cast(a), strlen(a)); +// yajl_gen_number(g, reinterpret_cast(b), strlen(b)); + +// #define LOGFY_ADD_NUM(a, b) +// yajl_gen_string(g, reinterpret_cast(a), strlen(a)); +// yajl_gen_integer(g, b); + +// #ifdef __cplusplus +/** enum modsecurity::actions::disruptive::AllowType */ +; + + +// Targeting ../XML.java + + +// Targeting ../JSON.java + + +// Targeting ../MultipartPartTmpFile.java + + + +// Targeting ../Operator.java + + + +// Targeting ../TransactionAnchoredVariables.java + + +// Targeting ../TransactionSecMarkerManagement.java + + +// Targeting ../Transaction.java + + + + +// #endif + +// #ifdef __cplusplus +// #endif + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native Transaction msc_new_transaction(ModSecurity ms, + RulesSet rules, Pointer logCbData); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native Transaction msc_new_transaction_with_id(ModSecurity ms, + RulesSet rules, @Cast("char*") BytePointer id, Pointer logCbData); +@Namespace("modsecurity") public static native Transaction msc_new_transaction_with_id(ModSecurity ms, + RulesSet rules, @Cast("char*") ByteBuffer id, Pointer logCbData); +@Namespace("modsecurity") public static native Transaction msc_new_transaction_with_id(ModSecurity ms, + RulesSet rules, @Cast("char*") byte[] id, Pointer logCbData); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_process_connection(Transaction transaction, + @Cast("const char*") BytePointer client, int cPort, @Cast("const char*") BytePointer server, int sPort); +@Namespace("modsecurity") public static native int msc_process_connection(Transaction transaction, + String client, int cPort, String server, int sPort); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_process_request_headers(Transaction transaction); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_add_request_header(Transaction transaction, @Cast("const unsigned char*") BytePointer key, + @Cast("const unsigned char*") BytePointer value); +@Namespace("modsecurity") public static native int msc_add_request_header(Transaction transaction, @Cast("const unsigned char*") ByteBuffer key, + @Cast("const unsigned char*") ByteBuffer value); +@Namespace("modsecurity") public static native int msc_add_request_header(Transaction transaction, @Cast("const unsigned char*") byte[] key, + @Cast("const unsigned char*") byte[] value); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_add_n_request_header(Transaction transaction, + @Cast("const unsigned char*") BytePointer key, @Cast("size_t") long len_key, @Cast("const unsigned char*") BytePointer value, + @Cast("size_t") long len_value); +@Namespace("modsecurity") public static native int msc_add_n_request_header(Transaction transaction, + @Cast("const unsigned char*") ByteBuffer key, @Cast("size_t") long len_key, @Cast("const unsigned char*") ByteBuffer value, + @Cast("size_t") long len_value); +@Namespace("modsecurity") public static native int msc_add_n_request_header(Transaction transaction, + @Cast("const unsigned char*") byte[] key, @Cast("size_t") long len_key, @Cast("const unsigned char*") byte[] value, + @Cast("size_t") long len_value); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_process_request_body(Transaction transaction); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_append_request_body(Transaction transaction, + @Cast("const unsigned char*") BytePointer body, @Cast("size_t") long size); +@Namespace("modsecurity") public static native int msc_append_request_body(Transaction transaction, + @Cast("const unsigned char*") ByteBuffer body, @Cast("size_t") long size); +@Namespace("modsecurity") public static native int msc_append_request_body(Transaction transaction, + @Cast("const unsigned char*") byte[] body, @Cast("size_t") long size); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_request_body_from_file(Transaction transaction, @Cast("const char*") BytePointer path); +@Namespace("modsecurity") public static native int msc_request_body_from_file(Transaction transaction, String path); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_process_response_headers(Transaction transaction, int code, + @Cast("const char*") BytePointer protocol); +@Namespace("modsecurity") public static native int msc_process_response_headers(Transaction transaction, int code, + String protocol); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_add_response_header(Transaction transaction, + @Cast("const unsigned char*") BytePointer key, @Cast("const unsigned char*") BytePointer value); +@Namespace("modsecurity") public static native int msc_add_response_header(Transaction transaction, + @Cast("const unsigned char*") ByteBuffer key, @Cast("const unsigned char*") ByteBuffer value); +@Namespace("modsecurity") public static native int msc_add_response_header(Transaction transaction, + @Cast("const unsigned char*") byte[] key, @Cast("const unsigned char*") byte[] value); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_add_n_response_header(Transaction transaction, + @Cast("const unsigned char*") BytePointer key, @Cast("size_t") long len_key, @Cast("const unsigned char*") BytePointer value, + @Cast("size_t") long len_value); +@Namespace("modsecurity") public static native int msc_add_n_response_header(Transaction transaction, + @Cast("const unsigned char*") ByteBuffer key, @Cast("size_t") long len_key, @Cast("const unsigned char*") ByteBuffer value, + @Cast("size_t") long len_value); +@Namespace("modsecurity") public static native int msc_add_n_response_header(Transaction transaction, + @Cast("const unsigned char*") byte[] key, @Cast("size_t") long len_key, @Cast("const unsigned char*") byte[] value, + @Cast("size_t") long len_value); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_process_response_body(Transaction transaction); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_append_response_body(Transaction transaction, + @Cast("const unsigned char*") BytePointer body, @Cast("size_t") long size); +@Namespace("modsecurity") public static native int msc_append_response_body(Transaction transaction, + @Cast("const unsigned char*") ByteBuffer body, @Cast("size_t") long size); +@Namespace("modsecurity") public static native int msc_append_response_body(Transaction transaction, + @Cast("const unsigned char*") byte[] body, @Cast("size_t") long size); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_process_uri(Transaction transaction, @Cast("const char*") BytePointer uri, + @Cast("const char*") BytePointer protocol, @Cast("const char*") BytePointer http_version); +@Namespace("modsecurity") public static native int msc_process_uri(Transaction transaction, String uri, + String protocol, String http_version); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native @Cast("const char*") BytePointer msc_get_response_body(Transaction transaction); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native @Cast("size_t") long msc_get_response_body_length(Transaction transaction); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native @Cast("size_t") long msc_get_request_body_length(Transaction transaction); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native void msc_transaction_cleanup(Transaction transaction); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_intervention(Transaction transaction, ModSecurityIntervention it); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_process_logging(Transaction transaction); + +/** \ingroup ModSecurity_C_API */ +@Namespace("modsecurity") public static native int msc_update_status_code(Transaction transaction, int status); + +// #ifdef __cplusplus + // namespace modsecurity +// #endif + + +// #endif // HEADERS_MODSECURITY_TRANSACTION_H_ + + +// Parsed from modsecurity/intervention.h + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +// #ifndef HEADERS_MODSECURITY_INTERVENTION_H_ +// #define HEADERS_MODSECURITY_INTERVENTION_H_ + +// #ifdef __cplusplus +// #endif + +// #ifdef __cplusplus + + // namespace intervention +// #endif + +// #ifdef __cplusplus + // namespace modsecurity +// #endif + +// #endif // HEADERS_MODSECURITY_INTERVENTION_H_ + + +} diff --git a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java similarity index 97% rename from modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java rename to modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java index 0b35bd58021..1d815522ef1 100644 --- a/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/libmodsecurity.java +++ b/modsecurity/src/main/java/org/bytedeco/modsecurity/presets/modsecurity.java @@ -53,8 +53,8 @@ includepath = {"lib","include"}, link = "modsecurity"), target = "org.bytedeco.modsecurity", - global = "org.bytedeco.modsecurity.global") -public class libmodsecurity implements InfoMapper { + global = "org.bytedeco.modsecurity.global.modsecurity") +public class modsecurity implements InfoMapper { static { Loader.checkVersion("org.bytedeco", "modsecurity"); } diff --git a/platform/pom.xml b/platform/pom.xml index be97eea9486..7b7b6cb3f94 100644 --- a/platform/pom.xml +++ b/platform/pom.xml @@ -65,6 +65,7 @@ ../qt/platform ../skia/platform ../cpu_features/platform + ../modsecurity/platform ../systems/platform @@ -325,6 +326,11 @@ cpu_features-platform 0.6.0-${project.version}
+ + org.bytedeco + modsecurity-platform + master-${project.version} + org.bytedeco systems-platform diff --git a/pom.xml b/pom.xml index dc3d689b202..82565ae38a0 100644 --- a/pom.xml +++ b/pom.xml @@ -628,8 +628,8 @@ qt skia cpu_features - systems modsecurity + systems ${os.name}-${os.arch} @@ -1357,8 +1357,8 @@ qt skia cpu_features - systems modsecurity + systems @@ -1434,8 +1434,8 @@ qt skia cpu_features - systems modsecurity + systems From 8f35824dedf89955d9fa9977b0a2da6181875df0 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Sun, 11 Apr 2021 09:32:38 +0900 Subject: [PATCH 26/26] Harmonize formatting of pom.xml file --- modsecurity/pom.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modsecurity/pom.xml b/modsecurity/pom.xml index 755ed327f16..da143be11ad 100644 --- a/modsecurity/pom.xml +++ b/modsecurity/pom.xml @@ -1,14 +1,15 @@ - + + 4.0.0 + - javacpp-presets org.bytedeco + javacpp-presets 1.5.6-SNAPSHOT - 4.0.0 + org.bytedeco modsecurity master-${project.parent.version} JavaCPP Presets for ModSecurity @@ -51,4 +52,4 @@ - \ No newline at end of file +