#include <stdio.h>
#include <string.h>
+#include <glib.h>
+
#include <epan/epan.h>
#include <epan/epan_dissect.h>
#include <epan/tvbuff.h>
gchar quote;
};
+GHashTable *output_only_tables = NULL;
+
static gboolean write_headers = FALSE;
static const gchar* get_field_hex_value(GSList* src_list, field_info *fi);
return;
}
+ /*
+ * If -O is specified, only display the protocols which are in the
+ * lookup table. Only check on the first level: once we start printing
+ * a tree, print the rest of the subtree. Otherwise we won't print
+ * subitems whose abbreviation doesn't match the protocol--for example
+ * text items (whose abbreviation is simply "text").
+ */
+ if (output_only_tables != NULL && pdata->level == 0
+ && g_hash_table_lookup(output_only_tables, fi->hfinfo->abbrev) == NULL) {
+ pdata->success = TRUE;
+ return;
+ }
+
if (PROTO_ITEM_IS_GENERATED(node)) {
g_free(label_ptr);
}
csv_str = csv_massage_str(str, NULL);
fprintf(fh, "\"%s\"%c", csv_str, sep);
g_free(csv_str);
-}
+}
void
proto_tree_write_csv(epan_dissect_t *edt, FILE *fh)
return FALSE; /* Is this guarded against by option parsing? */
}
option_name = strtok(option,"=");
+ if (!option_name) {
+ return FALSE;
+ }
option_value = option + strlen(option_name) + 1;
if(0 == strcmp(option_name, "header")) {
switch(NULL == option_value ? '\0' : *option_value) {