mirror of
https://github.com/strongswan/strongswan.git
synced 2025-12-04 00:00:21 -05:00
consistent display of strongSwan version
This commit is contained in:
parent
2b92fc9880
commit
ebde1a7ddd
@ -37,7 +37,6 @@ main(int argc, char *argv[])
|
|||||||
int opt;
|
int opt;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
int errflg = 0;
|
int errflg = 0;
|
||||||
const char *version = ipsec_version_code();
|
|
||||||
const char **notice = ipsec_copyright_notice();
|
const char **notice = ipsec_copyright_notice();
|
||||||
const char **co;
|
const char **co;
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ main(int argc, char *argv[])
|
|||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case 'v': /* version */
|
case 'v': /* version */
|
||||||
printf("%s %s\n", me, version);
|
printf("%s strongSwan "VERSION"\n", me);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
|
|||||||
@ -467,7 +467,7 @@ static bool initialize(private_daemon_t *this, bool syslog, level_t levels[])
|
|||||||
|
|
||||||
initialize_loggers(this, !syslog, levels);
|
initialize_loggers(this, !syslog, levels);
|
||||||
|
|
||||||
DBG1(DBG_DMN, "starting charon (strongSwan Version %s)", VERSION);
|
DBG1(DBG_DMN, "Starting IKEv2 charon daemon (strongSwan "VERSION")");
|
||||||
|
|
||||||
/* load secrets, ca certificates and crls */
|
/* load secrets, ca certificates and crls */
|
||||||
this->public.processor = processor_create();
|
this->public.processor = processor_create();
|
||||||
|
|||||||
@ -375,7 +375,7 @@ static void status(private_stroke_list_t *this, stroke_msg_t *msg, FILE *out, bo
|
|||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
u_int size, online, offline;
|
u_int size, online, offline;
|
||||||
|
|
||||||
fprintf(out, "Daemon status (charon "VERSION"):\n");
|
fprintf(out, "Status of IKEv2 charon daemon (strongSwan "VERSION"):\n");
|
||||||
fprintf(out, " uptime: %V, since %T\n", &now, &this->uptime, &this->uptime, FALSE);
|
fprintf(out, " uptime: %V, since %T\n", &now, &this->uptime, &this->uptime, FALSE);
|
||||||
fprintf(out, " worker threads: %d idle of %d,",
|
fprintf(out, " worker threads: %d idle of %d,",
|
||||||
charon->processor->get_idle_threads(charon->processor),
|
charon->processor->get_idle_threads(charon->processor),
|
||||||
|
|||||||
@ -7,7 +7,7 @@ libfreeswan_a_SOURCES = addrtoa.c addrtot.c addrtypeof.c anyaddr.c atoaddr.c ato
|
|||||||
pfkey.h pfkeyv2.h rangetosubnet.c sameaddr.c satoa.c \
|
pfkey.h pfkeyv2.h rangetosubnet.c sameaddr.c satoa.c \
|
||||||
satot.c subnetof.c subnettoa.c subnettot.c \
|
satot.c subnetof.c subnettoa.c subnettot.c \
|
||||||
subnettypeof.c ttoaddr.c ttodata.c ttoprotoport.c ttosa.c ttosubnet.c ttoul.c \
|
subnettypeof.c ttoaddr.c ttodata.c ttoprotoport.c ttosa.c ttosubnet.c ttoul.c \
|
||||||
ultoa.c ultot.c version.c
|
ultoa.c ultot.c
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
-I$(top_srcdir)/src/libstrongswan \
|
-I$(top_srcdir)/src/libstrongswan \
|
||||||
@ -15,5 +15,5 @@ INCLUDES = \
|
|||||||
|
|
||||||
dist_man3_MANS = anyaddr.3 atoaddr.3 atoasr.3 atosa.3 atoul.3 goodmask.3 initaddr.3 initsubnet.3 \
|
dist_man3_MANS = anyaddr.3 atoaddr.3 atoasr.3 atosa.3 atoul.3 goodmask.3 initaddr.3 initsubnet.3 \
|
||||||
keyblobtoid.3 portof.3 prng.3 rangetosubnet.3 sameaddr.3 subnetof.3 \
|
keyblobtoid.3 portof.3 prng.3 rangetosubnet.3 sameaddr.3 subnetof.3 \
|
||||||
ttoaddr.3 ttodata.3 ttosa.3 ttoul.3 version.3
|
ttoaddr.3 ttodata.3 ttosa.3 ttoul.3
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
#include "freeswan.h"
|
#include "freeswan.h"
|
||||||
|
|
||||||
static const char *co[] = {
|
static const char *co[] = {
|
||||||
"Copyright (C) 1999-2008 Henry Spencer, Richard Guy Briggs,",
|
"Copyright (C) 1999-2009 Henry Spencer, Richard Guy Briggs,",
|
||||||
" D. Hugh Redelmeier, Sandy Harris, Claudia Schmeing,",
|
" D. Hugh Redelmeier, Sandy Harris, Claudia Schmeing,",
|
||||||
" Michael Richardson, Angelos D. Keromytis, John Ioannidis,",
|
" Michael Richardson, Angelos D. Keromytis, John Ioannidis,",
|
||||||
"",
|
"",
|
||||||
|
|||||||
@ -218,8 +218,6 @@ unsigned long prng_count(struct prng *prng);
|
|||||||
void prng_final(struct prng *prng);
|
void prng_final(struct prng *prng);
|
||||||
|
|
||||||
/* odds and ends */
|
/* odds and ends */
|
||||||
const char *ipsec_version_code(void);
|
|
||||||
const char *ipsec_version_string(void);
|
|
||||||
const char **ipsec_copyright_notice(void);
|
const char **ipsec_copyright_notice(void);
|
||||||
|
|
||||||
const char *dns_string_rr(int rr, char *buf, int bufsize);
|
const char *dns_string_rr(int rr, char *buf, int bufsize);
|
||||||
|
|||||||
@ -1,43 +0,0 @@
|
|||||||
.TH IPSEC_VERSION 3 "21 Nov 2001"
|
|
||||||
.SH NAME
|
|
||||||
ipsec ipsec_version_code \- get IPsec version code
|
|
||||||
.br
|
|
||||||
ipsec ipsec_version_string \- get full IPsec version string
|
|
||||||
.br
|
|
||||||
ipsec ipsec_copyright_notice \- get IPsec copyright notice
|
|
||||||
.SH SYNOPSIS
|
|
||||||
.B "#include <freeswan.h>
|
|
||||||
.sp
|
|
||||||
.B "const char *ipsec_version_code(void);"
|
|
||||||
.br
|
|
||||||
.B "const char *ipsec_version_string(void);"
|
|
||||||
.br
|
|
||||||
.B "const char **ipsec_copyright_notice(void);"
|
|
||||||
.SH DESCRIPTION
|
|
||||||
These functions provide information on version numbering and copyright
|
|
||||||
of the Linux FreeS/WAN IPsec implementation.
|
|
||||||
.PP
|
|
||||||
.I Ipsec_version_code
|
|
||||||
returns a pointer to a string constant
|
|
||||||
containing the current IPsec version code,
|
|
||||||
such as ``1.92'' or ``snap2001Nov19b''.
|
|
||||||
.PP
|
|
||||||
.I Ipsec_version_string
|
|
||||||
returns a pointer to a string constant giving a full version identification,
|
|
||||||
consisting of the version code preceded by a prefix identifying the software,
|
|
||||||
e.g. ``Linux FreeS/WAN 1.92''.
|
|
||||||
.PP
|
|
||||||
.I Ipsec_copyright_notice
|
|
||||||
returns a pointer to a vector of pointers,
|
|
||||||
terminated by a
|
|
||||||
.BR NULL ,
|
|
||||||
which is the text of a suitable copyright notice.
|
|
||||||
Each pointer points to a string constant (possibly empty) which is one line
|
|
||||||
of the somewhat-verbose copyright notice.
|
|
||||||
The strings are NUL-terminated and do not contain a newline;
|
|
||||||
supplying suitable line termination for the output device is
|
|
||||||
the caller's responsibility.
|
|
||||||
.SH SEE ALSO
|
|
||||||
ipsec(8)
|
|
||||||
.SH HISTORY
|
|
||||||
Written for the FreeS/WAN project by Henry Spencer.
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* return IPsec version information
|
|
||||||
* Copyright (C) 2001 Henry Spencer.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Library General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or (at your
|
|
||||||
* option) any later version. See <http://www.fsf.org/copyleft/lgpl.txt>.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "freeswan.h"
|
|
||||||
|
|
||||||
static const char strongswan_number[] = VERSION;
|
|
||||||
static const char strongswan_string[] = "Linux strongSwan " VERSION;
|
|
||||||
|
|
||||||
/*
|
|
||||||
- ipsec_version_code - return IPsec version number/code, as string
|
|
||||||
*/
|
|
||||||
const char *
|
|
||||||
ipsec_version_code()
|
|
||||||
{
|
|
||||||
return strongswan_number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
- ipsec_version_string - return full version string
|
|
||||||
*/
|
|
||||||
const char *
|
|
||||||
ipsec_version_string()
|
|
||||||
{
|
|
||||||
return strongswan_string;
|
|
||||||
}
|
|
||||||
@ -577,7 +577,7 @@ adns_usage(const char *fmt, const char *arg)
|
|||||||
fprintf(stderr, "INTERNAL TO PLUTO: DO NOT EXECUTE\n");
|
fprintf(stderr, "INTERNAL TO PLUTO: DO NOT EXECUTE\n");
|
||||||
|
|
||||||
fprintf(stderr, fmt, arg);
|
fprintf(stderr, fmt, arg);
|
||||||
fprintf(stderr, "\n%s\n", ipsec_version_string());
|
fprintf(stderr, "\nstrongSwan "VERSION"\n");
|
||||||
|
|
||||||
for (; *sp != NULL; sp++)
|
for (; *sp != NULL; sp++)
|
||||||
fprintf(stderr, "%s\n", *sp);
|
fprintf(stderr, "%s\n", *sp);
|
||||||
|
|||||||
@ -850,7 +850,7 @@ void show_status(bool all, const char *name)
|
|||||||
{
|
{
|
||||||
if (all)
|
if (all)
|
||||||
{
|
{
|
||||||
whack_log(RC_COMMENT, "Daemon status (pluto "VERSION"):");
|
whack_log(RC_COMMENT, "Status of IKEv1 pluto daemon (strongSwan "VERSION"):");
|
||||||
show_ifaces_status();
|
show_ifaces_status();
|
||||||
show_myid_status();
|
show_myid_status();
|
||||||
show_loaded_plugins();
|
show_loaded_plugins();
|
||||||
|
|||||||
@ -137,11 +137,10 @@ static void usage(const char *mess)
|
|||||||
"[--nat_traversal] [--keep_alive <delay_sec>]"
|
"[--nat_traversal] [--keep_alive <delay_sec>]"
|
||||||
" \\\n\t"
|
" \\\n\t"
|
||||||
"[--force_keepalive] [--disable_port_floating]"
|
"[--force_keepalive] [--disable_port_floating]"
|
||||||
" \\\n\t"
|
" \\\n\t"
|
||||||
"[--virtual_private <network_list>]"
|
"[--virtual_private <network_list>]"
|
||||||
"\n"
|
"\n"
|
||||||
"strongSwan %s\n"
|
"strongSwan "VERSION"\n");
|
||||||
, ipsec_version_code());
|
|
||||||
exit_pluto(mess == NULL? 0 : 1);
|
exit_pluto(mess == NULL? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,8 +358,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
const char **sp = ipsec_copyright_notice();
|
const char **sp = ipsec_copyright_notice();
|
||||||
|
|
||||||
printf("%s%s\n", ipsec_version_string(),
|
printf("strongSwan "VERSION"%s\n", compile_time_interop_options);
|
||||||
compile_time_interop_options);
|
|
||||||
for (; *sp != NULL; sp++)
|
for (; *sp != NULL; sp++)
|
||||||
puts(*sp);
|
puts(*sp);
|
||||||
}
|
}
|
||||||
@ -636,9 +634,8 @@ int main(int argc, char **argv)
|
|||||||
/* Note: some scripts may look for this exact message -- don't change
|
/* Note: some scripts may look for this exact message -- don't change
|
||||||
* ipsec barf was one, but it no longer does.
|
* ipsec barf was one, but it no longer does.
|
||||||
*/
|
*/
|
||||||
plog("Starting Pluto (strongSwan Version %s%s)"
|
plog("Starting IKEv1 pluto daemon (strongSwan "VERSION")%s",
|
||||||
, ipsec_version_code()
|
compile_time_interop_options);
|
||||||
, compile_time_interop_options);
|
|
||||||
|
|
||||||
/* load plugins, further infrastructure may need it */
|
/* load plugins, further infrastructure may need it */
|
||||||
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
|
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
|
||||||
|
|||||||
@ -275,7 +275,7 @@ int main (int argc, char **argv)
|
|||||||
signal(SIGALRM, fsig);
|
signal(SIGALRM, fsig);
|
||||||
signal(SIGUSR1, fsig);
|
signal(SIGUSR1, fsig);
|
||||||
|
|
||||||
plog("Starting strongSwan %s IPsec [starter]...", ipsec_version_code());
|
plog("Starting strongSwan "VERSION" IPsec [starter]...");
|
||||||
|
|
||||||
/* verify that we can start */
|
/* verify that we can start */
|
||||||
if (getuid() != 0)
|
if (getuid() != 0)
|
||||||
|
|||||||
@ -230,8 +230,7 @@ static void help(void)
|
|||||||
"shutdown: whack"
|
"shutdown: whack"
|
||||||
" --shutdown"
|
" --shutdown"
|
||||||
"\n\n"
|
"\n\n"
|
||||||
"strongSwan %s\n"
|
"strongSwan "VERSION"\n");
|
||||||
, ipsec_version_code());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *label = NULL; /* --label operand, saved for diagnostics */
|
static const char *label = NULL; /* --label operand, saved for diagnostics */
|
||||||
@ -1004,7 +1003,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
const char **sp = ipsec_copyright_notice();
|
const char **sp = ipsec_copyright_notice();
|
||||||
|
|
||||||
printf("%s\n", ipsec_version_string());
|
printf("strongSwan "VERSION"\n");
|
||||||
for (; *sp != NULL; sp++)
|
for (; *sp != NULL; sp++)
|
||||||
puts(*sp);
|
puts(*sp);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user