Lines Matching refs:arp

59 	struct arp_hdr *arp;  in arp_raw_request()  local
69 arp = (struct arp_hdr *)pkt; in arp_raw_request()
71 arp->ar_hrd = htons(ARP_ETHER); in arp_raw_request()
72 arp->ar_pro = htons(PROT_IP); in arp_raw_request()
73 arp->ar_hln = ARP_HLEN; in arp_raw_request()
74 arp->ar_pln = ARP_PLEN; in arp_raw_request()
75 arp->ar_op = htons(ARPOP_REQUEST); in arp_raw_request()
77 memcpy(&arp->ar_sha, net_ethaddr, ARP_HLEN); /* source ET addr */ in arp_raw_request()
78 net_write_ip(&arp->ar_spa, source_ip); /* source IP addr */ in arp_raw_request()
79 memcpy(&arp->ar_tha, target_ethaddr, ARP_HLEN); /* target ET addr */ in arp_raw_request()
80 net_write_ip(&arp->ar_tpa, target_ip); /* target IP addr */ in arp_raw_request()
129 struct arp_hdr *arp; in arp_receive() local
145 arp = (struct arp_hdr *)ip; in arp_receive()
150 if (ntohs(arp->ar_hrd) != ARP_ETHER) in arp_receive()
152 if (ntohs(arp->ar_pro) != PROT_IP) in arp_receive()
154 if (arp->ar_hln != ARP_HLEN) in arp_receive()
156 if (arp->ar_pln != ARP_PLEN) in arp_receive()
162 if (net_read_ip(&arp->ar_tpa).s_addr != net_ip.s_addr) in arp_receive()
165 switch (ntohs(arp->ar_op)) { in arp_receive()
170 arp->ar_op = htons(ARPOP_REPLY); in arp_receive()
171 memcpy(&arp->ar_tha, &arp->ar_sha, ARP_HLEN); in arp_receive()
172 net_copy_ip(&arp->ar_tpa, &arp->ar_spa); in arp_receive()
173 memcpy(&arp->ar_sha, net_ethaddr, ARP_HLEN); in arp_receive()
174 net_copy_ip(&arp->ar_spa, &net_ip); in arp_receive()
185 if ((net_read_ip(&arp->ar_tpa).s_addr & net_netmask.s_addr) != in arp_receive()
186 (net_read_ip(&arp->ar_spa).s_addr & net_netmask.s_addr)) in arp_receive()
202 sprintf(buf, "%pM", &arp->ar_sha); in arp_receive()
207 reply_ip_addr = net_read_ip(&arp->ar_spa); in arp_receive()
213 arp->ar_data); in arp_receive()
218 &arp->ar_sha, ARP_HLEN); in arp_receive()
220 net_get_arp_handler()((uchar *)arp, 0, reply_ip_addr, in arp_receive()
226 &arp->ar_sha, ARP_HLEN); in arp_receive()
237 ntohs(arp->ar_op)); in arp_receive()