def _aa_broadcast_address(self): """ The broadcast address option option broadcast-address 123.123.123.123; This option specifies the broadcast address in use on the client's subnet. Legal values for broadcast addresses are specified in section 3.2.1.3 of STD 3 (RFC1122). """ self.is_option = True self.is_statement = False self.has_validator = True val = self._get_value() if not is_valid_ip(val): raise ValidationError("{0} is not a valid ip address".format(val))
def _aa_next_server(self): """ The next-server statement next-server server-name; The next-server statement is used to specify the host address of the server from which the initial boot file (specified in the filename statement) is to be loaded. Server-name should be a numeric IP address or a domain name. If no next-server parameter applies to a given client, the DHCP server's IP address is used. """ self.is_option = False self.is_statement = True self.has_validator = True val = self._get_value() if not (is_valid_ip(val) or is_valid_domain(val)): raise ValidationError("{0} is not a valid next-server statement " "and should be an ip or domain".format(val))
def _aa_subnet_mask(self): """ The subnet-mask option option subnet-mask 255.255.255.0; The subnet mask option specifies the client's subnet mask as per RFC 950. If no subnet mask option is provided anywhere in scope, as a last resort dhcpd will use the subnet mask from the subnet declaration for the network on which an address is being assigned. However, any subnet-mask option declaration that is in scope for the address being assigned will override the subnet mask specified in the subnet declaration. """ self.is_option = True self.is_statement = False self.has_validator = True val = self._get_value() if not is_valid_ip(val): raise ValidationError("{0} is not a valid ip address".format(val))