fprintf(stderr, " -d, --daemonize Start as a daemon.\n");
fprintf(stderr, " -C, --control-port URL Control port listening.\n");
fprintf(stderr, " -D, --data-port URL Data port listening.\n");
+ fprintf(stderr, " -L, --live-port URL Live view port listening.\n");
fprintf(stderr, " -o, --output PATH Output path for traces. Must use an absolute path.\n");
fprintf(stderr, " -v, --verbose Verbose mode. Activate DBG() macro.\n");
fprintf(stderr, " -g, --group NAME Specify the tracing group name. (default: tracing)\n");
while (1) {
int option_index = 0;
- c = getopt_long(argc, argv, "dhv" "C:D:o:g:",
+ c = getopt_long(argc, argv, "dhv" "C:D:L:o:g:",
long_options, &option_index);
if (c == -1) {
break;
data_uri->port = DEFAULT_NETWORK_DATA_PORT;
}
break;
+ case 'L':
+ ret = uri_parse(optarg, &live_uri);
+ if (ret < 0) {
+ ERR("Invalid live URI specified");
+ goto exit;
+ }
+ if (live_uri->port == 0) {
+ live_uri->port = DEFAULT_NETWORK_VIEWER_PORT;
+ }
+ break;
case 'd':
opt_daemon = 1;
break;
uri_free(control_uri);
uri_free(data_uri);
+ /* Live URI is freed in the live thread. */
}
/*
/* Check if daemon is UID = 0 */
if (relayd_uid == 0) {
- if (control_uri->port < 1024 || data_uri->port < 1024) {
+ if (control_uri->port < 1024 || data_uri->port < 1024 ||
+ live_uri->port < 1024) {
ERR("Need to be root to use ports < 1024");
ret = -1;
goto exit;