*************************************************/
/* Copyright (c) University of Cambridge 1995 - 2018 */
+/* Copyright (c) The Exim Maintainers 2015 - 2021 */
/* See the file NOTICE for conditions of use and distribution. */
[UNEXPECTED] = US"UNEXPECTED",
[CANCELLED] = US"CANCELLED",
[FAIL_SEND] = US"FAIL_SEND",
- [FAIL_DROP] = US"FAIL_DROP"
+ [FAIL_DROP] = US"FAIL_DROP",
+ [DANE] = US"DANE",
+};
+
+const uschar * dns_rc_names[] = {
+ [DNS_SUCCEED] = US"DNS_SUCCEED",
+ [DNS_NOMATCH] = US"DNS_NOMATCH",
+ [DNS_NODATA] = US"DNS_NODATA",
+ [DNS_AGAIN] = US"DNS_AGAIN",
+ [DNS_FAIL] = US"DNS_FAIL",
};
moves down the page. This function is used only in debugging circumstances. The
output is done via debug_printf(). */
-#define tree_printlinesize 132 /* line size for printing */
-static uschar tree_printline[tree_printlinesize];
+#define TREE_PRINTLINESIZE 132 /* line size for printing */
+static uschar tree_printline[TREE_PRINTLINESIZE];
/* Internal recursive subroutine.
*/
static void
-tree_printsub(tree_node *p, int pos, int barswitch)
+tree_printsub(tree_node * p, int pos, int barswitch)
{
if (p->right) tree_printsub(p->right, pos+2, 1);
-for (int i = 0; i <= pos-1; i++) debug_printf("%c", tree_printline[i]);
-debug_printf("-->%s [%d]\n", p->name, p->balance);
-tree_printline[pos] = barswitch? '|' : ' ';
+for (int i = 0; i <= pos-1; i++) debug_printf_indent(" %c", tree_printline[i]);
+debug_printf_indent(" -->%s [%d]\n", p->name, p->balance);
+tree_printline[pos] = barswitch ? '|' : ' ';
if (p->left)
{
tree_printline[pos+2] = '|';
/* The external function, with just a tree node argument. */
void
-debug_print_tree(tree_node *p)
+debug_print_tree(const char * title, tree_node * p)
{
-for (int i = 0; i < tree_printlinesize; i++) tree_printline[i] = ' ';
-if (!p) debug_printf("Empty Tree\n"); else tree_printsub(p, 0, 0);
-debug_printf("---- End of tree ----\n");
+debug_printf_indent("%s:\n", title);
+for (int i = 0; i < TREE_PRINTLINESIZE; i++) tree_printline[i] = ' ';
+if (!p) debug_printf_indent(" Empty Tree\n"); else tree_printsub(p, 0, 0);
+debug_printf_indent("---- End of tree ----\n");
}
g = string_fmt_append(g, " lcl [%s]:%u",
inet_ntoa(sinp->sin_addr), ntohs(sinp->sin_port));
alen = sizeof(*sinp);
- if (getpeername(fd, sinp, &alen) == 0)
+ if (getpeername(fd, (struct sockaddr *)sinp, &alen) == 0)
g = string_fmt_append(g, " rmt [%s]:%u",
inet_ntoa(sinp->sin_addr), ntohs(sinp->sin_port));
break;
inet_ntop(AF_INET6, &sin6p->sin6_addr, CS buf, sizeof(buf)),
ntohs(sin6p->sin6_port));
alen = sizeof(*sin6p);
- if (getpeername(fd, sin6p, &alen) == 0)
+ if (getpeername(fd, (struct sockaddr *)sin6p, &alen) == 0)
g = string_fmt_append(g, " rmt [%s]:%u",
inet_ntop(AF_INET6, &sin6p->sin6_addr, CS buf, sizeof(buf)),
ntohs(sin6p->sin6_port));
sunp->sun_path[0] ? US"" : US"@",
sunp->sun_path[0] ? sunp->sun_path : sunp->sun_path+1);
alen = sizeof(*sunp);
- if (getpeername(fd, sunp, &alen) == 0)
+ if (getpeername(fd, (struct sockaddr *)sunp, &alen) == 0)
g = string_fmt_append(g, " rmt %s%s",
sunp->sun_path[0] ? US"" : US"@",
sunp->sun_path[0] ? sunp->sun_path : sunp->sun_path+1);