summaryrefslogtreecommitdiff
path: root/sharkd_session.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2017-05-15 15:07:34 +0200
committerAnders Broman <a.broman58@gmail.com>2017-05-16 04:27:05 +0000
commit400bff055f697534ca0f1de034c4e38f13454a09 (patch)
treecc1834380d8ff0cb7e82a99de48cb1ab475113db /sharkd_session.c
parentbb6e31d8cce2d8b1c56722a816ef608555ece45f (diff)
downloadwireshark-400bff055f697534ca0f1de034c4e38f13454a09.tar.gz
sharkd: export uat records.
Move gtk's fld_tostr() to epan API as uat_fld_tostr. Change-Id: I01e3b66ca9ea3cd1e2e06e2122190ee42b9ad44b Reviewed-on: https://code.wireshark.org/review/21664 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'sharkd_session.c')
-rw-r--r--sharkd_session.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/sharkd_session.c b/sharkd_session.c
index 16655e63f2..591aa5ce02 100644
--- a/sharkd_session.c
+++ b/sharkd_session.c
@@ -3128,6 +3128,38 @@ sharkd_session_process_dumpconf_cb(pref_t *pref, gpointer d)
}
case PREF_UAT:
+ {
+ uat_t *uat = prefs_get_uat_value(pref);
+ guint idx;
+
+ printf("\"t\":[");
+ for (idx = 0; idx < uat->raw_data->len; idx++)
+ {
+ void *rec = UAT_INDEX_PTR(uat, idx);
+ guint colnum;
+
+ if (idx)
+ printf(",");
+
+ printf("[");
+ for (colnum = 0; colnum < uat->ncols; colnum++)
+ {
+ char *str = uat_fld_tostr(rec, &(uat->fields[colnum]));
+
+ if (colnum)
+ printf(",");
+
+ json_puts_string(str);
+ g_free(str);
+ }
+
+ printf("]");
+ }
+
+ printf("]");
+ break;
+ }
+
case PREF_COLOR:
case PREF_CUSTOM:
case PREF_STATIC_TEXT: