Use a more terse, but with more dynamic information version string.

This commit is contained in:
Nikos Mavrogiannopoulos
2014-06-23 21:09:22 +02:00
parent 0629345022
commit 4117bf2661
2 changed files with 35 additions and 0 deletions

View File

@@ -797,6 +797,39 @@ unsigned i;
return; return;
} }
void print_version(tOptions *opts, tOptDesc *desc)
{
const char *p;
fputs(OCSERV_FULL_VERSION, stderr);
fprintf(stderr, "\n\nCompiled with ");
#ifdef HAVE_LIBSECCOMP
fprintf(stderr, "seccomp, ");
#endif
#ifdef HAVE_LIBWRAP
fprintf(stderr, "tcp-wrappers, ");
#endif
#ifdef HAVE_PAM
fprintf(stderr, "PAM, ");
#endif
#ifdef HAVE_PKCS11
fprintf(stderr, "PKCS#11, ");
#endif
#ifdef ANYCONNECT_CLIENT_COMPAT
fprintf(stderr, "AnyConnect, ");
#endif
fprintf(stderr, "\n");
p = gnutls_check_version(NULL);
if (strcmp(p, GNUTLS_VERSION) != 0) {
fprintf(stderr, "GnuTLS version: %s (compiled with %s)\n", p, GNUTLS_VERSION);
} else {
fprintf(stderr, "GnuTLS version: %s\n", p);
}
exit(0);
}
void reload_cfg_file(void *pool, struct cfg_st* config) void reload_cfg_file(void *pool, struct cfg_st* config)
{ {
clear_cfg_file(config); clear_cfg_file(config);

View File

@@ -12,6 +12,8 @@ short-usage = "Usage: ocserv [options] -c [config]\nocserv --help for usage in
explain = ""; explain = "";
#include version.inc #include version.inc
version-proc = "print_version";
detail = "Openconnect VPN server (ocserv) is a VPN server compatible with the detail = "Openconnect VPN server (ocserv) is a VPN server compatible with the
openconnect VPN client. It follows the AnyConnect VPN protocol which openconnect VPN client. It follows the AnyConnect VPN protocol which
is used by several CISCO routers. is used by several CISCO routers.