diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-09-26 21:45:16 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-09-28 12:26:01 +0000 |
commit | f0e12f0fd301476378719d8268f13d53b14aaf1b (patch) | |
tree | b48d6c99803d436d4b18c52136242eb6f0a4b15e /plugins | |
parent | 13184fbf3a1490e2ba7c27cf34e458a77bfcc337 (diff) |
Remove TPG plugin and dependencies
It doesn't build with autotools and CMake.
Under-documented and unmaintained. Seems to be a work-in-progress
that stalled.
Introduces spurious CMake dependency on yapp.
Change-Id: I0dca1ccbdfd683586c05765437d4b7804ab5cc70
Reviewed-on: https://code.wireshark.org/review/23758
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/tpg/CMakeLists.txt | 92 | ||||
-rw-r--r-- | plugins/tpg/Makefile.am | 70 | ||||
-rw-r--r-- | plugins/tpg/http.tpg | 194 | ||||
-rw-r--r-- | plugins/tpg/packet-http.c | 154 |
4 files changed, 0 insertions, 510 deletions
diff --git a/plugins/tpg/CMakeLists.txt b/plugins/tpg/CMakeLists.txt deleted file mode 100644 index b8f4ca7086..0000000000 --- a/plugins/tpg/CMakeLists.txt +++ /dev/null @@ -1,92 +0,0 @@ -# CMakeLists.txt -# -# Wireshark - Network traffic analyzer -# By Gerald Combs <gerald@wireshark.org> -# Copyright 1998 Gerald Combs -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# 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 -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# - -include(WiresharkPlugin) - -# Plugin name and version info (major minor micro extra) -# set_plugin_properties(tpg ...) - -set(PLUGIN_FILES - http-parser.c - packet-http.c -) - -set(CLEAN_FILES - ${PLUGIN_FILES} -) - -set_source_files_properties( - ${CLEAN_FILES} - PROPERTIES - COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" -) - -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -set(_tpg ${CMAKE_SOURCE_DIR}/tools/tpg) - -ADD_CUSTOM_COMMAND( - OUTPUT - TPG.pm - COMMAND ${YAPP_EXECUTABLE} - -v - -m TPG - ${_tpg}/tpg.yp - DEPENDS - ${_tpg}/tpg.yp -) - -ADD_CUSTOM_COMMAND( - OUTPUT - http-parser.h - http-parser.c - COMMAND ${PERL_EXECUTABLE} - -I${CMAKE_BINARY_DIR} - -I${_tpg} - ${_tpg}/tpg.pl - ${CMAKE_CURRENT_SOURCE_DIR}/http.tpg - DEPENDS - ${_tpg}/tpg.pl - TPG.pm - ${_tpg}/V2P.pm - ${CMAKE_CURRENT_SOURCE_DIR}/http.tpg -) - -add_plugin_library(tpg) - -install(TARGETS tpg - LIBRARY DESTINATION ${PLUGIN_INSTALL_LIBDIR} NAMELINK_SKIP - RUNTIME DESTINATION ${PLUGIN_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${PLUGIN_INSTALL_LIBDIR} -) - -# -# Editor modelines - http://www.wireshark.org/tools/modelines.html -# -# Local variables: -# c-basic-offset: 8 -# tab-width: 8 -# indent-tabs-mode: t -# End: -# -# vi: set shiftwidth=8 tabstop=8 noexpandtab: -# :indentSize=8:tabSize=8:noTabs=false: -# diff --git a/plugins/tpg/Makefile.am b/plugins/tpg/Makefile.am deleted file mode 100644 index 930043fea9..0000000000 --- a/plugins/tpg/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ -# Makefile.am -# -# Wireshark - Network traffic analyzer -# By Gerald Combs <gerald@wireshark.org> -# Copyright 1998 Gerald Combs -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# 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 -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# - -include $(top_srcdir)/Makefile.am.inc -include ../Makefile.am.inc - -plugin_LTLIBRARIES = tpg.la - -tpg_la_SOURCES = \ - moduleinfo.h \ - http-parser.c \ - http-parser.h \ - packet-http.c - -tpg_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_CPPFLAGS) - -tpg_la_CFLAGS = $(AM_CFLAGS) $(PLUGIN_CFLAGS) - -tpg_la_LDFLAGS = $(PLUGIN_LDFLAGS) - -CLEANFILES = \ - tpg \ - *~ - -DISTCLEANFILES = \ - http-parser.c \ - http-parser.h - -MAINTAINERCLEANFILES = \ - Makefile.in \ - http-parser.c \ - http-parser.h \ - plugin.c - -EXTRA_DIST = \ - http.tpg \ - CMakeLists.txt - -TPG = $(top_builddir)/tools/tpg - -http-parser.h: http-parser.c - -$(TPG)/TPG.pm: $(TPG)/TPG.yp - cd $(TPG) && make - -http-parser.c: http.tpg $(TPG)/tpg.pl $(TPG)/TPG.pm - $(PERL) -I$(TPG) $(TPG)/tpg.pl http.tpg - -checkapi: - $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput -build \ - -sourcedir=$(srcdir) \ - $(DISSECTOR_SRC) $(DISSECTOR_INCLUDES) diff --git a/plugins/tpg/http.tpg b/plugins/tpg/http.tpg deleted file mode 100644 index cb43293e14..0000000000 --- a/plugins/tpg/http.tpg +++ /dev/null @@ -1,194 +0,0 @@ -# -# HTTP header TPG description -# -# (c) 2005 Luis E. Garcia Ontanon <luis@ontanon.org> -# -# Wireshark - Network traffic analyzer -# By Gerald Combs <gerald@wireshark.org> -# Copyright 2004 Gerald Combs -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# 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 -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -%header_head %{ -typedef struct _http_info_value_t -{ - guint32 framenum; - gchar *request_method; - guint response_code; - gchar *http_host; - gchar *request_uri; - guint content_length; - gchar* media; - gboolean is_response; - gchar* transfer_encoding; -} http_info_value_t; -%} - -%parser_name http . -%export req_resp header crlf sp. - -%tt_type %{ http_info_value_t %} - -%rule crlf = "\r\n" . - -%rule sp = [ ]+ . - -%choice versions = "1.0" | "1.1". <version> - -%field version hyttp.version "HTTP Version" FT_STRING . - -%sequence http_version = "HTTP/" & versions . - -%field response hyttp.response "Response" FT_STRING . -%field response_code hyttp.response.code "Response Code" FT_UINT32 BASE_DEC %{ http_response_codes %} . - -%sequence %tree response = http_version & [0-9]+<response_code:RESPONSE> & ... ( crlf ) . <response:%plain_text> %{ - TT_DATA->is_response = TRUE; - TT_DATA->response_code = TPG_UINT(RESPONSE); -%} - - -%field request hyttp.request "Request" FT_STRING . -%field method hyttp.request.method "Request Method" FT_STRING . -%field uri hyttp.request.uri "Request URI" FT_STRING . -%sequence %tree request = [A-Z]+<method:METHOD> & [^ ]+<uri:URI> & http_version & crlf . <request:%plain_text> %{ - TT_DATA->is_response = FALSE; - TT_DATA->request_method = TPG_STRING(METHOD); - TT_DATA->request_uri = TPG_STRING(URI); -%} - -%choice req_resp = request | response. - -%field media hyttp.content_type.media "Content-Type Media" FT_STRING . - -%sequence media = [a-zA-Z0-9-]+ & "/" & [a-zA-Z0-9-]+ . <media:MEDIA> %{ - TT_DATA->media = TPG_STRING(MEDIA); -%} - - -%sequence quoted_string = ["] & [^"]* & ["] . - -%choice value = [a-zA-Z0-9-]+ | quoted_string. - -%field charset hyttp.content_type.charset "Content-Type Charset" FT_STRING . - -%sequence parameter = [a-zA-Z0-9-]+ & [=] & value. -%sequence charset_parameter = 'charset' & '=' & [a-z0-9-]+<charset> . - -%choice content_type_param = charset_parameter | parameter . - -%sequence content_type_params = [;] & content_type_param . - -%sequence content_type_value = media & content_type_params* . - -%sequence content_type_hdr = 'Content-type:' & content_type_value & crlf . - -%field content_length hyttp.headers.content_length "Content-Length" FT_UINT32 BASE_DEC . -%sequence content_length = 'Content-length:' & [0-9]+<content_length:LENGTH> & crlf. %{ - TT_DATA->content_length = TPG_UINT(LENGTH); -%} - -%field transfer_encoding hyttp.transfer_encoding "Transfer-Encoding" FT_STRING . -%sequence transfer_encoding = 'Transfer-encoding:' & ...<transfer_encoding:ENCODING> ( crlf %leave ) & crlf. %{ - TT_DATA->transfer_encoding = TPG_STRING(ENCODING); -%} - -%field authorization hyttp.authorization "Authorization" FT_STRING . -%sequence authorization = 'Authorization:' & ...<authorization> ( crlf %leave ) & crlf. - -%field proxy_authorization hyttp.proxy_authorization "Proxy-Authorization" FT_STRING . -%sequence proxy_author = 'Proxy-authorization:' & ...<proxy_authorization> ( crlf %leave ) & crlf. - -%field proxy_authen hyttp.proxy_authenti "Proxy-Authenticate" FT_STRING . -%sequence proxy_authen = 'Proxy-authenticate:' & ...<proxy_authen> ( crlf %leave ) & crlf. - -%field www_auth hyttp.www_authenticate "WWW-Authenticate" FT_STRING . -%sequence www_auth = 'WWW-authenticate:' & ...<www_auth> ( crlf %leave ) & crlf. - -%field content_encoding hyttp.content_encoding "Content-Encoding" FT_STRING . -%sequence content_encoding = 'Content-Encoding:' & ...<content_encoding> ( crlf %leave ) & crlf. - -%field user_agent hyttp.content_encoding "User-Agent" FT_STRING . -%sequence user_agent = 'User-Agent:' & ...<user_agent> ( crlf %leave ) & crlf. - -%field host hyttp.host "Host" FT_STRING . -%sequence host = 'Host:' & ...<host:HOST> ( crlf %leave ) & crlf. %{ - TT_DATA->http_host = TPG_STRING(HOST); -%} - -%field accept hyttp.accept "Accept" FT_STRING . -%sequence accept = 'Accept:' & ...<accept> ( crlf %leave ) & crlf. - -%field accept_language hyttp.accept_language "Accept-Language" FT_STRING . -%sequence accept_language = 'Accept-language:' & ...<accept_language> ( crlf %leave ) & crlf. - -%field accept_encoding hyttp.accept_encoding "Accept-Language" FT_STRING . -%sequence accept_encoding = 'Accept-encoding:' & ...<accept_encoding> ( crlf %leave ) & crlf. - -%field accept_ranges hyttp.accept_encoding "Accept-Ranges" FT_STRING . -%sequence accept_ranges = 'Accept-Ranges:' & ...<accept_ranges> ( crlf %leave ) & crlf. - -%field keep_alive hyttp.keep_alive "Keep-Alive" FT_UINT32 BASE_DEC . -%sequence keep_alive = 'Keep-Alive:' & ...<keep_alive> ( crlf %leave ) & crlf. - -%field connection hyttp.connection "Connection" FT_STRING . -%sequence connection = 'Connection:' & ...<connection> ( crlf %leave ) & crlf. - -%field referer hyttp.referer "Referer" FT_STRING . -%sequence referer = 'Referer:' & ...<referer> ( crlf %leave ) & crlf. - -%field cookie hyttp.cookie "Cookie" FT_STRING . -%sequence cookie = 'Cookie:' & ...<cookie> ( crlf %leave ) & crlf. - -%field etag hyttp.etag "Etag" FT_STRING . -%sequence etag = 'Etag:' & ["] & [^"]+<etag> & ["] & crlf . - -%field last_modified hyttp.last_modified "Last-Modified" FT_STRING . -%sequence last_modified = 'Last-Modified:' & ...<last_modified> ( crlf %leave ) & crlf. - -%field server hyttp.server "Server" FT_STRING . -%sequence server = 'Server:' & ...<server> ( crlf %leave ) & crlf. - -%sequence other_header = [A-Z] & [a-zA-Z-]+ & ":" & ... ( crlf %leave ) & crlf. - -%field header hyttp.headers.line "HTTP Header Line" FT_BOOLEAN . -%choice %tree header = - content_type_hdr - | transfer_encoding - | content_length - | authorization - | proxy_author - | proxy_authen - | www_auth - | content_encoding - | user_agent - | host - | accept - | accept_language - | accept_encoding - | accept_ranges - | keep_alive - | connection - | referer - | cookie - | etag - | last_modified - | server - | other_header . <header:%plain_text> - - -%tail %{ -/* tail */ -%} diff --git a/plugins/tpg/packet-http.c b/plugins/tpg/packet-http.c deleted file mode 100644 index 2a14878c47..0000000000 --- a/plugins/tpg/packet-http.c +++ /dev/null @@ -1,154 +0,0 @@ -/* packet-http.c - * - * Wireshark - Network traffic analyzer - * By Gerald Combs <gerald@wireshark.org> - * Copyright 1998 Gerald Combs - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * 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 along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" - -#include <epan/wmem/wmem.h> - -#include "http-parser.h" -#include <gmodule.h> - -static const value_string http_response_codes[] = { - { 200, "OK" }, - { 302, "Later" }, - { 0, NULL } -}; - -static gint ett_http = -1; -static int proto_http = -1; - -static int hf_http_is_response = -1; -static int hf_http_request_method = -1; -static int hf_http_response_code = -1; -static int hf_http_transfer_encoding = -1; -static int hf_http_content_length = -1; -static int hf_http_media = -1; -static int hf_http_host = -1; -static int hf_http_request_uri = -1; - -static dissector_handle_t http_handle; - -static int dissect_http(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, void* data _U_) { - http_info_value_t* msgdata = wmem_alloc0(wmem_packet_scope(), sizeof(http_info_value_t)); - tvbparse_elem_t* reqresp; - tpg_parser_data_t* tpg; - proto_item* pi = proto_tree_add_item(tree,proto_http,tvb,0,-1,ENC_NA); - proto_tree* pt = proto_item_add_subtree(pi,ett_http); - - tpg = tpg_start(pt,tvb,0,-1,http_tpg_data.wanted_http_sp, msgdata); - - if (( reqresp = TPG_GET(tpg,http_tpg_data.wanted_http_req_resp) )) { - tvbparse_elem_t* hdr; - - while(( hdr = TPG_GET(tpg,http_tpg_data.wanted_http_header) )) - ; - - if ( TPG_GET(tpg,http_tpg_data.wanted_http_crlf) ) { - pi = proto_tree_add_boolean(pt,hf_http_is_response,tvb,0,0,msgdata->is_response); - pt = proto_item_add_subtree(pi,ett_http); - - - if (msgdata->is_response) { - proto_tree_add_uint(pt,hf_http_response_code,tvb,0,0,msgdata->response_code); - proto_tree_add_uint(pt,hf_http_content_length,tvb,0,0,msgdata->content_length); - if (msgdata->transfer_encoding) proto_tree_add_string(pt,hf_http_transfer_encoding,tvb,0,0,msgdata->transfer_encoding); - if (msgdata->media) proto_tree_add_string(pt,hf_http_media,tvb,0,0,msgdata->media); - } else { - if (msgdata->request_method) proto_tree_add_string(pt,hf_http_request_method,tvb,0,0,msgdata->request_method); - if (msgdata->http_host) proto_tree_add_string(pt,hf_http_host,tvb,0,0,msgdata->http_host); - if (msgdata->request_uri) proto_tree_add_string(pt,hf_http_request_uri,tvb,0,0,msgdata->request_uri); - } - - } else { - /* header fragment */ - } - } else { - /* no header */ - } - return tvb_captured_length(tvb); -} - -static void proto_register_http(void) { - static hf_register_info hf[] = { - HF_HTTP_PARSER, - { &hf_http_is_response, { "=Is Response", "hyttp.info.is_response", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "", HFILL }}, - { &hf_http_request_method, { "=Method", "hyttp.info.method", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, - { &hf_http_response_code, { "=Response Code", "hyttp.info.response.code", FT_UINT32, BASE_DEC, VALS( http_response_codes ), 0x0, "", HFILL }}, - { &hf_http_transfer_encoding, { "=Transfer-Encoding", "hyttp.info.transfer_encoding", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, - { &hf_http_content_length, { "=Content-Length", "hyttp.info.content_length", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, - { &hf_http_request_uri, { "=Request URI", "hyttp.info.uri", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, - { &hf_http_media, { "=Media", "hyttp.info.media", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, - { &hf_http_host, { "=Host", "hyttp.info.host", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }} - }; - - gint *ett[] = { - ETT_HTTP_PARSER, - &ett_http - }; - - tpg_http_init(); - - proto_http = proto_register_protocol("HyTTP", "HyTTP", "hyttp"); - proto_register_field_array(proto_http, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); -} - - -static void proto_reg_handoff_http(void) { - http_handle = create_dissector_handle(dissect_http, proto_http); - - dissector_add_uint_with_preference("tcp.port", 80, http_handle); - -} - -#ifndef ENABLE_STATIC - -WS_DLL_PUBLIC_DEF const gchar version[] = "0.0.0"; - -WS_DLL_PUBLIC_DEF void -plugin_register(void) -{ - /* register the new protocol, protocol fields, and subtrees */ - if (proto_http == -1) { /* execute protocol initialization only once */ - proto_register_http(); - } -} - -WS_DLL_PUBLIC_DEF void -plugin_reg_handoff(void){ - proto_reg_handoff_http(); -} - -#endif - - -/* - * Editor modelines - http://www.wireshark.org/tools/modelines.html - * - * Local variables: - * c-basic-offset: 4 - * tab-width: 8 - * indent-tabs-mode: nil - * End: - * - * vi: set shiftwidth=4 tabstop=8 expandtab: - * :indentSize=4:tabSize=8:noTabs=true: - */ |