aboutsummaryrefslogtreecommitdiffstats
path: root/sharkd_session.c
diff options
context:
space:
mode:
authorPaul Offord <paul.offord58@gmail.com>2021-02-08 10:27:18 +0000
committerWireshark GitLab Utility <6629907-ws-gitlab-utility@users.noreply.gitlab.com>2021-02-08 10:27:18 +0000
commit69df23fc40951556d2f9f303944f943547c31ac0 (patch)
treeabd4a8e28cd934e79a706432ec5a313d16f888dd /sharkd_session.c
parent37bef583dac539dd66e50c9f34a46563928356d2 (diff)
sharkd: Add configuration profile and other options
This change adds code to allow the selection of a configuration profile during sharkd start by adding a -C command line option. A new -a option has been added to specify the api service endpoint e.g. tcp:127.0.0.1:4446 The change also adds version display (-v) and help display (-h) options. These additions have been made in a way to ensure that the original command line options still work correctly to maintain backward compatibility. The new options have been added using the getopt_long(...) function that is used by tshark to simplify the addition of further command line options. Closes #17222
Diffstat (limited to 'sharkd_session.c')
-rw-r--r--sharkd_session.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sharkd_session.c b/sharkd_session.c
index dfb7945e1e..653bcdf840 100644
--- a/sharkd_session.c
+++ b/sharkd_session.c
@@ -80,6 +80,9 @@ struct sharkd_filter_item
static GHashTable *filter_table = NULL;
+static int mode;
+gboolean extended_log = FALSE;
+
static json_dumper dumper = {0};
static const char *
@@ -4251,12 +4254,14 @@ sharkd_session_process(char *buf, const jsmntok_t *tokens, int count)
}
int
-sharkd_session_main(void)
+sharkd_session_main(int mode_setting)
{
char buf[2 * 1024];
jsmntok_t *tokens = NULL;
int tokens_max = -1;
+ mode = mode_setting;
+
fprintf(stderr, "Hello in child.\n");
dumper.output_file = stdout;