IP Functions
...
Function Name | Description |
---|---|
NetIPv4_CfgAddrAdd() | Add a |
...
statically-configured IPv4 host address, subnet mask, and default gateway to an interface. |
Files
net_ip.h/net_ip.c
Prototype
Arguments
if_nbr
Interface number to configure.
addr_host
Desired IP address to add to this interface.
addr_subnet_mask
Desired IP address subnet mask.
addr_dflt_gateway
Desired IP default gateway address.
perr
Pointer to variable that will receive the error code from this function:
NET_IP_ERR_NONE
NET_IP_ERR_INVALID_ADDR_HOST
NET_IP_ERR_INVALID_ADDR_GATEWAY
NET_IP_ERR_ADDR_CFG_STATE
NET_IP_ERR_ADDR_TBL_FULL
NET_IP_ERR_ADDR_CFG_IN_USE
NET_IF_ERR_INVALID_IF
NET_OS_ERR_LOCK
Returned Value
DEF_OK
,
if valid IP address, subnet mask, and default gateway statically-configured;
DEF_FAIL
,
otherwise.
Required Configuration
None.
Notes / Warnings
IP addresses must be configured in host-order.
An interface may be configured with either:
...
If an interface’s address(es) are dynamically-configured, no statically-configured address(es) may be added until all dynamically-configured address(es) are removed.
The maximum number of IP address(es) configured on any interface is limited to NET_IP_CFG_IF_MAX_NBR_ADDR
(see section D-9-1).
Note that on the default interface, the first IP address added will be the default address used for all default communication. See also section C-9-1.
...
NetIPv4_CfgAddrAddDynamic() | Add a dynamically-configured IPv4 host address, subnet mask, and default gateway to an interface. |
NetIPv4_CfgAddrAddDynamicStart() | Start dynamic IPv4 address configuration for an interface. |
NetIPv4_CfgAddrAddDynamicStop() | Stop dynamic IPv4 address configuration for an interface. |
NetIPv4_CfgAddrRemove() | Remove a configured IPv4 host address from an interface. |
NetIPv4_CfgAddrRemoveAll() | Remove all configured IPv4 host address(es) from an interface. |
NetIPv4_CfgFragReasmTimeout() | Configure IPv4 fragment reassembly timeout. |
NetIPv4_GetAddrDfltGateway() | Get the default gateway IPv4 address for a host’s configured IPv4 address. |
NetIPv4_GetAddrHost() | Get an interface’s configured IPv4 host address(es). |
NetIPv4_GetAddrSrc() | Get corresponding configured IPv4 host address for a remote IPv4 address to use as source address. |
NetIPv4_GetAddrSubnetMask() | Get the IPv4 address subnet mask for a host’s configured IPv4 address. |
NetIPv4_IsAddrBroadcast() | Validate an IPv4 address as the limited broadcast IPv4 address. |
NetIPv4_IsAddrClassA() | Validate an IPv4 address as a Class-A IPv4 address. |
NetIPv4_IsAddrClassB() | Validate an IPv4 address as a Class-B IPv4 address. |
NetIPv4_IsAddrClassC() | Validate an IPv4 address as a Class-C 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_IsAddrLocalHost() | Validate an IPv4 address as a Localhost IPv4 address. |
NetIPv4_IsAddrLocalLink() | Validate an IPv4 address as a link-local IPv4 address. |
NetIPv4_IsAddrsHostCfgdOnIF() | Check if any IPv4 address(es) are configured on an interface. |
NetIPv4_IsAddrThisHost() | Validate an IPv4 address as the ‘This Host’ initialization IPv4 address. |
NetIPv4_IsValidAddrHost() | Validate an IPv4 address as a valid IPv4 host address. |
NetIPv4_IsValidAddrHostCfgd() | Validate an IPv4 address as a valid, configurable IPv4 host address. |
NetIPv4_IsValidAddrSubnetMask() | Validate an IPv4 address subnet mask. |