summaryrefslogtreecommitdiffstats
path: root/src/status.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-09 19:35:06 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-09 19:35:06 +0200
commitbcc60920ca4881b4e7c3eb42c55c72cca61562b5 (patch)
treef70f1d8ea93f38db0e542c826560e77a62a33c5f /src/status.c
parentde7f8c4765faa3f5cdc4ed440dfcec8d91130994 (diff)
downloadfastd-bcc60920ca4881b4e7c3eb42c55c72cca61562b5.tar
fastd-bcc60920ca4881b4e7c3eb42c55c72cca61562b5.zip
Add current method of connections to status output
Diffstat (limited to 'src/status.c')
-rw-r--r--src/status.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/status.c b/src/status.c
index 4b4131d..8049f59 100644
--- a/src/status.c
+++ b/src/status.c
@@ -30,14 +30,16 @@
*/
-#include "peer.h"
+#include "types.h"
#ifdef WITH_STATUS_SOCKET
-#include <sys/un.h>
+#include "method.h"
+#include "peer.h"
#include <json.h>
+#include <sys/un.h>
/** Argument for dump_thread */
@@ -98,6 +100,15 @@ static json_object * dump_peer(const fastd_peer_t *peer) {
if (fastd_peer_is_established(peer)) {
connection = json_object_new_object();
+ struct json_object *method = NULL;
+
+ const fastd_method_info_t *method_info = conf.protocol->get_current_method(peer);
+
+ if (method_info)
+ method = json_object_new_string(method_info->name);
+
+ json_object_object_add(connection, "method", method);
+
if (conf.mode == MODE_TAP) {
struct json_object *mac_addresses = json_object_new_array();
json_object_object_add(connection, "mac_addresses", mac_addresses);