diff options
author | Martin Willi <martin@strongswan.org> | 2006-04-27 07:24:04 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-04-27 07:24:04 +0000 |
commit | e168ee1785eff740af1e5b6db635bdc7bda010fa (patch) | |
tree | 5db6ebde12654e76be5171548db8334791dcb896 /Source/stroke/stroke.c | |
parent | 108b489f88ae4388c1eada3dfe8cceaba6adde85 (diff) | |
download | strongswan-e168ee1785eff740af1e5b6db635bdc7bda010fa.tar.bz2 strongswan-e168ee1785eff740af1e5b6db635bdc7bda010fa.tar.xz |
- add connection names to connections
- stroke status / ipsec status shows them
- added statusall for stroke
- added status by connection name
- some tests repaired, more to come
Diffstat (limited to 'Source/stroke/stroke.c')
-rw-r--r-- | Source/stroke/stroke.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/stroke/stroke.c b/Source/stroke/stroke.c index e4876ced0..9ecda0413 100644 --- a/Source/stroke/stroke.c +++ b/Source/stroke/stroke.c @@ -146,13 +146,21 @@ static int terminate_connection(char *name) return res; } -static int show_status() +static int show_status(char *mode, char *connection) { stroke_msg_t *msg = malloc(sizeof(stroke_msg_t)); int res; msg->length = sizeof(stroke_msg_t); - msg->type = STR_STATUS; + if (strcmp(mode, "statusall") == 0) + { + msg->type = STR_STATUS_ALL; + } + else + { + msg->type = STR_STATUS; + } + msg->status.name = push_string(&msg, connection); res = send_stroke_msg(msg); free(msg); return res; @@ -240,7 +248,7 @@ int main(int argc, char *argv[]) if (strcmp(argv[1], "status") == 0 || strcmp(argv[1], "statusall") == 0) { - res = show_status(); + res = show_status(argv[1], argc > 2 ? argv[2] : NULL); } else if (strcmp(argv[1], "up") == 0) |