summaryrefslogtreecommitdiff
path: root/epan/epan.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-05-22 23:02:19 +0000
committerGuy Harris <guy@alum.mit.edu>2013-05-22 23:02:19 +0000
commit70bb111babe59ed887ebc78fa6f7d79649acaa97 (patch)
tree8c3099c930738511fd7612ab78ad02b2bc7db3de /epan/epan.c
parent3384fee17796ac829014605da70af7b406ba2d3b (diff)
downloadwireshark-70bb111babe59ed887ebc78fa6f7d79649acaa97.tar.gz
Turn "packet_is_ssl()" into a general "does the packet whose dissection
is in this epan_dissect_t contain the field whose name is passed as an argument" routine in libwireshark, and use it where we used packet_is_ssl(). (We should check to see if anything *else* could use it.) svn path=/trunk/; revision=49530
Diffstat (limited to 'epan/epan.c')
-rw-r--r--epan/epan.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/epan/epan.c b/epan/epan.c
index cd65621942..e3a63175b3 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -272,6 +272,25 @@ epan_dissect_fill_in_columns(epan_dissect_t *edt, const gboolean fill_col_exprs,
col_fill_in(&edt->pi, fill_col_exprs, fill_fd_colums);
}
+gboolean
+epan_dissect_packet_contains_field(epan_dissect_t* edt,
+ const char *field_name)
+{
+ GPtrArray* array;
+ int field_id;
+ gboolean contains_field;
+
+ if (!edt || !edt->tree)
+ return FALSE;
+ field_id = proto_get_id_by_filter_name(field_name);
+ if (field_id < 0)
+ return FALSE;
+ array = proto_find_finfo(edt->tree, field_id);
+ contains_field = (array->len > 0) ? TRUE : FALSE;
+ g_ptr_array_free(array, TRUE);
+ return contains_field;
+}
+
/*
* Get compile-time information for libraries used by libwireshark.
*/