mirror of https://github.com/dirtbags/netarch.git
No, really
This commit is contained in:
parent
6c2ee3b993
commit
297598b7de
|
@ -200,6 +200,12 @@ def bin(i, bits=None):
|
||||||
return BitVector(i, bits).bitstr()
|
return BitVector(i, bits).bitstr()
|
||||||
|
|
||||||
|
|
||||||
|
def unhex(s):
|
||||||
|
"""Decode a string as hex, stripping whitespace first"""
|
||||||
|
|
||||||
|
return [ord(i) for i in s.replace(' ', '').decode('hex')]
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## Codecs
|
## Codecs
|
||||||
##
|
##
|
||||||
|
|
|
@ -17,7 +17,6 @@ class GapString:
|
||||||
self.length = 0
|
self.length = 0
|
||||||
self.drop = drop
|
self.drop = drop
|
||||||
if init:
|
if init:
|
||||||
print init
|
|
||||||
self.append(init)
|
self.append(init)
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
|
|
2
ip.py
2
ip.py
|
@ -494,7 +494,7 @@ class Session:
|
||||||
|
|
||||||
saddr = chunk.first.saddr
|
saddr = chunk.first.saddr
|
||||||
try:
|
try:
|
||||||
(first, data) = self.pending[saddr]
|
(first, data) = self.pending.pop(saddr)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
first = chunk.first
|
first = chunk.first
|
||||||
data = gapstr.GapString()
|
data = gapstr.GapString()
|
||||||
|
|
Loading…
Reference in New Issue