Beispiel #1
0
        /// <summary>
        /// Retrieve the last error string for a given pcap_t* device
        /// </summary>
        /// <param name="deviceHandle">
        /// A <see cref="IntPtr"/>
        /// </param>
        /// <returns>
        /// A <see cref="string"/>
        /// </returns>
        internal static string GetLastError(IntPtr deviceHandle)
        {
            IntPtr err_ptr = LibPcapSafeNativeMethods.pcap_geterr(deviceHandle);

            return(Marshal.PtrToStringAnsi(err_ptr));
        }
Beispiel #2
0
 /// <summary>
 /// Retrieve the last error string for a given pcap_t* device
 /// </summary>
 /// <param name="deviceHandle">
 /// A <see cref="IntPtr"/>
 /// </param>
 /// <returns>
 /// A <see cref="string"/>
 /// </returns>
 internal static string GetLastError(PcapHandle deviceHandle)
 {
     return(LibPcapSafeNativeMethods.pcap_geterr(deviceHandle));
 }