Validating IP Address Variables
Programatically, IP address attributes support four extended properties: IP_MASK, SUBNET, ALLOW_32_BIT_MASK, and ALLOW_ANY_VALID_IP. The state of the first two largely defines Open Manage Network Manager’s responses.
IP_MASK -- Determines whether Open Manage Network Manager accepts an IP address OR a subnet/subnet mask. The value accepted is an IP address attribute when false, subnet/subnet mask when true.
SUBNET -- This property determines whether a subnet value must be provided or not, and controls display of the subnet portion of the widget. Valid subnet values are 1-31.
By default, when both of the above are false, the attribute only accepts valid IPv4 addresses. For example: 10.10.10.4
If IP_MASK is false and SUBNET is true then Open Manage Network Manager accepts any valid IP address with a subnet specified. The address must be an IP within the specified subnet. For example, 10.10.10.4/24 is a valid entry whereas 10.10.10.0/24 is invalid since it represents the subnet id, not an actual address within the subnet.
If IP_MASK is true and SUBNET is false, then Open Manage Network Manager accepts one of the 32 valid subnet masks. The widget displays pick list for user to choose from. For example 255.255.255.0
If IP_MASK is true and SUBNET is true, then Open Manage Network Manager accepts a subnet id (the first IP address within a subnet). For example 10.10.10.0/24, with 10.10.10.0 as the first address within the subnet spanning 10.10.10.0 to 10.10.10.254. Entering an IP address within the subnet, say 10.10.10.4/24, the attribute would convert that to 10.10.10.0/24
ALLOW_32_BIT_MASK -- Valid subnet values are between 1 and 31. To extend this to support a 32-bit subnet, which is essentially a single IP address (10.10.10.4/32), set the ALLOW_32_BIT_MASK property.
ALLOW_ANY_VALID_IP -- To accept either an IP address, IP address and subnet or subnet, then IP_MASK remains false, SUBNET is true. With the ALLOW_ANY_VALID_IP true, the subnet field is optional and Open Manage Network Manager disables any requirement that a subnet id be specified. Basically the only validation is that a valid IP address is entered. For example, in this configuration, 10.10.10.4, 10.10.10.4/24 and 10.10.10.0/24 would all be valid.