extern void NetSetTimeout(ulong, thand_f *);/* Set timeout handler */
/* Transmit "NetTxPacket" */
-extern void NetSendPacket(uchar *, int);
+static inline void NetSendPacket(uchar *pkt, int len)
+{
+ (void) eth_send(pkt, len);
+}
/*
* Transmit UDP packet, performing ARP request if needed
}
NetWriteIP(&arp->ar_tpa, NetArpWaitReplyIP);
- (void) eth_send(NetTxPacket, eth_hdr_size + ARP_HDR_SIZE);
+ NetSendPacket(NetTxPacket, eth_hdr_size + ARP_HDR_SIZE);
}
void ArpTimeoutCheck(void)
NetCopyIP(&arp->ar_tpa, &arp->ar_spa);
memcpy(&arp->ar_sha, NetOurEther, ARP_HLEN);
NetCopyIP(&arp->ar_spa, &NetOurIP);
- (void) eth_send((uchar *)et, eth_hdr_size + ARP_HDR_SIZE);
+ NetSendPacket((uchar *)et, eth_hdr_size + ARP_HDR_SIZE);
return;
case ARPOP_REPLY: /* arp reply */
/* modify header, and transmit it */
memcpy(((struct ethernet_hdr *)NetArpWaitTxPacket)->
et_dest, NetArpWaitPacketMAC, ARP_HLEN);
- (void) eth_send(NetArpWaitTxPacket,
+ NetSendPacket(NetArpWaitTxPacket,
NetArpWaitTxPacketSize);
/* no arp request pending now */
chksum = 0xFFFF;
*cp = htons(chksum);
- (void) eth_send(NetTxPacket, (uchar *)s - NetTxPacket);
+ NetSendPacket(NetTxPacket, (uchar *)s - NetTxPacket);
return 0;
}
}
}
-
-void
-NetSendPacket(uchar *pkt, int len)
-{
- (void) eth_send(pkt, len);
-}
-
int NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport,
int payload_len)
{
return 1; /* waiting */
} else {
debug("sending UDP to %pI4/%pM\n", &dest, ether);
- eth_send(NetTxPacket, pkt_hdr_size + payload_len);
+ NetSendPacket(NetTxPacket, pkt_hdr_size + payload_len);
return 0; /* transmitted */
}
}
icmph->checksum = 0;
icmph->checksum = ~NetCksum((uchar *)icmph,
(len - IP_HDR_SIZE) >> 1);
- (void) eth_send((uchar *)et,
- ETHER_HDR_SIZE + len);
+ NetSendPacket((uchar *)et, ETHER_HDR_SIZE + len);
return;
/* default:
return;*/