summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2013-12-18 14:18:45 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2013-12-18 14:18:45 +0000
commit80150e196a9ce072914967ac2be567b6bc207ff6 (patch)
treee559d4b857f919ac0eb25567af9c132de6d8f9a6
parent4729c083ac6ae7456584cbf726c1023b8707b72b (diff)
downloadwireshark-80150e196a9ce072914967ac2be567b6bc207ff6.tar.gz
Added col_clear_fence().
svn path=/trunk/; revision=54220
-rw-r--r--epan/column-utils.c16
-rw-r--r--epan/column-utils.h10
2 files changed, 26 insertions, 0 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c
index db4c485e6f..622c7374f9 100644
--- a/epan/column-utils.c
+++ b/epan/column-utils.c
@@ -161,6 +161,22 @@ col_set_fence(column_info *cinfo, const gint el)
}
}
+/* Clear the fence for a column. */
+void
+col_clear_fence(column_info *cinfo, const gint el)
+{
+ int i;
+
+ if (!CHECK_COL(cinfo, el))
+ return;
+
+ for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
+ if (cinfo->fmt_matx[i][el]) {
+ cinfo->col_fence[i] = 0;
+ }
+ }
+}
+
/* Gets the text of a column */
const gchar *
col_get_text(column_info *cinfo, const gint el)
diff --git a/epan/column-utils.h b/epan/column-utils.h
index e892e51f37..bc760bea1c 100644
--- a/epan/column-utils.h
+++ b/epan/column-utils.h
@@ -108,6 +108,16 @@ WS_DLL_PUBLIC void col_set_writable(column_info *cinfo, const gboolean writable)
*/
WS_DLL_PUBLIC void col_set_fence(column_info *cinfo, const gint col);
+/** Clears a fence for the current column content
+ *
+ * This can be useful if a protocol wants to remove whatever
+ * a previous protocol has added to the column.
+ *
+ * @param cinfo the current packet row
+ * @param col the column to use, e.g. COL_INFO
+ */
+WS_DLL_PUBLIC void col_clear_fence(column_info *cinfo, const gint col);
+
/** Gets the text of a column element.
*
* @param cinfo the current packet row