示例#1
0
 internal PcapAddress(PcapUnmanagedStructures.pcap_addr pcap_addr)
 {
     if(pcap_addr.Addr != IntPtr.Zero)
         Addr = new Sockaddr( pcap_addr.Addr );
     if(pcap_addr.Netmask != IntPtr.Zero)
         Netmask = new Sockaddr( pcap_addr.Netmask );
     if(pcap_addr.Broadaddr !=IntPtr.Zero)
         Broadaddr = new Sockaddr( pcap_addr.Broadaddr );
     if(pcap_addr.Dstaddr != IntPtr.Zero)
         Dstaddr = new Sockaddr( pcap_addr.Dstaddr );
 }
示例#2
0
 internal PcapAddress(PcapUnmanagedStructures.pcap_addr pcap_addr)
 {
     if (pcap_addr.Addr != IntPtr.Zero)
     {
         Addr = new Sockaddr(pcap_addr.Addr);
     }
     if (pcap_addr.Netmask != IntPtr.Zero)
     {
         Netmask = new Sockaddr(pcap_addr.Netmask);
     }
     if (pcap_addr.Broadaddr != IntPtr.Zero)
     {
         Broadaddr = new Sockaddr(pcap_addr.Broadaddr);
     }
     if (pcap_addr.Dstaddr != IntPtr.Zero)
     {
         Dstaddr = new Sockaddr(pcap_addr.Dstaddr);
     }
 }
示例#3
0
        private void SendARPIps(IPAddress ip, Sockaddr netmask)
        {
            IPAddress firstIP = new IPAddress(ip.Address & netmask.ipAddress.Address);
            IPAddress lastIP = new IPAddress((uint)((int)ip.Address | (int)~netmask.ipAddress.Address));

            SendARPIps(firstIP, lastIP);
        }