Versions Compared

Key

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

...

Include fileDescription
IP/IPv4/net_ipv4.hFunctions used for IPv4 API.
IP/IPv6/net_ipv6.hFunctions used for IPv6 API.
Souce/net_ascii.hFunctions and Macro used for conversion utilities API.

Configuration

Some parameters should be configured and/or optimized for your project requirements. Please refer to the section IPv4 Layer Configuration and IPv6 Layer Configuration for further details. 

...

Function NameDescription
IPv4
NetIPv4_GetAddrHost()Get an interface’s configured IPv4 host address(es).
NetIPv4_GetAddrSrc()Get corresponding configured IPv4 host address  to address to use as source address for a remote IPv4 address.
NetIPv4_GetAddrDfltGateway() Get the default gateway IPv4 address for a host’s configured IPv4 address.
NetIPv4_GetAddrSubnetMask() Get the IPv4 address subnet mask for a host’s configured IPv4 address.
NetIPv4_IsAddrHost()Validate an IPv4 address as one the host’s IPv4 address(es).
NetIPv4_IsAddrHostCfgd()Validate an IPv4 address as one the host’s configured IPv4 address(es).
NetIPv4_IsAddrsHostCfgdOnIF()Check if any IPv4 address(es) are configured on an interface.
IPv6
NetIPv6_GetAddrHost()Get an interface's configured IPv6 host address(es).
NetIPv6_GetAddrSrc()Find the best matched source address in the IPv6 configured host addresses for the specified destination address.
NetIPv6_IsAddrHostCfgd()Validate an IPv6 address as a configured IPv6 host address on an enabled interface.
NetIPv6_IsAddrsCfgdOnIF()Validate if any IPv6 host addresses are configured on a specific interface.

...

See section IP Address Configuration for an example on how to configure a static IPv4 or IPv6 on a specific IntefaceInterface

Dynamic IP Address Configuration On An Interface

IPv4 address can be configured dynamically on an inteface by integrating µC/DHCP-c DHCPc to your application. 

If you want to develop your how network application to setup dynamic addressing, the IPv4 functions NetIPv4_CfgAddrAddDynamic()NetIPv4_CfgAddrAddDynamicStart()NetIPv4_CfgAddrAddDynamicStop() should be used. 

Dynamic addressing address configuration is not yet availabe for IPv6.

...

You also have the option to bind to the wildcard adress (0.0.0.0 for IPv4 and :: for IPv6). In that case, the server socket is not bound to any IP address in particular, therefore any packets send to the corresponding server port number will be received by the server regardless of the destination address. When sending packets, the µC/TCP-IP stack will take charge care of setting the best source address for the destination.

...

If you don't bound to an IP address, the µC/TCP-IP stack will take charge care of setting the source address of packets to send.

...