many fixes in icmp and rtl8139 driver code
[quarnos.git] / resources / net / arp_table.cpp
blob45db167859c9f346041d2fe874c6fa54e58db8fd
1 #include "arp_table.h"
3 using namespace net;
5 void arp_table::add(const arp_record &x) {
6 for (int i = 0; i < table.get_count();)
7 if (table[i].paddr == x.paddr)
8 table.remove(i);
9 else
10 i++;
12 table.add(x);
15 p<arp_table::arp_record> arp_table::get(const ipv4_addr &x) {
16 for (int i = 0; i < table.get_count(); i++)
17 if (table[i].paddr == x)
18 return &table[i];
20 return p<arp_table::arp_record>::invalid;