def packet2chain(packet):
    """Fetch Scapy packet protocol chain."""
    if scapy_all is None:
        raise ModuleNotFound("No module named 'scapy'", name='scapy')
    chain = [packet.name]
    payload = packet.payload
    while not isinstance(payload, scapy_all.packet.NoPayload):
        chain.append(payload.name)
        payload = payload.payload
    return ':'.join(chain)
def packet2chain ( packet ) : if scapy_all is None : raise ModuleNotFound ( "No module named 'scapy'" , name = 'scapy' ) chain = [ packet . name ] payload = packet . payload while not isinstance ( payload , scapy_all . packet . NoPayload ) : chain . append ( payload . name ) payload = payload . payload return ':' . join ( chain )
Fetch Scapy packet protocol chain.