Lines Matching refs:arph

62 DumpARPPacket(struct arphdr *arph);
131 struct arphdr *arph = (struct arphdr *)EthernetOutput(mtcp, NULL, in ARPOutput() local
133 if (!arph) { in ARPOutput()
138 arph->ar_hrd = htons(arp_hrd_ethernet); in ARPOutput()
139 arph->ar_pro = htons(ETH_P_IP); in ARPOutput()
140 arph->ar_hln = ETH_ALEN; in ARPOutput()
141 arph->ar_pln = 4; in ARPOutput()
142 arph->ar_op = htons(opcode); in ARPOutput()
145 arph->ar_sip = g_config.mos->netdev_table->ent[nif]->ip_addr; in ARPOutput()
146 arph->ar_tip = dst_ip; in ARPOutput()
148 memcpy(arph->ar_sha, g_config.mos->netdev_table->ent[nif]->haddr, arph->ar_hln); in ARPOutput()
150 memcpy(arph->ar_tha, target_haddr, arph->ar_hln); in ARPOutput()
152 memcpy(arph->ar_tha, dst_haddr, arph->ar_hln); in ARPOutput()
154 memset(arph->pad, 0, ARP_PAD_LEN); in ARPOutput()
157 DumpARPPacket(arph); in ARPOutput()
219 struct arphdr *arph, int nif, uint32_t cur_ts) in ProcessARPRequest() argument
224 temp = GetDestinationHWaddr(arph->ar_sip); in ProcessARPRequest()
226 RegisterARPEntry(arph->ar_sip, arph->ar_sha); in ProcessARPRequest()
230 ARPOutput(mtcp, nif, arp_op_reply, arph->ar_sip, arph->ar_sha, NULL); in ProcessARPRequest()
236 ProcessARPReply(mtcp_manager_t mtcp, struct arphdr *arph, uint32_t cur_ts) in ProcessARPReply() argument
242 temp = GetDestinationHWaddr(arph->ar_sip); in ProcessARPReply()
244 RegisterARPEntry(arph->ar_sip, arph->ar_sha); in ProcessARPReply()
250 if (ent->ip == arph->ar_sip) { in ProcessARPReply()
265 struct arphdr *arph = (struct arphdr *)(pkt_data + sizeof(struct ethhdr)); in ProcessARPPacket() local
271 if (arph->ar_tip == g_config.mos->netdev_table->ent[i]->ip_addr) { in ProcessARPPacket()
280 DumpARPPacket(arph); in ProcessARPPacket()
283 switch (ntohs(arph->ar_op)) { in ProcessARPPacket()
285 ProcessARPRequest(mtcp, arph, ifidx, cur_ts); in ProcessARPPacket()
289 ProcessARPReply(mtcp, arph, cur_ts); in ProcessARPPacket()
359 DumpARPPacket(struct arphdr *arph) in DumpARPPacket() argument
366 ntohs(arph->ar_hrd), arph->ar_hln, in DumpARPPacket()
367 ntohs(arph->ar_pro), arph->ar_pln, ntohs(arph->ar_op)); in DumpARPPacket()
368 t = (uint8_t *)&arph->ar_sip; in DumpARPPacket()
372 arph->ar_sha[0], arph->ar_sha[1], arph->ar_sha[2], in DumpARPPacket()
373 arph->ar_sha[3], arph->ar_sha[4], arph->ar_sha[5]); in DumpARPPacket()
374 t = (uint8_t *)&arph->ar_tip; in DumpARPPacket()
378 arph->ar_tha[0], arph->ar_tha[1], arph->ar_tha[2], in DumpARPPacket()
379 arph->ar_tha[3], arph->ar_tha[4], arph->ar_tha[5]); in DumpARPPacket()
392 struct arphdr *arph = (struct arphdr *) in ForwardARPPacket() local
396 if (!arph) in ForwardARPPacket()
398 memcpy(arph, (pctx->p.ethh + 1), sizeof(struct arphdr)); in ForwardARPPacket()