mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 05:07:56 +00:00
Add msp debug flag
This commit is contained in:
parent
f085ffec50
commit
68421db114
@ -242,6 +242,7 @@ ATOM(bool_t, gateway, 0, boolean,, "")
|
||||
ATOM(bool_t, keyring, 0, boolean,, "")
|
||||
ATOM(bool_t, security, 0, boolean,, "")
|
||||
ATOM(bool_t, mdprequests, 0, boolean,, "")
|
||||
ATOM(bool_t, msp, 0, boolean,, "")
|
||||
ATOM(bool_t, radio_link, 0, boolean,, "")
|
||||
ATOM(bool_t, peers, 0, boolean,, "")
|
||||
ATOM(bool_t, overlaybuffer, 0, boolean,, "")
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include "serval.h"
|
||||
#include "conf.h"
|
||||
#include "mdp_client.h"
|
||||
#include "msp_client.h"
|
||||
#include "str.h"
|
||||
@ -136,6 +137,7 @@ static void free_acked_packets(struct msp_window *window, uint16_t seq)
|
||||
window->rtt = rtt;
|
||||
if (window->base_rtt > rtt)
|
||||
window->base_rtt = rtt;
|
||||
if (config.debug.msp)
|
||||
DEBUGF("RTT %u, base %u", rtt, window->base_rtt);
|
||||
}
|
||||
if (!p)
|
||||
@ -342,6 +344,7 @@ static int msp_send_packet(struct msp_sock *sock, struct msp_packet *packet)
|
||||
msp_close_all(sock->mdp_sock);
|
||||
return -1;
|
||||
}
|
||||
if (config.debug.msp)
|
||||
DEBUGF("Sent packet seq %02x len %zd (acked %02x)", packet->seq, packet->len, sock->rx.next_seq);
|
||||
sock->tx.last_activity = packet->sent = gettime_ms();
|
||||
sock->next_ack = packet->sent + 1500;
|
||||
@ -386,6 +389,7 @@ static int send_ack(struct msp_sock *sock)
|
||||
msp_close_all(sock->mdp_sock);
|
||||
return -1;
|
||||
}
|
||||
if (config.debug.msp)
|
||||
DEBUGF("Sent packet (acked %02x)", sock->rx.next_seq);
|
||||
sock->previous_ack = sock->rx.next_seq;
|
||||
sock->tx.last_activity = gettime_ms();
|
||||
@ -574,6 +578,7 @@ static int process_packet(int mdp_sock, struct mdp_header *header, const uint8_t
|
||||
// process bind response from the daemon
|
||||
s->header.local = header->local;
|
||||
s->header.flags &= ~MDP_FLAG_BIND;
|
||||
if (config.debug.msp)
|
||||
DEBUGF("Bound to %s:%d", alloca_tohex_sid_t(header->local.sid), header->local.port);
|
||||
s->next_action = gettime_ms();
|
||||
if (s->state & MSP_STATE_LISTENING)
|
||||
|
Loading…
Reference in New Issue
Block a user