MCPcopy Create free account
hub / github.com/secdev/scapy / getfield

Method getfield

scapy/contrib/bgp.py:912–929  ·  view source on GitHub ↗
(self, pkt, s)

Source from the content-addressed store, hash-verified

910 """
911
912 def getfield(self, pkt, s):
913 lst = []
914
915 length = 0
916 if self.length_from is not None:
917 length = self.length_from(pkt)
918 remain = s
919 if length is not None:
920 remain, ret = s[:length], s[length:]
921
922 while remain:
923 param_len = orb(remain[1]) # Get param length
924 current = remain[:2 + param_len]
925 remain = remain[2 + param_len:]
926 packet = self.m2i(pkt, current)
927 lst.append(packet)
928
929 return remain + ret, lst
930
931
932class BGPOptParam(Packet):

Callers

nothing calls this directly

Calls 4

orbFunction · 0.90
length_fromMethod · 0.45
m2iMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected