Changeset View
Changeset View
Standalone View
Standalone View
sys/net/debugnet.h
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | struct debugnet_methods { | ||||
debugnet_event_t *dn_event; | debugnet_event_t *dn_event; | ||||
debugnet_transmit_t *dn_transmit; | debugnet_transmit_t *dn_transmit; | ||||
debugnet_poll_t *dn_poll; | debugnet_poll_t *dn_poll; | ||||
}; | }; | ||||
#define DEBUGNET_SUPPORTED_NIC(ifp) \ | #define DEBUGNET_SUPPORTED_NIC(ifp) \ | ||||
((ifp)->if_debugnet_methods != NULL && (ifp)->if_type == IFT_ETHER) | ((ifp)->if_debugnet_methods != NULL && (ifp)->if_type == IFT_ETHER) | ||||
struct debugnet_pcb; /* opaque */ | |||||
/* | /* | ||||
* Debugnet consumer API. | * Debugnet consumer API. | ||||
*/ | */ | ||||
struct debugnet_conn_params { | struct debugnet_conn_params { | ||||
struct ifnet *dc_ifp; | struct ifnet *dc_ifp; | ||||
in_addr_t dc_client; | in_addr_t dc_client; | ||||
in_addr_t dc_server; | in_addr_t dc_server; | ||||
in_addr_t dc_gateway; | in_addr_t dc_gateway; | ||||
uint16_t dc_herald_port; | uint16_t dc_herald_port; | ||||
uint16_t dc_client_ack_port; | uint16_t dc_client_port; | ||||
const void *dc_herald_data; | const void *dc_herald_data; | ||||
uint32_t dc_herald_datalen; | uint32_t dc_herald_datalen; | ||||
}; | |||||
struct debugnet_pcb; /* opaque */ | /* | ||||
* If NULL, debugnet is a unidirectional channel from panic machine to | |||||
* remote server (like netdump). | |||||
* | |||||
* If handler is non-NULL, packets received on the client port that are | |||||
* not just tx acks are forwarded to the provided handler. | |||||
* | |||||
* The mbuf chain will have all non-debugnet framing headers removed | |||||
* (ethernet, inet, udp). It will start with a debugnet_msg_hdr, of | |||||
* which the header is guaranteed to be contiguous. If m_pullup is | |||||
* used, the supplied in-out mbuf pointer should be updated | |||||
* appropriately. | |||||
* | |||||
* If the handler frees the mbuf chain, it should set the mbuf pointer | |||||
* to NULL. Otherwise, the debugnet input framework will free the | |||||
* chain. | |||||
*/ | |||||
void (*dc_rx_handler)(struct debugnet_pcb *, struct mbuf **); | |||||
}; | |||||
/* | /* | ||||
* Open a unidirectional stream to the specified server's herald port. | * Open a unidirectional stream to the specified server's herald port. | ||||
* | * | ||||
* If all goes well, the server will send ACK from a different port to our ack | * If all goes well, the server will send ACK from a different port to our ack | ||||
* port. This allows servers to somewhat gracefully handle multiple debugnet | * port. This allows servers to somewhat gracefully handle multiple debugnet | ||||
* clients. (Clients are limited to single connections.) | * clients. (Clients are limited to single connections.) | ||||
* | * | ||||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |