summaryrefslogtreecommitdiffstats
path: root/sharkd_session.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:18 +0000
commit1da76b3706a6c9bd41bf8f219d7c97de5e1e5c7f (patch)
tree9930fb4bb87cd6037f60efff9656f967121c8c2d /sharkd_session.c
parentAdding debian version 4.2.2-1.1. (diff)
downloadwireshark-1da76b3706a6c9bd41bf8f219d7c97de5e1e5c7f.tar.xz
wireshark-1da76b3706a6c9bd41bf8f219d7c97de5e1e5c7f.zip
Merging upstream version 4.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sharkd_session.c')
-rw-r--r--sharkd_session.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/sharkd_session.c b/sharkd_session.c
index 18071d77..8c378260 100644
--- a/sharkd_session.c
+++ b/sharkd_session.c
@@ -1220,11 +1220,16 @@ sharkd_session_process_load(const char *buf, const jsmntok_t *tokens, int count)
* Process status request
*
* Output object with attributes:
- * (m) frames - count of currently loaded frames
- * (m) duration - time difference between time of first frame, and last loaded frame
- * (o) filename - capture filename
- * (o) filesize - capture filesize
- * (o) columns - array of column titles
+ * (m) frames - count of currently loaded frames
+ * (m) duration - time difference between time of first frame, and last loaded frame
+ * (o) filename - capture filename
+ * (o) filesize - capture filesize
+ * (o) columns - array of column titles
+ * (o) column_info - array of column infos, array of object with attributes:
+ * 'title' - column title
+ * 'format' - column format (%x or %Cus:<expr>:<occurrence> if COL_CUSTOM)
+ * 'visible' - true if column is visible
+ * 'resolved' - true if column is resolved
*/
static void
sharkd_session_process_status(void)
@@ -1258,6 +1263,24 @@ sharkd_session_process_status(void)
sharkd_json_value_string(NULL, get_column_title(i));
}
sharkd_json_array_close();
+
+ sharkd_json_array_open("column_info");
+ for (int i = 0; i < cfile.cinfo.num_cols; ++i)
+ {
+ int fmt = get_column_format(i);
+ sharkd_json_object_open(NULL);
+ sharkd_json_value_string("title", get_column_title(i));
+ if (fmt != COL_CUSTOM)
+ {
+ sharkd_json_value_string("format", col_format_to_string(fmt));
+ } else {
+ sharkd_json_value_stringf("format", "%s:%s:%d", col_format_to_string(fmt), get_column_custom_fields(i), get_column_custom_occurrence(i));
+ }
+ sharkd_json_value_anyf("visible", get_column_visible(i) ? "true" : "false");
+ sharkd_json_value_anyf("resolved", get_column_resolved(i) ? "true" : "false");
+ sharkd_json_object_close();
+ }
+ sharkd_json_array_close();
}
sharkd_json_result_epilogue();
@@ -5836,7 +5859,7 @@ sharkd_session_process(char *buf, const jsmntok_t *tokens, int count)
int
sharkd_session_main(int mode_setting)
{
- char buf[2 * 1024];
+ char buf[8 * 1024];
jsmntok_t *tokens = NULL;
int tokens_max = -1;