AutoIP Automatic LinkLocal IP Configuration.
Data Structures | |
struct | autoip |
Macros | |
#define | ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */ |
#define | ANNOUNCE_NUM 2 /* (number of announcement packets) */ |
#define | ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */ |
#define | autoip_init() /* Compatibility define, no init needed. */ |
#define | autoip_remove_struct(netif) do { (netif)->autoip = NULL; } while (0) |
Remove a struct autoip previously set to the netif using autoip_set_struct() More... | |
#define | AUTOIP_STATE_ANNOUNCING 2 |
#define | AUTOIP_STATE_BOUND 3 |
#define | AUTOIP_STATE_OFF 0 |
#define | AUTOIP_STATE_PROBING 1 |
#define | AUTOIP_TICKS_PER_SECOND (1000 / AUTOIP_TMR_INTERVAL) |
#define | AUTOIP_TMR_INTERVAL 100 |
#define | DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */ |
#define | MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */ |
#define | PROBE_MAX 2 /* seconds (maximum delay till repeated probe) */ |
#define | PROBE_MIN 1 /* second (minimum delay till repeated probe) */ |
#define | PROBE_NUM 3 /* (number of probe packets) */ |
#define | PROBE_WAIT 1 /* second (initial random delay) */ |
#define | RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */ |
Functions | |
void | autoip_arp_reply (struct netif *netif, struct etharp_hdr *hdr) |
Handles every incoming ARP Packet, called by etharp_arp_input. More... | |
void | autoip_network_changed (struct netif *netif) |
Handle a possible change in the network configuration. More... | |
void | autoip_set_struct (struct netif *netif, struct autoip *autoip) |
Set a struct autoip allocated by the application to work with. More... | |
err_t | autoip_start (struct netif *netif) |
Start AutoIP client. More... | |
err_t | autoip_stop (struct netif *netif) |
Stop AutoIP client. More... | |
void | autoip_tmr (void) |
Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds. More... | |
#define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */ |
Referenced by autoip_tmr().
#define ANNOUNCE_NUM 2 /* (number of announcement packets) */ |
Referenced by autoip_tmr().
#define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */ |
Referenced by autoip_tmr().
#define autoip_init | ( | ) | /* Compatibility define, no init needed. */ |
Referenced by lwip_init().
Remove a struct autoip previously set to the netif using autoip_set_struct()
#define AUTOIP_STATE_ANNOUNCING 2 |
Referenced by autoip_arp_reply(), and autoip_tmr().
#define AUTOIP_STATE_BOUND 3 |
Referenced by autoip_tmr().
#define AUTOIP_STATE_OFF 0 |
Referenced by autoip_arp_reply(), autoip_network_changed(), autoip_start(), and autoip_stop().
#define AUTOIP_STATE_PROBING 1 |
Referenced by autoip_arp_reply(), autoip_start_probing(), and autoip_tmr().
#define AUTOIP_TICKS_PER_SECOND (1000 / AUTOIP_TMR_INTERVAL) |
Referenced by autoip_handle_arp_conflict(), autoip_start_probing(), and autoip_tmr().
#define AUTOIP_TMR_INTERVAL 100 |
Referenced by autoip_timer(), and sys_timeouts_init().
#define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */ |
Referenced by autoip_handle_arp_conflict().
#define MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */ |
Referenced by autoip_start_probing().
#define PROBE_MAX 2 /* seconds (maximum delay till repeated probe) */ |
Referenced by autoip_tmr().
#define PROBE_MIN 1 /* second (minimum delay till repeated probe) */ |
Referenced by autoip_tmr().
#define PROBE_NUM 3 /* (number of probe packets) */ |
Referenced by autoip_tmr().
#define PROBE_WAIT 1 /* second (initial random delay) */ |
Referenced by autoip_start_probing().
#define RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */ |
Referenced by autoip_start_probing().
void autoip_arp_reply | ( | struct netif * | netif, |
struct etharp_hdr * | hdr | ||
) |
Handles every incoming ARP Packet, called by etharp_arp_input.
netif | network interface to use for autoip processing |
hdr | Incoming ARP packet |
References netif::autoip, AUTOIP_DEBUG, autoip_handle_arp_conflict(), autoip_restart(), AUTOIP_STATE_ANNOUNCING, AUTOIP_STATE_OFF, AUTOIP_STATE_PROBING, eth_addr_cmp, ETHADDR16_COPY, netif::hwaddr, ip_addr_cmp, IPADDR2_COPY, autoip::llipaddr, LWIP_DBG_LEVEL_WARNING, LWIP_DBG_STATE, LWIP_DBG_TRACE, LWIP_DEBUGF, NULL, autoip::sent_num, and autoip::state.
Referenced by etharp_arp_input().
Handle a possible change in the network configuration.
If there is an AutoIP address configured, take the interface down and begin probing with the same address.
References netif::autoip, autoip_start_probing(), AUTOIP_STATE_OFF, netif_set_down(), and autoip::state.
Referenced by netif_set_link_up().
Set a struct autoip allocated by the application to work with.
Set a struct autoip allocated by the application to work with.
Using this prevents autoip_start to allocate it using mem_malloc.
netif | the netif for which to set the struct autoip |
dhcp | (uninitialised) dhcp struct allocated by the application |
References netif::autoip, LWIP_ASSERT, and NULL.
Start AutoIP client.
netif | network interface on which start the AutoIP client |
References netif::autoip, autoip_create_addr(), AUTOIP_DEBUG, autoip_start_probing(), AUTOIP_STATE_OFF, ERR_MEM, ERR_OK, netif::gw, netif::ip_addr, ip_addr_set_zero, autoip::lastconflict, autoip::llipaddr, LWIP_DBG_STATE, LWIP_DBG_TRACE, LWIP_DEBUGF, mem_malloc, netif::name, netif_is_up, netif_set_down(), netif::netmask, NULL, netif::num, autoip::sent_num, autoip::state, autoip::ttw, and U16_F.
Referenced by autoip_restart(), dhcp_discover(), and net_interface_up_imp().
Stop AutoIP client.
netif | network interface on which stop the AutoIP client |
References netif::autoip, AUTOIP_STATE_OFF, ERR_OK, netif_set_down(), and autoip::state.
Referenced by dhcp_bind(), dhcp_network_changed(), dhcp_stop(), and net_interface_down_imp().
Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds.
References ANNOUNCE_INTERVAL, ANNOUNCE_NUM, ANNOUNCE_WAIT, netif::autoip, autoip_arp_announce(), autoip_arp_probe(), autoip_bind(), AUTOIP_DEBUG, AUTOIP_STATE_ANNOUNCING, AUTOIP_STATE_BOUND, AUTOIP_STATE_PROBING, AUTOIP_TICKS_PER_SECOND, ip4_addr1_16, ip4_addr2_16, ip4_addr3_16, ip4_addr4_16, autoip::lastconflict, autoip::llipaddr, LWIP_AUTOIP_RAND, LWIP_DBG_STATE, LWIP_DBG_TRACE, LWIP_DEBUGF, netif_list, netif::next, NULL, PROBE_MAX, PROBE_MIN, PROBE_NUM, autoip::sent_num, autoip::state, autoip::ttw, and U16_F.
Referenced by autoip_timer().