summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ftp-proxy/ftp-proxy.c
diff options
context:
space:
mode:
authorcamield <camield@openbsd.org>2005-06-07 04:37:32 +0000
committercamield <camield@openbsd.org>2005-06-07 04:37:32 +0000
commit867a6359887874012df9b4cc9a930ea99bdd49e5 (patch)
treea9474b77fbb1a6f7e6fbf4a1639ac95beb26c755 /usr.sbin/ftp-proxy/ftp-proxy.c
parent-netccitt/ (diff)
downloadwireguard-openbsd-867a6359887874012df9b4cc9a930ea99bdd49e5.tar.xz
wireguard-openbsd-867a6359887874012df9b4cc9a930ea99bdd49e5.zip
Introduce verbose option to control the logging of the pf rules.
ok beck mpf
Diffstat (limited to 'usr.sbin/ftp-proxy/ftp-proxy.c')
-rw-r--r--usr.sbin/ftp-proxy/ftp-proxy.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/ftp-proxy/ftp-proxy.c b/usr.sbin/ftp-proxy/ftp-proxy.c
index dfefecd925b..2c7c2c2109d 100644
--- a/usr.sbin/ftp-proxy/ftp-proxy.c
+++ b/usr.sbin/ftp-proxy/ftp-proxy.c
@@ -115,7 +115,7 @@ struct sockaddr_storage fixed_server_ss, fixed_proxy_ss;
char *fixed_server, *fixed_server_port, *fixed_proxy, *listen_ip, *listen_port,
*qname;
int anonymous_only, caught_sig, daemonize, id_count, ipv6_mode, loglevel,
- max_sessions, rfc_mode, session_count, timeout;
+ max_sessions, rfc_mode, session_count, timeout, verbose;
extern char *__progname;
void
@@ -594,12 +594,13 @@ main(int argc, char *argv[])
qname = NULL;
rfc_mode = 0;
timeout = 24 * 3600;
+ verbose = 0;
/* Other initialization. */
id_count = 1;
session_count = 0;
- while ((ch = getopt(argc, argv, "6Aa:b:D:dm:P:p:q:R:rt:")) != -1) {
+ while ((ch = getopt(argc, argv, "6Aa:b:D:dm:P:p:q:R:rt:v")) != -1) {
switch (ch) {
case '6':
ipv6_mode = 1;
@@ -648,6 +649,11 @@ main(int argc, char *argv[])
if (timeout < 0)
errx(1, "bad timeout");
break;
+ case 'v':
+ verbose++;
+ if (verbose > 2)
+ usage();
+ break;
default:
usage();
}
@@ -718,7 +724,7 @@ main(int argc, char *argv[])
freeaddrinfo(res);
/* Initialize pf. */
- init_filter(qname);
+ init_filter(qname, verbose);
if (daemonize) {
if (daemon(0, 0) == -1)
@@ -1085,7 +1091,7 @@ sock_ntop(struct sockaddr *sa)
void
usage(void)
{
- fprintf(stderr, "usage: %s [-6Adr] [-a address] [-b address]"
+ fprintf(stderr, "usage: %s [-6Adrv] [-a address] [-b address]"
" [-D level] [-m maxsessions]\n [-P port]"
" [-p port] [-q queue] [-R address] [-t timeout]\n", __progname);
exit(1);