/// A packet filter, converting a high level filtering expression (see <see href="http://www.winpcap.org/docs/docs_40_2/html/group__language.html">WinPcap Filtering expression syntax</see>) in a program that can be interpreted by the kernel-level filtering engine.
/// The user must dispose instances of this class to deallocate resources.
/// Compile a packet filter without the need of opening an adapter.
/// This constructor converts a high level filtering expression (see <see href="http://www.winpcap.org/docs/docs_40_2/html/group__language.html">WinPcap Filtering expression syntax</see>) in a program that can be interpreted by the kernel-level filtering engine.
/// </summary>
/// <param name="filterValue">A high level filtering expression (see <see href="http://www.winpcap.org/docs/docs_40_2/html/group__language.html">WinPcap Filtering expression syntax</see>)</param>
/// <param name="snapshotLength">Length of the packet that has to be retained of the communicator this filter will be applied on.</param>
/// <param name="kind">The link layer of an adapter that this filter will apply upon.</param>
/// <param name="netmask">Specifies the IPv4 netmask of the network on which packets are being captured; it is used only when checking for IPv4 broadcast addresses in the filter program. If the netmask of the network on which packets are being captured isn't known to the program, or if packets are being captured on the Linux "any" pseudo-interface that can capture on more than one network, null can be supplied; tests for IPv4 broadcast addreses won't be done correctly, but all other tests in the filter program will be OK.</param>
/// <exception cref="System::ArgumentException">Indicates an error. Probably caused by bad syntax.</exception>
/// <remarks>
/// If the purpose of this filter is to apply it on a communicator and not to test packets in memory, it would be simpler to call to PacketCommunicator.CreateFilter() or to directly call PacketCommunicator.SetFilter().
/// Compile a packet filter without the need of opening an adapter.
/// This constructor converts a high level filtering expression (see <see href="http://www.winpcap.org/docs/docs_40_2/html/group__language.html">WinPcap Filtering expression syntax</see>) in a program that can be interpreted by the kernel-level filtering engine.
/// Assumes the netmask of the network on which packets are being captured isn't known to the program, or that packets are being captured on the Linux "any" pseudo-interface that can capture on more than one network.
/// Tests for IPv4 broadcast addreses won't be done correctly, but all other tests in the filter program will be OK.
/// </summary>
/// <param name="filterValue">A high level filtering expression (see <see href="http://www.winpcap.org/docs/docs_40_2/html/group__language.html">WinPcap Filtering expression syntax</see>)</param>
/// <param name="snapshotLength">Length of the packet that has to be retained of the communicator this filter will be applied on.</param>
/// <param name="kind">The link layer of an adapter that this filter will apply upon.</param>
/// <exception cref="System::ArgumentException">Indicates an error. Probably caused by bad syntax.</exception>
/// <remarks>
/// If the purpose of this filter is to apply it on a communicator and not to test packets in memory, it would be simpler to call to PacketCommunicator.CreateFilter() or to directly call PacketCommunicator.SetFilter().
/// Returns if a given filter applies to an offline packet.
/// This method is used to apply a filter to a packet that is currently in memory.
/// This process does not need to open an adapter; we need just to create the proper filter (by settings parameters like the snapshot length, or the link-layer type) by means of the Pcap.
/// The current API of libpcap does not allow to receive a packet and to filter the packet after it has been received. However, this can be useful in case you want to filter packets in the application, instead of into the receiving process. This function allows you to do the job.
/// </summary>
/// <param name="snapshotLength">The length of the bytes that are currently available into the packet if the packet satisfies the filter, 0 otherwise.</param>
/// <param name="packet">The packet that has to be filtered.</param>
/// <returns>
/// True iff the given packet satisfies the filter.
/// Returns if a given filter applies to an offline packet.
/// This method is used to apply a filter to a packet that is currently in memory.
/// This process does not need to open an adapter; we need just to create the proper filter (by settings parameters like the snapshot length, or the link-layer type) by means of the Pcap.
/// The current API of libpcap does not allow to receive a packet and to filter the packet after it has been received. However, this can be useful in case you want to filter packets in the application, instead of into the receiving process. This function allows you to do the job.
/// </summary>
/// <param name="packet">The packet that has to be filtered.</param>
/// <returns>
/// True iff the given packet satisfies the filter.
/// </returns>
boolTest(Packets::Packet^packet);
boolTest(Packets::Packet^packet);
/// <summary>
/// Free a filter.
/// Used to free up allocated memory when that BPF program is no longer needed, for example after it has been made the filter program for a packet communicator by a call to PacketCommunicator.SetFilter().
/// Open a generic source in order to capture / send (WinPcap only) traffic.
/// Open a generic source in order to capture / send (WinPcap only) traffic.
/// </summary>
/// </summary>
/// <param name="snapshotLength">length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored.</param>
/// <param name="snapshotLength">Length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored.</param>
/// <param name="attributes">keeps several flags that can be needed for capturing packets.</param>
/// <param name="attributes">Keeps several flags that can be needed for capturing packets.</param>
/// <param name="readTimeout">read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored.</param>
/// <param name="readTimeout">Read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored.</param>
/// <exception cref="System::InvalidOperationException">Thrown on failure.</exception>
/// <exception cref="System::InvalidOperationException">Thrown on failure.</exception>
/// <item>libpcap/WinPcap was not installed on the local/remote host.</item>
/// <item>The user does not have enough privileges to list the devices.</item>
/// <item>A network problem.</item>
/// <item>other errors (not enough memory and others).</item>
/// </list>
/// </exception>
/// <remarks>
/// There may be network devices that cannot be opened with Open() by the process calling AllLocalMachine, because, for example, that process might not have sufficient privileges to open them for capturing; if so, those devices will not appear on the list.
/// Open a generic source in order to capture / send (WinPcap only) traffic.
/// Open a generic source in order to capture / send (WinPcap only) traffic.
/// </summary>
/// </summary>
/// <param name="snapshotLength">length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored.</param>
/// <param name="snapshotLength">Length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored.</param>
/// <param name="attributes">keeps several flags that can be needed for capturing packets.</param>
/// <param name="attributes">Keeps several flags that can be needed for capturing packets.</param>
/// <param name="readTimeout">read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored.</param>
/// <param name="readTimeout">Read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored.</param>
/// <exception cref="System::InvalidOperationException">Thrown on failure.</exception>
/// Open a generic source in order to capture / send (WinPcap only) traffic.
/// </summary>
/// <param name="snapshotLength">length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored.</param>
/// <param name="attributes">Keeps several flags that can be needed for capturing packets.</param>
/// <param name="readTimeout">Read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored.</param>
/// <exception cref="System::InvalidOperationException">Thrown on failure.</exception>
/// Open a generic source in order to capture / send (WinPcap only) traffic.
/// </summary>
/// <param name="snapshotLength">Length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored.</param>
/// <param name="attributes">Keeps several flags that can be needed for capturing packets.</param>
/// <param name="readTimeout">Read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored.</param>
/// <exception cref="System::InvalidOperationException">Thrown on failure.</exception>
/// Note that transmitting a send buffer is much more efficient than performing a series of Send(), because the send buffer is buffered at kernel level drastically decreasing the number of context switches.
/// This function allocates a send buffer, i.e. a buffer containing a set of raw packets that will be transimtted on the network with PacketCommunicator.Transmit().
/// </summary>
/// <param name="capacity">The size, in bytes, of the buffer, therefore it determines the maximum amount of data that the buffer will contain.</param>
PacketSendBuffer(unsignedintcapacity);
PacketSendBuffer(unsignedintcapacity);
/// <summary>
/// Adds a raw packet at the end of the send buffer.
/// 'Raw packet' means that the sending application will have to include the protocol headers, since every packet is sent to the network 'as is'. The CRC of the packets needs not to be calculated, because it will be transparently added by the network interface.
/// </summary>
/// <param name="packet">The packet to be added to the buffer</param>
/// <exception cref="System::InvalidOperationException">Thrown on failure.</exception>
voidEnqueue(Packets::Packet^packet);
voidEnqueue(Packets::Packet^packet);
/// <summary>
/// Deletes a send buffer and frees all the memory associated with it.
/// Win32 specific. Number of packets captured, i.e number of packets that are accepted by the filter, that find place in the kernel buffer and therefore that actually reach the application.