summaryrefslogtreecommitdiffstats
path: root/src/status.c
diff options
context:
space:
mode:
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);