Class RawEthernetSocket
- java.lang.Object
-
- org.apache.plc4x.java.utils.rawsockets.attic.RawEthernetSocket
-
public class RawEthernetSocket extends Object
The raw ethernet socket relies on a layer 3 IP protocol implementation for finding the Network device able to connect to a given mac address. In Contrast to theRawIpSocketthe Layer 2 protocol does not support gateways and routers, so we don't need the logic for looking up the default gateway, which makes this implementation a lot simpler.
-
-
Constructor Summary
Constructors Constructor Description RawEthernetSocket(org.pcap4j.packet.namednumber.EtherType etherType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(RawSocketListener listener)voidconnect(String localMacAddress, String remoteMacAddress)voiddisconnect()voidremoveListener(RawSocketListener listener)voidwrite(byte[] rawData)
-
-
-
Method Detail
-
connect
public void connect(String localMacAddress, String remoteMacAddress) throws PcapException
- Throws:
PcapException
-
disconnect
public void disconnect() throws PcapException- Throws:
PcapException
-
write
public void write(byte[] rawData) throws PcapException- Throws:
PcapException
-
addListener
public void addListener(RawSocketListener listener)
-
removeListener
public void removeListener(RawSocketListener listener)
-
-