]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: enable/disable yaml settings
authorVictor Julien <victor@inliniac.net>
Tue, 27 Jun 2017 19:51:00 +0000 (21:51 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 27 Jun 2017 19:51:00 +0000 (21:51 +0200)
Based on compile time settings, enable/disable app-layers
and loggers.

configure.ac
suricata.yaml.in

index dba302b7458a297165ba8d07c261bd13feac295a..967ce24967c38c2ccb66ae3cb3e12e8af19e5c92 100644 (file)
     AC_ARG_ENABLE([rust], AS_HELP_STRING([--enable-rust], [Enable Experimental Rust support]))
     AC_ARG_ENABLE([rust_experimental], AS_HELP_STRING([--enable-rust-experimental], [Enable support for experimental Rus parsers]))
 
-
+    rust_config_enabled="no"        # used in suricata.yaml.in to enable/disable app-layers
+    rust_config_comment="#"         # used in suricata.yaml.in to enable/disable eve loggers
+    rust_config_exp_enabled="no"    # used in suricata.yaml.in to enable/disable app-layers
     rust_vendor_comment="# "
     have_rust_vendor="no"
 
           CFLAGS="${CFLAGS} -I\${srcdir}/../rust/gen/c-headers"
           AC_SUBST(RUST_SURICATA_LIB)
           AC_SUBST(RUST_LDADD)
-         AC_SUBST([CARGO], [$HAVE_CARGO])
-         if test "x$CARGO_HOME" = "x"; then
-           AC_SUBST([CARGO_HOME], [~/.cargo])
-         else
-           AC_SUBST([CARGO_HOME], [$CARGO_HOME])
-         fi
+          AC_SUBST([CARGO], [$HAVE_CARGO])
+          if test "x$CARGO_HOME" = "x"; then
+              AC_SUBST([CARGO_HOME], [~/.cargo])
+          else
+                 AC_SUBST([CARGO_HOME], [$CARGO_HOME])
+          fi
           AC_CHECK_FILES([$srcdir/rust/vendor], [have_rust_vendor="yes"])
           if test "x$have_rust_vendor" = "xyes"; then
-           rust_vendor_comment=""
+                 rust_vendor_comment=""
           fi
+
+          rust_config_enabled="yes"
+          rust_config_comment=""
         fi
       fi
     fi
 
+    if test "x$enable_rust_experimental" = "xyes"; then
+        rust_config_exp_enabled="yes"
+        rust_config_exp_comment=""
+    else
+        enable_rust_experimental="no"
+    fi
+
     AM_CONDITIONAL([HAVE_RUST], [test "x$enable_rust" = "xyes"])
     AM_CONDITIONAL([HAVE_RUST_EXTERNAL], [test "x$enable_rust_experimental" = "xyes"])
     AC_SUBST(rust_vendor_comment)
+    AC_SUBST(rust_config_enabled)
+    AC_SUBST(rust_config_comment)
+    AC_SUBST(rust_config_exp_comment)
+    AC_SUBST(rust_config_exp_enabled)
     AM_CONDITIONAL([HAVE_RUST_VENDOR], [test "x$have_rust_vendor" = "xyes"])
 
     if test "x$enable_rust" = "xyes"; then
index 28b239b13faa85bfff7c952934d3f202cb40affc..9c7b5ba917ad90c8982245afe3f0d08406fdd342 100644 (file)
@@ -234,7 +234,7 @@ outputs:
             #md5: [body, subject]
 
         #- dnp3
-        #- nfs
+        @rust_config_comment@- nfs
         - ssh
         - stats:
             totals: yes       # stats for all threads merged together
@@ -681,10 +681,6 @@ pcap-file:
 # "detection-only" enables protocol detection only (parser disabled).
 app-layer:
   protocols:
-    ntp:
-      enabled: yes
-    nfs:
-      enabled: yes
     tls:
       enabled: yes
       detection-ports:
@@ -740,6 +736,10 @@ app-layer:
     # smb2 detection is disabled internally inside the engine.
     #smb2:
     #  enabled: yes
+    # Note: NFS parser depends on Rust support: pass --enable-rust
+    # to configure.
+    nfs:
+      enabled: @rust_config_enabled@
     dns:
       # memcaps. Globally and per flow/state.
       #global-memcap: 16mb
@@ -896,6 +896,11 @@ app-layer:
         dp: 44818
         sp: 44818
 
+    # Note: parser depends on experimental Rust support
+    # with --enable-rust-experimental passed to configure
+    ntp:
+      enabled: @rust_config_exp_enabled@
+
 # Limit for the maximum number of asn1 frames to decode (default 256)
 asn1-max-frames: 256