...
IP
...
Functions
...
NetIP_CfgAddrAdd()
...
Files
...
net_ip.h/net_ip.c
...
rowspan | 5 |
---|
...
Prototype
Arguments
if_nbr
Anchor
Interface number to configure.
Anchor
addr_host
Desired IP address to add to this interface.
Anchor
addr_subnet_mask
anchorDesired IP address subnet mask.
Anchor
addr_dflt_gateway
anchorDesired IP default gateway address.
...
perr
Anchor
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
Anchor
DEF_OK
,if valid IP address, subnet mask, and default gateway statically-configured;
Anchor
DEF_FAIL
,anchorotherwise.
...
Required Configuration
...
Notes / Warnings
...
...
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.
Anchor
NET_IP_CFG_IF_MAX_NBR_ADDR
(see section D-9-1 on page 752).A host may be configured without a gateway address to allow communication only with other hosts on its local network. However, any configured gateway address must be on the same network as the configured host IP address (i.e., the network portion of the configured IP address and the configured gateway addresses must be identical).