diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-07-18 12:46:40 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-07-18 19:47:35 +0000 |
commit | d54f372c999ce1bf1437a7718301265e2c1f15cb (patch) | |
tree | 1cd8866ea6d4903d6dd4d6f0acaf83dc19182c38 /wiretap | |
parent | d08e7679fafd236db0fbb61aac7e56667fa250dc (diff) |
Remove wtap_block_num_options_of_type().
It's not used; currently, everything that accesses instances of a
multiple-instance-allowed option do so in a loop that iterates over
option instances by fetching values of the Nth option until the attempt
to fetch the option fails, making only one pass over the options.
Change-Id: Ife9583a5d246027dbfc133ab58027ef6641d65ef
Reviewed-on: https://code.wireshark.org/review/16534
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/wtap_opttypes.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/wiretap/wtap_opttypes.c b/wiretap/wtap_opttypes.c index c3b9f0df29..0a76c390b8 100644 --- a/wiretap/wtap_opttypes.c +++ b/wiretap/wtap_opttypes.c @@ -331,42 +331,6 @@ void wtap_block_foreach_option(wtap_block_t block, wtap_block_foreach_func func, } } -wtap_opttype_return_val -wtap_block_num_options_of_type(wtap_block_t block, guint option_id, guint *countp) -{ - guint n_options; - guint i; - wtap_option_t *opt; - wtap_opttype_t *opttype; - - if (option_id >= block->info->options->len) { - /* There's no option for this block with that option ID */ - return WTAP_OPTTYPE_NO_SUCH_OPTION; - } - - opttype = &g_array_index(block->info->options, wtap_opttype_t, option_id); - - /* - * Can there be more than one instance of this option? - */ - if (!(opttype->flags & WTAP_OPTTYPE_FLAG_MULTIPLE_ALLOWED)) { - /* - * No; this is only for use with options with multiple - * instances. - */ - return WTAP_OPTTYPE_NUMBER_MISMATCH; - } - - n_options = 0; - for (i = 0; i < block->options->len; i++) { - opt = g_array_index(block->options, wtap_option_t*, i); - if (opt->option_id == option_id) - n_options++; - } - *countp = n_options; - return WTAP_OPTTYPE_SUCCESS; -} - static wtap_opttype_return_val wtap_block_add_option_common(wtap_block_t block, guint option_id, wtap_opttype_e type, wtap_option_t **optp) { |