1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
/*++
/* NAME
/* dns_str_resflags 3
/* SUMMARY
/* convert resolver flags to printable form
/* SYNOPSIS
/* #include <dns.h>
/*
/* const char *dns_str_resflags(mask)
/* unsigned long mask;
/* DESCRIPTION
/* dns_str_resflags() converts RES_* resolver(5) flags from internal
/* form to printable string. Individual flag names are separated
/* with '|'. The result is overwritten with each call.
/* LICENSE
/* .ad
/* .fi
/* The Secure Mailer license must be distributed with this software.
/* AUTHOR(S)
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*
/* Viktor Dukhovni
/*--*/
/*
* System library.
*/
#include <sys_defs.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
/*
* Utility library.
*/
#include <name_mask.h>
/*
* DNS library.
*/
#include <dns.h>
/*
* Application-specific.
*/
/*
* This list overlaps with dns_res_opt_masks[] in smtp.c, but there we
* permit only a small subset of all possible flags.
*/
static const LONG_NAME_MASK resflag_table[] = {
"RES_INIT", RES_INIT,
"RES_DEBUG", RES_DEBUG,
#if defined(RES_AAONLY) && !HAVE_GLIBC_API_VERSION_SUPPORT(2, 24)
"RES_AAONLY", RES_AAONLY,
#endif
"RES_USEVC", RES_USEVC,
#if defined(RES_PRIMARY) && !HAVE_GLIBC_API_VERSION_SUPPORT(2, 24)
"RES_PRIMARY", RES_PRIMARY,
#endif
"RES_IGNTC", RES_IGNTC,
"RES_RECURSE", RES_RECURSE,
"RES_DEFNAMES", RES_DEFNAMES,
"RES_STAYOPEN", RES_STAYOPEN,
"RES_DNSRCH", RES_DNSRCH,
#ifdef RES_INSECURE1
"RES_INSECURE1", RES_INSECURE1,
#endif
#ifdef RES_INSECURE2
"RES_INSECURE2", RES_INSECURE2,
#endif
"RES_NOALIASES", RES_NOALIASES,
#ifdef RES_USE_INET6
"RES_USE_INET6", RES_USE_INET6,
#endif
#ifdef RES_ROTATE
"RES_ROTATE", RES_ROTATE,
#endif
#if defined(RES_NOCHECKNAME) && !HAVE_GLIBC_API_VERSION_SUPPORT(2, 24)
"RES_NOCHECKNAME", RES_NOCHECKNAME,
#endif
"RES_USE_EDNS0", RES_USE_EDNS0,
"RES_USE_DNSSEC", RES_USE_DNSSEC,
#if defined(RES_KEEPTSIG) && !HAVE_GLIBC_API_VERSION_SUPPORT(2, 24)
"RES_KEEPTSIG", RES_KEEPTSIG,
#endif
#if defined(RES_BLAST) && !HAVE_GLIBC_API_VERSION_SUPPORT(2, 24)
"RES_BLAST", RES_BLAST,
#endif
#ifdef RES_USEBSTRING
"RES_USEBSTRING", RES_USEBSTRING,
#endif
#ifdef RES_NSID
"RES_NSID", RES_NSID,
#endif
#ifdef RES_NOIP6DOTINT
"RES_NOIP6DOTINT", RES_NOIP6DOTINT,
#endif
#ifdef RES_USE_DNAME
"RES_USE_DNAME", RES_USE_DNAME,
#endif
#ifdef RES_NO_NIBBLE2
"RES_NO_NIBBLE2", RES_NO_NIBBLE2,
#endif
#ifdef RES_SNGLKUP
"RES_SNGLKUP", RES_SNGLKUP,
#endif
#ifdef RES_SNGLKUPREOP
"RES_SNGLKUPREOP", RES_SNGLKUPREOP,
#endif
#ifdef RES_NOTLDQUERY
"RES_NOTLDQUERY", RES_NOTLDQUERY,
#endif
0,
};
/* dns_str_resflags - convert RES_* resolver flags to printable form */
const char *dns_str_resflags(unsigned long mask)
{
static VSTRING *buf;
if (buf == 0)
buf = vstring_alloc(20);
return (str_long_name_mask_opt(buf, "dsns_str_resflags", resflag_table,
mask, NAME_MASK_NUMBER | NAME_MASK_PIPE));
}
|