49 #ifdef UIP_NEIGHBOR_CONF_ENTRIES
50 #define ENTRIES UIP_NEIGHBOR_CONF_ENTRIES
55 struct neighbor_entry {
57 struct uip_neighbor_addr addr;
60 static struct neighbor_entry entries[ENTRIES];
64 uip_neighbor_init(
void)
68 for(i = 0; i < ENTRIES; ++i) {
69 entries[i].time = MAX_TIME;
74 uip_neighbor_periodic(
void)
78 for(i = 0; i < ENTRIES; ++i) {
79 if(entries[i].time < MAX_TIME) {
86 uip_neighbor_add(
uip_ipaddr_t *ipaddr,
struct uip_neighbor_addr *addr)
98 for(i = 0; i < ENTRIES; ++i) {
99 if(entries[i].time == MAX_TIME) {
107 if(entries[i].time > oldest_time) {
109 oldest_time = entries[i].time;
115 entries[oldest].time = 0;
117 memcpy(&entries[oldest].addr, addr,
sizeof(
struct uip_neighbor_addr));
120 static struct neighbor_entry *
125 for(i = 0; i < ENTRIES; ++i) {
136 struct neighbor_entry *e;
138 e = find_entry(ipaddr);
144 struct uip_neighbor_addr *
147 struct neighbor_entry *e;
149 e = find_entry(ipaddr);