camel-hostname-utils

camel-hostname-utils

Functions

Description

Functions

camel_hostname_utils_requires_ascii ()

gboolean
camel_hostname_utils_requires_ascii (const gchar *hostname);

Check whether the hostname requires conversion to ASCII. That can be when a character in it can look like an ASCII character, even it being a Unicode letter. This can be used to display host names in a way of invulnerable to IDN homograph attacks.

Parameters

hostname

a host name

 

Returns

TRUE, when the hostname should be converted to an ASCII equivalent, FALSE, when it can be shown as is.

Since: 3.44


camel_hostname_utils_host_is_in_domain ()

gboolean
camel_hostname_utils_host_is_in_domain
                               (const gchar *host,
                                const gchar *domain);

Check whether the hostname host is equal to or a subdomain of domain . Both host and domain are UTF-8 strings and can be IDNs (which will be punycode-encoded for comparison).

Parameters

host

The hostname to check.

[nullable]

domain

The domain name.

[nullable]

Returns

TRUE if host is a subdomain of domain (or the same domain). FALSE if not, or if either argument is null or in some way invalid as a domain/hostname.

Since: 3.54