Skip to content

Documentation update #55

@DmitriKh

Description

@DmitriKh

Example given in "Automatically decoding layers" shows

eth_frame = ethernet.Ethernet(capfile.packets[0].raw())
wifi_frame = wifi.WIFI(capfile.packets[1].raw())
print(eth_frame)
ethernet from 00:11:22:33:44:55 to ff:ee:dd:cc:bb:aa type IPv4
print(wifi_frame)
QoS data (sa: None, ta: 00:11:22:33:44:55, ra: ff:ee:dd:cc:bb:aa, da: None)
ip_packet = ip.IP(eth_frame.payload)
print(ip_packet)

When tested on python 3.9.x the example requires additional "binascii.unhexlify" to create IP packet from Ethernet and UDP from IP.
ip_packet = ip.IP(binascii.unhexlify(eth_frame.payload))
udp_frame = udp.UDP(binascii.unhexlify(ip_packet.payload))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions