Commit 3af72dff authored by Lubos Slovak's avatar Lubos Slovak

Function for checking if domain name is wildcard.

refs #5
parent c23c0da9
......@@ -385,6 +385,15 @@ int dnslib_dname_is_subdomain(const dnslib_dname_t *sub,
/*----------------------------------------------------------------------------*/
int dnslib_dname_is_wildcard(const dnslib_dname_t *dname)
{
return (dname->size >= 2
&& dname->name[0] == 1
&& dname->name[1] == '*');
}
/*----------------------------------------------------------------------------*/
int dnslib_dname_matched_labels(const dnslib_dname_t *dname1,
const dnslib_dname_t *dname2)
{
......
......@@ -169,6 +169,16 @@ dnslib_dname_t *dnslib_dname_left_chop(const dnslib_dname_t *dname);
int dnslib_dname_is_subdomain(const dnslib_dname_t *sub,
const dnslib_dname_t *domain);
/*!
* \brief Checks if the domain name is a wildcard.
*
* \param dname Domain name to check.
*
* \retval <> 0 if \a dname is a wildcard domain name.
* \retval 0 otherwise.
*/
int dnslib_dname_is_wildcard(const dnslib_dname_t *dname);
/*!
* \brief Returns the number of labels common for the two domain names (counted
* from the rightmost label.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment