20 #ifdef HAVE_NETINET_IN_H
21 #include <netinet/in.h>
23 #ifdef HAVE_SYS_SOCKET_H
24 #include <sys/socket.h>
29 #ifdef HAVE_ARPA_INET_H
30 #include <arpa/inet.h>
38 ldns_dname_last_label_is_root_label(
const ldns_rdf* dname)
43 for (src_pos = 0; src_pos <
ldns_rdf_size(dname); src_pos += len + 1) {
48 return src_pos > 0 && len == 0;
68 if (ldns_dname_last_label_is_root_label(rd1)) {
105 if (ldns_dname_last_label_is_root_label(rd1)) {
147 if (ldns_dname_last_label_is_root_label(dname)) {
148 buf[rd_size - 1] = 0;
151 for (src_pos = 0; src_pos < rd_size; src_pos += len + 1) {
153 memcpy(&buf[rd_size - src_pos - len - 1],
175 label_size = data[0] + 1;
177 if (data_size < label_size) {
181 data_size -= label_size;
238 while ((len > 0) && src_pos < r_size) {
320 if (sub_lab < par_lab) {
327 for (i = par_lab -1; i >= 0; i--) {
330 if (!tmp_sub || !tmp_par) {
358 size_t lc1, lc2, lc1f, lc2f;
367 if (!dname1 && !dname2) {
370 if (!dname1 || !dname2) {
383 if (lc1 == 0 && lc2 == 0) {
413 for (i = 1; i < (size_t)(*lp1 + 1); i++) {
434 if (lc1 == 0 && lc2 > 0) {
437 }
else if (lc1 > 0 && lc2 == 0) {
440 }
else if (lc1 == 0 && lc2 == 0) {
488 int prev_check, next_check;
499 if (next_check == 0) {
504 if ((prev_check == -1 || prev_check == 0) &&
518 if(dname_str && strcmp(dname_str,
".") == 0)
520 if(!dname_str || strlen(dname_str) < 2)
522 if(dname_str[strlen(dname_str) - 1] !=
'.')
524 if(dname_str[strlen(dname_str) - 2] !=
'\\')
527 for(s=dname_str; *s; s++) {
529 if(s[1] && s[2] && s[3]
530 && isdigit(s[1]) && isdigit(s[2]) &&
533 else if(!s[1] || isdigit(s[1]))
537 else if(!*(s+1) && *s ==
'.')
574 while ((len > 0) && src_pos < s) {
575 if (labelcnt == labelpos) {
582 data[len + 2 - 1] = 0;