-
Notifications
You must be signed in to change notification settings - Fork 7
port dns from vs1 to vs2 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
This PR depends on the following PR to vstruct2: vstruct2 PR 7 |
|
restarting the unit test builds with the newly merged vstruct2 PR... if all goes well, i'll mainline today. |
|
Unit tests still failing with merged vstruct2 PR #7. |
dissect/protos/dns.py
Outdated
|
|
||
| from __future__ import unicode_literals | ||
|
|
||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a construct like this probably belongs in dissect/compat.py ( rather than having a separate issue like this in every protocol module ). Additionally, we should probably have the semantics lean forward toward 3 rather than backward toward 2 ( ie, not use the name xrange ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved, and tried to make it more py3-ish.
| DNS_FLAG_TRUNC = 1 << 9 | ||
| DNS_FLAG_RECUR = 1 << 8 | ||
| DNS_FLAG_AD = 1 << 5 | ||
| #DNS_FLAG_AA = 1 << 5 # authoritative answer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly curiosity... why are these commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know, that's a good q! I am not sure, they were commented out in the original version from vs1, and I didn't see a reason to change them. Tests seem to pass with or without them, but I suspect that's because they are for some case that isn't yet covered by tests.
dissect/protos/dns.py
Outdated
| if self.vsHasField('label'): # the resize will crash if the label hasn't been set yet w/o this | ||
| self.vsGetField('label').vsResize(size) | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra empty line ( which totally may have been inherited from my previous DNS cruft, but lets kill it off since we're touching it... )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
killed.
dissect/protos/dns.py
Outdated
| self._cache_qrs = ret | ||
| return ret | ||
|
|
||
| def _getResourceRecords(self, structure): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this is a top level API ( compliment of getQuestionRecords ) lets promote him by removing the _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
promoted.
dissect/protos/inet.py
Outdated
| def __repr__(self): | ||
| return socket.inet_ntop(socket.AF_INET, bytes(self)) | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra blank lines for style points :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
I could be wrong, but it appears that the tests are failing because the pip version of vstruct2 doesn't include the changes from PR#7 for vs2. |
Copies dns.py from vs1, and makes necessary changes to run under vs2.