コード例 #1
0
        private unsafe LivePacketDevice(pcap_if *device)
        {
            List <DeviceAddress> list        = new List <DeviceAddress>();
            pcap_addr *          pcapAddress = (pcap_addr *)*(long *)((IntPtr)device + 24L);

            if ((IntPtr)pcapAddress != IntPtr.Zero)
            {
                do
                {
                    DeviceAddress deviceAddress = new DeviceAddress(pcapAddress);
                    list.Add(deviceAddress);
                    pcapAddress = (pcap_addr *)*(long *)pcapAddress;
                }while ((IntPtr)pcapAddress != IntPtr.Zero);
            }
            this._name        = new string((sbyte *)*(long *)((IntPtr)device + 8L));
            this._description = new string((sbyte *)*(long *)((IntPtr)device + 16L));
            this._attributes  = (DeviceAttributes) * (int *)((IntPtr)device + 32L);
            this._addresses   = new ReadOnlyCollection <DeviceAddress>((IList <DeviceAddress>)list);
        }
コード例 #2
0
ファイル: CPcapNet.cs プロジェクト: sparrow58/SelfishNetv0.3
 public unsafe ArrayList getAllDevsID()
 {
     pcap_if *pcapIfPointer = null;
     $ArrayType$$$BY0BAA@D _u0024ArrayTypeu0024u0024u0024BY0BAAu0040D = new $ArrayType$$$BY0BAA@D();