Changeset View
Changeset View
Standalone View
Standalone View
sys/net/debugnet_int.h
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | #define DNETDEBUGV(f, ...) do { \ | ||||
if (debugnet_debug > 1) \ | if (debugnet_debug > 1) \ | ||||
printf(("%s: " f), __func__, ## __VA_ARGS__); \ | printf(("%s: " f), __func__, ## __VA_ARGS__); \ | ||||
} while (0) | } while (0) | ||||
enum dnet_pcb_st { | enum dnet_pcb_st { | ||||
DN_STATE_INIT = 1, | DN_STATE_INIT = 1, | ||||
DN_STATE_HAVE_GW_MAC, | DN_STATE_HAVE_GW_MAC, | ||||
DN_STATE_GOT_HERALD_PORT, | DN_STATE_GOT_HERALD_PORT, | ||||
DN_STATE_REMOTE_CLOSED, | |||||
}; | }; | ||||
struct debugnet_pcb { | struct debugnet_pcb { | ||||
uint64_t dp_rcvd_acks; | uint64_t dp_rcvd_acks; | ||||
in_addr_t dp_client; | in_addr_t dp_client; | ||||
in_addr_t dp_server; | in_addr_t dp_server; | ||||
in_addr_t dp_gateway; | in_addr_t dp_gateway; | ||||
uint32_t dp_seqno; | uint32_t dp_seqno; | ||||
struct ether_addr dp_gw_mac; | struct ether_addr dp_gw_mac; | ||||
uint16_t dp_server_port; | uint16_t dp_server_port; | ||||
struct ifnet *dp_ifp; | struct ifnet *dp_ifp; | ||||
/* Saved driver if_input to restore on close. */ | /* Saved driver if_input to restore on close. */ | ||||
void (*dp_drv_input)(struct ifnet *, struct mbuf *); | void (*dp_drv_input)(struct ifnet *, struct mbuf *); | ||||
/* RX handler for bidirectional protocols. */ | |||||
void (*dp_rx_handler)(struct debugnet_pcb *, | |||||
struct mbuf **); | |||||
enum dnet_pcb_st dp_state; | enum dnet_pcb_st dp_state; | ||||
uint16_t dp_client_ack_port; | uint16_t dp_client_port; | ||||
bool dp_event_started; | bool dp_event_started; | ||||
}; | }; | ||||
/* TODO(CEM): Obviate this assertion by using a BITSET(9) for acks. */ | /* TODO(CEM): Obviate this assertion by using a BITSET(9) for acks. */ | ||||
CTASSERT(sizeof(((struct debugnet_pcb *)0)->dp_rcvd_acks) * NBBY >= | CTASSERT(sizeof(((struct debugnet_pcb *)0)->dp_rcvd_acks) * NBBY >= | ||||
DEBUGNET_MAX_IN_FLIGHT); | DEBUGNET_MAX_IN_FLIGHT); | ||||
extern unsigned debugnet_debug; | extern unsigned debugnet_debug; | ||||
Show All 13 Lines |