Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When you setup a client application, you MAY want to bind to a specific configured IP address. Knowing the destination IP address, you can use the functions function NetIPv4_GetAddrSrc() or NetIPv6_GetAddrSrc() to found the best suited configured IP address for your destination. 

...

Refer to section Socket Programming for more information on using network sockets.

TO DELETE

Removing Statically Assigned IP Addresses From An Interface

Statically assigned IPv4 addresses for a specific interface may be removed by calling NetIPv4_CfgAddrRemove().

Alternatively, the application may call NetIPv4_CfgAddrRemoveAll() to remove all configured static IPv4 addresses for a specific interface.

The same goes for IPv6. A statically assigned IPv6 address for a specific interface may be removed by calling NetIPv6_CfgAddrRemove(). Also, all statically configured IPv6 addresses for a specific interface can be removed by calling NetIPv6_CfgAddrRemoveAll().

Getting all the IP Addresses Configured on a Specific Interface

The application may obtain the IPv4 protocol address information for a specific interface by calling NetIPv4_GetAddrHost(). This function may return one or more configured addresses.

Similarly, the application may call NetIPv4_GetAddrSubnetMask() and NetIPv4_GetAddrDfltGateway() in order to determine the IPv4 subnet mask and IPv4 gateway information for a specific interface.

With IPv6, applications may obtain the IPv6 protocol address information for a specific interface by calling NetIPv6_GetAddrHost(). This function may return one or more configured addresses.

Assigning Static IP Addresses to an Interface 

IPv4

The constant NET_IPv4_CFG_IF_MAX_NBR_ADDR specified in net_cfg.h determines the maximum number of IPv4 addresses that may be assigned to an interface. Many IPv4 addresses may be added up to the specified maximum by calling NetIPv4_CfgAddrAdd(). 

Configuring an IPv4 gateway address is not necessary when communicating only within your local network.

 

IPv6 

With IPv6, the µC/TCP-IP stack can autoconfigured itself, meaning that it can setup its own IPv6 link-local address based on the MAC address of the Interface and also it can setup an IPv6 global address if a IPv6 router is present on the local network. The IPv6 autoconfiguration is not yet available with the µC/TCP-IP stack. 

It is still possible to setup IPv6 addresses manually by calling NetIPv6_CfgAddrAdd(). As for IPv4, the NET_IPv6_CFG_IF_MAX_NBR_ADDR specified in net_cfg.h determines the maximum number of IPv6 addresses that may be assigned to an interface.