diff options
author | Ed Warnicke <hagbard@physics.rutgers.edu> | 2001-11-18 02:28:15 +0000 |
---|---|---|
committer | Ed Warnicke <hagbard@physics.rutgers.edu> | 2001-11-18 02:28:15 +0000 |
commit | e361502b7095dfc89ae14cd16d9bc700aea33f5a (patch) | |
tree | 0625b9e44ddb27a1c517d062e614ba0598d94d1d /packet-http.c | |
parent | c211cb9da92fcbab67d8c4f12eb6aed0c070ffc7 (diff) |
Added hooks to allow the registration of heuristic subdissectors of
http.
svn path=/trunk/; revision=4217
Diffstat (limited to 'packet-http.c')
-rw-r--r-- | packet-http.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/packet-http.c b/packet-http.c index 27bbf070d9..38c686613e 100644 --- a/packet-http.c +++ b/packet-http.c @@ -3,7 +3,7 @@ * * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-http.c,v 1.39 2001/09/04 01:01:46 guy Exp $ + * $Id: packet-http.c,v 1.40 2001/11/18 02:28:15 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -80,6 +80,7 @@ typedef enum { static int is_http_request_or_reply(const u_char *data, int linelen, http_type_t *type); static dissector_table_t subdissector_table; +static heur_dissector_list_t heur_subdissector_list; static void dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -271,6 +272,14 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ if (ti != NULL) proto_item_set_len(ti, offset); + } else if(dissector_try_heuristic(heur_subdissector_list, + next_tvb,pinfo,tree)){ + /* + * Yes. Fix up the top-level item so that it + * doesn't include the stuff for that protocol. + */ + if (ti != NULL) + proto_item_set_len(ti, offset); } else dissect_data(tvb, offset, pinfo, http_tree); } @@ -405,6 +414,15 @@ proto_register_http(void) * HTTP on a specific non-HTTP port. */ subdissector_table = register_dissector_table("http.port"); + + /* + * Heuristic dissectors SHOULD register themselves in + * this table using the standard heur_dissector_add() + * function. + */ + + register_heur_dissector_list("http",&heur_subdissector_list); + } /* |