Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot DNS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
bb21cd1b
Commit
bb21cd1b
authored
Feb 22, 2011
by
Jan Kadlec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes in parser script and new set of response testing data.
Refs
#470
@15m
parent
d500d7a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
20 deletions
+23
-20
scripts/parse_dump.py
scripts/parse_dump.py
+23
-20
src/tests/files/parsed_data
src/tests/files/parsed_data
+0
-0
src/tests/files/raw_data
src/tests/files/raw_data
+0
-0
No files found.
scripts/parse_dump.py
View file @
bb21cd1b
...
...
@@ -34,31 +34,34 @@ def chop_and_write_rr_response(rr):
try
:
rdata
=
dns
.
rdata
.
from_wire
(
rr
.
rclass
,
rr
.
type
,
rr
.
rdata
,
0
,
len
(
rr
.
rdata
))
fp
.
write
(
pack
(
'B'
,
len
(
rr
.
rdata
)))
fp
.
write
(
pack
(
'B'
,
len
(
rr
.
rdata
)))
# print "type ", rr.type, "length ", len(rr.rdata)
# OPT has length 0 - wat do?
rdata
.
to_wire
(
fp
)
except
:
try
:
if
rr
.
rdata
[
0
]
!=
'\#'
:
rdata
=
dns
.
rdata
.
from_text
(
rr
.
rclass
,
rr
.
type
,
rr
.
rdata
)
try
:
fp
.
write
(
pack
(
'B'
,
len
(
rdata
)))
except
:
#
if rr.rdata[0] != '\#':
rdata
=
dns
.
rdata
.
from_text
(
rr
.
rclass
,
rr
.
type
,
rr
.
rdata
)
try
:
fp
.
write
(
pack
(
'B'
,
len
(
rdata
)))
except
:
# no length - no way to know wire length
try
:
if
rr
.
type
==
2
:
fp
.
seek
(
1
,
1
)
old
=
fp
.
tell
()
rdata
.
to_wire
(
fp
)
size
=
fp
.
tell
()
-
old
fp
.
seek
(
-
(
size
+
1
),
1
)
fp
.
write
(
pack
(
'B'
,
size
))
fp
.
seek
(
0
,
2
)
else
:
rdata
.
to_wire
(
fp
)
except
Exception
as
e
:
print
'Error, exiting: '
,
e
sys
.
exit
(
-
1
)
try
:
print
"unknown length for type"
,
rr
.
type
# if rr.type == 2:
# fp.seek(1, 1)
# old = fp.tell()
# rdata.to_wire(fp)
# size = fp.tell() - old
# fp.seek(-(size + 1), 1)
# fp.write(pack('B', size))
# fp.seek(0, 2)
# else:
rdata
.
to_wire
(
fp
)
except
Exception
as
e
:
print
'Error, exiting: '
,
e
sys
.
exit
(
-
1
)
except
:
print
'could not parse rdata type: '
,
rr
.
type
print
'dumping directly (hopefully it is SOA)'
...
...
src/tests/files/parsed_data
View file @
bb21cd1b
No preview for this file type
src/tests/files/raw_data
View file @
bb21cd1b
No preview for this file type
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