|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface JAnalyze
Capture, decode and analyze stream of packets. This interface provides
methods that allow a capture of certain amount of packets. Have the packets
decoded using jNetPcap's packet scanner and analyzed using
JRegistry registered protocol analyzers.
| Method Summary | ||
|---|---|---|
int |
analyze()
Captures packets, decodes each header using a native scanner and analyzes the packet stream. |
|
int |
analyze(int count)
Captures packets, decodes each header using a native scanner and analyzes the packet stream. |
|
|
analyze(int count,
JPacketHandler<T> handler,
T user)
Captures packets, decodes each header using a native scanner and analyzes the packet stream. |
|
|
analyze(JPacketHandler<T> handler,
T user)
Captures packets, decodes each header using a native scanner and analyzes the packet stream. |
|
| Method Detail |
|---|
int analyze()
JRegistry. No user packet handler is registered.
Captured packet will be consumed, but they will be analyzed. The user will
have to register a protocol specific handler with a protocol. Here is an
example:
HttpAnalyzer analyzer = JRegistry.getAnalyzer(HttpAnalyzer.class);
analyzer.add(new HttpHandler() {
// Handle processed http headers
public void processHttp(Http http) {
}
});
The protocol specific listener has to be registered with the analyzer
before the call to Pcap.analyze method.
This method invokes pcap capture to grab infinate amount of packets, or until the capture source is closed.
int analyze(int count)
JRegistry. No user packet handler is registered.
Captured packet will be consumed, but they will be analyzed. The user will
have to register a protocol specific handler with a protocol. Here is an
example:
HttpAnalyzer analyzer = JRegistry.getAnalyzer(HttpAnalyzer.class);
analyzer.add(new HttpHandler() {
// Handle processed http headers
public void processHttp(Http http) {
}
});
The protocol specific listener has to be registered with the analyzer
before the call to Pcap.analyze method.
count - max number of packets to capture before returning
<T> int analyze(JPacketHandler<T> handler,
T user)
JRegistry.
Analyzer's capture infinate amount of packets or until the capture source is closed.
T - type for user object passed to the packet handlerhandler - user packet handler that will receive all captured packetsuser - user object of type
<T> int analyze(int count,
JPacketHandler<T> handler,
T user)
JRegistry.
T - type for user object passed to the packet handlercount - max number of packets to capture before returninghandler - user packet handler that will receive all captured packetsuser - user object of type
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||