Function

MalcontentWebFiltervalidate_hostname_len

unstable since: 0.14.0

Declaration [src]

gboolean
mct_web_filter_validate_hostname_len (
  const char* hostname,
  size_t max_len
)

Description [src]

Validate a potential hostname.

This checks against RFC 1035.

See mct_web_filter_validate_domain_name_len() for validating domain names instead. Domain names are entries in the DNS database, hostnames are website addresses. Every hostname is a domain name, but not vice-versa.

Available since: 0.14.0

Parameters

hostname

Type: const char*

A potential hostname.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
max_len

Type: size_t

Length (in bytes) to check, or until the first nul byte is reached.

Return value

Type: gboolean

True if hostname is a valid hostname, false otherwise.