|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jpcap.JpcapSender
This class is used to send a packet.
Method Summary | |
void |
close()
Closes the interface. |
static JpcapSender |
openDevice(java.lang.String device)
Initializes a network interface for sending a packet, and returns an instance of this class. |
void |
sendPacket(IPPacket packet)
Sends a packet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static JpcapSender openDevice(java.lang.String device) throws java.io.IOException
device
- Interface for sending a packet
IOException
- Raised when initialization of the interface failedpublic void sendPacket(IPPacket packet)
On UNIX, only IP packet is supported. For ICMP, only echo packet is supported (to prohibit DOS attack).
ON WINDOWS, you may be able to send non-IP packet, too. However, on Windows, you must also set the Datalink layer header (e.g. Ethernet header).
packet
- Packet to be sentpublic void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |