mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-21 22:17:53 +00:00
Log more debug in MDP_ROUTE_TABLE request
This commit is contained in:
parent
3cbf60f2b7
commit
9ef7d33d69
@ -1126,6 +1126,7 @@ static void send_route(
|
|||||||
static int routing_table(void **record, void *context)
|
static int routing_table(void **record, void *context)
|
||||||
{
|
{
|
||||||
struct subscriber *subscriber = *record;
|
struct subscriber *subscriber = *record;
|
||||||
|
DEBUGF(mdprequests, " subscriber sid=%s reachable=%s", alloca_tohex_sid_t(subscriber->sid), alloca_reachable_flags(subscriber->reachable));
|
||||||
if (subscriber->reachable != REACHABLE_NONE){
|
if (subscriber->reachable != REACHABLE_NONE){
|
||||||
struct routing_state *state = (struct routing_state *)context;
|
struct routing_state *state = (struct routing_state *)context;
|
||||||
if ((subscriber->reachable & REACHABLE_SELF) == 0 || subscriber != get_my_subscriber(0)){
|
if ((subscriber->reachable & REACHABLE_SELF) == 0 || subscriber != get_my_subscriber(0)){
|
||||||
@ -1597,7 +1598,7 @@ static void mdp_process_packet(struct socket_address *client, struct mdp_header
|
|||||||
mdp_interface_packet(client, header, payload);
|
mdp_interface_packet(client, header, payload);
|
||||||
break;
|
break;
|
||||||
case MDP_ROUTE_TABLE:
|
case MDP_ROUTE_TABLE:
|
||||||
DEBUGF(mdprequests, "Processing MDP_ROUTING_TABLE from %s", alloca_socket_address(client));
|
DEBUGF(mdprequests, "Processing MDP_ROUTE_TABLE from %s", alloca_socket_address(client));
|
||||||
{
|
{
|
||||||
struct routing_state state={
|
struct routing_state state={
|
||||||
.client = client,
|
.client = client,
|
||||||
|
@ -66,6 +66,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include "lang.h" // for FALLTHROUGH
|
#include "lang.h" // for FALLTHROUGH
|
||||||
|
#include "overlay_address.h" // for REACHABLE_ flags
|
||||||
#include "http_server.h"
|
#include "http_server.h"
|
||||||
#include "strbuf_helpers.h"
|
#include "strbuf_helpers.h"
|
||||||
#include "str.h"
|
#include "str.h"
|
||||||
@ -623,6 +624,40 @@ strbuf strbuf_append_file_meta(strbuf sb, const struct file_meta *metap)
|
|||||||
return sb;
|
return sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strbuf strbuf_append_reachable_flags(strbuf sb, int flags) {
|
||||||
|
if (flags == REACHABLE_NONE)
|
||||||
|
strbuf_puts(sb, "NONE");
|
||||||
|
else {
|
||||||
|
const char *sep = "";
|
||||||
|
if (flags & REACHABLE_SELF) {
|
||||||
|
strbuf_puts(sb, sep);
|
||||||
|
strbuf_puts(sb, "SELF");
|
||||||
|
sep = "|";
|
||||||
|
}
|
||||||
|
if (flags & REACHABLE_BROADCAST) {
|
||||||
|
strbuf_puts(sb, sep);
|
||||||
|
strbuf_puts(sb, "BROADCAST");
|
||||||
|
sep = "|";
|
||||||
|
}
|
||||||
|
if (flags & REACHABLE_UNICAST) {
|
||||||
|
strbuf_puts(sb, sep);
|
||||||
|
strbuf_puts(sb, "UNICAST");
|
||||||
|
sep = "|";
|
||||||
|
}
|
||||||
|
if (flags & REACHABLE_INDIRECT) {
|
||||||
|
strbuf_puts(sb, sep);
|
||||||
|
strbuf_puts(sb, "INDIRECT");
|
||||||
|
sep = "|";
|
||||||
|
}
|
||||||
|
if (flags & REACHABLE_ASSUMED) {
|
||||||
|
strbuf_puts(sb, sep);
|
||||||
|
strbuf_puts(sb, "ASSUMED");
|
||||||
|
sep = "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb;
|
||||||
|
}
|
||||||
|
|
||||||
strbuf strbuf_append_quoted_string(strbuf sb, const char *str)
|
strbuf strbuf_append_quoted_string(strbuf sb, const char *str)
|
||||||
{
|
{
|
||||||
strbuf_putc(sb, '"');
|
strbuf_putc(sb, '"');
|
||||||
|
@ -205,6 +205,12 @@ struct file_meta;
|
|||||||
strbuf strbuf_append_file_meta(strbuf sb, const struct file_meta *metap);
|
strbuf strbuf_append_file_meta(strbuf sb, const struct file_meta *metap);
|
||||||
#define alloca_file_meta(metap) strbuf_str(strbuf_append_file_meta(strbuf_alloca(80), (metap)))
|
#define alloca_file_meta(metap) strbuf_str(strbuf_append_file_meta(strbuf_alloca(80), (metap)))
|
||||||
|
|
||||||
|
/* Append a representation of routing reachable flags.
|
||||||
|
* @author Andrew Bettison <andrew@servalproject.com>
|
||||||
|
*/
|
||||||
|
strbuf strbuf_append_reachable_flags(strbuf sb, int flags);
|
||||||
|
#define alloca_reachable_flags(flags) strbuf_str(strbuf_append_reachable_flags(strbuf_alloca(80), (flags)))
|
||||||
|
|
||||||
/* Append a string using HTTP quoted-string format: delimited by double quotes (") and
|
/* Append a string using HTTP quoted-string format: delimited by double quotes (") and
|
||||||
* internal double quotes and backslash escaped by leading backslash.
|
* internal double quotes and backslash escaped by leading backslash.
|
||||||
* @author Andrew Bettison <andrew@servalproject.com>
|
* @author Andrew Bettison <andrew@servalproject.com>
|
||||||
|
@ -44,7 +44,7 @@ link_matches() {
|
|||||||
done
|
done
|
||||||
sid="$1"
|
sid="$1"
|
||||||
tfw_log "Looking for link ${sid}, ${link_type}, ${interface_ex}, ${via}"
|
tfw_log "Looking for link ${sid}, ${link_type}, ${interface_ex}, ${via}"
|
||||||
if ! $GREP "^${sid}:${link_type}:${interface_ex}:${via}:" $_tfw_tmp/stdout; then
|
if ! $GREP "^${sid}:${link_type}:${interface_ex}:${via}:" "$TFWSTDOUT"; then
|
||||||
tfw_log "Link not found"
|
tfw_log "Link not found"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -90,6 +90,7 @@ configure_servald_server() {
|
|||||||
executeOk_servald config \
|
executeOk_servald config \
|
||||||
set debug.mdprequests yes \
|
set debug.mdprequests yes \
|
||||||
set debug.linkstate yes \
|
set debug.linkstate yes \
|
||||||
|
set debug.subscriber yes \
|
||||||
set debug.verbose yes \
|
set debug.verbose yes \
|
||||||
set debug.overlayrouting yes \
|
set debug.overlayrouting yes \
|
||||||
set log.console.level debug \
|
set log.console.level debug \
|
||||||
|
Loading…
Reference in New Issue
Block a user