autoip.c File Reference
`#include "lwip/opt.h"`
`#include "lwip/mem.h"`
`#include "lwip/ip_addr.h"`
`#include "lwip/netif.h"`
`#include "lwip/autoip.h"`
`#include "lwip/acd.h"`
`#include "lwip/etharp.h"`
`#include "lwip/prot/autoip.h"`
`#include <string.h>`

## Macros

#define | LWIP_AUTOIP_CREATE_SEED_ADDR(netif)

## Functions

void | autoip_set_struct (struct netif *netif, struct autoip *autoip)
void | autoip_remove_struct (struct netif *netif)
err_t | autoip_start (struct netif *netif)
void | autoip_network_changed_link_up (struct netif *netif)
void | autoip_network_changed_link_down (struct netif *netif)
err_t | autoip_stop (struct netif *netif)
u8_t | autoip_supplied_address (struct netif *netif)

## Detailed Description

AutoIP Automatic LinkLocal IP Configuration

This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform with RFC 3927. It uses IPv4 address conflict detection to evaluate the chosen address. The ACD module aims to be conform to RFC 5227. RFC 5227 is extracted out of RFC 3927 so the acd module fits nicely in autoip.

## Macro Definition Documentation

## LWIP_AUTOIP_CREATE_SEED_ADDR

#define LWIP_AUTOIP_CREATE_SEED_ADDR | ( |  | netif | ) |

Value:
lwip_htonl(AUTOIP_RANGE_START + ((u32_t)(((u8_t)(netif->hwaddr[4])) | \
((u32_t)((u8_t)(netif->hwaddr[5]))) << 8)))

Macro that generates the initial IP address to be tried by AUTOIP. If you want to override this, define it to something else in lwipopts.h.

## Function Documentation

## autoip_network_changed_link_down()

void autoip_network_changed_link_down | ( | struct netif * | netif | ) |

Handle a possible change in the network configuration: link down

If there is an AutoIP address configured and AutoIP is in cooperation with DHCP, then stop the autoip module. When the link goes up, we do not want the autoip module to start again. DHCP will initiate autoip when needed.

## autoip_network_changed_link_up()

void autoip_network_changed_link_up | ( | struct netif * | netif | ) |

Handle a possible change in the network configuration: link up

If there is an AutoIP address configured and AutoIP is not in cooperation with DHCP, start probing for previous address.

## autoip_supplied_address()

u8_t autoip_supplied_address | ( | struct netif * | netif | ) |

check if AutoIP supplied netif->ip_addr

Parameters

  netif | the netif to check

Returns
  1 if AutoIP supplied netif->ip_addr (state BOUND), 0 otherwise

netif::hwaddr
u8_t hwaddr[6U]
Definition: netif.h:350
netif
Definition: netif.h:269
lwip_htonl
u32_t lwip_htonl(u32_t n)
Definition: def.c:90