Examples of EthernetPacket


Examples of jpcap.packet.EthernetPacket

    icmp.id=0;
    icmp.setIPv4Parameter(0,false,false,false,0,false,false,false,0,0,0,IPPacket.IPPROTO_ICMP,
        thisIP,InetAddress.getByName(args[1]));
    icmp.data="data".getBytes();
   
    EthernetPacket ether=new EthernetPacket();
    ether.frametype=EthernetPacket.ETHERTYPE_IP;
    ether.src_mac=device.mac_address;
    ether.dst_mac=gwmac;
    icmp.datalink=ether;
   
View Full Code Here

Examples of jpcap.packet.EthernetPacket

    p.recv_timestamp=789;
    p.setIPv4Parameter(0,false,false,false,0,false,false,false,0,1010101,100,IPPacket.IPPROTO_ICMP,
      InetAddress.getByName("www.yahoo.com"),InetAddress.getByName("www.amazon.com"));
    p.data="data".getBytes();

    EthernetPacket ether=new EthernetPacket();
    ether.frametype=EthernetPacket.ETHERTYPE_IP;
    ether.src_mac=new byte[]{(byte)0,(byte)1,(byte)2,(byte)3,(byte)4,(byte)5};
    ether.dst_mac=new byte[]{(byte)0,(byte)6,(byte)7,(byte)8,(byte)9,(byte)10};
    p.datalink=ether;
View Full Code Here

Examples of jpcap.packet.EthernetPacket

    UDPPacket p=new UDPPacket(12345,54321);
    p.setIPv4Parameter(0,false,false,false,0,false,false,false,0,1010101,100,IPPacket.IPPROTO_UDP,
      InetAddress.getByName("www.yahoo.com"),InetAddress.getByName("www.google.com"));
    p.data="data".getBytes();

    EthernetPacket ether=new EthernetPacket();
    ether.frametype=EthernetPacket.ETHERTYPE_IP;
    ether.src_mac=new byte[]{(byte)0,(byte)1,(byte)2,(byte)3,(byte)4,(byte)5};
    ether.dst_mac=new byte[]{(byte)0,(byte)6,(byte)7,(byte)8,(byte)9,(byte)10};
    p.datalink=ether;
View Full Code Here

Examples of jpcap.packet.EthernetPacket

    TCPPacket p=new TCPPacket(12,34,56,78,false,false,false,false,true,true,true,true,10,10);
    p.setIPv4Parameter(0,false,false,false,0,false,false,false,0,1010101,100,IPPacket.IPPROTO_TCP,
      InetAddress.getByName("www.microsoft.com"),InetAddress.getByName("www.google.com"));
    p.data=("data").getBytes();
   
    EthernetPacket ether=new EthernetPacket();
    ether.frametype=EthernetPacket.ETHERTYPE_IP;
    ether.src_mac=new byte[]{(byte)0,(byte)1,(byte)2,(byte)3,(byte)4,(byte)5};
    ether.dst_mac=new byte[]{(byte)0,(byte)6,(byte)7,(byte)8,(byte)9,(byte)10};
    p.datalink=ether;
View Full Code Here

Examples of jpcap.packet.EthernetPacket

    TCPPacket p=new TCPPacket(12,34,56,78,false,false,false,false,true,true,true,true,10,10);
    p.setIPv6Parameter(1, 2, IPPacket.IPPROTO_TCP, 3,
      Inet6Address.getByName("fe80:0:0:0:30d5:2afd:7f3c:a522"),Inet6Address.getByName("fe80:0:0:0:30d5:2afd:7f3c:a522"));
    p.data=("data").getBytes();
   
    EthernetPacket ether=new EthernetPacket();
    ether.frametype=EthernetPacket.ETHERTYPE_IP;
    ether.src_mac=new byte[]{(byte)0,(byte)1,(byte)2,(byte)3,(byte)4,(byte)5};
    ether.dst_mac=new byte[]{(byte)0,(byte)6,(byte)7,(byte)8,(byte)9,(byte)10};
    p.datalink=ether;
View Full Code Here

Examples of jpcap.packet.EthernetPacket

    packet.header = new byte[0];
    packet.data = packetData;
    packet.len = packetData.length;

    /* Link ethernet frame */
    EthernetPacket ether = new EthernetPacket();
    ether.frametype = EthernetPacket.ETHERTYPE_IP;
    ether.dst_mac = networkInterfaceMAC;
    ether.src_mac = networkInterfaceMAC;

    if (loopbackInterface != null) {
View Full Code Here

Examples of jpcap.packet.EthernetPacket

    packet.header = new byte[0];
    packet.data = packetData;
    packet.len = packetData.length;

    /* Link ethernet frame */
    EthernetPacket ether = new EthernetPacket();
    ether.frametype = EthernetPacket.ETHERTYPE_IP;
    ether.dst_mac = networkInterfaceMAC;
    ether.src_mac = networkInterfaceMAC;

    if (loopbackInterface != null) {
View Full Code Here

Examples of jpcap.packet.EthernetPacket

    packet.header = new byte[0];
    packet.data = packetData;
    packet.len = packetData.length;

    /* Link ethernet frame */
    EthernetPacket ether = new EthernetPacket();
    ether.frametype = EthernetPacket.ETHERTYPE_IP;
    ether.dst_mac = networkInterfaceMAC;
    ether.src_mac = networkInterfaceMAC;

    if (loopbackInterface != null) {
View Full Code Here

Examples of org.hxzon.netprotocol.packet.EthernetPacket

import org.hxzon.netprotocol.packet.VlanPacket;
import org.hxzon.util.BytesUtil;

public class PacketUtils {
    public static void initPacket() {
        new EthernetPacket();
        new VlanPacket();
        new GoosePacket();
        new SvPacket();
        new Ip4Packet();
        new TcpPacket();
View Full Code Here

Examples of org.pcap4j.packet.EthernetPacket

      .srcAddr(MacAddress.getByName("fe:00:00:00:00:01"))
      .type(EtherType.IPV4)
      .payloadBuilder(ipv4b)
      .paddingAtBuild(true);

    EthernetPacket orgPacket = eb.build();

    PcapHandle handle = Pcaps.openDead(DataLinkType.EN10MB, 65536);
    PcapDumper dumper = handle.dumpOpen(dumpFile);
    dumper.dump(orgPacket, 0, 0);

    List<IpV4Packet> list = new ArrayList<IpV4Packet>();
    for (IpV4Packet p: IpV4Helper.fragment((IpV4Packet)orgPacket.getPayload(), 987)) {
      EthernetPacket ep = eb.payloadBuilder(new SimpleBuilder(p)).build();
      dumper.dump(ep, 0, 0);
      list.add(p);
    }

    dumper.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.