X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=net%2Frarp.c;h=f50d2fbd9de7dc5ef261d19ac833a2047def641a;hb=243c0adf895fc3eaf78ef8696fe1937e17fa9aca;hp=a8e085126d4fa27c9837323e5ea3c2e81ac6cdaa;hpb=1a4596601fd395f3afb8f82f3f840c5e00bdd57a;p=karo-tx-uboot.git diff --git a/net/rarp.c b/net/rarp.c index a8e085126d..f50d2fbd9d 100644 --- a/net/rarp.c +++ b/net/rarp.c @@ -43,10 +43,10 @@ void rarp_receive(struct ip_udp_hdr *ip, unsigned len) puts("invalid RARP header\n"); } else { - NetCopyIP(&NetOurIP, &arp->ar_data[16]); - if (NetServerIP == 0) - NetCopyIP(&NetServerIP, &arp->ar_data[6]); - memcpy(NetServerEther, &arp->ar_data[0], 6); + net_copy_ip(&net_ip, &arp->ar_data[16]); + if (net_server_ip.s_addr == 0) + net_copy_ip(&net_server_ip, &arp->ar_data[6]); + memcpy(net_server_ethaddr, &arp->ar_data[0], 6); debug_cond(DEBUG_DEV_PKT, "Got good RARP\n"); net_auto_load(); } @@ -75,9 +75,9 @@ void RarpRequest(void) int eth_hdr_size; printf("RARP broadcast %d\n", ++RarpTry); - pkt = NetTxPacket; + pkt = net_tx_packet; - eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_RARP); + eth_hdr_size = net_set_ether(pkt, net_bcast_ethaddr, PROT_RARP); pkt += eth_hdr_size; rarp = (struct arp_hdr *)pkt; @@ -87,14 +87,14 @@ void RarpRequest(void) rarp->ar_hln = 6; rarp->ar_pln = 4; rarp->ar_op = htons(RARPOP_REQUEST); - memcpy(&rarp->ar_data[0], NetOurEther, 6); /* source ET addr */ - memcpy(&rarp->ar_data[6], &NetOurIP, 4); /* source IP addr */ + memcpy(&rarp->ar_data[0], net_ethaddr, 6); /* source ET addr */ + memcpy(&rarp->ar_data[6], &net_ip, 4); /* source IP addr */ /* dest ET addr = source ET addr ??*/ - memcpy(&rarp->ar_data[10], NetOurEther, 6); + memcpy(&rarp->ar_data[10], net_ethaddr, 6); /* dest IP addr set to broadcast */ memset(&rarp->ar_data[16], 0xff, 4); - NetSendPacket(NetTxPacket, eth_hdr_size + ARP_HDR_SIZE); + net_send_packet(net_tx_packet, eth_hdr_size + ARP_HDR_SIZE); NetSetTimeout(TIMEOUT, RarpTimeout); }