mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-08 00:02:03 -04:00
Show what kind of *Swan we run in "ipsec status"
This commit is contained in:
parent
b31a56f128
commit
137035cc78
@ -50,6 +50,11 @@ struct private_stroke_list_t {
|
|||||||
*/
|
*/
|
||||||
stroke_list_t public;
|
stroke_list_t public;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kind of *swan we run
|
||||||
|
*/
|
||||||
|
char *swan;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* timestamp of daemon start
|
* timestamp of daemon start
|
||||||
*/
|
*/
|
||||||
@ -440,8 +445,10 @@ METHOD(stroke_list_t, status, void,
|
|||||||
now = time_monotonic(NULL);
|
now = time_monotonic(NULL);
|
||||||
since = time(NULL) - (now - this->uptime);
|
since = time(NULL) - (now - this->uptime);
|
||||||
|
|
||||||
fprintf(out, "Status of IKE charon daemon (strongSwan "VERSION"):\n");
|
fprintf(out, "Status of IKE charon daemon (%sSwan "VERSION"):\n",
|
||||||
fprintf(out, " uptime: %V, since %T\n", &now, &this->uptime, &since, FALSE);
|
this->swan);
|
||||||
|
fprintf(out, " uptime: %V, since %T\n", &now, &this->uptime, &since,
|
||||||
|
FALSE);
|
||||||
#ifdef HAVE_MALLINFO
|
#ifdef HAVE_MALLINFO
|
||||||
{
|
{
|
||||||
struct mallinfo mi = mallinfo();
|
struct mallinfo mi = mallinfo();
|
||||||
@ -1493,16 +1500,22 @@ stroke_list_t *stroke_list_create(stroke_attribute_t *attribute)
|
|||||||
|
|
||||||
INIT(this,
|
INIT(this,
|
||||||
.public = {
|
.public = {
|
||||||
|
|
||||||
.list = _list,
|
.list = _list,
|
||||||
.status = _status,
|
.status = _status,
|
||||||
.leases = _leases,
|
.leases = _leases,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
.uptime = time_monotonic(NULL),
|
.uptime = time_monotonic(NULL),
|
||||||
|
.swan = "strong",
|
||||||
.attribute = attribute,
|
.attribute = attribute,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (lib->settings->get_bool(lib->settings,
|
||||||
|
"charon.i_dont_care_about_security_and_use_aggressive_mode_psk", FALSE))
|
||||||
|
{
|
||||||
|
this->swan = "weak";
|
||||||
|
}
|
||||||
|
|
||||||
return &this->public;
|
return &this->public;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user