PcapDotNet.Core.Extensions Different extension methods for PacketCommunicator class. Collect a group of packets. Similar to ReceivePackets() except instead of calling a callback the packets are returned as an IEnumerable. The PacketCommunicator to work on Number of packets to process. A negative count causes ReceivePackets() to loop until the IEnumerable break (or until an error occurs). An IEnumerable of Packets to process. Thrown if the mode is not Capture or an error occurred. Only the first bytes of data from the packet might be in the received packet (which won't necessarily be the entire packet; to capture the entire packet, you will have to provide a value for snapshortLength in your call to PacketDevice.Open() that is sufficiently large to get all of the packet's data - a value of 65536 should be sufficient on most if not all networks). If a break is called on the returned Enumerable before the number of packets asked for received, the packet that was handled while breaking the enumerable may not be the last packet read. More packets might be read. This is because this method actually loops over calls to ReceiveSomePackets() Collect a group of packets. Similar to ReceivePackets() except instead of calling a callback the packets are returned as an IEnumerable. Loops until the IEnumerable break (or until an error occurs). The PacketCommunicator to work on An IEnumerable of Packets to process. Thrown if the mode is not Capture or an error occurred. Only the first bytes of data from the packet might be in the received packet (which won't necessarily be the entire packet; to capture the entire packet, you will have to provide a value for snapshortLength in your call to PacketDevice.Open() that is sufficiently large to get all of the packet's data - a value of 65536 should be sufficient on most if not all networks). If a break is called on the returned Enumerable, the packet that was handled while breaking the enumerable may not be the last packet read. More packets might be read. This is because this method actually loops over calls to ReceiveSomePackets() Extension methods for LivePacketDevice class. Returns the GUID (NetCfgInstanceId) for a instance. The GUID is parsed from the property. The instance. The GUID (NetCfgInstanceId) of the instance. When the doesn't match the expectations. Returns the PNPDeviceID for a instance. The PNPDeviceID is retrieved by querying the registry. The instance. The PNPDeviceID of the instance. When the PNPDeviceID cannot be retrieved from the registry. Returns the network interface of the packet device. The interface is found using its id. If no interface is found, null is returned. The LivePacketDevice to look for a matching network interface for. The network interface found according to the given device or null if none is found. Returns the of the network interface of the given device. If no interface matches the given packet device, an exception is thrown. We first look for the device using and if that fails we look for them using WMI. The packet device to look for the matching interface. The of the given device's matching interface. Returns the for a instance. The is retrieved through using WMI. The instance. The of the instance. When the cannot be retrieved using WMI. Extension methods for NetworkInterface class. Returns the LivePacketDevice of the given NetworkInterface. The LivePacketDevice is found using the NetworkInterface's id and the LivePacketDevice's name. If no interface is found, null is returned. The NetworkInterface to look for a matching LivePacketDevice for. The LivePacketDevice found according to the given NetworkInterface or null if none is found.