diff options
Diffstat (limited to 'src/stroke')
-rw-r--r-- | src/stroke/stroke.c | 12 | ||||
-rw-r--r-- | src/stroke/stroke_keywords.h | 1 | ||||
-rw-r--r-- | src/stroke/stroke_keywords.txt | 1 | ||||
-rw-r--r-- | src/stroke/stroke_msg.h | 2 |
4 files changed, 16 insertions, 0 deletions
diff --git a/src/stroke/stroke.c b/src/stroke/stroke.c index 2c5a03d77..6dbaf6464 100644 --- a/src/stroke/stroke.c +++ b/src/stroke/stroke.c @@ -326,6 +326,15 @@ static int leases(stroke_keyword_t kw, char *pool, char *address) return send_stroke_msg(&msg); } +static int memusage() +{ + stroke_msg_t msg; + + msg.type = STR_MEMUSAGE; + msg.length = offsetof(stroke_msg_t, buffer); + return send_stroke_msg(&msg); +} + static int set_loglevel(char *type, u_int level) { stroke_msg_t msg; @@ -530,6 +539,9 @@ int main(int argc, char *argv[]) res = leases(token->kw, argc > 2 ? argv[2] : NULL, argc > 3 ? argv[3] : NULL); break; + case STROKE_MEMUSAGE: + res = memusage(); + break; default: exit_usage(NULL); } diff --git a/src/stroke/stroke_keywords.h b/src/stroke/stroke_keywords.h index ff2ba36ef..dd00dc24c 100644 --- a/src/stroke/stroke_keywords.h +++ b/src/stroke/stroke_keywords.h @@ -54,6 +54,7 @@ typedef enum { STROKE_PURGE_IKE, STROKE_EXPORT_X509, STROKE_LEASES, + STROKE_MEMUSAGE, } stroke_keyword_t; #define STROKE_LIST_FIRST STROKE_LIST_PUBKEYS diff --git a/src/stroke/stroke_keywords.txt b/src/stroke/stroke_keywords.txt index dafd1ab08..f87b15769 100644 --- a/src/stroke/stroke_keywords.txt +++ b/src/stroke/stroke_keywords.txt @@ -61,3 +61,4 @@ purgecerts, STROKE_PURGE_CERTS purgeike, STROKE_PURGE_IKE exportx509, STROKE_EXPORT_X509 leases, STROKE_LEASES +memusage, STROKE_MEMUSAGE diff --git a/src/stroke/stroke_msg.h b/src/stroke/stroke_msg.h index 9800d4319..2fbacecf7 100644 --- a/src/stroke/stroke_msg.h +++ b/src/stroke/stroke_msg.h @@ -212,6 +212,8 @@ struct stroke_msg_t { STR_LEASES, /* export credentials */ STR_EXPORT, + /* print memory usage details */ + STR_MEMUSAGE, /* more to come */ } type; |