]> git.meshlink.io Git - meshlink/blobdiff - src/control.c
Add the ability to dump all traffic going through route() over a control connection.
[meshlink] / src / control.c
index b8e5204b9db0a58d6e1b2e2fbe1bd1f6d82a01f8..e03e67da0045131268f893893015eb5b096962eb 100644 (file)
 #include "control_common.h"
 #include "graph.h"
 #include "logger.h"
+#include "meta.h"
+#include "net.h"
 #include "protocol.h"
+#include "route.h"
+#include "splay_tree.h"
 #include "utils.h"
 #include "xalloc.h"
 
@@ -113,6 +117,14 @@ bool control_h(connection_t *c, char *request) {
                        return control_return(c, REQ_DISCONNECT, found ? 0 : -2);
                }
 
+               case REQ_DUMP_TRAFFIC:
+                       return dump_traffic(c);
+
+               case REQ_PCAP:
+                       c->status.pcap = true;
+                       pcap = true;
+                       return true;
+
                default:
                        return send_request(c, "%d %d", CONTROL, REQ_INVALID);
        }