Commit 54286b40 authored by Mark Andrews's avatar Mark Andrews

Merge branch 'rt28261'

* rt28261:
  add new files
  Allow nsupdate to report which types it knows the internal structure to.
parents c6581f1a 4e59bd34
......@@ -14,3 +14,37 @@ autom4te.cache
*.la
*_test
timestamp
named.run
gen.dSYM/
.libs/
.deps/
.dirstamp
unit/atf-src/atf-c++/atf-c++.pc
unit/atf-src/atf-c/atf-c.pc
unit/atf-src/atf-c/defs.h
unit/atf-src/atf-c/detail/process_helpers
unit/atf-src/atf-config/atf-config
unit/atf-src/atf-report/atf-report
unit/atf-src/atf-report/fail_helper
unit/atf-src/atf-report/misc_helpers
unit/atf-src/atf-report/pass_helper
unit/atf-src/atf-run/atf-run
unit/atf-src/atf-run/bad_metadata_helper
unit/atf-src/atf-run/expect_helpers
unit/atf-src/atf-run/misc_helpers
unit/atf-src/atf-run/pass_helper
unit/atf-src/atf-run/several_tcs_helper
unit/atf-src/atf-run/zero_tcs_helper
unit/atf-src/atf-sh/atf-check
unit/atf-src/atf-sh/atf-sh
unit/atf-src/atf-sh/misc_helpers
unit/atf-src/atf-version/atf-version
unit/atf-src/atf-version/revision.h
unit/atf-src/atf-version/revision.h.stamp
unit/atf-src/bconfig.h
unit/atf-src/bootstrap/atconfig
unit/atf-src/doc/atf.7
unit/atf-src/stamp-h1
unit/atf-src/test-programs/c_helpers
unit/atf-src/test-programs/cpp_helpers
unit/atf-src/test-programs/sh_helpers
......@@ -934,11 +934,14 @@ get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
INSIST(count == 1);
}
#define PARSE_ARGS_FMT "dDML:y:ghlovk:p:rR::t:u:"
#define PARSE_ARGS_FMT "dDML:y:ghlovk:p:PrR::t:Tu:"
static void
pre_parse_args(int argc, char **argv) {
dns_rdatatype_t t;
int ch;
char buf[100];
isc_boolean_t doexit = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv, PARSE_ARGS_FMT)) != -1) {
switch (ch) {
......@@ -960,10 +963,34 @@ pre_parse_args(int argc, char **argv) {
"[-v] [filename]\n");
exit(1);
case 'P':
for (t = 0xff00; t <= 0xfffe; t++) {
if (dns_rdatatype_ismeta(t))
continue;
dns_rdatatype_format(t, buf, sizeof(buf));
if (strncmp(buf, "TYPE", 4) != 0)
fprintf(stdout, "%s\n", buf);
}
doexit = ISC_TRUE;
break;
case 'T':
for (t = 1; t <= 0xfeff; t++) {
if (dns_rdatatype_ismeta(t))
continue;
dns_rdatatype_format(t, buf, sizeof(buf));
if (strncmp(buf, "TYPE", 4) != 0)
fprintf(stdout, "%s\n", buf);
}
doexit = ISC_TRUE;
break;
default:
break;
}
}
if (doexit)
exit(0);
isc_commandline_reset = ISC_TRUE;
isc_commandline_index = 1;
}
......
......@@ -71,6 +71,8 @@
<arg><option>-r <replaceable class="parameter">udpretries</replaceable></option></arg>
<arg><option>-R <replaceable class="parameter">randomdev</replaceable></option></arg>
<arg><option>-v</option></arg>
<arg><option>-T</option></arg>
<arg><option>-P</option></arg>
<arg>filename</arg>
</cmdsynopsis>
</refsynopsisdiv>
......@@ -237,6 +239,21 @@
<filename>keyboard</filename> indicates that keyboard input
should be used. This option may be specified multiple times.
</para>
<para>
The <option>-T</option> and <option>-P</option> print out a
lists of non-meta types for which the type specific presentation
format is known. <option>-T</option> prints out the list of
assigned types. <option>-P</option> prints out the list of
private types. These options may be combined. nsupdate will
exit after the lists are printed.
</para>
<para>
Other types can be entered using "TYPEXXXXX" where "XXXXX" is the
decimal value of the type with no leading zeros. The rdata,
if present, will be parsed using the UNKNOWN rdata format,
(&lt;backslash&gt; &lt;hash&gt; &lt;space&gt; &lt;length&gt;
&lt;space&gt; &lt;hexstring&gt;).
</para>
</refsect1>
<refsect1>
......
......@@ -36,3 +36,4 @@ rm -f ns3/K*
rm -f dig.out.*
rm -f jp.out.ns3.*
rm -f Kxxx.*
rm -f typelist.out.*
......@@ -461,5 +461,25 @@ if [ $ret -ne 0 ]; then
status=1
fi
n=`expr $n + 1`
ret=0
echo "I:check type list options ($n)"
$NSUPDATE -T > typelist.out.T.${n} || { ret=1; echo "I: nsupdate -T failed"; }
$NSUPDATE -P > typelist.out.P.${n} || { ret=1; echo "I: nsupdate -P failed"; }
$NSUPDATE -TP > typelist.out.TP.${n} || { ret=1; echo "I: nsupdate -TP failed"; }
grep ANY typelist.out.T.${n} > /dev/null && { ret=1; echo "I: failed: ANY found (-T)"; }
grep ANY typelist.out.P.${n} > /dev/null && { ret=1; echo "I: failed: ANY found (-P)"; }
grep ANY typelist.out.TP.${n} > /dev/null && { ret=1; echo "I: failed: ANY found (-TP)"; }
grep KEYDATA typelist.out.T.${n} > /dev/null && { ret=1; echo "I: failed: KEYDATA found (-T)"; }
grep KEYDATA typelist.out.P.${n} > /dev/null || { ret=1; echo "I: failed: KEYDATA not found (-P)"; }
grep KEYDATA typelist.out.TP.${n} > /dev/null || { ret=1; echo "I: failed: KEYDATA not found (-TP)"; }
grep AAAA typelist.out.T.${n} > /dev/null || { ret=1; echo "I: failed: AAAA not found (-T)"; }
grep AAAA typelist.out.P.${n} > /dev/null && { ret=1; echo "I: failed: AAAA found (-P)"; }
grep AAAA typelist.out.TP.${n} > /dev/null || { ret=1; echo "I: failed: AAAA not found (-TP)"; }
if [ $ret -ne 0 ]; then
echo "I:failed"
status=1
fi
echo "I:exit status: $status"
exit $status
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment