++ New features:
+ 2007-03-28 Frédéric Bernon
+ * netif.h, netif.c: A new NETIF_FLAG_ETHARP flag is defined in netif.h, to allow to
+ initialize a network interface's flag with. It tell this interface is an ethernet
+ device, and we can use ARP with it to do a "gratuitous ARP" (RFC 3220 "IP Mobility
+ Support for IPv4" section 4.6) when interface is "up" with netif_set_up().
+
2007-03-26 Frédéric Bernon, Jonathan Larmour
* opt.h, tcpip.c: New configuration option LWIP_ARP allow to disable ARP init at build
time if you only use PPP or SLIP. The default is enable. Note we don't have to call
#include "lwip/tcp.h"
#include "lwip/snmp.h"
+#if LWIP_ARP
+#include "netif/etharp.h"
+#endif /* LWIP_ARP */
+
+
struct netif *netif_list = NULL;
struct netif *netif_default = NULL;
snmp_insert_ipaddridx_tree(netif);
snmp_insert_iprteidx_tree(0,netif);
-#if 0 /* only allowed for Ethernet interfaces TODO: how can we check? */
- /** For Ethernet network interfaces, we would like to send a
- * "gratuitous ARP"; this is an ARP packet sent by a node in order
- * to spontaneously cause other nodes to update an entry in their
- * ARP cache. From RFC 3220 "IP Mobility Support for IPv4" section 4.6.
- */
- etharp_query(netif, ipaddr, NULL);
-#endif
LWIP_DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: IP address of interface %c%c set to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
netif->name[0], netif->name[1],
ip4_addr1(&netif->ip_addr),
#if LWIP_SNMP
snmp_get_sysuptime(&netif->ts);
-#endif
+#endif /* LWIP_SNMP */
+
#if LWIP_NETIF_CALLBACK
if ( netif->status_callback )
(netif->status_callback)( netif );
#endif /* LWIP_NETIF_CALLBACK */
+
+#if LWIP_ARP
+ /** For Ethernet network interfaces, we would like to send a
+ * "gratuitous ARP"; this is an ARP packet sent by a node in order
+ * to spontaneously cause other nodes to update an entry in their
+ * ARP cache. From RFC 3220 "IP Mobility Support for IPv4" section 4.6.
+ */
+ if ((netif->flags & NETIF_FLAG_ETHARP) == 0) {
+ etharp_query(netif, &(netif->ip_addr), NULL);
+ }
+#endif /* LWIP_ARP */
+
}
}
/** if set, the interface has an active link
* (set by the network interface driver) */
#define NETIF_FLAG_LINK_UP 0x10U
+/** if set, the netif is an device using ARP */
+#define NETIF_FLAG_ETHARP 0x20U
/** Generic data structure used for all lwIP network interfaces.
* The following fields should be filled in by the initialization
#if LWIP_DHCP
/** the DHCP client state information for this netif */
struct dhcp *dhcp;
-#endif
+#endif /* LWIP_DHCP */
/** number of bytes used in hwaddr */
u8_t hwaddr_len;
/** link level hardware address of this interface */
u32_t ifoutucastpkts;
u32_t ifoutnucastpkts;
u32_t ifoutdiscards;
-#endif
+#endif /* LWIP_SNMP */
#if LWIP_IGMP
/* This function could be called to add or delete a entry in the multicast filter table of the ethernet MAC.*/
err_t (*igmp_mac_filter)( struct netif *netif, struct ip_addr *group, u8_t action);
-#endif
+#endif /* LWIP_IGMP */
};
/** The list of network interfaces. */