Extracting protocol and info header in PcapDotNet

488 Views Asked by At

I am trying to read packets from a pcap file using PcapDotNet. This file contains captured RTP packets as below.

enter image description here

In my code I have to extract G711 and H264 packets and write to different files. How can I find this information?

    private static void DispatcherHandler(Packet packet)
    {            
        UdpDatagram udp = null;
        udp = packet.IpV4.Udp;
        Datagram  datagram = udp.Payload;
        if (!nProto.ContainsKey(packet.IpV4.Protocol))
            nProto.Add(packet.IpV4.Protocol, 1);
        else
            nProto [packet.IpV4.Protocol]++;

        String sourceIP = packet.Ethernet.IpV4.Source.ToString();
        String destIP = packet.Ethernet.IpV4.Destination.ToString();

        String srcPort = udp.SourcePort.ToString();
        String destPort = udp.DestinationPort.ToString();

        String info = ?
        Console.WriteLine();            
    }
0

There are 0 best solutions below