Skip to content

Having trouble retrieving package data #305

@ogozman

Description

@ogozman

Hello,
I am trying to capture and parse packets, for this I need to retrieve the metadata from them, however, no matter what layer types i put into get() function, i always get null.

Here is a snippet of my code:

    while (handle.isOpen()) {
        Packet packet;
        try {
            packet = handle.getNextPacketEx();
            if (packet != null) {

                UdpPacket udpPacket = packet.get(UdpPacket.class);
                System.out.println(udpPacket);
            }
        } catch (EOFException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (TimeoutException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }   
    }

Am I doing something wrong?

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