const char *opt_privdrop_user = NULL;
static void cb_user(const char *arg) { opt_privdrop_user = arg; }
const char *opt_privdrop_user = NULL;
static void cb_user(const char *arg) { opt_privdrop_user = arg; }
-const char *daylog_fn = NULL;
-static void cb_daylog(const char *arg)
-{
- if (opt_chroot_dir == NULL)
- errx(1, "the daylog file is relative to the chroot.\n"
- "You must specify a --chroot dir before you can use --daylog.");
- else
- daylog_fn = arg;
-}
+const char *opt_daylog_fn = NULL;
+static void cb_daylog(const char *arg) { opt_daylog_fn = arg; }
-static void cb_import(const char *arg)
-{
- if (opt_chroot_dir == NULL)
- errx(1, "the import file is relative to the chroot.\n"
- "You must specify a --chroot dir before you can use --import.");
- else
- import_fn = arg;
-}
+static void cb_import(const char *arg) { import_fn = arg; }
-static void cb_export(const char *arg)
-{
- if ((opt_chroot_dir == NULL) && (opt_capfile == NULL))
- errx(1, "the export file is relative to the chroot.\n"
- "You must specify a --chroot dir before you can use --export.");
- else
- export_fn = arg;
-}
+static void cb_export(const char *arg) { export_fn = arg; }
-static void cb_pidfile(const char *arg)
-{
- if (opt_chroot_dir == NULL)
- errx(1, "the pidfile is relative to the chroot.\n"
- "You must specify a --chroot dir before you can use --pidfile.");
- else
- pid_fn = arg;
-}
+static void cb_pidfile(const char *arg) { pid_fn = arg; }
{"-p", "port", cb_port, 0},
{"-b", "bindaddr", cb_bindaddr, -1},
{"-l", "network/netmask", cb_local, 0},
{"-p", "port", cb_port, 0},
{"-b", "bindaddr", cb_bindaddr, -1},
{"-l", "network/netmask", cb_local, 0},
{"--local-only", NULL, cb_local_only, 0},
{"--snaplen", "bytes", cb_snaplen, 0},
{"--pppoe", NULL, cb_pppoe, 0},
{"--local-only", NULL, cb_local_only, 0},
{"--snaplen", "bytes", cb_snaplen, 0},
{"--pppoe", NULL, cb_pppoe, 0},
- (unsigned long long)acct_total_packets,
- (unsigned long long)acct_total_bytes);
+ (llu)acct_total_packets,
+ (llu)acct_total_bytes);
/* do this first as it forks - minimize memory use */
if (opt_want_dns) dns_init(opt_privdrop_user);
cap_start(opt_want_promisc); /* needs root */
/* do this first as it forks - minimize memory use */
if (opt_want_dns) dns_init(opt_privdrop_user);
cap_start(opt_want_promisc); /* needs root */