From: Martin Willi Date: Wed, 13 Jun 2012 10:11:55 +0000 (+0200) Subject: Show what kind of *Swan we run in "ipsec status" X-Git-Tag: 5.0.0~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=137035cc783809421d3e75b76d4df3683c839b68;p=thirdparty%2Fstrongswan.git Show what kind of *Swan we run in "ipsec status" --- diff --git a/src/libcharon/plugins/stroke/stroke_list.c b/src/libcharon/plugins/stroke/stroke_list.c index 88523ea46b..37970f6caf 100644 --- a/src/libcharon/plugins/stroke/stroke_list.c +++ b/src/libcharon/plugins/stroke/stroke_list.c @@ -50,6 +50,11 @@ struct private_stroke_list_t { */ stroke_list_t public; + /** + * Kind of *swan we run + */ + char *swan; + /** * timestamp of daemon start */ @@ -440,8 +445,10 @@ METHOD(stroke_list_t, status, void, now = time_monotonic(NULL); since = time(NULL) - (now - this->uptime); - fprintf(out, "Status of IKE charon daemon (strongSwan "VERSION"):\n"); - fprintf(out, " uptime: %V, since %T\n", &now, &this->uptime, &since, FALSE); + fprintf(out, "Status of IKE charon daemon (%sSwan "VERSION"):\n", + this->swan); + fprintf(out, " uptime: %V, since %T\n", &now, &this->uptime, &since, + FALSE); #ifdef HAVE_MALLINFO { struct mallinfo mi = mallinfo(); @@ -1493,16 +1500,22 @@ stroke_list_t *stroke_list_create(stroke_attribute_t *attribute) INIT(this, .public = { - .list = _list, .status = _status, .leases = _leases, .destroy = _destroy, }, .uptime = time_monotonic(NULL), + .swan = "strong", .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; }