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

Method getfield

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

Source from the content-addressed store, hash-verified

1886 """
1887
1888 def getfield(self, pkt, s):
1889 lst = []
1890 remain = s
1891
1892 # IPv6
1893 if pkt.afi == 2:
1894 if pkt.safi == 1:
1895 # BGPNLRI_IPv6
1896 while remain:
1897 mask = orb(remain[0])
1898 length_in_bytes = (mask + 7) // 8
1899 current = remain[:length_in_bytes + 1]
1900 remain = remain[length_in_bytes + 1:]
1901 prefix = self.m2i(pkt, current)
1902 lst.append(prefix)
1903
1904 return remain, lst
1905
1906
1907class BGPPAMPReachNLRI(Packet):

Callers

nothing calls this directly

Calls 3

orbFunction · 0.90
m2iMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected