|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.slytechs.jnetstream.protocol.ProtocolRegistry
public abstract class ProtocolRegistry
Main protocol registry. The registry contains the master list of all known protocols and their bindings. You can iterate through each of the known protocols or iterate through all of the protocol bindings.
Protocol bindings define how each protocol is linked or bound to another. For example IP protocol is bound to Ethernet2 frame using etherenet's protocol field when the value of that field is 0x800 in hex. Any number of bindings can be specified for any given protocol. In our example above ip protocol is the source protocol (the one linking to) and Ethernet2 is the sink protocol (the one being linked to.)
IPv4 = link Ethernet2 0x800 HTTP = link TCP sport == 80 || dport == 80
The registry also contains a list of all of the known protocols. You can retrieve them using the getProtocols() method. Not all the protocols may be loaded into the registry for efficiency. But all the protocols are discovered and Protocol object is created to represent, in somecases a place holder, for all of the known protocols. You can use the Protocol.isLoaded() method to find out if a protocol is actually loaded. Before any packets are dissected (parsed), none of the protocols may be loaded. Protocols may be loaded on demand only when needed. They may also be loaded upfront, this behaviour is release dependent and may be altered via global user accessible properties.
| Field Summary | |
|---|---|
static java.lang.String |
BINDING_CMD_DEFAULT
|
static java.lang.String |
BINDING_CMD_RESET
|
protected static LegacyProtocolRegistry |
defaultRegistry
|
| Constructor Summary | |
|---|---|
protected |
ProtocolRegistry()
The instantiation of ProtocolRegistry requires use of factory method ProtocolRegistry.getDefault(). |
| Method Summary | |
|---|---|
abstract Protocol |
findProtocol(java.lang.String name)
Retrieves the specified protocol from the protocol repository. |
static ProtocolRegistry |
getDefault()
Gets the default protocol registery which contains a list of all the protocols and protocol bindings. |
abstract Protocol |
getProtocol(java.lang.String name)
Retrieves the specified protocol from the protocol repository. |
abstract Iterable |
getProtocolBindings()
Retruns an Iterable list of all the protocol bindings. |
abstract Iterable |
getProtocols()
Returns an Iterable list of currently defined and known protocols. |
abstract void |
loadProtocolBinding(java.lang.String bindingExpression)
Loads a single binding specified by the bindingExpression. |
abstract void |
loadProtocolBindings(java.io.File file)
Loads protocol bindings from the specified url. |
abstract void |
loadProtocolBindings(java.io.InputStream in,
java.lang.String filename)
Loads protocol bindings from the specified reader. |
abstract void |
loadProtocolBindings(java.net.URL url)
Loads protocol bindings from the specified url. |
abstract boolean |
resetProtocolBindings(java.lang.String name)
Resets any bindings for the specified protocol. |
abstract void |
setSystemProtocolImplementationTypes(java.util.Set requestedSet)
A user requested set of protocol implementations to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static LegacyProtocolRegistry defaultRegistry
public static final java.lang.String BINDING_CMD_DEFAULT
public static final java.lang.String BINDING_CMD_RESET
| Constructor Detail |
|---|
protected ProtocolRegistry()
| Method Detail |
|---|
public abstract void loadProtocolBindings(java.net.URL url)
throws java.io.IOException
protocol=binding statement. If there are any syntax
errors in the stream, error warning will be logged and those entries skipped.
url - URL from which to load the binding definition file.
java.io.IOException
public abstract void loadProtocolBindings(java.io.File file)
throws java.io.IOException
protocol=binding statement. If there are any syntax
errors in the stream, error warning will be logged and those entries skipped.
filename - File from which to load the bindings.
java.io.IOException
public abstract void loadProtocolBindings(java.io.InputStream in,
java.lang.String filename)
throws java.io.IOException
protocol=binding statement. If there are any syntax
errors in the stream, error warning will be logged and those entries skipped.
filename - Filename that will be reported if there are any errors.
InvalidBindingFormat - Any problems with the syntax.
java.io.IOException
public abstract void loadProtocolBinding(java.lang.String bindingExpression)
throws InvalidBindingFormat,
ProtocolNotFoundException
protocol=binding statement
bindingExpression - The expression to load the binding
InvalidBindingFormat - Any syntax problems with the expression.
ProtocolNotFoundException - if either the source or the sink protocols are not found. In either case
when this exception is thrown, no binding will be created at all.public static ProtocolRegistry getDefault()
public abstract Iterable getProtocols()
public abstract Iterable getProtocolBindings()
public abstract Protocol getProtocol(java.lang.String name)
name - Name of the protocol to return.
public abstract Protocol findProtocol(java.lang.String name)
name - Name of the protocol to return.
public abstract boolean resetProtocolBindings(java.lang.String name)
Resets any bindings for the specified protocol. The specified protocol will have all of its bindings cleared. Any bindings that have been linked into the runtime environment, will be unlinked and removed.
name - Protocol name to clear the binding for.
public abstract void setSystemProtocolImplementationTypes(java.util.Set requestedSet)
A user requested set of protocol implementations to use. Only these implementation types will be considered when making the decision which protocol implementation types to use during protocol loading and during the packet decoding process.
Changing this set will modify what is returned as available protocol implementations for each protocol using the Protocol.getAvailableProtocolImplementationTypes(). Only types as specified in this Set will be ever returned as available even if other types are available. Thus the user can explicitely force a particular implementation of a protocol only.
Default is to consider all implementation types as defined by the enum class ProtocolImplementationType.
requestedSet - A Set of ProtocolImplementationType enum constant objects to
use a candidates for protocol implementations.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||