/*
* Address Resolution Protocol (ARP) header.
*/
-typedef struct
-{
+struct arp_hdr {
ushort ar_hrd; /* Format of hardware address */
# define ARP_ETHER 1 /* Ethernet hardware address */
ushort ar_pro; /* Format of protocol address */
uchar ar_tha[]; /* Target hardware address */
uchar ar_tpa[]; /* Target protocol address */
#endif /* 0 */
-} ARP_t;
+};
#define ARP_HDR_SIZE (8+20) /* Size assuming ethernet */
void ArpRequest(void)
{
uchar *pkt;
- ARP_t *arp;
+ struct arp_hdr *arp;
debug("ARP broadcast %d\n", NetArpWaitTry);
pkt += NetSetEther(pkt, NetBcastAddr, PROT_ARP);
- arp = (ARP_t *) pkt;
+ arp = (struct arp_hdr *) pkt;
arp->ar_hrd = htons(ARP_ETHER);
arp->ar_pro = htons(PROT_IP);
void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
{
- ARP_t *arp;
+ struct arp_hdr *arp;
IPaddr_t tmp;
uchar *pkt;
*/
debug("Got ARP\n");
- arp = (ARP_t *)ip;
+ arp = (struct arp_hdr *)ip;
if (len < ARP_HDR_SIZE) {
printf("bad length %d < %d\n", len, ARP_HDR_SIZE);
return;
*/
void rarp_receive(struct ip_udp_hdr *ip, unsigned len)
{
- ARP_t *arp;
+ struct arp_hdr *arp;
debug("Got RARP\n");
- arp = (ARP_t *)ip;
+ arp = (struct arp_hdr *)ip;
if (len < ARP_HDR_SIZE) {
printf("bad length %d < %d\n", len, ARP_HDR_SIZE);
return;
void RarpRequest(void)
{
uchar *pkt;
- ARP_t *rarp;
+ struct arp_hdr *rarp;
printf("RARP broadcast %d\n", ++RarpTry);
pkt = NetTxPacket;
pkt += NetSetEther(pkt, NetBcastAddr, PROT_RARP);
- rarp = (ARP_t *)pkt;
+ rarp = (struct arp_hdr *)pkt;
rarp->ar_hrd = htons(ARP_ETHER);
rarp->ar_pro = htons(PROT_IP);