diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-03-04 03:38:20 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-03-04 03:38:20 +0000 |
commit | 703f49d14d87a4cc42e8153f149e952c25fdd3ca (patch) | |
tree | 643aec442da5e6a3b446e238b25c8d89d565eb45 /plugins/mgcp | |
parent | 9078b773ca0307a27307a4858d540cda7d7d7671 (diff) |
Updates from Ed Warnicke.
svn path=/trunk/; revision=3103
Diffstat (limited to 'plugins/mgcp')
-rw-r--r-- | plugins/mgcp/moduleinfo.h | 2 | ||||
-rw-r--r-- | plugins/mgcp/packet-mgcp.c | 33 |
2 files changed, 21 insertions, 14 deletions
diff --git a/plugins/mgcp/moduleinfo.h b/plugins/mgcp/moduleinfo.h index 30cfca2096..f2f123e7e0 100644 --- a/plugins/mgcp/moduleinfo.h +++ b/plugins/mgcp/moduleinfo.h @@ -13,5 +13,5 @@ #endif /* Version number of package */ -#define VERSION "0.0.4" +#define VERSION "0.0.5" diff --git a/plugins/mgcp/packet-mgcp.c b/plugins/mgcp/packet-mgcp.c index 369f4e1414..8d47cd9c59 100644 --- a/plugins/mgcp/packet-mgcp.c +++ b/plugins/mgcp/packet-mgcp.c @@ -2,7 +2,7 @@ * Routines for mgcp packet disassembly * RFC 2705 * - * $Id: packet-mgcp.c,v 1.17 2001/03/04 00:43:56 guy Exp $ + * $Id: packet-mgcp.c,v 1.18 2001/03/04 03:38:20 guy Exp $ * * Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu> * @@ -163,7 +163,7 @@ static gint tvb_parse_param(tvbuff_t *tvb, gint offset, gint maxlength, * are written in the same style. */ static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree); + proto_tree *tree,proto_tree *mgcp_tree, proto_tree *ti); static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree); @@ -198,6 +198,7 @@ dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) gint sectionlen; guint32 num_messages; gint tvb_sectionend,tvb_sectionbegin, tvb_len, tvb_current_len; + proto_tree *mgcp_tree, *ti; /* Initialize variables */ tvb_sectionend = 0; @@ -206,7 +207,9 @@ dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_len = tvb_length(tvb); tvb_current_len = tvb_len; num_messages = 0; - + mgcp_tree = NULL; + ti = NULL; + /* * Set the columns now, so that they'll be set correctly if we throw * an exception. We can set them later as well.... @@ -231,20 +234,28 @@ dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ do{ num_messages++; + if(tree){ + /* Create out mgcp subtree */ + ti = proto_tree_add_item(tree,proto_mgcp,tvb,0,0, FALSE); + mgcp_tree = proto_item_add_subtree(ti, ett_mgcp); + } + sectionlen = tvb_find_dot_line(tvb, tvb_sectionbegin, -1, &tvb_sectionend); if( sectionlen != -1){ dissect_mgcp_message(tvb_new_subset(tvb, tvb_sectionbegin, sectionlen, -1), - pinfo, tree); + pinfo, tree, mgcp_tree,ti); tvb_sectionbegin = tvb_sectionend; } else { break; } } while(tvb_sectionend < tvb_len ); - proto_tree_add_uint_hidden(tree, hf_mgcp_messagecount,NullTVB,0,0, - num_messages); + if(mgcp_tree){ + proto_tree_add_uint_hidden(mgcp_tree, hf_mgcp_messagecount, tvb, + 0 ,0 , num_messages); + } } /* @@ -276,10 +287,10 @@ dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } static void -dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ +dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + proto_tree *mgcp_tree, proto_tree *ti){ /* Declare variables */ - proto_tree *mgcp_tree, *ti; gint sectionlen; gint tvb_sectionend,tvb_sectionbegin, tvb_len, tvb_current_len; tvbuff_t *next_tvb; @@ -300,11 +311,7 @@ dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ if(is_mgcp_verb(tvb,0,tvb_len) || is_mgcp_rspcode(tvb,0,tvb_len)){ /* Build the info tree if we've been given a root */ - if (tree) { - - /* Create out mgcp subtree */ - ti = proto_tree_add_item(tree,proto_mgcp,tvb,0,0, FALSE); - mgcp_tree = proto_item_add_subtree(ti, ett_mgcp); + if (tree && mgcp_tree) { /* dissect first line */ tvb_sectionbegin = 0; |