]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: implement http_connection sticky buffer
authorVictor Julien <victor@inliniac.net>
Sat, 1 Apr 2017 10:23:05 +0000 (12:23 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 20 Apr 2017 15:41:11 +0000 (17:41 +0200)
src/Makefile.am
src/detect-http-connection.c [new file with mode: 0644]
src/detect-http-connection.h [new file with mode: 0644]
src/detect-http-headers.c
src/detect.h

index e4af8bcd07be88ffba08cb52faed0d9ad511e544..2279f368efa479c234f76d28986d3697492ce7d0 100644 (file)
@@ -165,6 +165,7 @@ detect-gid.c detect-gid.h \
 detect-hostbits.c detect-hostbits.h \
 detect-http-accept.c detect-http-accept.h \
 detect-http-client-body.c detect-http-client-body.h \
+detect-http-connection.c detect-http-connection.h \
 detect-http-cookie.c detect-http-cookie.h \
 detect-http-header.c detect-http-header.h \
 detect-http-headers.c detect-http-headers.h detect-http-headers-stub.h \
diff --git a/src/detect-http-connection.c b/src/detect-http-connection.c
new file mode 100644 (file)
index 0000000..e53f74a
--- /dev/null
@@ -0,0 +1,46 @@
+/* Copyright (C) 2007-2017 Open Information Security Foundation
+ *
+ * You can copy, redistribute or modify this Program under the terms of
+ * the GNU General Public License version 2 as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+/**
+ * \ingroup httplayer
+ *
+ * @{
+ */
+
+
+/**
+ * \file
+ *
+ * \author Victor Julien <victor@inliniac.net>
+ *
+ * Implements the http_connection sticky buffer
+ */
+
+#define KEYWORD_NAME "http_connection"
+#define KEYWORD_DOC "http-keywords#http-connection"
+#define BUFFER_NAME "http_connection"
+#define BUFFER_DESC "http connection header"
+#define HEADER_NAME "Connection"
+#define KEYWORD_ID DETECT_AL_HTTP_HEADER_CONNECTION
+#define KEYWORD_TOSERVER 1
+
+#include "detect-http-headers-stub.h"
+
+void RegisterHttpHeadersConnection(void)
+{
+    DetectHttpHeadersRegisterStub();
+}
diff --git a/src/detect-http-connection.h b/src/detect-http-connection.h
new file mode 100644 (file)
index 0000000..7210132
--- /dev/null
@@ -0,0 +1,23 @@
+/* Copyright (C) 2007-2017 Open Information Security Foundation
+ *
+ * You can copy, redistribute or modify this Program under the terms of
+ * the GNU General Public License version 2 as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef __DETECT_HTTP_CONNECTION_H__
+#define __DETECT_HTTP_CONNECTION_H__
+
+void RegisterHttpHeadersConnection(void);
+
+#endif /* __DETECT_HTTP_CONNECTION_H__ */
index f22cdf108cc9700253ad35b395d95139b23a7eb4..91436d580a7d1a44d00e035716d7f77a3c3e2ab6 100644 (file)
  */
 
 #include "detect-http-accept.h"
+#include "detect-http-connection.h"
 #include "detect-http-referer.h"
 
 void DetectHttpHeadersRegister(void)
 {
     RegisterHttpHeadersAccept();
     RegisterHttpHeadersReferer();
+    RegisterHttpHeadersConnection();
 }
index d46dbcd9b4f39a724f8f1e174c218744f9d8ecac..41764d8904bf218ee7d8ce722737f158fc4a0251 100644 (file)
@@ -1242,6 +1242,7 @@ enum {
     DETECT_AL_HTTP_HEADER,
     DETECT_AL_HTTP_HEADER_NAMES,
     DETECT_AL_HTTP_HEADER_ACCEPT,
+    DETECT_AL_HTTP_HEADER_CONNECTION,
     DETECT_AL_HTTP_HEADER_REFERER,
     DETECT_AL_HTTP_RAW_HEADER,
     DETECT_AL_HTTP_URI,