From 1e1b6d19ef707a581e10b689a925d7b4ded76d2f Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Tue, 22 Jul 2014 17:28:34 +0200 Subject: snort: move files from 'files' to 'snort' for faster lookup Signed-off-by: Martin Jansa --- .../0001-libpcap-search-sysroot-for-headers.patch | 31 ------ .../snort/files/disable-dap-address-space-id.patch | 52 ---------- .../snort/files/disable-inaddr-none.patch | 75 -------------- .../recipes-connectivity/snort/files/snort.init | 109 --------------------- .../0001-libpcap-search-sysroot-for-headers.patch | 31 ++++++ .../snort/snort/disable-dap-address-space-id.patch | 52 ++++++++++ .../snort/snort/disable-inaddr-none.patch | 75 ++++++++++++++ .../recipes-connectivity/snort/snort/snort.init | 109 +++++++++++++++++++++ 8 files changed, 267 insertions(+), 267 deletions(-) delete mode 100644 meta-networking/recipes-connectivity/snort/files/0001-libpcap-search-sysroot-for-headers.patch delete mode 100644 meta-networking/recipes-connectivity/snort/files/disable-dap-address-space-id.patch delete mode 100644 meta-networking/recipes-connectivity/snort/files/disable-inaddr-none.patch delete mode 100644 meta-networking/recipes-connectivity/snort/files/snort.init create mode 100644 meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch create mode 100644 meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch create mode 100644 meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch create mode 100644 meta-networking/recipes-connectivity/snort/snort/snort.init (limited to 'meta-networking') diff --git a/meta-networking/recipes-connectivity/snort/files/0001-libpcap-search-sysroot-for-headers.patch b/meta-networking/recipes-connectivity/snort/files/0001-libpcap-search-sysroot-for-headers.patch deleted file mode 100644 index 54c2a9521b..0000000000 --- a/meta-networking/recipes-connectivity/snort/files/0001-libpcap-search-sysroot-for-headers.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 4d7ebe3ed6cee72bc7db98bd408d22c10ef5dd82 Mon Sep 17 00:00:00 2001 -From: Joe MacDonald -Date: Wed, 20 Nov 2013 16:06:07 -0500 -Subject: [PATCH] libpcap: search sysroot for headers - -Configure hard-coded host header paths when building with libpcap. Point -the search path at the sysroot instead. - -Upstream-Status: Pending - -Signed-off-by: Joe MacDonald ---- - configure.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.in b/configure.in -index e52bb6c..8ded35d 100644 ---- a/configure.in -+++ b/configure.in -@@ -78,7 +78,7 @@ case "$host" in - linux="yes" - AC_DEFINE([LINUX],[1],[Define if Linux]) - AC_SUBST(extra_incl) -- extra_incl="-I/usr/include/pcap" -+ extra_incl="-I=/usr/include/pcap" - ;; - *-hpux10*|*-hpux11*) - AC_DEFINE([HPUX],[1],[Define if HP-UX 10 or 11]) --- -1.7.10.4 - diff --git a/meta-networking/recipes-connectivity/snort/files/disable-dap-address-space-id.patch b/meta-networking/recipes-connectivity/snort/files/disable-dap-address-space-id.patch deleted file mode 100644 index 39e5c9c03a..0000000000 --- a/meta-networking/recipes-connectivity/snort/files/disable-dap-address-space-id.patch +++ /dev/null @@ -1,52 +0,0 @@ -Upstream-Status:Inappropriate [embedded specific] - -fix the below error: -checking for dap address space id... configure: -configure: error: cannot run test program while cross compiling - - -Signed-off-by: Chunrong Guo - ---- a/configure.in 2013-08-23 00:06:37.239361932 -0500 -+++ b/configure.in 2013-08-23 00:07:32.860266534 -0500 -@@ -679,23 +679,23 @@ - - AC_CHECK_FUNCS([daq_hup_apply] [daq_acquire_with_meta]) - --AC_MSG_CHECKING([for daq address space ID]) --AC_RUN_IFELSE( --[AC_LANG_PROGRAM( --[[ --#include --]], --[[ -- DAQ_PktHdr_t hdr; -- hdr.address_space_id = 0; --]])], --[have_daq_address_space_id="yes"], --[have_daq_address_space_id="no"]) --AC_MSG_RESULT($have_daq_address_space_id) --if test "x$have_daq_address_space_id" = "xyes"; then -- AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1], -- [DAQ version supports address space ID in header.]) --fi -+#AC_MSG_CHECKING([for daq address space ID]) -+#AC_RUN_IFELSE( -+#[AC_LANG_PROGRAM( -+#[[ -+##include -+#]], -+#[[ -+# DAQ_PktHdr_t hdr; -+# hdr.address_space_id = 0; -+#]])], -+have_daq_address_space_id="yes" -+#[have_daq_address_space_id="no"]) -+#AC_MSG_RESULT($have_daq_address_space_id) -+#if test "x$have_daq_address_space_id" = "xyes"; then -+# AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1], -+# [DAQ version supports address space ID in header.]) -+#fi - - # any sparc platform has to have this one defined. - AC_MSG_CHECKING(for sparc) diff --git a/meta-networking/recipes-connectivity/snort/files/disable-inaddr-none.patch b/meta-networking/recipes-connectivity/snort/files/disable-inaddr-none.patch deleted file mode 100644 index 9dafe63459..0000000000 --- a/meta-networking/recipes-connectivity/snort/files/disable-inaddr-none.patch +++ /dev/null @@ -1,75 +0,0 @@ -Upstream-Status: Inappropriate [embedded specific] - -fix the below error: -checking for INADDR_NONE... configure: -configure: error: cannot run test program while cross compiling - -Signed-off-by: Chunrong Guo - - ---- a/configure.in 2013-08-21 03:56:17.197414789 -0500 -+++ b/configure.in 2013-08-21 23:19:05.298553560 -0500 -@@ -281,25 +281,7 @@ - AC_CHECK_TYPES([boolean]) - - # In case INADDR_NONE is not defined (like on Solaris) --have_inaddr_none="no" --AC_MSG_CHECKING([for INADDR_NONE]) --AC_RUN_IFELSE( --[AC_LANG_PROGRAM( --[[ --#include --#include --#include --]], --[[ -- if (inet_addr("10,5,2") == INADDR_NONE); -- return 0; --]])], --[have_inaddr_none="yes"], --[have_inaddr_none="no"]) --AC_MSG_RESULT($have_inaddr_none) --if test "x$have_inaddr_none" = "xno"; then -- AC_DEFINE([INADDR_NONE],[-1],[For INADDR_NONE definition]) --fi -+have_inaddr_none="yes" - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include -@@ -397,21 +379,21 @@ - fi - fi - --AC_MSG_CHECKING([for pcap_lex_destroy]) --AC_RUN_IFELSE( --[AC_LANG_PROGRAM( --[[ --#include --]], --[[ -- pcap_lex_destroy(); --]])], --[have_pcap_lex_destroy="yes"], --[have_pcap_lex_destroy="no"]) --AC_MSG_RESULT($have_pcap_lex_destroy) --if test "x$have_pcap_lex_destroy" = "xyes"; then -- AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter]) --fi -+#AC_MSG_CHECKING([for pcap_lex_destroy]) -+#AC_RUN_IFELSE( -+#[AC_LANG_PROGRAM( -+#[[ -+##include -+#]], -+#[[ -+# pcap_lex_destroy(); -+#]])], -+have_pcap_lex_destroy="yes" -+#[have_pcap_lex_destroy="no"]) -+#AC_MSG_RESULT($have_pcap_lex_destroy) -+#if test "x$have_pcap_lex_destroy" = "xyes"; then -+# AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter]) -+#fi - - AC_MSG_CHECKING([for pcap_lib_version]) - AC_LINK_IFELSE( diff --git a/meta-networking/recipes-connectivity/snort/files/snort.init b/meta-networking/recipes-connectivity/snort/files/snort.init deleted file mode 100644 index d8a00c43fc..0000000000 --- a/meta-networking/recipes-connectivity/snort/files/snort.init +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/sh -# -# Snort Startup Script modified for OpenEmbedded -# - -# Script variables - -LAN_INTERFACE="$2" -RETURN_VAL=0 -BINARY=/usr/bin/snort -PATH=/bin:/usr/bin -PID=/var/run/snort_${LAN_INTERFACE}_ids.pid -DEL_PID=$PID -LOGDIR="/var/log/snort" -DATE=`/bin/date +%Y%m%d` -CONFIG_FILE=/etc/snort/snort.conf -PROG=snort -USER=root -GROUP=root - -if [ ! -x "$BINARY" ]; then - echo "ERROR: $BINARY not found." - exit 1 -fi - -if [ ! -r "$CONFIG_FILE" ]; then - echo "ERROR: $CONFIG_FILE not found." - exit 1 -fi - -start() -{ - - [ -n "$LAN_INTERFACE" ] || return 0 - # Check if log diratory is present. Otherwise, create it. - if [ ! -d $LOGDIR/$DATE ]; then - mkdir -d $LOGDIR/$DATE - /bin/chown -R $USER:$USER $LOGDIR/$DATE - /bin/chmod -R 700 $LOGDIR/$DATE - fi - - /bin/echo "Starting $PROG: " - # Snort parameters - # -D Run Snort in background (daemon) mode - # -i Listen on interface - # -u Run snort uid as user (or uid) - # -g Run snort uid as group (or gid) - # -c Load configuration file - # -N Turn off logging (alerts still work) (removed to enable logging) :) - # -l Log to directory - # -t Chroots process to directory after initialization - # -R Include 'id' in snort_intf.pid file name - - $BINARY -D -i $LAN_INTERFACE -u $USER -g $GROUP -c $CONFIG_FILE -l $LOGDIR/$DATE -t $LOGDIR/$DATE -R _ids - /bin/echo "$PROG startup complete." - return $RETURN_VAL -} - -stop() -{ - if [ -s $PID ]; then - /bin/echo "Stopping $PROG with PID `cat $PID`: " - kill -TERM `cat $PID` 2>/dev/null - RETURN_VAL=$? - /bin/echo "$PROG shutdown complete." - [ -e $DEL_PID ] && rm -f $DEL_PID - [ -e $DEL_PID.lck ] && rm -f $DEL_PID.lck - else - /bin/echo "ERROR: PID in $PID file not found." - RETURN_VAL=1 - fi - return $RETURN_VAL -} - -status() { - if [ -s $PID ]; then - echo "$PROG is running as pid `cat $PID`:" - else - echo "$PROG is not running." - fi -} - -restart() -{ - stop - start - RETURN_VAL=$? - return $RETURN_VAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status - ;; - restart|reload) - restart - ;; - *) - /bin/echo "Usage: $0 {start|stop|status|restart|reload}" - RETURN_VAL=1 -esac - -exit $RETURN_VAL diff --git a/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch b/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch new file mode 100644 index 0000000000..54c2a9521b --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch @@ -0,0 +1,31 @@ +From 4d7ebe3ed6cee72bc7db98bd408d22c10ef5dd82 Mon Sep 17 00:00:00 2001 +From: Joe MacDonald +Date: Wed, 20 Nov 2013 16:06:07 -0500 +Subject: [PATCH] libpcap: search sysroot for headers + +Configure hard-coded host header paths when building with libpcap. Point +the search path at the sysroot instead. + +Upstream-Status: Pending + +Signed-off-by: Joe MacDonald +--- + configure.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.in b/configure.in +index e52bb6c..8ded35d 100644 +--- a/configure.in ++++ b/configure.in +@@ -78,7 +78,7 @@ case "$host" in + linux="yes" + AC_DEFINE([LINUX],[1],[Define if Linux]) + AC_SUBST(extra_incl) +- extra_incl="-I/usr/include/pcap" ++ extra_incl="-I=/usr/include/pcap" + ;; + *-hpux10*|*-hpux11*) + AC_DEFINE([HPUX],[1],[Define if HP-UX 10 or 11]) +-- +1.7.10.4 + diff --git a/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch b/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch new file mode 100644 index 0000000000..39e5c9c03a --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch @@ -0,0 +1,52 @@ +Upstream-Status:Inappropriate [embedded specific] + +fix the below error: +checking for dap address space id... configure: +configure: error: cannot run test program while cross compiling + + +Signed-off-by: Chunrong Guo + +--- a/configure.in 2013-08-23 00:06:37.239361932 -0500 ++++ b/configure.in 2013-08-23 00:07:32.860266534 -0500 +@@ -679,23 +679,23 @@ + + AC_CHECK_FUNCS([daq_hup_apply] [daq_acquire_with_meta]) + +-AC_MSG_CHECKING([for daq address space ID]) +-AC_RUN_IFELSE( +-[AC_LANG_PROGRAM( +-[[ +-#include +-]], +-[[ +- DAQ_PktHdr_t hdr; +- hdr.address_space_id = 0; +-]])], +-[have_daq_address_space_id="yes"], +-[have_daq_address_space_id="no"]) +-AC_MSG_RESULT($have_daq_address_space_id) +-if test "x$have_daq_address_space_id" = "xyes"; then +- AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1], +- [DAQ version supports address space ID in header.]) +-fi ++#AC_MSG_CHECKING([for daq address space ID]) ++#AC_RUN_IFELSE( ++#[AC_LANG_PROGRAM( ++#[[ ++##include ++#]], ++#[[ ++# DAQ_PktHdr_t hdr; ++# hdr.address_space_id = 0; ++#]])], ++have_daq_address_space_id="yes" ++#[have_daq_address_space_id="no"]) ++#AC_MSG_RESULT($have_daq_address_space_id) ++#if test "x$have_daq_address_space_id" = "xyes"; then ++# AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1], ++# [DAQ version supports address space ID in header.]) ++#fi + + # any sparc platform has to have this one defined. + AC_MSG_CHECKING(for sparc) diff --git a/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch b/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch new file mode 100644 index 0000000000..9dafe63459 --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch @@ -0,0 +1,75 @@ +Upstream-Status: Inappropriate [embedded specific] + +fix the below error: +checking for INADDR_NONE... configure: +configure: error: cannot run test program while cross compiling + +Signed-off-by: Chunrong Guo + + +--- a/configure.in 2013-08-21 03:56:17.197414789 -0500 ++++ b/configure.in 2013-08-21 23:19:05.298553560 -0500 +@@ -281,25 +281,7 @@ + AC_CHECK_TYPES([boolean]) + + # In case INADDR_NONE is not defined (like on Solaris) +-have_inaddr_none="no" +-AC_MSG_CHECKING([for INADDR_NONE]) +-AC_RUN_IFELSE( +-[AC_LANG_PROGRAM( +-[[ +-#include +-#include +-#include +-]], +-[[ +- if (inet_addr("10,5,2") == INADDR_NONE); +- return 0; +-]])], +-[have_inaddr_none="yes"], +-[have_inaddr_none="no"]) +-AC_MSG_RESULT($have_inaddr_none) +-if test "x$have_inaddr_none" = "xno"; then +- AC_DEFINE([INADDR_NONE],[-1],[For INADDR_NONE definition]) +-fi ++have_inaddr_none="yes" + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include +@@ -397,21 +379,21 @@ + fi + fi + +-AC_MSG_CHECKING([for pcap_lex_destroy]) +-AC_RUN_IFELSE( +-[AC_LANG_PROGRAM( +-[[ +-#include +-]], +-[[ +- pcap_lex_destroy(); +-]])], +-[have_pcap_lex_destroy="yes"], +-[have_pcap_lex_destroy="no"]) +-AC_MSG_RESULT($have_pcap_lex_destroy) +-if test "x$have_pcap_lex_destroy" = "xyes"; then +- AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter]) +-fi ++#AC_MSG_CHECKING([for pcap_lex_destroy]) ++#AC_RUN_IFELSE( ++#[AC_LANG_PROGRAM( ++#[[ ++##include ++#]], ++#[[ ++# pcap_lex_destroy(); ++#]])], ++have_pcap_lex_destroy="yes" ++#[have_pcap_lex_destroy="no"]) ++#AC_MSG_RESULT($have_pcap_lex_destroy) ++#if test "x$have_pcap_lex_destroy" = "xyes"; then ++# AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter]) ++#fi + + AC_MSG_CHECKING([for pcap_lib_version]) + AC_LINK_IFELSE( diff --git a/meta-networking/recipes-connectivity/snort/snort/snort.init b/meta-networking/recipes-connectivity/snort/snort/snort.init new file mode 100644 index 0000000000..d8a00c43fc --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort/snort.init @@ -0,0 +1,109 @@ +#!/bin/sh +# +# Snort Startup Script modified for OpenEmbedded +# + +# Script variables + +LAN_INTERFACE="$2" +RETURN_VAL=0 +BINARY=/usr/bin/snort +PATH=/bin:/usr/bin +PID=/var/run/snort_${LAN_INTERFACE}_ids.pid +DEL_PID=$PID +LOGDIR="/var/log/snort" +DATE=`/bin/date +%Y%m%d` +CONFIG_FILE=/etc/snort/snort.conf +PROG=snort +USER=root +GROUP=root + +if [ ! -x "$BINARY" ]; then + echo "ERROR: $BINARY not found." + exit 1 +fi + +if [ ! -r "$CONFIG_FILE" ]; then + echo "ERROR: $CONFIG_FILE not found." + exit 1 +fi + +start() +{ + + [ -n "$LAN_INTERFACE" ] || return 0 + # Check if log diratory is present. Otherwise, create it. + if [ ! -d $LOGDIR/$DATE ]; then + mkdir -d $LOGDIR/$DATE + /bin/chown -R $USER:$USER $LOGDIR/$DATE + /bin/chmod -R 700 $LOGDIR/$DATE + fi + + /bin/echo "Starting $PROG: " + # Snort parameters + # -D Run Snort in background (daemon) mode + # -i Listen on interface + # -u Run snort uid as user (or uid) + # -g Run snort uid as group (or gid) + # -c Load configuration file + # -N Turn off logging (alerts still work) (removed to enable logging) :) + # -l Log to directory + # -t Chroots process to directory after initialization + # -R Include 'id' in snort_intf.pid file name + + $BINARY -D -i $LAN_INTERFACE -u $USER -g $GROUP -c $CONFIG_FILE -l $LOGDIR/$DATE -t $LOGDIR/$DATE -R _ids + /bin/echo "$PROG startup complete." + return $RETURN_VAL +} + +stop() +{ + if [ -s $PID ]; then + /bin/echo "Stopping $PROG with PID `cat $PID`: " + kill -TERM `cat $PID` 2>/dev/null + RETURN_VAL=$? + /bin/echo "$PROG shutdown complete." + [ -e $DEL_PID ] && rm -f $DEL_PID + [ -e $DEL_PID.lck ] && rm -f $DEL_PID.lck + else + /bin/echo "ERROR: PID in $PID file not found." + RETURN_VAL=1 + fi + return $RETURN_VAL +} + +status() { + if [ -s $PID ]; then + echo "$PROG is running as pid `cat $PID`:" + else + echo "$PROG is not running." + fi +} + +restart() +{ + stop + start + RETURN_VAL=$? + return $RETURN_VAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status + ;; + restart|reload) + restart + ;; + *) + /bin/echo "Usage: $0 {start|stop|status|restart|reload}" + RETURN_VAL=1 +esac + +exit $RETURN_VAL -- cgit 1.2.3-korg