aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap_opttypes.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-07-15 17:25:41 -0700
committerGuy Harris <guy@alum.mit.edu>2016-07-16 00:26:47 +0000
commitae598d17370e141c37e3130fe16123d3e36d5195 (patch)
treebaf8f4011b5e67aa97954d1e34f891a904ea9f97 /wiretap/wtap_opttypes.h
parent9dd2674fada1f1b8cfed521b5ee4c3a4852a7ef9 (diff)
Add APIs to remove option instances from blocks.
That will allow deletion of comments, stripping of options when sanitizing captures, etc.. Change-Id: I9667ba2ccf4e548ff3b7d500796b260a437bcea0 Reviewed-on: https://code.wireshark.org/review/16485 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/wtap_opttypes.h')
-rw-r--r--wiretap/wtap_opttypes.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/wiretap/wtap_opttypes.h b/wiretap/wtap_opttypes.h
index a7d2fe8966..f1c4fd3af3 100644
--- a/wiretap/wtap_opttypes.h
+++ b/wiretap/wtap_opttypes.h
@@ -481,6 +481,28 @@ wtap_block_set_custom_option_value(wtap_block_t block, guint option_id, void* va
WS_DLL_PUBLIC wtap_opttype_return_val
wtap_block_get_custom_option_value(wtap_block_t block, guint option_id, void** value) G_GNUC_WARN_UNUSED_RESULT;
+/** Remove an option from a block
+ *
+ * @param[in] block Block from which to remove the option
+ * @param[in] option_id Identifier value for option
+ * @return wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful,
+ * error code otherwise
+ */
+WS_DLL_PUBLIC wtap_opttype_return_val
+wtap_block_remove_option(wtap_block_t block, guint option_id);
+
+/** Remove the nth instance of an option from a block
+ *
+ * @param[in] block Block from which to remove the option instance
+ * @param[in] option_id Identifier value for option
+ * @param[in] idx Instance number of option with that ID
+ * @return wtap_opttype_return_val - WTAP_OPTTYPE_SUCCESS if successful,
+ * error code otherwise
+ */
+WS_DLL_PUBLIC wtap_opttype_return_val
+wtap_block_remove_nth_option_instance(wtap_block_t block, guint option_id,
+ guint idx);
+
/** Copy a block to another.
*
* Any options that are in the destination but not the source are not removed.