mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-03 03:46:47 +00:00
mdp based dna lookup works now, but lacks duplicate suppression.
This commit is contained in:
parent
0133ea972a
commit
98c3b72cf4
@ -504,10 +504,11 @@ int app_dna_lookup(int argc, const char *const *argv, struct command_line_option
|
|||||||
{
|
{
|
||||||
fprintf(stderr," Error message: %s\n",mdp.error.message);
|
fprintf(stderr," Error message: %s\n",mdp.error.message);
|
||||||
}
|
}
|
||||||
else if (rx.packetTypeAndFlags==MDP_RX)
|
else if ((rx.packetTypeAndFlags&MDP_TYPE_MASK)==MDP_TX)
|
||||||
fprintf(stderr,"%s:%s\n",
|
fprintf(stderr,"%s:%s\n",
|
||||||
overlay_render_sid(&rx.in.payload[0]),
|
overlay_render_sid(&rx.in.src.sid[0]),
|
||||||
&rx.in.payload[SID_SIZE]);
|
&rx.in.payload[0]);
|
||||||
|
else WHYF("packettype=0x%x",rx.packetTypeAndFlags);
|
||||||
if (servalShutdown) break;
|
if (servalShutdown) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -787,7 +788,7 @@ int app_mdp_ping(int argc, const char *const *argv, struct command_line_option *
|
|||||||
fprintf(stderr,"mdpping: overlay_mdp_recv: %s (code %d)\n",
|
fprintf(stderr,"mdpping: overlay_mdp_recv: %s (code %d)\n",
|
||||||
mdp.error.message,mdp.error.error);
|
mdp.error.message,mdp.error.error);
|
||||||
break;
|
break;
|
||||||
case MDP_RX:
|
case MDP_TX:
|
||||||
{
|
{
|
||||||
int *rxseq=(int *)&mdp.in.payload;
|
int *rxseq=(int *)&mdp.in.payload;
|
||||||
long long *txtime=(long long *)&mdp.in.payload[4];
|
long long *txtime=(long long *)&mdp.in.payload[4];
|
||||||
|
@ -436,11 +436,6 @@ int overlay_saw_mdp_frame(int interface, overlay_mdp_frame *mdp,long long now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (match>-1) {
|
if (match>-1) {
|
||||||
/* We now know the socket, and so we can pass the MDP_TX frame to the
|
|
||||||
recipient. We do, however, translate it into an MDP_RX frame first,
|
|
||||||
so that the recipient understands the context. */
|
|
||||||
mdp->packetTypeAndFlags&=~MDP_TYPE_MASK;
|
|
||||||
mdp->packetTypeAndFlags|=MDP_RX;
|
|
||||||
struct sockaddr_un addr;
|
struct sockaddr_un addr;
|
||||||
bcopy(mdp_bindings_sockets[match],&addr.sun_path[0],mdp_bindings_socket_name_lengths[match]);
|
bcopy(mdp_bindings_sockets[match],&addr.sun_path[0],mdp_bindings_socket_name_lengths[match]);
|
||||||
addr.sun_family=AF_UNIX;
|
addr.sun_family=AF_UNIX;
|
||||||
@ -661,7 +656,6 @@ int overlay_mdp_dispatch(overlay_mdp_frame *mdp,int userGeneratedFrameP,
|
|||||||
/* Packet is addressed such that we should process it. */
|
/* Packet is addressed such that we should process it. */
|
||||||
overlay_saw_mdp_frame(-1 /* not received on a network interface */,
|
overlay_saw_mdp_frame(-1 /* not received on a network interface */,
|
||||||
mdp,overlay_gettime_ms());
|
mdp,overlay_gettime_ms());
|
||||||
|
|
||||||
if (!broadcast) {
|
if (!broadcast) {
|
||||||
/* Is local, and is not broadcast, so shouldn't get sent out
|
/* Is local, and is not broadcast, so shouldn't get sent out
|
||||||
on the wire. */
|
on the wire. */
|
||||||
@ -999,10 +993,6 @@ int overlay_mdp_relevant_bytes(overlay_mdp_frame *mdp)
|
|||||||
len=&mdp->out.payload[0]-(unsigned char *)mdp;
|
len=&mdp->out.payload[0]-(unsigned char *)mdp;
|
||||||
len+=mdp->out.payload_length;
|
len+=mdp->out.payload_length;
|
||||||
break;
|
break;
|
||||||
case MDP_RX:
|
|
||||||
len=&mdp->in.payload[0]-(unsigned char *)mdp;
|
|
||||||
len+=mdp->in.payload_length;
|
|
||||||
break;
|
|
||||||
case MDP_BIND:
|
case MDP_BIND:
|
||||||
len=&mdp->bind.sid[SID_SIZE]-(unsigned char *)mdp;
|
len=&mdp->bind.sid[SID_SIZE]-(unsigned char *)mdp;
|
||||||
break;
|
break;
|
||||||
|
1
serval.h
1
serval.h
@ -1108,7 +1108,6 @@ unsigned char *keyring_get_nm_bytes(sockaddr_mdp *priv,sockaddr_mdp *pub);
|
|||||||
#define MDP_NOCRYPT 0x0200
|
#define MDP_NOCRYPT 0x0200
|
||||||
#define MDP_NOSIGN 0x0400
|
#define MDP_NOSIGN 0x0400
|
||||||
#define MDP_TX 1
|
#define MDP_TX 1
|
||||||
#define MDP_RX 2
|
|
||||||
typedef struct overlay_mdp_data_frame {
|
typedef struct overlay_mdp_data_frame {
|
||||||
sockaddr_mdp src;
|
sockaddr_mdp src;
|
||||||
sockaddr_mdp dst;
|
sockaddr_mdp dst;
|
||||||
|
Loading…
Reference in New Issue
Block a user