*/
/**
- *
- *
* @file gns/gnunet-service-gns_resolver.c
* @brief GNUnet GNS resolver logic
* @author Martin Schanzenbach
*/
static unsigned long long rid = 0;
+/*
+ * Check if name is in srv format (_x._y.xxx)
+ *
+ * @param name
+ * @return GNUNET_YES if true
+ */
static int
is_srv (char* name)
{
char* ndup;
- int ret = 1;
+ int ret = GNUNET_YES;
if (*name != '_')
- return 0;
+ return GNUNET_NO;
if (NULL == strstr (name, "._"))
- return 0;
+ return GNUNET_NO;
ndup = GNUNET_strdup (name);
strtok (ndup, ".");
if (NULL == strtok (NULL, "."))
- ret = 0;
+ ret = GNUNET_NO;
if (NULL == strtok (NULL, "."))
- ret = 0;
+ ret = GNUNET_NO;
if (NULL != strtok (NULL, "."))
- ret = 0;
+ ret = GNUNET_NO;
GNUNET_free (ndup);
&rh->private_local_zone))
check_dht = GNUNET_NO;
- if ((strcmp (rh->name, "+") != 0) && (is_srv (rh->name) != 0))
+ if ((strcmp (rh->name, "+") != 0) && (is_srv (rh->name) == GNUNET_YES))
check_dht = GNUNET_NO;