Show More
@@ -490,7 +490,8 b' class DNSIncoming(object):' | |||||
490 | """Reads header portion of packet""" |
|
490 | """Reads header portion of packet""" | |
491 | format = '!HHHHHH' |
|
491 | format = '!HHHHHH' | |
492 | length = struct.calcsize(format) |
|
492 | length = struct.calcsize(format) | |
493 |
info = struct.unpack(format, |
|
493 | info = struct.unpack(format, | |
|
494 | self.data[self.offset:self.offset + length]) | |||
494 | self.offset += length |
|
495 | self.offset += length | |
495 |
|
496 | |||
496 | self.id = info[0] |
|
497 | self.id = info[0] | |
@@ -520,7 +521,8 b' class DNSIncoming(object):' | |||||
520 | """Reads an integer from the packet""" |
|
521 | """Reads an integer from the packet""" | |
521 | format = '!I' |
|
522 | format = '!I' | |
522 | length = struct.calcsize(format) |
|
523 | length = struct.calcsize(format) | |
523 |
info = struct.unpack(format, |
|
524 | info = struct.unpack(format, | |
|
525 | self.data[self.offset:self.offset + length]) | |||
524 | self.offset += length |
|
526 | self.offset += length | |
525 | return info[0] |
|
527 | return info[0] | |
526 |
|
528 | |||
@@ -534,7 +536,8 b' class DNSIncoming(object):' | |||||
534 | """Reads a string of a given length from the packet""" |
|
536 | """Reads a string of a given length from the packet""" | |
535 | format = '!' + str(len) + 's' |
|
537 | format = '!' + str(len) + 's' | |
536 | length = struct.calcsize(format) |
|
538 | length = struct.calcsize(format) | |
537 |
info = struct.unpack(format, |
|
539 | info = struct.unpack(format, | |
|
540 | self.data[self.offset:self.offset + length]) | |||
538 | self.offset += length |
|
541 | self.offset += length | |
539 | return info[0] |
|
542 | return info[0] | |
540 |
|
543 | |||
@@ -542,7 +545,8 b' class DNSIncoming(object):' | |||||
542 | """Reads an unsigned short from the packet""" |
|
545 | """Reads an unsigned short from the packet""" | |
543 | format = '!H' |
|
546 | format = '!H' | |
544 | length = struct.calcsize(format) |
|
547 | length = struct.calcsize(format) | |
545 |
info = struct.unpack(format, |
|
548 | info = struct.unpack(format, | |
|
549 | self.data[self.offset:self.offset + length]) | |||
546 | self.offset += length |
|
550 | self.offset += length | |
547 | return info[0] |
|
551 | return info[0] | |
548 |
|
552 |
General Comments 0
You need to be logged in to leave comments.
Login now