/// <summary> /// Send a raw packet.<br/> /// This function allows to send a raw packet to the network. /// The MAC CRC doesn't need to be included, because it is transparently calculated /// and added by the network interface driver. /// </summary> /// <param name="adaptHandle">the interface that will be used to send the packet</param> /// <param name="data">contains the data of the packet to send (including the various protocol headers)</param> /// <param name="size">the dimension of the buffer pointed by data</param> /// <returns>0 if the packet is succesfully sent, -1 otherwise.</returns> internal static int pcap_sendpacket(IntPtr /* pcap_t* */ adaptHandle, IntPtr data, int size) { return(UseWindows ? Windows.pcap_sendpacket(adaptHandle, data, size) : Unix.pcap_sendpacket(adaptHandle, data, size)); }