Lines Matching refs:ent
79 if (ip == g_config.mos->netdev_table->ent[i]->ip_addr) { in GetHWaddr()
80 haddr = g_config.mos->netdev_table->ent[i]->haddr; in GetHWaddr()
102 if (g_config.mos->arp_table->ent[i]->prefix == 1) { in GetDestinationHWaddr()
103 if (g_config.mos->arp_table->ent[i]->ip == dip) { in GetDestinationHWaddr()
104 d_haddr = g_config.mos->arp_table->ent[i]->haddr; in GetDestinationHWaddr()
108 if ((dip & g_config.mos->arp_table->ent[i]->mask) == in GetDestinationHWaddr()
109 g_config.mos->arp_table->ent[i]->masked_ip) { in GetDestinationHWaddr()
111 if (g_config.mos->arp_table->ent[i]->prefix > prefix) { in GetDestinationHWaddr()
112 d_haddr = g_config.mos->arp_table->ent[i]->haddr; in GetDestinationHWaddr()
113 prefix = g_config.mos->arp_table->ent[i]->prefix; in GetDestinationHWaddr()
145 arph->ar_sip = g_config.mos->netdev_table->ent[nif]->ip_addr; in ARPOutput()
148 memcpy(arph->ar_sha, g_config.mos->netdev_table->ent[nif]->haddr, arph->ar_hln); in ARPOutput()
167 g_config.mos->arp_table->ent[idx] = calloc(1, sizeof(struct _arp_entry)); in RegisterARPEntry()
168 if (!g_config.mos->arp_table->ent[idx]) in RegisterARPEntry()
170 g_config.mos->arp_table->ent[idx]->prefix = 32; in RegisterARPEntry()
171 g_config.mos->arp_table->ent[idx]->ip = ip; in RegisterARPEntry()
172 memcpy(g_config.mos->arp_table->ent[idx]->haddr, haddr, ETH_ALEN); in RegisterARPEntry()
173 g_config.mos->arp_table->ent[idx]->mask = -1; in RegisterARPEntry()
174 g_config.mos->arp_table->ent[idx]->masked_ip = ip; in RegisterARPEntry()
187 struct arp_queue_entry *ent; in RequestARP() local
193 TAILQ_FOREACH(ent, &g_arpm.list, arp_link) { in RequestARP()
194 if (ent->ip == ip) { in RequestARP()
200 ent = (struct arp_queue_entry *)calloc(1, sizeof(struct arp_queue_entry)); in RequestARP()
201 if (ent == NULL) { in RequestARP()
205 ent->ip = ip; in RequestARP()
206 ent->nif_out = nif; in RequestARP()
207 ent->ts_out = cur_ts; in RequestARP()
208 TAILQ_INSERT_TAIL(&g_arpm.list, ent, arp_link); in RequestARP()
239 struct arp_queue_entry *ent; in ProcessARPReply() local
249 TAILQ_FOREACH(ent, &g_arpm.list, arp_link) { in ProcessARPReply()
250 if (ent->ip == arph->ar_sip) { in ProcessARPReply()
251 TAILQ_REMOVE(&g_arpm.list, ent, arp_link); in ProcessARPReply()
252 free(ent); in ProcessARPReply()
271 if (arph->ar_tip == g_config.mos->netdev_table->ent[i]->ip_addr) { in ProcessARPPacket()
305 ARPOutput(mtcp, g_config.mos->netdev_table->ent[i]->ifindex, arp_op_request, 0, NULL, NULL); in PublishARP()
315 struct arp_queue_entry *ent, *ent_tmp; in ARPTimer() local
319 TAILQ_FOREACH_SAFE(ent, &g_arpm.list, arp_link, ent_tmp) { in ARPTimer()
320 if (TS_GEQ(cur_ts, ent->ts_out + SEC_TO_TS(ARP_TIMEOUT_SEC))) { in ARPTimer()
323 TAILQ_REMOVE(&g_arpm.list, ent, arp_link); in ARPTimer()
324 free(ent); in ARPTimer()
339 uint8_t *da = (uint8_t *)&g_config.mos->arp_table->ent[i]->ip; in PrintARPTable()
344 g_config.mos->arp_table->ent[i]->haddr[0], in PrintARPTable()
345 g_config.mos->arp_table->ent[i]->haddr[1], in PrintARPTable()
346 g_config.mos->arp_table->ent[i]->haddr[2], in PrintARPTable()
347 g_config.mos->arp_table->ent[i]->haddr[3], in PrintARPTable()
348 g_config.mos->arp_table->ent[i]->haddr[4], in PrintARPTable()
349 g_config.mos->arp_table->ent[i]->haddr[5]); in PrintARPTable()