Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
f5b7359c
Commit
f5b7359c
authored
Mar 05, 2012
by
Mark Andrews
Browse files
Allow nsupdate to report which types it knows the internal structure to.
parent
a26e1cac
Changes
4
Hide whitespace changes
Inline
Side-by-side
bin/nsupdate/nsupdate.c
View file @
f5b7359c
...
...
@@ -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:
P
rR::t:
T
u:"
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
;
}
...
...
bin/nsupdate/nsupdate.docbook
View file @
f5b7359c
...
...
@@ -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,
(
<
backslash
>
<
hash
>
<
space
>
<
length
>
<
space
>
<
hexstring
>
).
</para>
</refsect1>
<refsect1>
...
...
bin/tests/system/nsupdate/clean.sh
View file @
f5b7359c
...
...
@@ -36,3 +36,4 @@ rm -f ns3/K*
rm
-f
dig.out.
*
rm
-f
jp.out.ns3.
*
rm
-f
Kxxx.
*
rm
-f
typelist.out.
*
bin/tests/system/nsupdate/tests.sh
View file @
f5b7359c
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment