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
2192b449
Commit
2192b449
authored
Jan 22, 1999
by
Mark Andrews
Browse files
HINFO and TXT now handle quoted strings.
parent
110d1702
Changes
6
Hide whitespace changes
Inline
Side-by-side
bin/tests/rdata_test.c
View file @
2192b449
...
...
@@ -65,8 +65,9 @@ main(int argc, char *argv[]) {
int
debug
=
0
;
isc_region_t
region
;
int
first
=
1
;
int
raw
=
0
;
while
((
c
=
getopt
(
argc
,
argv
,
"dqswtaz"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"dqswta
r
z"
))
!=
-
1
)
{
switch
(
c
)
{
case
'd'
:
debug
=
1
;
...
...
@@ -91,6 +92,9 @@ main(int argc, char *argv[]) {
case
'z'
:
zero
=
1
;
break
;
case
'r'
:
raw
=
1
;
break
;
}
}
...
...
@@ -178,6 +182,19 @@ main(int argc, char *argv[]) {
fflush
(
stdout
);
continue
;
}
if
(
raw
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
rdata
.
length
;
/* */
)
{
fprintf
(
stdout
,
"%02x"
,
rdata
.
data
[
i
]);
if
((
++
i
%
20
)
==
0
)
fputs
(
"
\n
"
,
stdout
);
else
if
(
i
==
rdata
.
length
)
fputs
(
"
\n
"
,
stdout
);
else
fputs
(
" "
,
stdout
);
}
}
/* Convert to wire and back? */
if
(
wire
)
{
...
...
lib/dns/rdata.c
View file @
2192b449
...
...
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: rdata.c,v 1.1
1
1999/01/22 01:2
1:02 explorer
Exp $ */
/* $Id: rdata.c,v 1.1
2
1999/01/22 01:2
7:29 marka
Exp $ */
#include <config.h>
...
...
@@ -607,6 +607,8 @@ gettoken(isc_lex_t *lexer, isc_token_t *token, isc_tokentype_t expect,
isc_boolean_t
eol
)
{
unsigned
int
options
=
ISC_LEXOPT_EOL
|
ISC_LEXOPT_EOF
;
if
(
expect
==
isc_tokentype_qstring
)
options
|=
ISC_LEXOPT_QSTRING
;
if
(
expect
==
isc_tokentype_number
)
options
|=
ISC_LEXOPT_NUMBER
;
if
(
isc_lex_gettoken
(
lexer
,
options
,
token
)
!=
ISC_R_SUCCESS
)
...
...
@@ -614,6 +616,9 @@ gettoken(isc_lex_t *lexer, isc_token_t *token, isc_tokentype_t expect,
if
(
eol
&&
((
token
->
type
==
isc_tokentype_eol
)
||
(
token
->
type
==
isc_tokentype_eof
)))
return
(
DNS_R_SUCCESS
);
if
(
token
->
type
==
isc_tokentype_string
&&
expect
==
isc_tokentype_qstring
)
return
(
DNS_R_SUCCESS
);
if
(
token
->
type
!=
expect
)
{
isc_lex_ungettoken
(
lexer
,
token
);
if
(
token
->
type
==
isc_tokentype_eol
||
...
...
lib/dns/rdata/generic/hinfo_13.c
View file @
2192b449
...
...
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: hinfo_13.c,v 1.
6
1999/01/22 0
0:36:55
marka Exp $ */
/* $Id: hinfo_13.c,v 1.
7
1999/01/22 0
1:27:30
marka Exp $ */
#ifndef RDATA_GENERIC_HINFO_13_H
#define RDATA_GENERIC_HINFO_13_H
...
...
@@ -34,7 +34,7 @@ fromtext_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
downcase
=
downcase
;
/*unused*/
for
(
i
=
0
;
i
<
2
;
i
++
)
{
RETERR
(
gettoken
(
lexer
,
&
token
,
isc_tokentype_string
,
RETERR
(
gettoken
(
lexer
,
&
token
,
isc_tokentype_
q
string
,
ISC_FALSE
));
RETERR
(
txt_fromtext
(
&
token
.
value
.
as_textregion
,
target
));
}
...
...
lib/dns/rdata/generic/hinfo_13.h
View file @
2192b449
...
...
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: hinfo_13.h,v 1.
6
1999/01/22 0
0:36:55
marka Exp $ */
/* $Id: hinfo_13.h,v 1.
7
1999/01/22 0
1:27:30
marka Exp $ */
#ifndef RDATA_GENERIC_HINFO_13_H
#define RDATA_GENERIC_HINFO_13_H
...
...
@@ -34,7 +34,7 @@ fromtext_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
downcase
=
downcase
;
/*unused*/
for
(
i
=
0
;
i
<
2
;
i
++
)
{
RETERR
(
gettoken
(
lexer
,
&
token
,
isc_tokentype_string
,
RETERR
(
gettoken
(
lexer
,
&
token
,
isc_tokentype_
q
string
,
ISC_FALSE
));
RETERR
(
txt_fromtext
(
&
token
.
value
.
as_textregion
,
target
));
}
...
...
lib/dns/rdata/generic/txt_16.c
View file @
2192b449
...
...
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: txt_16.c,v 1.
6
1999/01/22 0
0:36:58
marka Exp $ */
/* $Id: txt_16.c,v 1.
7
1999/01/22 0
1:27:30
marka Exp $ */
#ifndef RDATA_GENERIC_TXT_16_H
#define RDATA_GENERIC_TXT_16_H
...
...
@@ -33,9 +33,10 @@ fromtext_txt(dns_rdataclass_t class, dns_rdatatype_t type,
downcase
=
downcase
;
/*unused*/
while
(
1
)
{
RETERR
(
gettoken
(
lexer
,
&
token
,
isc_tokentype_string
,
RETERR
(
gettoken
(
lexer
,
&
token
,
isc_tokentype_
q
string
,
ISC_TRUE
));
if
(
token
.
type
!=
isc_tokentype_string
)
if
(
token
.
type
!=
isc_tokentype_qstring
&&
token
.
type
!=
isc_tokentype_string
)
break
;
RETERR
(
txt_fromtext
(
&
token
.
value
.
as_textregion
,
target
));
}
...
...
lib/dns/rdata/generic/txt_16.h
View file @
2192b449
...
...
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: txt_16.h,v 1.
6
1999/01/22 0
0:36:58
marka Exp $ */
/* $Id: txt_16.h,v 1.
7
1999/01/22 0
1:27:30
marka Exp $ */
#ifndef RDATA_GENERIC_TXT_16_H
#define RDATA_GENERIC_TXT_16_H
...
...
@@ -33,9 +33,10 @@ fromtext_txt(dns_rdataclass_t class, dns_rdatatype_t type,
downcase
=
downcase
;
/*unused*/
while
(
1
)
{
RETERR
(
gettoken
(
lexer
,
&
token
,
isc_tokentype_string
,
RETERR
(
gettoken
(
lexer
,
&
token
,
isc_tokentype_
q
string
,
ISC_TRUE
));
if
(
token
.
type
!=
isc_tokentype_string
)
if
(
token
.
type
!=
isc_tokentype_qstring
&&
token
.
type
!=
isc_tokentype_string
)
break
;
RETERR
(
txt_fromtext
(
&
token
.
value
.
as_textregion
,
target
));
}
...
...
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