Home | History | Annotate | Download | only in c-ares

Lines Matching defs:cname

8  * and get the CNAME (host->h_name). Result will be:
9 * CNAME = zz<CC>.countries.nerd.dk with address 127.0.x.y (ver 1) or
10 * CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.x.y (ver 2)
97 static void find_country_from_cname(const char *cname, struct in_addr addr);
221 * Extract the CNAME and figure out the country-code from it.
226 const char *cname;
241 cname = host->h_name; /* CNAME gets put here */
242 if (!cname)
243 printf("Failed to get CNAME for %s\n", name);
245 find_country_from_cname(cname, *(struct in_addr*)host->h_addr);
548 * Find the country-code and name from the CNAME. E.g.:
549 * version 1: CNAME = zzno.countries.nerd.dk with address 127.0.2.66
551 * version 2: CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.2.66
554 static void find_country_from_cname(const char *cname, struct in_addr addr)
562 z0 = TOLOWER(cname[0]);
563 z1 = TOLOWER(cname[1]);
564 ccopy = strdup(cname);
567 ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1));
572 const char *dot = strchr(cname, '.');
573 if ((z0 != 'z' && z1 != 'z') || dot != cname+4)
575 printf("Unexpected CNAME %s (ver_1)\n", cname);
585 printf("Unexpected CNAME %s (ver_2)\n", cname);
591 printf("Unexpected CNAME %s (ver?)\n", cname);
597 ccode_A2[0] = (char)TOLOWER(cname[2]);
598 ccode_A2[1] = (char)TOLOWER(cname[3]);