Lines Matching refs:arp
49 struct arpMsg arp; in arpping() local
67 memset(&arp, 0, sizeof(arp)); in arpping()
68 memset(arp.h_dest, 0xff, 6); /* MAC DA */ in arpping()
69 memcpy(arp.h_source, from_mac, 6); /* MAC SA */ in arpping()
70 arp.h_proto = htons(ETH_P_ARP); /* protocol type (Ethernet) */ in arpping()
71 arp.htype = htons(ARPHRD_ETHER); /* hardware type */ in arpping()
72 arp.ptype = htons(ETH_P_IP); /* protocol type (ARP message) */ in arpping()
73 arp.hlen = 6; /* hardware address length */ in arpping()
74 arp.plen = 4; /* protocol address length */ in arpping()
75 arp.operation = htons(ARPOP_REQUEST); /* ARP op code */ in arpping()
76 memcpy(arp.sHaddr, from_mac, 6); /* source hardware address */ in arpping()
77 memcpy(arp.sInaddr, &from_ip, sizeof(from_ip)); /* source IP address */ in arpping()
79 memcpy(arp.tInaddr, &test_nip, sizeof(test_nip));/* target IP address */ in arpping()
83 if (sendto(s, &arp, sizeof(arp), 0, &addr, sizeof(addr)) < 0) { in arpping()
101 r = safe_read(s, &arp, sizeof(arp)); in arpping()
110 && arp.operation == htons(ARPOP_REPLY) in arpping()
113 && *(aliased_uint32_t*)arp.sInaddr == test_nip in arpping()
119 if (!safe_mac || memcmp(safe_mac, arp.sHaddr, 6) != 0) in arpping()