Package jpcap.packet

Examples of jpcap.packet.Packet


    InetAddress pingAddr=InetAddress.getByName("www.microsoft.com");
    captor.setFilter("tcp and dst host "+pingAddr.getHostAddress(),true);
    byte[] gwmac=null;
    while(true){
      new URL("http://www.microsoft.com").openStream().close();
      Packet ping=captor.getPacket();
      if(ping==null){
        System.out.println("cannot obtain MAC address of default gateway.");
        System.exit(-1);
      }else if(Arrays.equals(((EthernetPacket)ping.datalink).dst_mac,device.mac_address))
          continue;
View Full Code Here

TOP

Related Classes of jpcap.packet.Packet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.