// Copy data into the buffer.
-char *buffer_add(buffer_t *buffer, const char *data, int size) {
+void buffer_add(buffer_t *buffer, const char *data, int size) {
memcpy(buffer_prepare(buffer, size), data, size);
}
extern void buffer_compact(buffer_t *buffer);
extern char *buffer_prepare(buffer_t *buffer, int size);
-extern char *buffer_add(buffer_t *buffer, const char *data, int size);
+extern void buffer_add(buffer_t *buffer, const char *data, int size);
extern char *buffer_readline(buffer_t *buffer);
extern char *buffer_read(buffer_t *buffer, int size);
extern void buffer_clear(buffer_t *buffer);
}
bool receive_meta(connection_t *c) {
- int inlen, reqlen;
+ int inlen;
char inbuf[MAXBUFSIZE];
char *bufp = inbuf, *endp;
extern node_t *lookup_node(char *);
extern node_t *lookup_node_udp(const sockaddr_t *);
extern bool dump_nodes(struct connection_t *);
+extern bool dump_traffic(struct connection_t *);
extern void update_node_udp(node_t *, const sockaddr_t *);
#endif /* __TINC_NODE_H__ */
}
bool do_graph = false;
- int dumps = 1;
if(!strcasecmp(argv[optind+1], "nodes"))
sendline(fd, "%d %d", CONTROL, REQ_DUMP_NODES);
sendline(fd, "%d %d", CONTROL, REQ_DUMP_NODES);
sendline(fd, "%d %d", CONTROL, REQ_DUMP_EDGES);
do_graph = true;
- dumps = 2;
printf("digraph {\n");
} else {
fprintf(stderr, "Unknown dump type '%s'.\n", argv[optind+1]);