diff --git a/doc/Makefile.am b/doc/Makefile.am index f0bc9017..a574765e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -2,13 +2,18 @@ EXTRA_DIST = design.dia sample.config scripts/ocserv-script sample.passwd \ systemd/ocserv.service systemd/ocserv.socket \ dbus/org.infradead.ocserv.conf -dist_man_MANS = ocserv.8 ocpasswd.8 +dist_man_MANS = ocserv.8 ocpasswd.8 occtl.8 ocserv.8: ../src/ocserv-args.def -sed 's/@subheading \(.*\)/@*\n@var{\1}\n@*/' $< > "$<".tmp && \ @AUTOGEN@ -L../src -DMAN_SECTION=8 -Tagman-cmd.tpl "$<".tmp && \ rm -f "$<".tmp +occtl.8: ../src/occtl-args.def + -sed 's/@subheading \(.*\)/@*\n@var{\1}\n@*/' $< > "$<".tmp && \ + @AUTOGEN@ -L../src -DMAN_SECTION=8 -Tagman-cmd.tpl "$<".tmp && \ + rm -f "$<".tmp + ocpasswd.8: ../src/ocpasswd-args.def -sed 's/@subheading \(.*\)/@*\n@var{\1}\n@*/' $< > "$<".tmp && \ @AUTOGEN@ -L../src -DMAN_SECTION=8 -Tagman-cmd.tpl "$<".tmp && \ diff --git a/src/Makefile.am b/src/Makefile.am index 702316e6..33e7b76b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,6 +4,7 @@ AM_CPPFLAGS = -I$(srcdir)/../gl/ -I$(builddir)/../gl/ \ -I$(srcdir)/ -I$(builddir)/../ $(LIBOPTS_CFLAGS) \ $(LIBPROTOBUF_C_CFLAGS) $(LIBDBUS_CFLAGS) +EXTRA_DIST = occtl-args.def BUILT_SOURCES = ocpasswd-args.c ocpasswd-args.h \ ocserv-args.c ocserv-args.h ipc.pb-c.c ipc.pb-c.h diff --git a/src/occtl-args.def b/src/occtl-args.def new file mode 100644 index 00000000..608a0b37 --- /dev/null +++ b/src/occtl-args.def @@ -0,0 +1,60 @@ +AutoGen Definitions options; +prog-name = occtl; +prog-title = "OpenConnect VPN server control"; +prog-desc = "OpenConnect VPN server control."; +disable-save; +no-xlate = opt; +gnu-usage; +config-header = config.h; +long-opts; +no-misuse-usage; +short-usage = "Usage: occtl [options] [command]\nocctl --help for usage instructions.\n"; +explain = ""; +#include version.inc + +detail = "Openconnect VPN server control (occtl) is a tool to control +the ocserv VPN server. It uses D-BUS to connect to ocserv."; + +copyright = { + date = "2014"; + owner = "Red Hat"; + author = "Nikos Mavrogiannopoulos"; + eaddr = "openconnect-devel@lists.infradead.org"; + type = gplv2; +}; + +help-value = h; + + +doc-section = { + ds-type = 'SYNOPSIS'; + ds-format = 'texi'; + ds-text = <<-_EOT_ +Openconnect VPN server control (occtl) is a tool to control +the ocserv VPN server. It uses D-BUS to connect to ocserv. +_EOT_; +}; + +doc-section = { + ds-type = 'DESCRIPTION'; + ds-format = 'texi'; + ds-text = <<-_EOT_ +This a control tool that can be used to send commands to ocserv. When +called without any arguments the tool can be used interactively, where +each command is entered on a command prompt; alternatively the tool +can be called with the command specified as parameter. In the latter +case the tool's exit code will reflect the successful execution of +the command. +_EOT_; +}; + +doc-section = { + ds-type = 'IMPLEMENTATION NOTES'; + ds-format = 'texi'; + ds-text = <<-_EOT_ +This tool uses D-BUS to connect to ocserv thus the D-BUS access controls +should be used to prevent potentially dangerous commands to be sent +to ocserv by unprivileged users. +_EOT_; +}; + diff --git a/src/occtl-cache.c b/src/occtl-cache.c index 5ceb4964..7c46250b 100644 --- a/src/occtl-cache.c +++ b/src/occtl-cache.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Red Hat + * Copyright (C) 2014 Red Hat * * Author: Nikos Mavrogiannopoulos * diff --git a/src/occtl-pager.c b/src/occtl-pager.c index 3c6482fd..d5ee2d6d 100644 --- a/src/occtl-pager.c +++ b/src/occtl-pager.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Red Hat + * Copyright (C) 2014 Red Hat * * Author: Nikos Mavrogiannopoulos * diff --git a/src/occtl-time.c b/src/occtl-time.c index d841f9e3..162da5b8 100644 --- a/src/occtl-time.c +++ b/src/occtl-time.c @@ -7,7 +7,7 @@ * Michael K. Johnson. * * Changes by Albert Cahalan, 2002. - * Modified for occtl by Nikos Mavrogiannopoulos, 2013. + * Modified for occtl by Nikos Mavrogiannopoulos, 2014. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/occtl.c b/src/occtl.c index 843883cf..fe3746db 100644 --- a/src/occtl.c +++ b/src/occtl.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Red Hat + * Copyright (C) 2014 Red Hat * * Author: Nikos Mavrogiannopoulos *