3 |
* Address Resolution Protocol module for IP over Ethernet |
* Address Resolution Protocol module for IP over Ethernet |
4 |
* |
* |
5 |
* $Log$ |
* $Log$ |
6 |
|
* Revision 1.24 2003/02/06 22:18:57 davidhaas |
7 |
|
* Add the following features and bugfixes: |
8 |
|
* |
9 |
|
* Added select() functionality to sockets library. |
10 |
|
* Support for errno in sockets library. |
11 |
|
* Byte ordering fixes. |
12 |
|
* basic lwip_ioctl(), FIONREAD, get/setsockopt() etc. support |
13 |
|
* |
14 |
|
* - added additional argument to netif_add to pass state pointer so that the |
15 |
|
* if_init function has access to context information before |
16 |
|
* the interface is added, without accessing globals. |
17 |
|
* |
18 |
|
* - added netif_remove() |
19 |
|
* |
20 |
|
* - to conserve cpu load the tcpip_tcp_timer should only be active |
21 |
|
* when tcbs that need it exist. |
22 |
|
* |
23 |
|
* - pass length of available data to callbacks for NETCONN_EVT_RCV events |
24 |
|
* |
25 |
|
* - added tcpip_link_input(), a hack to allow processing of PPP |
26 |
|
* packets in tcpip_thread() context. This saves threads and context |
27 |
|
* switches. |
28 |
|
* |
29 |
|
* - renamed incompatible ASSERT() macro to LWIP_ASSERT() to avoid name |
30 |
|
* collision. |
31 |
|
* |
32 |
|
* - changed a bunch of %d's to %u's in format strings for unsigned values. |
33 |
|
* |
34 |
|
* - added ip_frag to lwip_stats. |
35 |
|
* |
36 |
|
* - changed IP_REASS_MAXAGE and IP_REASS_TMO defaults to more realistic |
37 |
|
* values. |
38 |
|
* |
39 |
|
* - added sys_timeout_remove() function to cancel timeouts (needed by PPP |
40 |
|
* amongst other things). |
41 |
|
* |
42 |
|
* - tolerate NULL returns from sys_arch_timeouts() since some threads might |
43 |
|
* not need to use or have timeouts. |
44 |
|
* |
45 |
|
* - added sys_sem_wait_timeout() |
46 |
|
* |
47 |
|
* - moved mem_malloc() function to end of mem.c to work around tasking |
48 |
|
* compiler bug. |
49 |
|
* |
50 |
|
* - automatically bind to local tcp port if 0. |
51 |
|
* |
52 |
|
* - allow customization of port ranges for automatic local bindings. |
53 |
|
* |
54 |
|
* - corrected various typos, spelling errors, etc.. |
55 |
|
* |
56 |
|
* Thanks to Marc Boucher for many of these changes. |
57 |
|
* |
58 |
* Revision 1.23 2003/01/18 16:05:24 jani |
* Revision 1.23 2003/01/18 16:05:24 jani |
59 |
* When all entries are 0 due to the whole table changing since the last arp tick (past 10 seconds) there's no oldest entry and the new entry does not get a spot.Fix this (from Ed Sutter) |
* When all entries are 0 due to the whole table changing since the last arp tick (past 10 seconds) there's no oldest entry and the new entry does not get a spot.Fix this (from Ed Sutter) |
60 |
* |
* |
371 |
} /* for */ |
} /* for */ |
372 |
|
|
373 |
/* no matching ARP entry was found */ |
/* no matching ARP entry was found */ |
374 |
ASSERT("update_arp_entry: i == ARP_TABLE_SIZE", i == ARP_TABLE_SIZE); |
LWIP_ASSERT("update_arp_entry: i == ARP_TABLE_SIZE", i == ARP_TABLE_SIZE); |
375 |
|
|
376 |
DEBUGF(ETHARP_DEBUG, ("update_arp_entry: IP address not yet in table\n")); |
DEBUGF(ETHARP_DEBUG, ("update_arp_entry: IP address not yet in table\n")); |
377 |
/* allowed to insert an entry? */ |
/* allowed to insert an entry? */ |
389 |
DEBUGF(ETHARP_DEBUG, ("update_arp_entry: overwriting old stable entry %u\n", i)); |
DEBUGF(ETHARP_DEBUG, ("update_arp_entry: overwriting old stable entry %u\n", i)); |
390 |
/* stable entries should have no queued packets (TODO: allow later) */ |
/* stable entries should have no queued packets (TODO: allow later) */ |
391 |
#if ARP_QUEUEING |
#if ARP_QUEUEING |
392 |
ASSERT("update_arp_entry: arp_table[i].p == NULL", arp_table[i].p == NULL); |
LWIP_ASSERT("update_arp_entry: arp_table[i].p == NULL", arp_table[i].p == NULL); |
393 |
#endif |
#endif |
394 |
} else { |
} else { |
395 |
DEBUGF(ETHARP_DEBUG, ("update_arp_entry: filling empty entry %u with state %u\n", i, arp_table[i].state)); |
DEBUGF(ETHARP_DEBUG, ("update_arp_entry: filling empty entry %u with state %u\n", i, arp_table[i].state)); |
396 |
ASSERT("update_arp_entry: arp_table[i].state == ETHARP_STATE_EMPTY", arp_table[i].state == ETHARP_STATE_EMPTY); |
LWIP_ASSERT("update_arp_entry: arp_table[i].state == ETHARP_STATE_EMPTY", arp_table[i].state == ETHARP_STATE_EMPTY); |
397 |
} |
} |
398 |
/* set IP address */ |
/* set IP address */ |
399 |
ip_addr_set(&arp_table[i].ipaddr, ipaddr); |
ip_addr_set(&arp_table[i].ipaddr, ipaddr); |