パッケージ org.pcap4j.core
クラス PcapNetworkInterface
- java.lang.Object
-
- org.pcap4j.core.PcapNetworkInterface
-
public final class PcapNetworkInterface extends Object
- 導入されたバージョン:
- pcap4j 0.9.1
- 作成者:
- Kaito Yamada
-
-
ネストされたクラスの概要
ネストされたクラス 修飾子とタイプ クラス 説明 static classPcapNetworkInterface.PromiscuousMode
-
メソッドの概要
すべてのメソッド インスタンス・メソッド concreteメソッド 修飾子とタイプ メソッド 説明 booleanequals(Object obj)List<PcapAddress>getAddresses()StringgetDescription()ArrayList<LinkLayerAddress>getLinkLayerAddresses()StringgetName()inthashCode()booleanisLocal()booleanisLoopBack()Returns if this network interface is loopback.booleanisRunning()Returns if this network interface is running.booleanisUp()Returns if this network interface is up.PcapHandleopenLive(int snaplen, PcapNetworkInterface.PromiscuousMode mode, int timeoutMillis)StringtoString()
-
-
-
メソッドの詳細
-
getName
public String getName()
- 戻り値:
- name
-
getDescription
public String getDescription()
- 戻り値:
- description
-
getAddresses
public List<PcapAddress> getAddresses()
- 戻り値:
- inet addresses
-
getLinkLayerAddresses
public ArrayList<LinkLayerAddress> getLinkLayerAddresses()
- 戻り値:
- link layer addresses
-
isLoopBack
public boolean isLoopBack()
Returns if this network interface is loopback. This method may always return false on some environments.- 戻り値:
- true if the network interface represented by this object is a loop back interface; false otherwise.
-
isUp
public boolean isUp()
Returns if this network interface is up. This method may always return false on some environments.- 戻り値:
- true if the network interface represented by this object is up; false otherwise.
-
isRunning
public boolean isRunning()
Returns if this network interface is running. This method may always return false on some environments.- 戻り値:
- true if the network interface represented by this object is running; false otherwise.
-
isLocal
public boolean isLocal()
- 戻り値:
- true if the network interface represented by this object is a local interface; false otherwise.
-
openLive
public PcapHandle openLive(int snaplen, PcapNetworkInterface.PromiscuousMode mode, int timeoutMillis) throws PcapNativeException
- パラメータ:
snaplen- Snapshot length, which is the number of bytes captured for each packet.mode- modetimeoutMillis- Read timeout. Most OSs buffer packets. The OSs pass the packets to Pcap4j after the buffer gets full or the read timeout expires. Must be non-negative. May be ignored by some OSs. 0 means disable buffering on Solaris. 0 means infinite on the other OSs. 1 through 9 means infinite on Solaris.- 戻り値:
- a new PcapHandle object.
- 例外:
PcapNativeException- if an error occurs in the pcap native library.
-
-