Lines Matching refs:pcb
83 debugnet_handle_ip(struct debugnet_pcb *pcb, struct mbuf **mb) in debugnet_handle_ip() argument
175 if (ip->ip_src.s_addr != pcb->dp_server) { in debugnet_handle_ip()
182 if (ip->ip_dst.s_addr != pcb->dp_client) { in debugnet_handle_ip()
215 debugnet_handle_udp(pcb, mb); in debugnet_handle_ip()
227 debugnet_send_arp(struct debugnet_pcb *pcb, in_addr_t dst) in debugnet_send_arp() argument
235 ifp = pcb->dp_ifp; in debugnet_send_arp()
255 ((struct in_addr *)ar_spa(ah))->s_addr = pcb->dp_client; in debugnet_send_arp()
276 debugnet_handle_arp(struct debugnet_pcb *pcb, struct mbuf **mb) in debugnet_handle_arp() argument
330 if (isaddr.s_addr == pcb->dp_client) { in debugnet_handle_arp()
343 if (isaddr.s_addr != pcb->dp_gateway && in debugnet_handle_arp()
344 isaddr.s_addr != pcb->dp_server) { in debugnet_handle_arp()
350 memcpy(pcb->dp_gw_mac.octet, ar_sha(ah), in debugnet_handle_arp()
354 pcb->dp_gw_mac.octet, ":"); in debugnet_handle_arp()
356 MPASS(pcb->dp_state == DN_STATE_INIT); in debugnet_handle_arp()
357 pcb->dp_state = DN_STATE_HAVE_GW_MAC; in debugnet_handle_arp()
366 if (itaddr.s_addr != pcb->dp_client) { in debugnet_handle_arp()
396 debugnet_arp_gw(struct debugnet_pcb *pcb) in debugnet_arp_gw() argument
401 dst = pcb->dp_server; in debugnet_arp_gw()
404 error = debugnet_send_arp(pcb, dst); in debugnet_arp_gw()
408 pcb->dp_state < DN_STATE_HAVE_GW_MAC; polls++) { in debugnet_arp_gw()
409 debugnet_network_poll(pcb); in debugnet_arp_gw()
412 if (pcb->dp_state >= DN_STATE_HAVE_GW_MAC) in debugnet_arp_gw()
416 if (pcb->dp_state >= DN_STATE_HAVE_GW_MAC) in debugnet_arp_gw()
418 if (dst == pcb->dp_server) { in debugnet_arp_gw()
420 if (pcb->dp_gateway != INADDR_ANY) { in debugnet_arp_gw()
422 dst = pcb->dp_gateway; in debugnet_arp_gw()
445 debugnet_ip_output(struct debugnet_pcb *pcb, struct mbuf *m) in debugnet_ip_output() argument
451 MPASS(pcb->dp_state >= DN_STATE_HAVE_GW_MAC); in debugnet_ip_output()
453 ifp = pcb->dp_ifp; in debugnet_ip_output()
474 ip->ip_src = (struct in_addr) { pcb->dp_client }; in debugnet_ip_output()
475 ip->ip_dst = (struct in_addr) { pcb->dp_server }; in debugnet_ip_output()
492 return (debugnet_ether_output(m, ifp, pcb->dp_gw_mac, ETHERTYPE_IP)); in debugnet_ip_output()