aboutsummaryrefslogtreecommitdiffstats
path: root/sharkd_session.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2018-09-24 09:24:55 +0200
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2018-09-24 08:21:16 +0000
commitc5416e9b23db34b3110383ab427093c14a823ce2 (patch)
treed92e2259a59c742e0142eec49fd07fa4a3e5e476 /sharkd_session.c
parent01711ecfa67b5c59de24186dd1c0fa7a49f42100 (diff)
sharkd: add field checking in check request.
Change-Id: I5467dda6eaa931e0648ce178bf6412fcd1b9661c Reviewed-on: https://code.wireshark.org/review/29801 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Diffstat (limited to 'sharkd_session.c')
-rw-r--r--sharkd_session.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sharkd_session.c b/sharkd_session.c
index 416c835799..2db25846cd 100644
--- a/sharkd_session.c
+++ b/sharkd_session.c
@@ -3314,17 +3314,21 @@ sharkd_session_process_frame(char *buf, const jsmntok_t *tokens, int count)
*
* Input:
* (o) filter - filter to be checked
+ * (o) field - field to be checked
*
* Output object with attributes:
* (m) err - always 0
* (o) filter - 'ok', 'warn' or error message
+ * (o) field - 'ok', or 'notfound'
*/
static int
sharkd_session_process_check(char *buf, const jsmntok_t *tokens, int count)
{
const char *tok_filter = json_find_attr(buf, tokens, count, "filter");
+ const char *tok_field = json_find_attr(buf, tokens, count, "field");
printf("{\"err\":0");
+
if (tok_filter != NULL)
{
char *err_msg = NULL;
@@ -3348,6 +3352,13 @@ sharkd_session_process_check(char *buf, const jsmntok_t *tokens, int count)
}
}
+ if (tok_field != NULL)
+ {
+ header_field_info *hfi = proto_registrar_get_byname(tok_field);
+
+ printf(",\"field\":\"%s\"", (hfi) ? "ok" : "notfound");
+ }
+
printf("}\n");
return 0;
}