X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fcontrol.c;h=19ac37a4dd23857200ccd4ca84e91314086afc81;hp=7b27f69afe8f4f956b88cc4298febe553e5da37d;hb=6eaefb4dbce240334e35f67d9f3db5d4f44e49c9;hpb=50ad3f2a895c38f8d546f87490ca96ab7d9e011e diff --git a/src/control.c b/src/control.c index 7b27f69a..19ac37a4 100644 --- a/src/control.c +++ b/src/control.c @@ -62,11 +62,41 @@ static void handle_control_data(struct bufferevent *event, void *data) { } if(req.type == REQ_STOP) { - logger(LOG_NOTICE, _("Got stop command")); + logger(LOG_NOTICE, _("Got '%s' command"), "stop"); event_loopexit(NULL); goto respond; } + if(req.type == REQ_DUMP_NODES) { + logger(LOG_NOTICE, _("Got '%s' command"), "dump nodes"); + res.res_errno = dump_nodes(res_data); + goto respond; + } + + if(req.type == REQ_DUMP_EDGES) { + logger(LOG_NOTICE, _("Got '%s' command"), "dump edges"); + res.res_errno = dump_edges(res_data); + goto respond; + } + + if(req.type == REQ_DUMP_SUBNETS) { + logger(LOG_NOTICE, _("Got '%s' command"), "dump subnets"); + res.res_errno = dump_subnets(res_data); + goto respond; + } + + if(req.type == REQ_DUMP_CONNECTIONS) { + logger(LOG_NOTICE, _("Got '%s' command"), "dump connections"); + res.res_errno = dump_connections(res_data); + goto respond; + } + + if(req.type == REQ_DUMP_GRAPH) { + logger(LOG_NOTICE, _("Got '%s' command"), "dump graph"); + res.res_errno = dump_graph(res_data); + goto respond; + } + logger(LOG_DEBUG, _("Malformed control command received")); res.res_errno = EINVAL;