aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2010-10-30 16:00:30 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2010-10-30 16:00:30 +0000
commite17b9ccec18b9efaacb370ff715c19b09f1b4ea0 (patch)
tree96ced51f0ba70bc067960c979a5243c43d4a52d7
parentb94da93586f8af151aea9ef60e2d409761371a5a (diff)
Rev 29427 added packet_add_new_data_source() with a comment indicating that
the data source does not need to be allocated if (!tree). Rev 30158 took the if (!tree) check out indicating that the check was invalid. So: (since packet_add_new_data_source() now only calls add_new_data_source()), remove packet_add_new_data_source(). svn path=/trunk/; revision=34717
-rw-r--r--epan/dissectors/packet-ber.c2
-rw-r--r--epan/dissectors/packet-bthci_acl.c2
-rw-r--r--epan/dissectors/packet-btl2cap.c2
-rw-r--r--epan/packet.c16
-rw-r--r--epan/packet.h29
-rw-r--r--epan/reassemble.c2
-rw-r--r--epan/reassemble_test.c4
-rw-r--r--print.c8
8 files changed, 14 insertions, 51 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 037ea32588..6ac4915c9e 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -1215,7 +1215,7 @@ reassemble_octet_string(asn1_ctx_t *actx, proto_tree *tree, gint hf_id, tvbuff_t
actx->created_item = proto_tree_add_item(tree, hf_id, reassembled_tvb, 0, -1, FALSE);
next_tree = proto_item_add_subtree (actx->created_item, ett_ber_reassembled_octet_string);
- packet_add_new_data_source(actx->pinfo, next_tree, reassembled_tvb, "Reassembled OCTET STRING");
+ add_new_data_source(actx->pinfo, reassembled_tvb, "Reassembled OCTET STRING");
show_fragment_seq_tree(fd_head, &octet_string_frag_items, next_tree, actx->pinfo, reassembled_tvb, &frag_tree_item);
}
}
diff --git a/epan/dissectors/packet-bthci_acl.c b/epan/dissectors/packet-bthci_acl.c
index 04c6b35a25..2634faf4fd 100644
--- a/epan/dissectors/packet-bthci_acl.c
+++ b/epan/dissectors/packet-bthci_acl.c
@@ -213,7 +213,7 @@ dissect_btacl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if(mfp && mfp->last_frame==pinfo->fd->num){
next_tvb = tvb_new_child_real_data(tvb, (guint8*)mfp->reassembled, mfp->tot_len, mfp->tot_len);
- packet_add_new_data_source(pinfo, btacl_tree, next_tvb, "Reassembled BTHCI ACL");
+ add_new_data_source(pinfo, next_tvb, "Reassembled BTHCI ACL");
/* call L2CAP dissector */
if(btl2cap_handle){
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c
index eedf2e21f7..67e03c5278 100644
--- a/epan/dissectors/packet-btl2cap.c
+++ b/epan/dissectors/packet-btl2cap.c
@@ -928,7 +928,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
}
if(segment == 0x02 && mfp && mfp->last_frame==pinfo->fd->num){
next_tvb = tvb_new_child_real_data(tvb, (guint8*)mfp->reassembled, mfp->tot_len, mfp->tot_len);
- packet_add_new_data_source(pinfo, btl2cap_tree, next_tvb, "Reassembled L2CAP");
+ add_new_data_source(pinfo, next_tvb, "Reassembled L2CAP");
}
/*pass up to higher layer if we have a complete packet*/
if(segment == 0x00) {
diff --git a/epan/packet.c b/epan/packet.c
index 3d8ec03e3a..cd89256975 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -225,20 +225,6 @@ add_new_data_source(packet_info *pinfo, tvbuff_t *tvb, const char *name)
pinfo->data_src = g_slist_append(pinfo->data_src, src);
}
-/*
- * This should only add a data source to the list of data sources for
- * a frame if the data sources are being used. Note that they can
- * be used even if the protocol tree isn't being built or isn't visible,
- * e.g. if you run tshark with -x but without -V or anything else to
- * cause the protocol tree to be built.
- */
-void
-packet_add_new_data_source(packet_info *pinfo, proto_tree *tree _U_,
- tvbuff_t *tvb, const char *name)
-{
- add_new_data_source(pinfo, tvb, name);
-}
-
const char*
get_data_source_name(data_source *src)
{
@@ -330,7 +316,7 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header,
TRY {
edt->tvb = tvb_new_real_data(pd, fd->cap_len, fd->pkt_len);
/* Add this tvbuffer into the data_src list */
- packet_add_new_data_source(&edt->pi, edt->tree, edt->tvb, "Frame");
+ add_new_data_source(&edt->pi, edt->tvb, "Frame");
/* Even though dissect_frame() catches all the exceptions a
* sub-dissector can throw, dissect_frame() itself may throw
diff --git a/epan/packet.h b/epan/packet.h
index 5aa87dee59..092741cf3c 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -192,7 +192,7 @@ extern gboolean dissector_try_port(dissector_table_t sub_dissectors,
/* Look for a given value in a given uint dissector table and, if found,
call the dissector with the arguments supplied, and return TRUE,
otherwise return FALSE. */
-extern gboolean dissector_try_port_new(dissector_table_t sub_dissectors,
+extern gboolean dissector_try_port_new(dissector_table_t sub_dissectors,
const guint32 port, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const gboolean add_proto_name);
/* Look for a given value in a given uint dissector table and, if found,
@@ -307,14 +307,14 @@ extern dissector_handle_t new_create_dissector_handle(new_dissector_t dissector,
* @param tvb The buffer to dissect.
* @param pinfo Packet Info.
* @param tree The protocol tree.
- * @return If the protocol for that handle isn't enabled call the data
- * dissector. Otherwise, if the handle refers to a new-style
- * dissector, call the dissector and return its return value, otherwise call
+ * @return If the protocol for that handle isn't enabled call the data
+ * dissector. Otherwise, if the handle refers to a new-style
+ * dissector, call the dissector and return its return value, otherwise call
* it and return the length of the tvbuff pointed to by the argument.
*/
extern int call_dissector(dissector_handle_t handle, tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree);
-
+
/* Call a dissector through a handle but if no dissector was found
* just return 0 and do not call the "data" dissector instead.
*
@@ -323,8 +323,8 @@ extern int call_dissector(dissector_handle_t handle, tvbuff_t *tvb,
* @param pinfo Packet Info.
* @param tree The protocol tree.
* @return If the protocol for that handle isn't enabled, return 0 without
- * calling the dissector. Otherwise, if the handle refers to a new-style
- * dissector, call the dissector and return its return value, otherwise call
+ * calling the dissector. Otherwise, if the handle refers to a new-style
+ * dissector, call the dissector and return its return value, otherwise call
* it and return the length of the tvbuff pointed to by the argument.
*/
extern int call_dissector_only(dissector_handle_t handle, tvbuff_t *tvb,
@@ -377,22 +377,11 @@ extern void
final_registration_all_protocols(void);
/*
- * DEPRECATED: Use packet_add_new_data_source() instead.
- */
-extern void
-add_new_data_source(packet_info *pinfo, tvbuff_t *tvb, const char *name);
-
-/*
* Add a new data source to the list of data sources for a frame, given
* the tvbuff for the data source and its name.
- *
- * @param tree The protocol tree.
- * @param pinfo Packet Info.
- * @param tvb The buffer to store.
- * @param name The name of the data source
*/
-extern void
-packet_add_new_data_source(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, const char *name);
+extern void add_new_data_source(packet_info *pinfo, tvbuff_t *tvb,
+ const char *name);
/*
* Return the data source name.
diff --git a/epan/reassemble.c b/epan/reassemble.c
index a82622f175..b88588cbea 100644
--- a/epan/reassemble.c
+++ b/epan/reassemble.c
@@ -1914,7 +1914,7 @@ process_reassembled_data(tvbuff_t *tvb, const int offset, packet_info *pinfo,
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
/* Add the defragmented data to the data source list. */
- packet_add_new_data_source(pinfo, tree, next_tvb, name);
+ add_new_data_source(pinfo, next_tvb, name);
/* show all fragments */
if (fd_head->flags & FD_BLOCKSEQUENCE) {
diff --git a/epan/reassemble_test.c b/epan/reassemble_test.c
index b90ec935f3..e106f96e52 100644
--- a/epan/reassemble_test.c
+++ b/epan/reassemble_test.c
@@ -1074,10 +1074,6 @@ void add_new_data_source(packet_info *pinfo _U_, tvbuff_t *tvb _U_,
const char *name _U_)
{}
-void packet_add_new_data_source(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_,
- const char *name _U_)
-{}
-
proto_item *
proto_tree_add_uint(proto_tree *tree _U_, int hfindex _U_, tvbuff_t *tvb _U_,
gint start _U_, gint length _U_, guint32 value _U_)
diff --git a/print.c b/print.c
index ad67e0a868..010e52eecd 100644
--- a/print.c
+++ b/print.c
@@ -245,10 +245,6 @@ proto_tree_write_pdml(epan_dissect_t *edt, FILE *fh)
data.src_list = edt->pi.data_src;
data.edt = edt;
- /* We shouldn't be called with a NULL pointer here because we've
- * created a visible protocol tree */
- g_assert(data.src_list);
-
fprintf(fh, "<packet>\n");
/* Print a "geninfo" protocol as required by PDML */
@@ -799,10 +795,6 @@ print_hex_data(print_stream_t *stream, epan_dissect_t *edt)
const guchar *cp;
guint length;
- /* We shouldn't be called with a NULL pointer here because we've
- * created a visible protocol tree */
- g_assert(edt->pi.data_src);
-
/*
* Set "multiple_sources" iff this frame has more than one
* data source; if it does, we need to print the name of