mirror of https://github.com/secdev/scapy.git
Remove fields.py dependency on packet.py
This commit is contained in:
parent
b26fe5984b
commit
1174a1c72a
|
@ -472,8 +472,8 @@ class PacketField(StrField):
|
||||||
def getfield(self, pkt, s):
|
def getfield(self, pkt, s):
|
||||||
i = self.m2i(pkt, s)
|
i = self.m2i(pkt, s)
|
||||||
remain = ""
|
remain = ""
|
||||||
if i.haslayer(packet.Padding):
|
if 'Padding' in i:
|
||||||
r = i.getlayer(packet.Padding)
|
r = i['Padding']
|
||||||
del(r.underlayer.payload)
|
del(r.underlayer.payload)
|
||||||
remain = r.load
|
remain = r.load
|
||||||
return remain,i
|
return remain,i
|
||||||
|
@ -538,8 +538,8 @@ class PacketListField(PacketField):
|
||||||
break
|
break
|
||||||
c -= 1
|
c -= 1
|
||||||
p = self.m2i(pkt,remain)
|
p = self.m2i(pkt,remain)
|
||||||
if packet.Padding in p:
|
if 'Padding' in p:
|
||||||
pad = p[packet.Padding]
|
pad = p['Padding']
|
||||||
remain = pad.load
|
remain = pad.load
|
||||||
del(pad.underlayer.payload)
|
del(pad.underlayer.payload)
|
||||||
else:
|
else:
|
||||||
|
@ -940,6 +940,3 @@ class FloatField(BitField):
|
||||||
frac /= 65536.0
|
frac /= 65536.0
|
||||||
b = sec+frac
|
b = sec+frac
|
||||||
return s,b
|
return s,b
|
||||||
|
|
||||||
# This import must come in last to avoid problems with cyclic dependencies
|
|
||||||
import packet
|
|
||||||
|
|
Loading…
Reference in New Issue