Changeset View
Changeset View
Standalone View
Standalone View
sys/net/debugnet.c
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | |||||
debugnet_get_gw_mac(const struct debugnet_pcb *pcb) | debugnet_get_gw_mac(const struct debugnet_pcb *pcb) | ||||
{ | { | ||||
MPASS(g_debugnet_pcb_inuse && pcb == &g_dnet_pcb && | MPASS(g_debugnet_pcb_inuse && pcb == &g_dnet_pcb && | ||||
pcb->dp_state >= DN_STATE_HAVE_GW_MAC); | pcb->dp_state >= DN_STATE_HAVE_GW_MAC); | ||||
return (pcb->dp_gw_mac.octet); | return (pcb->dp_gw_mac.octet); | ||||
} | } | ||||
const in_addr_t * | const in_addr_t * | ||||
debugnet_get_server(const struct debugnet_pcb *pcb) | debugnet_get_server_addr(const struct debugnet_pcb *pcb) | ||||
{ | { | ||||
MPASS(g_debugnet_pcb_inuse && pcb == &g_dnet_pcb && | MPASS(g_debugnet_pcb_inuse && pcb == &g_dnet_pcb && | ||||
pcb->dp_state >= DN_STATE_GOT_HERALD_PORT); | pcb->dp_state >= DN_STATE_GOT_HERALD_PORT); | ||||
return (&pcb->dp_server); | return (&pcb->dp_server); | ||||
} | } | ||||
const uint16_t | const uint16_t | ||||
debugnet_get_server_port(const struct debugnet_pcb *pcb) | debugnet_get_server_port(const struct debugnet_pcb *pcb) | ||||
▲ Show 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | debugnet_handle_rx_msg(struct debugnet_pcb *pcb, struct mbuf **mb) | ||||
* non-transient (like driver objecting to rx -> tx from the same | * non-transient (like driver objecting to rx -> tx from the same | ||||
* thread), not much else we can do. | * thread), not much else we can do. | ||||
*/ | */ | ||||
seqno = dnh->mh_seqno; /* net endian */ | seqno = dnh->mh_seqno; /* net endian */ | ||||
m_adj(m, sizeof(*dnh)); | m_adj(m, sizeof(*dnh)); | ||||
dnh = NULL; | dnh = NULL; | ||||
error = pcb->dp_rx_handler(m); | error = pcb->dp_rx_handler(m); | ||||
if (error != 0) { | if (error != 0) { | ||||
DNETDEBUG("RX handler was not able to accept message, " | DNETDEBUG("RX handler was not able to accept message, error %d. " | ||||
"skipping ack.\n"); | "Skipping ack.\n", error); | ||||
return; | return; | ||||
} | } | ||||
error = debugnet_ack_output(pcb, seqno); | error = debugnet_ack_output(pcb, seqno); | ||||
if (error != 0) { | if (error != 0) { | ||||
DNETDEBUG("Couldn't ACK rx packet %u; %d\n", ntohl(seqno), error); | DNETDEBUG("Couldn't ACK rx packet %u; %d\n", ntohl(seqno), error); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 687 Lines • Show Last 20 Lines |