Changeset View
Changeset View
Standalone View
Standalone View
sys/net/debugnet.h
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | struct debugnet_conn_params { | ||||
uint16_t dc_herald_port; | uint16_t dc_herald_port; | ||||
uint16_t dc_client_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; | ||||
/* | /* | ||||
* Consistent with debugnet_send(), aux paramaters to debugnet | |||||
* functions are provided host-endian (but converted to | |||||
* network endian on the wire). | |||||
*/ | |||||
uint32_t dc_herald_aux2; | |||||
uint64_t dc_herald_offset; | |||||
/* | |||||
* If NULL, debugnet is a unidirectional channel from panic machine to | * If NULL, debugnet is a unidirectional channel from panic machine to | ||||
* remote server (like netdump). | * remote server (like netdump). | ||||
* | * | ||||
* If handler is non-NULL, packets received on the client port that are | * If handler is non-NULL, packets received on the client port that are | ||||
* not just tx acks are forwarded to the provided handler. | * not just tx acks are forwarded to the provided handler. | ||||
* | * | ||||
* The mbuf chain will have all non-debugnet framing headers removed | * The mbuf chain will have all non-debugnet framing headers removed | ||||
* (ethernet, inet, udp). It will start with a debugnet_msg_hdr, of | * (ethernet, inet, udp). It will start with a debugnet_msg_hdr, of | ||||
* which the header is guaranteed to be contiguous. If m_pullup is | * which the header is guaranteed to be contiguous. If m_pullup is | ||||
* used, the supplied in-out mbuf pointer should be updated | * used, the supplied in-out mbuf pointer should be updated | ||||
* appropriately. | * appropriately. | ||||
* | * | ||||
* If the handler frees the mbuf chain, it should set the mbuf pointer | * If the handler frees the mbuf chain, it should set the mbuf pointer | ||||
* to NULL. Otherwise, the debugnet input framework will free the | * to NULL. Otherwise, the debugnet input framework will free the | ||||
* chain. | * chain. | ||||
* | |||||
* The handler should ACK receieved packets with debugnet_ack_output. | |||||
*/ | */ | ||||
void (*dc_rx_handler)(struct debugnet_pcb *, struct mbuf **); | void (*dc_rx_handler)(struct debugnet_pcb *, struct mbuf **); | ||||
}; | }; | ||||
/* | /* | ||||
* Open a unidirectional stream to the specified server's herald port. | * Open a 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.) | ||||
* | * | ||||
* Returns zero on success, or errno. | * Returns zero on success, or errno. | ||||
*/ | */ | ||||
int debugnet_connect(const struct debugnet_conn_params *, | int debugnet_connect(const struct debugnet_conn_params *, | ||||
Show All 31 Lines | |||||
/* | /* | ||||
* A simple wrapper around the above when no data or auxdata is needed. | * A simple wrapper around the above when no data or auxdata is needed. | ||||
*/ | */ | ||||
static inline int | static inline int | ||||
debugnet_sendempty(struct debugnet_pcb *pcb, uint32_t mhtype) | debugnet_sendempty(struct debugnet_pcb *pcb, uint32_t mhtype) | ||||
{ | { | ||||
return (debugnet_send(pcb, mhtype, NULL, 0, NULL)); | return (debugnet_send(pcb, mhtype, NULL, 0, NULL)); | ||||
} | } | ||||
/* | |||||
* Full-duplex RX should ACK received messages. | |||||
*/ | |||||
int debugnet_ack_output(struct debugnet_pcb *, uint32_t seqno /*net endian*/); | |||||
/* | |||||
* Check and/or wait for further packets. | |||||
*/ | |||||
void debugnet_network_poll(struct debugnet_pcb *); | |||||
/* | /* | ||||
* PCB accessors. | * PCB accessors. | ||||
*/ | */ | ||||
/* | /* | ||||
* Get the 48-bit MAC address of the discovered next hop (gateway, or | * Get the 48-bit MAC address of the discovered next hop (gateway, or | ||||
* destination server if it is on the same segment. | * destination server if it is on the same segment. | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |