diff options
author | Tomas Kukosa <tomas.kukosa@siemens.com> | 2005-09-22 14:40:26 +0000 |
---|---|---|
committer | Tomas Kukosa <tomas.kukosa@siemens.com> | 2005-09-22 14:40:26 +0000 |
commit | 81a2feddabc6ef32a06276bbbb5c1fe2ba95d161 (patch) | |
tree | 752b2e97b16ae1fbfa6e9a287fbb29bb8ddfff10 /asn1/h225 | |
parent | 1c0667858e11e9461ad69e755739512dbc8bd93e (diff) |
Call H245 decoding and tunelled protocols decoding at the end of H225 dissector. I makes less confusion in info column.
svn path=/trunk/; revision=15958
Diffstat (limited to 'asn1/h225')
-rw-r--r-- | asn1/h225/h225.cnf | 12 | ||||
-rw-r--r-- | asn1/h225/packet-h225-template.c | 77 |
2 files changed, 80 insertions, 9 deletions
diff --git a/asn1/h225/h225.cnf b/asn1/h225/h225.cnf index a2f370241e..25e2689291 100644 --- a/asn1/h225/h225.cnf +++ b/asn1/h225/h225.cnf @@ -230,18 +230,14 @@ CallIdentifier/guid guid tvbuff_t *h245_tvb = NULL; %(DEFAULT_BODY)s - if (h245_tvb && tvb_length(h245_tvb)) { - call_dissector(h245dg_handle, h245_tvb, pinfo, tree); - } + next_tvb_add(&h245_list, h245_tvb, tree, h245dg_handle); #.END #---------------------------------------------------------------------------------------- #.FN_BODY H245Control/_item VAL_PTR = &h245_tvb tvbuff_t *h245_tvb = NULL; %(DEFAULT_BODY)s - if (h245_tvb && tvb_length(h245_tvb)) { - call_dissector(h245dg_handle, h245_tvb, pinfo, tree); - } + next_tvb_add(&h245_list, h245_tvb, tree, h245dg_handle); #.END #---------------------------------------------------------------------------------------- #.FN_FTR H323-UU-PDU/h323-message-body/empty @@ -485,9 +481,7 @@ ReleaseCompleteReason VAL_PTR = &value tvbuff_t *next_tvb = NULL; %(DEFAULT_BODY)s - if (next_tvb && tvb_length(next_tvb)) { - call_dissector((tp_handle)?tp_handle:data_handle, next_tvb, pinfo, tree); - } + next_tvb_add(&tp_list, next_tvb, tree, tp_handle); #.END #--- NonStandardParameter --------------------------------------------------------------- diff --git a/asn1/h225/packet-h225-template.c b/asn1/h225/packet-h225-template.c index 76dc2b93d6..5ecc1affdf 100644 --- a/asn1/h225/packet-h225-template.c +++ b/asn1/h225/packet-h225-template.c @@ -55,6 +55,69 @@ #include "packet-h245.h" #include "packet-q931.h" +/*---------------------------------------------------------------------------*/ +/* next tvb list - can be moved to some more common file if other dissector needs it */ + +#include <epan/emem.h> + +typedef struct next_tvb_item { + struct next_tvb_item *next; + struct next_tvb_item *previous; + dissector_handle_t handle; + tvbuff_t *tvb; + proto_tree *tree; +} next_tvb_item_t; + +typedef struct { + next_tvb_item_t *first; + next_tvb_item_t *last; + int count; +} next_tvb_list_t; + +void next_tvb_init(next_tvb_list_t *list); +void next_tvb_add(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_handle_t handle); +void next_tvb_call(next_tvb_list_t *list, packet_info *pinfo, proto_tree *tree, dissector_handle_t handle, dissector_handle_t data_handle); + +void next_tvb_init(next_tvb_list_t *list) { + list->first = NULL; + list->last = NULL; + list->count = 0; +} + +void next_tvb_add(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_handle_t handle) { + next_tvb_item_t *item; + + item = ep_alloc(sizeof(next_tvb_item_t)); + + item->handle = handle; + item->tvb = tvb; + item->tree = tree; + + if (list->last) { + list->last->next = item; + } else { + list->first = item; + } + item->next = NULL; + item->previous = list->last; + list->last = item; + list->count++; +} + +void next_tvb_call(next_tvb_list_t *list, packet_info *pinfo, proto_tree *tree, dissector_handle_t handle, dissector_handle_t data_handle) { + next_tvb_item_t *item; + + item = list->first; + while (item) { + if (item->tvb && tvb_length(item->tvb)) { + call_dissector((item->handle) ? item->handle : ((handle) ? handle : data_handle), item->tvb, pinfo, (item->tree) ? item->tree : tree); + } + item = item->next; + } +} + +/*---------------------------------------------------------------------------*/ + #define PNAME "H323-MESSAGES" #define PSNAME "H.225.0" #define PFNAME "h225" @@ -87,6 +150,9 @@ static dissector_handle_t h4501_handle=NULL; static dissector_handle_t nsp_handle; static dissector_handle_t tp_handle; +static next_tvb_list_t h245_list; +static next_tvb_list_t tp_list; + /* Initialize the protocol and registered fields */ static int h225_tap = -1; static int proto_h225 = -1; @@ -144,6 +210,9 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree * reset_h225_packet_info(h225_pi); h225_pi->msg_type = H225_CS; + next_tvb_init(&h245_list); + next_tvb_init(&tp_list); + if (check_col(pinfo->cinfo, COL_PROTOCOL)){ col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); } @@ -156,6 +225,14 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree * offset = dissect_h225_H323_UserInformation(tvb, offset,pinfo, tr, hf_h225_H323_UserInformation); + if (h245_list.count && check_col(pinfo->cinfo, COL_PROTOCOL)){ + col_append_str(pinfo->cinfo, COL_PROTOCOL, "/"); + col_set_fence(pinfo->cinfo, COL_PROTOCOL); + } + + next_tvb_call(&h245_list, pinfo, tree, h245dg_handle, data_handle); + next_tvb_call(&tp_list, pinfo, tree, NULL, data_handle); + tap_queue_packet(h225_tap, pinfo, h225_pi); return offset; |