|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.slytechs.jnetstream.protocol.ProtocolRegistry
com.voytechs.jnetstream.protocol.LegacyProtocolRegistry
public final class LegacyProtocolRegistry
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_EXTENSION
|
protected ProtocolLoader |
systemProtocolLoader
|
| Fields inherited from class com.slytechs.jnetstream.protocol.ProtocolRegistry |
|---|
BINDING_CMD_DEFAULT, BINDING_CMD_RESET, defaultRegistry |
| Constructor Summary | |
|---|---|
LegacyProtocolRegistry()
Default constructor. |
|
| Method Summary | |
|---|---|
Protocol |
findProtocol(java.lang.String name)
Retrieves the specified protocol from the protocol repository. |
java.lang.String |
getDefaultBindingSource()
|
Protocol |
getProtocol(java.lang.String name)
Retrieves the specified protocol from the protocol repository. |
Iterable |
getProtocolBindings()
Retruns an Iterable list of all the protocol bindings. |
Iterable |
getProtocols()
Returns an Iterable list of currently defined and known protocols. |
ProtocolLoader |
getSystemProtocolLoader()
|
void |
init()
Because of objects in LegacyPR rely on ProtocolRegistry, we have delay their initialization until such time that a single default PR is created. |
boolean |
isResetBindings(java.lang.String name)
|
void |
loadProtocolBinding(java.lang.String bindingExpression)
Loads a single binding specified by the bindingExpression. |
void |
loadProtocolBindings(java.io.File file)
Loads protocol bindings from the specified url. |
void |
loadProtocolBindings(java.io.InputStream in,
java.lang.String filename)
Loads protocol bindings from the specified reader. |
void |
loadProtocolBindings(java.io.Reader reader,
java.lang.String filename)
Loads protocol bindings from the specified reader. |
void |
loadProtocolBindings(java.net.URL url)
Loads protocol bindings from the specified url. |
boolean |
resetProtocolBindings(java.lang.String name)
Resets any bindings for the specified protocol. |
void |
setBindingLinked(NPLProtocolBinding binding,
boolean linked)
|
void |
setLinker(ProtocolLinker linker)
|
void |
setResetBindings(java.lang.String name,
boolean resetBindings)
|
void |
setSystemProtocolImplementationTypes(java.util.Set requestedSet)
A user requested set of protocol implementations to use. |
| Methods inherited from class com.slytechs.jnetstream.protocol.ProtocolRegistry |
|---|
getDefault |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BINDING_EXTENSION
protected ProtocolLoader systemProtocolLoader
| Constructor Detail |
|---|
public LegacyProtocolRegistry()
| Method Detail |
|---|
public java.lang.String getDefaultBindingSource()
public Protocol getProtocol(java.lang.String name)
getProtocol in class ProtocolRegistryname - Name of the protocol to return.
public Protocol findProtocol(java.lang.String name)
findProtocol in class ProtocolRegistryname - Name of the protocol to return.
public Iterable getProtocolBindings()
getProtocolBindings in class ProtocolRegistrypublic Iterable getProtocols()
getProtocols in class ProtocolRegistrypublic ProtocolLoader getSystemProtocolLoader()
public void init()
public boolean isResetBindings(java.lang.String name)
public void loadProtocolBinding(java.lang.String bindingExpression)
throws InvalidBindingFormat,
ProtocolNotFoundException
protocol=binding statement
loadProtocolBinding in class ProtocolRegistrybindingExpression - The expression to load the binding
InvalidBindingFormat - Any syntax problems with the expression.
ProtocolNotFoundException
public void loadProtocolBindings(java.io.File file)
throws java.io.IOException
protocol=binding statement
loadProtocolBindings in class ProtocolRegistryfilename - File from which to load the bindings.
InvalidBindingFormat - Any problems with the syntax.
java.io.IOException
public void loadProtocolBindings(java.io.InputStream in,
java.lang.String filename)
throws java.io.IOException
ProtocolRegistryprotocol=binding statement. If there are any syntax
errors in the stream, error warning will be logged and those entries skipped.
loadProtocolBindings in class ProtocolRegistryfilename - Filename that will be reported if there are any errors.
java.io.IOException
public void loadProtocolBindings(java.io.Reader reader,
java.lang.String filename)
throws java.io.IOException
protocol=binding statement
filename - File from which to load the bindings.
InvalidBindingFormat - Any problems with the syntax.
java.io.IOException
ProtocolNotFoundException
public void loadProtocolBindings(java.net.URL url)
throws java.io.IOException
protocol=binding statement
loadProtocolBindings in class ProtocolRegistryfilename - File from which to load the bindings.
InvalidBindingFormat - Any problems with the syntax.
java.io.IOExceptionpublic void setLinker(ProtocolLinker linker)
linker - The linker to set.
public void setResetBindings(java.lang.String name,
boolean resetBindings)
resetBindings - The resetBindings to set.public boolean resetProtocolBindings(java.lang.String name)
ProtocolRegistryResets 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.
resetProtocolBindings in class ProtocolRegistryname - Protocol name to clear the binding for.
public void setBindingLinked(NPLProtocolBinding binding,
boolean linked)
b - public void setSystemProtocolImplementationTypes(java.util.Set requestedSet)
ProtocolRegistryA 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.
setSystemProtocolImplementationTypes in class ProtocolRegistryrequestedSet - 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 | ||||||||