From ebf41c3b1e19a06a534814bb13e4de1a644c06dc Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 16 Sep 2008 09:28:21 +0200 Subject: [PATCH] Remove obsolete decode-http files. --- src/Makefile.am | 1 - src/decode-http.c | 56 ----------------------------------------------- src/decode-http.h | 7 ------ src/decode-tcp.c | 1 - src/decode.h | 2 +- 5 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 src/decode-http.c delete mode 100644 src/decode-http.h diff --git a/src/Makefile.am b/src/Makefile.am index d43a2ba1cc..72c47f26d8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,7 +10,6 @@ decode-ipv6.c decode-ipv6.h \ decode-icmpv4.c decode-icmpv4.h \ decode-icmpv6.c decode-icmpv6.h \ decode-tcp.c decode-tcp.h \ -decode-http.c decode-http.h \ flow.c flow.h \ flow-queue.c flow-queue.h \ flow-hash.c flow-hash.h \ diff --git a/src/decode-http.c b/src/decode-http.c deleted file mode 100644 index a979b35976..0000000000 --- a/src/decode-http.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) 2008 Victor Julien */ - -#include "decode.h" -#include "decode-http.h" -#include "decode-events.h" - -#define HTTP_HEADER_LEN 10 -#define HTTP_BANNER "HTTP" -#define HTTP_GET "GET" -#define HTTP_POST "POST" - -void DecodeHTTP(ThreadVars *t, Packet *p, u_int8_t *pkt, u_int16_t len) -{ - int i, u = 0; - char uri[2048]; - char code[4]; - - if (len < HTTP_HEADER_LEN) - return; - - if (memcmp(pkt, HTTP_GET, 3) == 0) { - for (u = 0, i = 4; i < len && pkt[i] != ' ' && u < sizeof(uri); i++) { - uri[u] = pkt[i]; - u++; - } - uri[u] = '\0'; -#ifdef DEBUG - printf("HTTP GET %s\n", uri); -#endif - - } else if (memcmp(pkt, HTTP_POST, 4) == 0) { - for (u = 0, i = 5; i < len && pkt[i] != ' ' && u < sizeof(uri); i++) { - uri[u] = pkt[i]; - u++; - } - uri[u] = '\0'; - -#ifdef DEBUG - printf("HTTP POST %s\n", uri); -#endif - } - if (memcmp(pkt, HTTP_BANNER, 4) == 0) { - for (u = 0, i = 9; i < len && pkt[i] != ' ' && u < sizeof(code); i++) { - code[u] = pkt[i]; - u++; - } - code[u] = '\0'; - -#ifdef DEBUG - printf("HTTP reply code %s\n", code); -#endif - } - - return; -} - diff --git a/src/decode-http.h b/src/decode-http.h deleted file mode 100644 index 7110ae1b2c..0000000000 --- a/src/decode-http.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Copyright (c) 2008 Victor Julien */ - -#ifndef __DECODE_HTTP_H__ -#define __DECODE_HTTP_H__ - -#endif /* __DECODE_HTTP_H__ */ - diff --git a/src/decode-tcp.c b/src/decode-tcp.c index 0a4f419104..966cb31c05 100644 --- a/src/decode-tcp.c +++ b/src/decode-tcp.c @@ -151,7 +151,6 @@ void DecodeTCP(ThreadVars *t, Packet *p, u_int8_t *pkt, u_int16_t len) /* Flow is an integral part of us */ FlowHandlePacket(t, p); - DecodeHTTP(t, p, pkt + p->tcpvars.hlen, len - p->tcpvars.hlen); return; } diff --git a/src/decode.h b/src/decode.h index a87af1001e..38f5e9bdc3 100644 --- a/src/decode.h +++ b/src/decode.h @@ -31,13 +31,13 @@ #endif /* NFQ */ #include "action-globals.h" + #include "decode-ethernet.h" #include "decode-ipv4.h" #include "decode-ipv6.h" #include "decode-icmpv4.h" #include "decode-icmpv6.h" #include "decode-tcp.h" -#include "decode-http.h" /* Address */ typedef struct _Address