diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..88c7fbc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/Installers diff --git a/FPC4/build.xml b/FPC4/build.xml deleted file mode 100644 index 854da90..0000000 --- a/FPC4/build.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FPC4/fpc4.iml b/FPC4/fpc4.iml deleted file mode 100644 index aaf0ae9..0000000 --- a/FPC4/fpc4.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/FPC4/generate_sources.BAT b/FPC4/generate_sources.BAT deleted file mode 100644 index 7c78a98..0000000 --- a/FPC4/generate_sources.BAT +++ /dev/null @@ -1 +0,0 @@ -xjc.exe .\src\TemplateEngine\Template4\fingerprint3.xsd -p TemplateEngine.Fingerprint3 -d src \ No newline at end of file diff --git a/FPC4/lib/Required_libs.txt b/FPC4/lib/Required_libs.txt deleted file mode 100644 index aa18330..0000000 --- a/FPC4/lib/Required_libs.txt +++ /dev/null @@ -1 +0,0 @@ -antlr-4.5-complete \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Compiler/CompiledCode.java b/FPC4/src/TemplateEngine/Compiler/CompiledCode.java deleted file mode 100644 index 6219a74..0000000 --- a/FPC4/src/TemplateEngine/Compiler/CompiledCode.java +++ /dev/null @@ -1,43 +0,0 @@ -package TemplateEngine.Compiler; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URI; -import java.net.URISyntaxException; -import javax.tools.SimpleJavaFileObject; - -/** - * Created by BESTDOG on 11/23/2015. - * - *
- * Buffers compiled code in memory while behaving like a FileObject to the JavaCompiler.
- * 
- */ -public class CompiledCode extends SimpleJavaFileObject { - - ByteArrayOutputStream os; - - public CompiledCode(String className) throws URISyntaxException { - super( new URI(className), Kind.CLASS ); - os = new ByteArrayOutputStream(); - } - - @Override - public OutputStream openOutputStream() throws IOException { - return os; - } - - @Override - public boolean delete() { - try { - os.close(); - } catch( Exception ex ) {} - os = null; - return true; - } - - public byte[] getbytes() { - return os.toByteArray(); - } -} \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Compiler/FPCompiler.java b/FPC4/src/TemplateEngine/Compiler/FPCompiler.java deleted file mode 100644 index e09039d..0000000 --- a/FPC4/src/TemplateEngine/Compiler/FPCompiler.java +++ /dev/null @@ -1,129 +0,0 @@ -package TemplateEngine.Compiler; - -import TemplateEngine.Data.FunctionalOperation; - -import javax.tools.*; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Created by BESTDOG on 11/23/2015. - * - * Manages compilation of SourceCode by ClassName. - * Allows classes to be unloaded with {@link IsolatedClassLoader}. - */ -public class FPCompiler { - - final JavaCompiler javac; - IsolatedClassLoader loader; - - private static FPCompiler self; - - public FPCompiler() { - findTools(); - javac = ToolProvider.getSystemJavaCompiler(); - if (FPCompiler.self == null) { - this.self = this; - } - } - - public static FPCompiler getCompiler() { - return self; - } - - /** - * Compiles a {@link SourceCode} java-code file and loads it into an {@link IsolatedClassLoader} so it may be unloaded - * from the JVM. - * @param sourceCode SourceCode to compile. - * @return true on successful compilation, else false. - */ - public boolean compile(SourceCode sourceCode) { - boolean res = false; - CompiledCode cc = null; - - if(javac == null) { - Logger.getLogger(getClass().getName()).log(Level.SEVERE, "JavaCompiler is unavailable."); - } else try { - cc = new CompiledCode(sourceCode.getClassName()); - - Iterable units = Arrays.asList(sourceCode); - - IsolatedClassLoader cl = getLoader(); - - StandardJavaFileManager sjfm = javac.getStandardFileManager(new DiagnosticListener() { - @Override - public void report(Diagnostic diagnostic) { - Logger.getLogger(FPCompiler.class.getName()).log(Level.SEVERE, diagnostic.getMessage(Locale.ENGLISH)); - } - }, Locale.ENGLISH, Charset.defaultCharset()); - - List options = new ArrayList<>(); - //options.add("-Xlint:unchecked"); - - IsolatedJavaFileManager jfm = new IsolatedJavaFileManager(sjfm, cc, cl); - JavaCompiler.CompilationTask t = javac.getTask(null, jfm, null, options, null, units); - res = t.call(); - } catch (URISyntaxException e) { - e.printStackTrace(); - } - - return res; - } - - /** - * Compiles and loads a single source file. - * - * @param className Unique name of the class. - * @param rawCode Raw source code as a String. - * @return true on successful compilation, else false. - * @throws URISyntaxException Thrown when the JavaFileManagerEx cannot - * resolve the name of the compiled code in the StandardJavaFileManager. - */ - public boolean compile(String className, String rawCode) throws URISyntaxException { - SourceCode sc = new SourceCode(className, rawCode); - return this.compile(sc); - } - - /** - * Sets the internal class loader reference to null and returns the last - * strong reference to it. - * - * @return The last strong reference to the class loader. - */ - public IsolatedClassLoader deleteLoader() { - IsolatedClassLoader l = loader; - if (loader != null) { - loader.clear(); - } - loader = null; - return l; - } - - public IsolatedClassLoader getLoader() { - if (loader == null) { - loader = new IsolatedClassLoader(); - } - return loader; - } - - /** - * Typically used to check if the loader persisted after being deleted. - * @return IsolatedClassLoader if exists, may be null. - */ - public IsolatedClassLoader getCurrentLoader() { - return this.loader; - } - - /*** - * Locates the JDK's tools.jar, typically jdk1.8.0_66 folder. - */ - private void findTools() { - /** this should be handled by implementing project. */ - } -} diff --git a/FPC4/src/TemplateEngine/Compiler/IsolatedClassLoader.java b/FPC4/src/TemplateEngine/Compiler/IsolatedClassLoader.java deleted file mode 100644 index 365b5b5..0000000 --- a/FPC4/src/TemplateEngine/Compiler/IsolatedClassLoader.java +++ /dev/null @@ -1,94 +0,0 @@ -package TemplateEngine.Compiler; - -import java.util.HashMap; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Created by BESTDOG on 11/23/2015. - * - *
- * Classloader for Fingerprints and Detect interfaces.
- * A classloader is created for each fingerprint so that it may be deleted.
- * Loading a class into the system class loader means that class cannot be unloaded without unloading every other class.
- * A class can only be unloaded by removing all references to it's classLoader, this is why we use {@link IsolatedClassLoader}.
- * 
- */ -public class IsolatedClassLoader extends ClassLoader { - - final HashMap units = new HashMap<>(); - final HashMap classes = new HashMap<>(); - - public IsolatedClassLoader() { - super(new ClassLoader() {}); - } - - /** - * @return Map of all code units to their {@link CompiledCode#getName() } value. - */ - public HashMap getUnits() { - return units; - } - - public void loadAll() throws ClassNotFoundException { - loadAll(false); - } - - /** - * Loads all code units within this class loader ( typically just 1 ) - * - * @param verbose logges errors if true, else false and silent. - * @throws ClassNotFoundException If {@link #findClass(java.lang.String) } - * is called on a class that has not been added. - */ - public void loadAll(Boolean verbose) throws ClassNotFoundException { - Set names = getUnits().keySet(); - for (String s : names) { - if (verbose) { - Logger.getLogger(IsolatedClassLoader.class.getName()).log(Level.INFO, "Loading, " + s); - } - Class c = this.findClass(s); - classes.put(s, c); - } - } - - /** - * Adds a compiled code unit to this classloader. - * - * @param unit Compiled unit of code, its {@link CompiledCode#getName() } - * will be the name used to load the class with {@link #findClass(java.lang.String) - * }. - */ - public void setCode(CompiledCode unit) { - String name = unit.getName(); - units.put(name, unit); - } - - /** - * Clears all code units and loaded classes. - */ - public void clear() { - classes.clear(); - units.values().forEach(CompiledCode::delete); - units.clear(); - } - - @Override - public Class findClass(String name) throws ClassNotFoundException { - Class c = classes.get(name); - if (c != null) { - return c; - } - CompiledCode unit = units.get(name); - if (unit == null) { - return super.findClass(name); - } - byte[] bytes = unit.getbytes(); - return defineClass(name, bytes, 0, bytes.length); - } - - public boolean isPresent(String className) { - return this.classes.containsKey(className); - } -} diff --git a/FPC4/src/TemplateEngine/Compiler/IsolatedJavaFileManager.java b/FPC4/src/TemplateEngine/Compiler/IsolatedJavaFileManager.java deleted file mode 100644 index 7d75688..0000000 --- a/FPC4/src/TemplateEngine/Compiler/IsolatedJavaFileManager.java +++ /dev/null @@ -1,43 +0,0 @@ -package TemplateEngine.Compiler; - -import java.io.IOException; -import javax.tools.FileObject; -import javax.tools.ForwardingJavaFileManager; -import javax.tools.JavaFileManager; -import javax.tools.JavaFileObject; -/** - * Created by BESTDOG on 11/23/2015. - * - *
- * Used by the JavaCompiler to proxy the transition of SourceCode to CompiledCode objects.
- * Helps the determine (when used by javac) to locate the compiled-code files in memory, vs on disk.
- * 
- */ -public class IsolatedJavaFileManager extends ForwardingJavaFileManager { - - CompiledCode unit; - IsolatedClassLoader loader; - - /** - * Constructs this file-manager from the manager it will forward files from. - * @param fileman FileManager to forward or get from when necessary. - * @param unit Code unit to supply when requested. - * @param loader Class loader used to load the CompiledCodeUnit within this FileManager. - */ - protected IsolatedJavaFileManager(JavaFileManager fileman, CompiledCode unit, IsolatedClassLoader loader) { - super(fileman); - this.unit = unit; - this.loader = loader; - this.loader.setCode(unit); - } - - @Override - public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException { - return unit; - } - - @Override - public ClassLoader getClassLoader(JavaFileManager.Location location) { - return loader; - } -} diff --git a/FPC4/src/TemplateEngine/Compiler/SourceCode.java b/FPC4/src/TemplateEngine/Compiler/SourceCode.java deleted file mode 100644 index c5aa56d..0000000 --- a/FPC4/src/TemplateEngine/Compiler/SourceCode.java +++ /dev/null @@ -1,39 +0,0 @@ -package TemplateEngine.Compiler; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.net.URI; -import javax.tools.SimpleJavaFileObject; - -/** - * Created by BESTDOG on 11/23/2015. - * - *
- * Used to intermediatly buffer source code as a JavaFileObject before it is compiled into a CompiledCode object.
- * 
- */ -public class SourceCode extends SimpleJavaFileObject { - final String source; - private String className; - - /** - * By creating a URI to the default-java String pool we load our source files into memory, vs on disk. - * We can then read them as files with {@link ByteArrayInputStream}. - * @param className Name of contained class. - * @param source Contents of the source code. - */ - public SourceCode(String className, String source) { - super( URI.create("string:///"+className.replace('.','/')+Kind.SOURCE.extension), Kind.SOURCE ); - this.source = source; - this.className = className; - } - - public String getClassName() { - return this.className; - } - - @Override - public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { - return source; - } -} diff --git a/FPC4/src/TemplateEngine/Data/Cursor.java b/FPC4/src/TemplateEngine/Data/Cursor.java deleted file mode 100644 index f5aed9f..0000000 --- a/FPC4/src/TemplateEngine/Data/Cursor.java +++ /dev/null @@ -1,19 +0,0 @@ -package TemplateEngine.Data; - -/** - * Created by BESTDOG on 11/24/2015. - * - * Simple cursor implementation with three index. - * - * Three indexes is the minimal amount of cursors required to to exacting field extraction. - */ -public interface Cursor { - int getA(); - int getB(); - int get(); - void setA(int i); - void setB(int i); - void set(int i); - void forward(int i); - void reset(); -} diff --git a/FPC4/src/TemplateEngine/Data/Filter.java b/FPC4/src/TemplateEngine/Data/Filter.java deleted file mode 100644 index d1ac083..0000000 --- a/FPC4/src/TemplateEngine/Data/Filter.java +++ /dev/null @@ -1,69 +0,0 @@ -package TemplateEngine.Data; - -/** - * Created by BESTDOG on 11/24/2015. - *

- * Interface for filter ethernet header data. - */ -public interface Filter { - - static final Integer[] NILL = new Integer[0]; - - default Integer[] getTransportProtocol(int proto) { - return NILL; - } - - default Integer[] getSrcPort(int src) { - return NILL; - } - - default Integer[] getDstPort(int dst) { - return NILL; - } - - default Integer[] getEthertype(int eth) { - return NILL; - } - - default Integer[] getAck(String ack) { - return NILL; - } - - default Integer[] getFlags(String flags) { - return NILL; - } - - default Integer[] getSeq(String seq) { - return NILL; - } - - default Integer[] getWindow(int window) { - return NILL; - } - - default Integer[] getTTL(int ttl) { - return NILL; - } - - default Integer[] getDsize(int dsize) { - return NILL; - } - - /** - * @deprecated - */ - default Integer[] DsizeInRange(int dsize) { - return NILL; - } - - /** - * @deprecated - */ - default Integer[] TTLInRange(int ttl) { - return NILL; - } - - FunctionalOperation getOperation(int index); - - -} diff --git a/FPC4/src/TemplateEngine/Data/FilterData.java b/FPC4/src/TemplateEngine/Data/FilterData.java deleted file mode 100644 index c7fe0e5..0000000 --- a/FPC4/src/TemplateEngine/Data/FilterData.java +++ /dev/null @@ -1,73 +0,0 @@ -package TemplateEngine.Data; - -/** - * Created by BESTDOG on 11/24/2015. - * - * FilterData contains the data that filter must check. - * - * This contain mostly UDP and TCP Ethernet header fields. - * - */ -public interface FilterData { - - /** - * @return Source Port. - */ - int getSrc(); - - /** - * @return Destination Port. - */ - int getDst(); - - /** - * @return Packets Ethertype. - */ - int getEth(); - - /** - * @return The Time-To-Live for a IPv4 packet. - */ - int getTtl(); - - /** - * @return IANA protocol number, either 6(TCP) or 7(UDP) while implementing JNETPCAP. - */ - int getProto(); - - /** - * @return The size of the datagram. - */ - int getDsize(); - - /** - * @return The TCP window field. - */ - int getWindow(); - - /** - * @return The packet size in bytes. - */ - int size(); - - /** - * @return The frame count of this traffic. - */ - Long getFrame(); - - /** - * @return ACK flag string. - */ - String getFlags(); - - /** - * @return The Long value of the ACK field of a TCP packet as a String since Long cannot be used in a switch. - */ - String getAck(); - - /** - * @return The Long value of the SEQ field of a TCP packet as a String since Long cannot be used in a switch. - */ - String getSeq(); - -} diff --git a/FPC4/src/TemplateEngine/Data/FunctionalFingerprint.java b/FPC4/src/TemplateEngine/Data/FunctionalFingerprint.java deleted file mode 100644 index b9259d7..0000000 --- a/FPC4/src/TemplateEngine/Data/FunctionalFingerprint.java +++ /dev/null @@ -1,10 +0,0 @@ -package TemplateEngine.Data; - -/** - * Created by BESTDOG on 11/24/2015. - */ -public interface FunctionalFingerprint { - - FunctionalOperation loadMethod(String methodName); - -} diff --git a/FPC4/src/TemplateEngine/Data/FunctionalOperation.java b/FPC4/src/TemplateEngine/Data/FunctionalOperation.java deleted file mode 100644 index 4d25cc6..0000000 --- a/FPC4/src/TemplateEngine/Data/FunctionalOperation.java +++ /dev/null @@ -1,17 +0,0 @@ -package TemplateEngine.Data; - -import java.util.function.Consumer; -import java.util.function.Supplier; - -/** - * Created by BESTDOG on 11/24/2015. - * - * Functional interface for the methods generated by the FPC. - * - */ -@FunctionalInterface -public interface FunctionalOperation { - - void apply(FilterData t, PseudoBuffer payload, Cursor cursor, Consumer ret, Supplier supplier); - -} diff --git a/FPC4/src/TemplateEngine/Data/LateBindingMap.java b/FPC4/src/TemplateEngine/Data/LateBindingMap.java deleted file mode 100644 index 3051d56..0000000 --- a/FPC4/src/TemplateEngine/Data/LateBindingMap.java +++ /dev/null @@ -1,100 +0,0 @@ -package TemplateEngine.Data; - -import ICSDefines.ByteFunctionSupplier; - -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.BiConsumer; -import java.util.stream.Stream; - -/** - * - * @author BESTDOG Map which can be given a Key-Value pair or a - * Key-Byte[]-ToString method tuple to store the data quickly and convert is - * later. - * - * The default underlying map is a - * {@link java.util.concurrent.ConcurrentHashMap}. - */ -public class LateBindingMap extends ConcurrentHashMap { - - ConcurrentHashMap unboundMap; - ConcurrentHashMap byteFunctions; - - public LateBindingMap() { - super(); - unboundMap = new ConcurrentHashMap<>(); - byteFunctions = new ConcurrentHashMap<>(); - } - - public void put(String key, byte[] rawData, ByteFunctionSupplier byteFunction) { - this.byteFunctions.put(key, byteFunction); - unboundMap.put(key, rawData); - } - - /** - * If this map contains unbound entries. - * - * @return True if unbound entries exist, else false. - */ - public boolean isUnbound() { - return !isBound(); - } - - /** - * If this map contains no unbound entries. - * - * @return True is no unbound entries exist, else false. - */ - public boolean isBound() { - return unboundMap.isEmpty(); - } - - /** - * Attempts to bind all unbound entries by their assigned binding function. - */ - public void bindAll() { - if (isUnbound()) { - unboundMap.entrySet().removeIf(this::bindEntry); - } - } - - /** - * Binds a single entry unbound entry by its {@link #byteFunctions} - * ByteFunctionSupplier. - * - * @param e Entry to bind. - * @return Always true. - */ - private boolean bindEntry(Entry e) { - String key = e.getKey(); - byte[] oldValue = e.getValue(); - String newValue = this.byteFunctions.get(key).toString(oldValue); - this.put(key, newValue); - return true; - } - - public void putAll(LateBindingMap other) { - super.putAll(other); - this.byteFunctions.putAll(other.byteFunctions); - this.unboundMap.putAll(other.unboundMap); - } - - public Stream> stream() { - bindAll(); - return this.entrySet().stream(); - } - - @Override - public void forEach(BiConsumer action) { - bindAll(); - super.forEach(action); - } - - @Override - public void clear() { - super.clear(); - unboundMap.clear(); - byteFunctions.clear(); - } - -} diff --git a/FPC4/src/TemplateEngine/Data/PseudoBuffer.java b/FPC4/src/TemplateEngine/Data/PseudoBuffer.java deleted file mode 100644 index 5045cda..0000000 --- a/FPC4/src/TemplateEngine/Data/PseudoBuffer.java +++ /dev/null @@ -1,137 +0,0 @@ -package TemplateEngine.Data; - -import java.util.regex.Pattern; - -/** - * Created by BESTDOG on 11/24/2015. - *

- * Interface to be used for the buffer parameter. - */ -public interface PseudoBuffer { - /** - * @param index Index to get a byte from. - * @return Byte at the provided index. - */ - byte getByte(int index); - - /** - * Retrieves a byte array with a maximum length and optionally reversed order. - * @param index Start index to copy from. - * @param array byte[] to write to. - * @param offset Offset from the start index. - * @param length maximum length of the copy, actual copied size may be less. - * @param flip Reverses bytes if true, else NBO. - * @return Reference to the copied byte array. - */ - byte[] getByteArray(int index, byte[] array, int offset, int length, boolean flip); - - /** - * Retrieves a byte array with a maximum length and always in NBO. - * @param index Start index to copy from. - * @param array byte[] to write to. - * @param offset Offset from the start index. - * @param length maximum length of the copy, actual copied size may be less. - * @return Reference to the copied byte array. - */ - byte[] getByteArray(int index, byte[] array, int offset, int length); - - /** - * Creates a copy at the offset with the length provided, or less if end of buffer is reached. - * @param offset Start index to copy from. - * @param length Length in bytes to copy. - * @return A new byte[] with the copied bytes. - */ - byte[] getByteArray(int offset, int length); - - /** - * Gets an int at the offset and optionally reverses byte order, see {@link Integer#BYTES}. - * @param offset Start index to copy from. - * @param isNetByteOrder Reverses bytes if true, else NBO. - * @return Integer at the offset. - */ - int getInt(final int offset, boolean isNetByteOrder); - - /** - * Gets an int at the offset and optionally reverses byte order, see {@link Integer#BYTES}. - * @param offset Start index to copy from. - * @param length Length of bytes to read, may be less then 4 and converted to an int. - * @param isNetByteOrder Reverses bytes if true, else NBO. - * @return Integer at the offset. - */ - int getInt(final int offset, int length, boolean isNetByteOrder); - - /** - * Gets a String constructed from the bytes at the given offset. - * @param offset Start index to copy from. - * @param length Length of bytes to read. - * @return UTF-8 string equivalent. - */ - String getString(int offset, int length); - - /** - * Returns the first string from the buffer which matches the Pattern. - * @param pattern Pattern to search for. - * @return First matching sub-string. - */ - String match(Pattern pattern); - - /** - * Returns the first string from the buffer within the bounds of offset and length which matches the Pattern. - * @param pattern Pattern to search for. - * @param offset Start index to search from. - * @param length Length of bytes to read. - * @return First matching sub-string. - */ - String match(Pattern pattern, int offset, int length); - - /** - * Searches for the byte sequence within the payload within the bounds of offset and length. - * @param search byte[] to match. - * @param offset Start index to search from. - * @param length Length of bytes to read. - * @return Beginning index in the buffer where the search sequence was a complete match, else -1 on failure. - */ - int match(byte[] search, int offset, int length); - - /** - * Checks if an integer is at a given byte offset. - * @param offset Start index to search from. - * @param compareTo Integer to compare to. - * @return - */ - boolean match(int offset, int compareTo); - - /** - * Copies bytes `from an index `to an index with a maximum `length. - * @param from Start index to search from. - * @param to End index to search To. - * @param length Maximum length, actual returned byte[] may be less then or equal to this length. - * @return Copy of the bytes within the provided bounds. - */ - byte[] extract(final int from, final int to, int length); - - /** - * Same as {@link #extract(int, int, int)} but will flip the byte order. - * @param from Start index to search from. - * @param to End index to search To. - * @param length Maximum length, actual returned byte[] may be less then or equal to this length. - * @return Copy of the bytes within the provided bounds. - */ - byte[] extractLittle(final int from, final int to, final int length); - - /** - * @return Last addressable index within the buffer. ({@link #size()} - 1) - */ - int end(); - - /** - * @return Size as returned by the buffer. - */ - int size(); - - /** - * @return Entire buffer dumped to a hex-string. - */ - String toHexdump(); - -} diff --git a/FPC4/src/TemplateEngine/Data/PseudoDetails.java b/FPC4/src/TemplateEngine/Data/PseudoDetails.java deleted file mode 100644 index 90c7777..0000000 --- a/FPC4/src/TemplateEngine/Data/PseudoDetails.java +++ /dev/null @@ -1,38 +0,0 @@ -package TemplateEngine.Data; - -import ICSDefines.Category; -import ICSDefines.Direction; -import ICSDefines.Role; - -/** - * Created by BESTDOG on 11/24/2015. - *

- * Interface for the methods which extract data from fingerprinting. - */ -public class PseudoDetails extends LateBindingMap { - - public PseudoDetails() { - } - - public void setCategory(Category category) { - } - - public void setCategory(Category category, boolean setIfUnknown) { - } - - public void setCountry(String country) { - } - - public void setConfidence(Integer confidence) { - } - - public void setDirection(Direction direction) { - } - - public void putName(String name) { - } - - public void setRole(Role role) { - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/Anchor.java b/FPC4/src/TemplateEngine/Fingerprint3/Anchor.java deleted file mode 100644 index 54cefaf..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/Anchor.java +++ /dev/null @@ -1,150 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for Anchor complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Anchor">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute ref="{}Cursor use="required""/>
- *       <attribute ref="{}Position"/>
- *       <attribute ref="{}Relative"/>
- *       <attribute ref="{}Offset"/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Anchor") -public class Anchor { - - @XmlAttribute(name = "Cursor", required = true) - protected Cursor cursor; - @XmlAttribute(name = "Position") - protected Position position; - @XmlAttribute(name = "Relative") - protected Boolean relative; - @XmlAttribute(name = "Offset") - protected Integer offset; - - /** - * Gets the value of the cursor property. - * - * @return - * possible object is - * {@link Cursor } - * - */ - public Cursor getCursor() { - return cursor; - } - - /** - * Sets the value of the cursor property. - * - * @param value - * allowed object is - * {@link Cursor } - * - */ - public void setCursor(Cursor value) { - this.cursor = value; - } - - /** - * Gets the value of the position property. - * - * @return - * possible object is - * {@link Position } - * - */ - public Position getPosition() { - return position; - } - - /** - * Sets the value of the position property. - * - * @param value - * allowed object is - * {@link Position } - * - */ - public void setPosition(Position value) { - this.position = value; - } - - /** - * Gets the value of the relative property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isRelative() { - if (relative == null) { - return false; - } else { - return relative; - } - } - - /** - * Sets the value of the relative property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setRelative(Boolean value) { - this.relative = value; - } - - /** - * Gets the value of the offset property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getOffset() { - return offset; - } - - /** - * Sets the value of the offset property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setOffset(Integer value) { - this.offset = value; - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/AndThen.java b/FPC4/src/TemplateEngine/Fingerprint3/AndThen.java deleted file mode 100644 index 4cc6593..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/AndThen.java +++ /dev/null @@ -1,89 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <group ref="{}Operation"/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "matchOrByteTestOrIsDataAt" -}) -@XmlRootElement(name = "AndThen") -public class AndThen { - - @XmlElements({ - @XmlElement(name = "Match", type = MatchFunction.class), - @XmlElement(name = "ByteTest", type = ByteTestFunction.class), - @XmlElement(name = "IsDataAt", type = IsDataAtFunction.class), - @XmlElement(name = "ByteJump", type = ByteJumpFunction.class), - @XmlElement(name = "Anchor", type = Anchor.class), - @XmlElement(name = "Return", type = Return.class) - }) - protected List matchOrByteTestOrIsDataAt; - - /** - * Gets the value of the matchOrByteTestOrIsDataAt property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the matchOrByteTestOrIsDataAt property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getMatchOrByteTestOrIsDataAt().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link MatchFunction } - * {@link ByteTestFunction } - * {@link IsDataAtFunction } - * {@link ByteJumpFunction } - * {@link Anchor } - * {@link Return } - * - * - */ - public List getMatchOrByteTestOrIsDataAt() { - if (matchOrByteTestOrIsDataAt == null) { - matchOrByteTestOrIsDataAt = new ArrayList(); - } - return this.matchOrByteTestOrIsDataAt; - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/ByteJumpFunction.java b/FPC4/src/TemplateEngine/Fingerprint3/ByteJumpFunction.java deleted file mode 100644 index 38f6bc0..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/ByteJumpFunction.java +++ /dev/null @@ -1,243 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for ByteJumpFunction complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ByteJumpFunction">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Calc" minOccurs="0">
- *           <simpleType>
- *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *               <pattern value="((\d+)|x)([-+/*]((\d+)|x))*"/>
- *             </restriction>
- *           </simpleType>
- *         </element>
- *         <element ref="{}AndThen"/>
- *       </sequence>
- *       <attribute ref="{}PostOffset"/>
- *       <attribute ref="{}Relative"/>
- *       <attribute ref="{}Endian"/>
- *       <attribute ref="{}Offset"/>
- *       <attribute ref="{}Bytes"/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ByteJumpFunction", propOrder = { - "calc", - "andThen" -}) -public class ByteJumpFunction { - - @XmlElement(name = "Calc") - protected String calc; - @XmlElement(name = "AndThen", required = true) - protected AndThen andThen; - @XmlAttribute(name = "PostOffset") - protected Integer postOffset; - @XmlAttribute(name = "Relative") - protected Boolean relative; - @XmlAttribute(name = "Endian") - protected String endian; - @XmlAttribute(name = "Offset") - protected Integer offset; - @XmlAttribute(name = "Bytes") - protected Integer bytes; - - /** - * Gets the value of the calc property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCalc() { - return calc; - } - - /** - * Sets the value of the calc property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCalc(String value) { - this.calc = value; - } - - /** - * Gets the value of the andThen property. - * - * @return - * possible object is - * {@link AndThen } - * - */ - public AndThen getAndThen() { - return andThen; - } - - /** - * Sets the value of the andThen property. - * - * @param value - * allowed object is - * {@link AndThen } - * - */ - public void setAndThen(AndThen value) { - this.andThen = value; - } - - /** - * Gets the value of the postOffset property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getPostOffset() { - return postOffset; - } - - /** - * Sets the value of the postOffset property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setPostOffset(Integer value) { - this.postOffset = value; - } - - /** - * Gets the value of the relative property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isRelative() { - if (relative == null) { - return false; - } else { - return relative; - } - } - - /** - * Sets the value of the relative property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setRelative(Boolean value) { - this.relative = value; - } - - /** - * Gets the value of the endian property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getEndian() { - return endian; - } - - /** - * Sets the value of the endian property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEndian(String value) { - this.endian = value; - } - - /** - * Gets the value of the offset property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getOffset() { - return offset; - } - - /** - * Sets the value of the offset property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setOffset(Integer value) { - this.offset = value; - } - - /** - * Gets the value of the bytes property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getBytes() { - return bytes; - } - - /** - * Sets the value of the bytes property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setBytes(Integer value) { - this.bytes = value; - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/ByteTestFunction.java b/FPC4/src/TemplateEngine/Fingerprint3/ByteTestFunction.java deleted file mode 100644 index 881ea9a..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/ByteTestFunction.java +++ /dev/null @@ -1,424 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import java.math.BigInteger; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for ByteTestFunction complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ByteTestFunction">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <choice>
- *           <element name="GT" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *           <element name="LT" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *           <element name="GTE" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *           <element name="LTE" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *           <element name="EQ" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *           <element name="AND" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *           <element name="OR" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *         </choice>
- *         <element ref="{}AndThen"/>
- *       </sequence>
- *       <attribute ref="{}PostOffset default="0""/>
- *       <attribute ref="{}Relative"/>
- *       <attribute ref="{}Endian default="BIG""/>
- *       <attribute ref="{}Offset default="0""/>
- *       <attribute ref="{}Bytes default="1""/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ByteTestFunction", propOrder = { - "gt", - "lt", - "gte", - "lte", - "eq", - "and", - "or", - "andThen" -}) -public class ByteTestFunction { - - @XmlElement(name = "GT") - protected BigInteger gt; - @XmlElement(name = "LT") - protected BigInteger lt; - @XmlElement(name = "GTE") - protected BigInteger gte; - @XmlElement(name = "LTE") - protected BigInteger lte; - @XmlElement(name = "EQ") - protected BigInteger eq; - @XmlElement(name = "AND") - protected BigInteger and; - @XmlElement(name = "OR") - protected BigInteger or; - @XmlElement(name = "AndThen", required = true) - protected AndThen andThen; - @XmlAttribute(name = "PostOffset") - protected Integer postOffset; - @XmlAttribute(name = "Relative") - protected Boolean relative; - @XmlAttribute(name = "Endian") - protected String endian; - @XmlAttribute(name = "Offset") - protected Integer offset; - @XmlAttribute(name = "Bytes") - protected Integer bytes; - - /** - * Gets the value of the gt property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getGT() { - return gt; - } - - /** - * Sets the value of the gt property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setGT(BigInteger value) { - this.gt = value; - } - - /** - * Gets the value of the lt property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getLT() { - return lt; - } - - /** - * Sets the value of the lt property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setLT(BigInteger value) { - this.lt = value; - } - - /** - * Gets the value of the gte property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getGTE() { - return gte; - } - - /** - * Sets the value of the gte property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setGTE(BigInteger value) { - this.gte = value; - } - - /** - * Gets the value of the lte property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getLTE() { - return lte; - } - - /** - * Sets the value of the lte property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setLTE(BigInteger value) { - this.lte = value; - } - - /** - * Gets the value of the eq property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getEQ() { - return eq; - } - - /** - * Sets the value of the eq property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setEQ(BigInteger value) { - this.eq = value; - } - - /** - * Gets the value of the and property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getAND() { - return and; - } - - /** - * Sets the value of the and property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setAND(BigInteger value) { - this.and = value; - } - - /** - * Gets the value of the or property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getOR() { - return or; - } - - /** - * Sets the value of the or property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setOR(BigInteger value) { - this.or = value; - } - - /** - * Gets the value of the andThen property. - * - * @return - * possible object is - * {@link AndThen } - * - */ - public AndThen getAndThen() { - return andThen; - } - - /** - * Sets the value of the andThen property. - * - * @param value - * allowed object is - * {@link AndThen } - * - */ - public void setAndThen(AndThen value) { - this.andThen = value; - } - - /** - * Gets the value of the postOffset property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getPostOffset() { - if (postOffset == null) { - return 0; - } else { - return postOffset; - } - } - - /** - * Sets the value of the postOffset property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setPostOffset(Integer value) { - this.postOffset = value; - } - - /** - * Gets the value of the relative property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isRelative() { - if (relative == null) { - return false; - } else { - return relative; - } - } - - /** - * Sets the value of the relative property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setRelative(Boolean value) { - this.relative = value; - } - - /** - * Gets the value of the endian property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getEndian() { - if (endian == null) { - return "BIG"; - } else { - return endian; - } - } - - /** - * Sets the value of the endian property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEndian(String value) { - this.endian = value; - } - - /** - * Gets the value of the offset property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getOffset() { - if (offset == null) { - return 0; - } else { - return offset; - } - } - - /** - * Sets the value of the offset property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setOffset(Integer value) { - this.offset = value; - } - - /** - * Gets the value of the bytes property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getBytes() { - if (bytes == null) { - return 1; - } else { - return bytes; - } - } - - /** - * Sets the value of the bytes property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setBytes(Integer value) { - this.bytes = value; - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/ContentType.java b/FPC4/src/TemplateEngine/Fingerprint3/ContentType.java deleted file mode 100644 index 6e16754..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/ContentType.java +++ /dev/null @@ -1,50 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for ContentType. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="ContentType">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *     <enumeration value="HEX"/>
- *     <enumeration value="INTEGER"/>
- *     <enumeration value="RAW_BYTES"/>
- *     <enumeration value="STRING"/>
- *     <maxLength value="1024"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "ContentType") -@XmlEnum -public enum ContentType { - - HEX, - INTEGER, - RAW_BYTES, - STRING; - - public String value() { - return name(); - } - - public static ContentType fromValue(String v) { - return valueOf(v); - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/Cursor.java b/FPC4/src/TemplateEngine/Fingerprint3/Cursor.java deleted file mode 100644 index 3343458..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/Cursor.java +++ /dev/null @@ -1,47 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for Cursor. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="Cursor">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *     <enumeration value="START"/>
- *     <enumeration value="MAIN"/>
- *     <enumeration value="END"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "Cursor") -@XmlEnum -public enum Cursor { - - START, - MAIN, - END; - - public String value() { - return name(); - } - - public static Cursor fromValue(String v) { - return valueOf(v); - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/DetailGroup.java b/FPC4/src/TemplateEngine/Fingerprint3/DetailGroup.java deleted file mode 100644 index a1f113b..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/DetailGroup.java +++ /dev/null @@ -1,251 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; - - -/** - *

Java class for DetailGroup complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="DetailGroup">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Category" minOccurs="0">
- *           <simpleType>
- *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *               <enumeration value="PLC"/>
- *               <enumeration value="RTU"/>
- *               <enumeration value="MTU"/>
- *               <enumeration value="IED"/>
- *               <enumeration value="HMI"/>
- *               <enumeration value="UNKNOWN"/>
- *               <enumeration value="ICS_HOST"/>
- *               <enumeration value="FIREWALL"/>
- *               <enumeration value="NETWORK_DEVICE"/>
- *               <enumeration value="PROTOCOL_CONVERTER"/>
- *               <enumeration value="WORKSTATION"/>
- *               <enumeration value="OTHER"/>
- *             </restriction>
- *           </simpleType>
- *         </element>
- *         <element name="Role" minOccurs="0">
- *           <simpleType>
- *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *               <enumeration value="CLIENT"/>
- *               <enumeration value="SERVER"/>
- *               <enumeration value="MASTER"/>
- *               <enumeration value="SLAVE"/>
- *               <enumeration value="OPERATOR"/>
- *               <enumeration value="ENGINEER"/>
- *               <enumeration value="UNKNOWN"/>
- *               <enumeration value="OTHER"/>
- *             </restriction>
- *           </simpleType>
- *         </element>
- *         <element name="Detail" maxOccurs="unbounded" minOccurs="0">
- *           <complexType>
- *             <simpleContent>
- *               <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </extension>
- *             </simpleContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "DetailGroup", propOrder = { - "category", - "role", - "detail" -}) -public class DetailGroup { - - @XmlElement(name = "Category") - protected String category; - @XmlElement(name = "Role") - protected String role; - @XmlElement(name = "Detail") - protected List detail; - - /** - * Gets the value of the category property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCategory() { - return category; - } - - /** - * Sets the value of the category property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCategory(String value) { - this.category = value; - } - - /** - * Gets the value of the role property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRole() { - return role; - } - - /** - * Sets the value of the role property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRole(String value) { - this.role = value; - } - - /** - * Gets the value of the detail property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the detail property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getDetail().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link DetailGroup.Detail } - * - * - */ - public List getDetail() { - if (detail == null) { - detail = new ArrayList(); - } - return this.detail; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <simpleContent>
-     *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
-     *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </extension>
-     *   </simpleContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "value" - }) - public static class Detail { - - @XmlValue - protected String value; - @XmlAttribute(name = "Name", required = true) - protected String name; - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/Extract.java b/FPC4/src/TemplateEngine/Fingerprint3/Extract.java deleted file mode 100644 index 2af52ed..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/Extract.java +++ /dev/null @@ -1,213 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{}Post" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="From" use="required" type="{}Index" />
- *       <attribute name="To" use="required" type="{}Index" />
- *       <attribute name="MaxLength" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="1024" />
- *       <attribute ref="{}Endian"/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "post" -}) -@XmlRootElement(name = "Extract") -public class Extract { - - @XmlElement(name = "Post") - protected Post post; - @XmlAttribute(name = "Name", required = true) - protected String name; - @XmlAttribute(name = "From", required = true) - protected String from; - @XmlAttribute(name = "To", required = true) - protected String to; - @XmlAttribute(name = "MaxLength") - @XmlSchemaType(name = "unsignedShort") - protected Integer maxLength; - @XmlAttribute(name = "Endian") - protected String endian; - - /** - * Gets the value of the post property. - * - * @return - * possible object is - * {@link Post } - * - */ - public Post getPost() { - return post; - } - - /** - * Sets the value of the post property. - * - * @param value - * allowed object is - * {@link Post } - * - */ - public void setPost(Post value) { - this.post = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the from property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getFrom() { - return from; - } - - /** - * Sets the value of the from property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFrom(String value) { - this.from = value; - } - - /** - * Gets the value of the to property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTo() { - return to; - } - - /** - * Sets the value of the to property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTo(String value) { - this.to = value; - } - - /** - * Gets the value of the maxLength property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getMaxLength() { - if (maxLength == null) { - return 1024; - } else { - return maxLength; - } - } - - /** - * Sets the value of the maxLength property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setMaxLength(Integer value) { - this.maxLength = value; - } - - /** - * Gets the value of the endian property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getEndian() { - return endian; - } - - /** - * Sets the value of the endian property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEndian(String value) { - this.endian = value; - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/Fingerprint.java b/FPC4/src/TemplateEngine/Fingerprint3/Fingerprint.java deleted file mode 100644 index 56d4dbd..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/Fingerprint.java +++ /dev/null @@ -1,751 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementRef; -import javax.xml.bind.annotation.XmlElementRefs; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Header" type="{}Header"/>
- *         <sequence maxOccurs="unbounded">
- *           <element name="Filter">
- *             <complexType>
- *               <complexContent>
- *                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                   <sequence maxOccurs="unbounded">
- *                     <element name="Ack" type="{http://www.w3.org/2001/XMLSchema}long" maxOccurs="unbounded" minOccurs="0"/>
- *                     <element name="MSS" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" maxOccurs="unbounded" minOccurs="0"/>
- *                     <element name="Dsize" type="{http://www.w3.org/2001/XMLSchema}integer" maxOccurs="unbounded" minOccurs="0"/>
- *                     <element name="DsizeWithin" maxOccurs="unbounded" minOccurs="0">
- *                       <complexType>
- *                         <complexContent>
- *                           <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                             <attribute name="Min" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *                             <attribute name="Max" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *                           </restriction>
- *                         </complexContent>
- *                       </complexType>
- *                     </element>
- *                     <element name="DstPort" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" maxOccurs="unbounded" minOccurs="0"/>
- *                     <element name="Ethertype" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" maxOccurs="unbounded" minOccurs="0"/>
- *                     <element name="Flags" maxOccurs="unbounded" minOccurs="0">
- *                       <simpleType>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *                           <pattern value="((NS)|(CWR)|(ECE)|(URG)|(ACK)|(PSH)|(RST)|(SYN)|(FIN)){1,9}"/>
- *                         </restriction>
- *                       </simpleType>
- *                     </element>
- *                     <element name="Seq" type="{http://www.w3.org/2001/XMLSchema}long" maxOccurs="unbounded" minOccurs="0"/>
- *                     <element name="SrcPort" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" maxOccurs="unbounded" minOccurs="0"/>
- *                     <element name="TransportProtocol" type="{http://www.w3.org/2001/XMLSchema}unsignedByte" maxOccurs="unbounded" minOccurs="0"/>
- *                     <element name="TTL" type="{http://www.w3.org/2001/XMLSchema}integer" maxOccurs="unbounded" minOccurs="0"/>
- *                     <element name="TTLWithin" maxOccurs="unbounded" minOccurs="0">
- *                       <complexType>
- *                         <complexContent>
- *                           <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                             <attribute name="Min" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *                             <attribute name="Max" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *                           </restriction>
- *                         </complexContent>
- *                       </complexType>
- *                     </element>
- *                     <element name="Window" type="{http://www.w3.org/2001/XMLSchema}unsignedByte" maxOccurs="unbounded" minOccurs="0"/>
- *                   </sequence>
- *                   <attribute name="For" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 </restriction>
- *               </complexContent>
- *             </complexType>
- *           </element>
- *         </sequence>
- *         <element name="Payload" maxOccurs="unbounded" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *                   <sequence>
- *                     <element name="Always" minOccurs="0">
- *                       <complexType>
- *                         <complexContent>
- *                           <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                             <sequence>
- *                               <element ref="{}Return" maxOccurs="unbounded"/>
- *                             </sequence>
- *                           </restriction>
- *                         </complexContent>
- *                       </complexType>
- *                     </element>
- *                     <group ref="{}Operation" maxOccurs="unbounded"/>
- *                   </sequence>
- *                 </sequence>
- *                 <attribute name="For" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "header", - "filter", - "payload" -}) -@XmlRootElement(name = "Fingerprint") -public class Fingerprint { - - @XmlElement(name = "Header", required = true) - protected Header header; - @XmlElement(name = "Filter", required = true) - protected List filter; - @XmlElement(name = "Payload") - protected List payload; - - /** - * Gets the value of the header property. - * - * @return - * possible object is - * {@link Header } - * - */ - public Header getHeader() { - return header; - } - - /** - * Sets the value of the header property. - * - * @param value - * allowed object is - * {@link Header } - * - */ - public void setHeader(Header value) { - this.header = value; - } - - /** - * Gets the value of the filter property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the filter property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getFilter().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Fingerprint.Filter } - * - * - */ - public List getFilter() { - if (filter == null) { - filter = new ArrayList(); - } - return this.filter; - } - - /** - * Gets the value of the payload property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the payload property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getPayload().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Fingerprint.Payload } - * - * - */ - public List getPayload() { - if (payload == null) { - payload = new ArrayList(); - } - return this.payload; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <sequence maxOccurs="unbounded">
-     *         <element name="Ack" type="{http://www.w3.org/2001/XMLSchema}long" maxOccurs="unbounded" minOccurs="0"/>
-     *         <element name="MSS" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" maxOccurs="unbounded" minOccurs="0"/>
-     *         <element name="Dsize" type="{http://www.w3.org/2001/XMLSchema}integer" maxOccurs="unbounded" minOccurs="0"/>
-     *         <element name="DsizeWithin" maxOccurs="unbounded" minOccurs="0">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="Min" type="{http://www.w3.org/2001/XMLSchema}integer" />
-     *                 <attribute name="Max" type="{http://www.w3.org/2001/XMLSchema}integer" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *         <element name="DstPort" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" maxOccurs="unbounded" minOccurs="0"/>
-     *         <element name="Ethertype" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" maxOccurs="unbounded" minOccurs="0"/>
-     *         <element name="Flags" maxOccurs="unbounded" minOccurs="0">
-     *           <simpleType>
-     *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
-     *               <pattern value="((NS)|(CWR)|(ECE)|(URG)|(ACK)|(PSH)|(RST)|(SYN)|(FIN)){1,9}"/>
-     *             </restriction>
-     *           </simpleType>
-     *         </element>
-     *         <element name="Seq" type="{http://www.w3.org/2001/XMLSchema}long" maxOccurs="unbounded" minOccurs="0"/>
-     *         <element name="SrcPort" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" maxOccurs="unbounded" minOccurs="0"/>
-     *         <element name="TransportProtocol" type="{http://www.w3.org/2001/XMLSchema}unsignedByte" maxOccurs="unbounded" minOccurs="0"/>
-     *         <element name="TTL" type="{http://www.w3.org/2001/XMLSchema}integer" maxOccurs="unbounded" minOccurs="0"/>
-     *         <element name="TTLWithin" maxOccurs="unbounded" minOccurs="0">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="Min" type="{http://www.w3.org/2001/XMLSchema}integer" />
-     *                 <attribute name="Max" type="{http://www.w3.org/2001/XMLSchema}integer" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *         <element name="Window" type="{http://www.w3.org/2001/XMLSchema}unsignedByte" maxOccurs="unbounded" minOccurs="0"/>
-     *       </sequence>
-     *       <attribute name="For" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "ackAndMSSAndDsize" - }) - public static class Filter { - - @XmlElementRefs({ - @XmlElementRef(name = "TransportProtocol", type = JAXBElement.class, required = false), - @XmlElementRef(name = "Ack", type = JAXBElement.class, required = false), - @XmlElementRef(name = "DsizeWithin", type = JAXBElement.class, required = false), - @XmlElementRef(name = "SrcPort", type = JAXBElement.class, required = false), - @XmlElementRef(name = "Flags", type = JAXBElement.class, required = false), - @XmlElementRef(name = "Window", type = JAXBElement.class, required = false), - @XmlElementRef(name = "MSS", type = JAXBElement.class, required = false), - @XmlElementRef(name = "Ethertype", type = JAXBElement.class, required = false), - @XmlElementRef(name = "DstPort", type = JAXBElement.class, required = false), - @XmlElementRef(name = "Dsize", type = JAXBElement.class, required = false), - @XmlElementRef(name = "TTL", type = JAXBElement.class, required = false), - @XmlElementRef(name = "TTLWithin", type = JAXBElement.class, required = false), - @XmlElementRef(name = "Seq", type = JAXBElement.class, required = false) - }) - protected List> ackAndMSSAndDsize; - @XmlAttribute(name = "For", required = true) - protected String _for; - - /** - * Gets the value of the ackAndMSSAndDsize property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the ackAndMSSAndDsize property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getAckAndMSSAndDsize().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link JAXBElement }{@code <}{@link Short }{@code >} - * {@link JAXBElement }{@code <}{@link Long }{@code >} - * {@link JAXBElement }{@code <}{@link Fingerprint.Filter.DsizeWithin }{@code >} - * {@link JAXBElement }{@code <}{@link Integer }{@code >} - * {@link JAXBElement }{@code <}{@link String }{@code >} - * {@link JAXBElement }{@code <}{@link Short }{@code >} - * {@link JAXBElement }{@code <}{@link BigInteger }{@code >} - * {@link JAXBElement }{@code <}{@link Integer }{@code >} - * {@link JAXBElement }{@code <}{@link Integer }{@code >} - * {@link JAXBElement }{@code <}{@link BigInteger }{@code >} - * {@link JAXBElement }{@code <}{@link BigInteger }{@code >} - * {@link JAXBElement }{@code <}{@link Fingerprint.Filter.TTLWithin }{@code >} - * {@link JAXBElement }{@code <}{@link Long }{@code >} - * - * - */ - public List> getAckAndMSSAndDsize() { - if (ackAndMSSAndDsize == null) { - ackAndMSSAndDsize = new ArrayList>(); - } - return this.ackAndMSSAndDsize; - } - - /** - * Gets the value of the for property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getFor() { - return _for; - } - - /** - * Sets the value of the for property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFor(String value) { - this._for = value; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-         * <complexType>
-         *   <complexContent>
-         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *       <attribute name="Min" type="{http://www.w3.org/2001/XMLSchema}integer" />
-         *       <attribute name="Max" type="{http://www.w3.org/2001/XMLSchema}integer" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class DsizeWithin { - - @XmlAttribute(name = "Min") - protected BigInteger min; - @XmlAttribute(name = "Max") - protected BigInteger max; - - /** - * Gets the value of the min property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getMin() { - return min; - } - - /** - * Sets the value of the min property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setMin(BigInteger value) { - this.min = value; - } - - /** - * Gets the value of the max property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getMax() { - return max; - } - - /** - * Sets the value of the max property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setMax(BigInteger value) { - this.max = value; - } - - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-         * <complexType>
-         *   <complexContent>
-         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *       <attribute name="Min" type="{http://www.w3.org/2001/XMLSchema}integer" />
-         *       <attribute name="Max" type="{http://www.w3.org/2001/XMLSchema}integer" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class TTLWithin { - - @XmlAttribute(name = "Min") - protected BigInteger min; - @XmlAttribute(name = "Max") - protected BigInteger max; - - /** - * Gets the value of the min property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getMin() { - return min; - } - - /** - * Sets the value of the min property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setMin(BigInteger value) { - this.min = value; - } - - /** - * Gets the value of the max property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getMax() { - return max; - } - - /** - * Sets the value of the max property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setMax(BigInteger value) { - this.max = value; - } - - } - - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <sequence>
-     *         <element name="Description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
-     *         <sequence>
-     *           <element name="Always" minOccurs="0">
-     *             <complexType>
-     *               <complexContent>
-     *                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                   <sequence>
-     *                     <element ref="{}Return" maxOccurs="unbounded"/>
-     *                   </sequence>
-     *                 </restriction>
-     *               </complexContent>
-     *             </complexType>
-     *           </element>
-     *           <group ref="{}Operation" maxOccurs="unbounded"/>
-     *         </sequence>
-     *       </sequence>
-     *       <attribute name="For" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "description", - "always", - "operation" - }) - public static class Payload { - - @XmlElement(name = "Description") - protected String description; - @XmlElement(name = "Always") - protected Fingerprint.Payload.Always always; - @XmlElements({ - @XmlElement(name = "Match", type = MatchFunction.class), - @XmlElement(name = "ByteTest", type = ByteTestFunction.class), - @XmlElement(name = "IsDataAt", type = IsDataAtFunction.class), - @XmlElement(name = "ByteJump", type = ByteJumpFunction.class), - @XmlElement(name = "Anchor", type = Anchor.class), - @XmlElement(name = "Return", type = Return.class) - }) - protected List operation; - @XmlAttribute(name = "For", required = true) - protected String _for; - - /** - * Gets the value of the description property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDescription(String value) { - this.description = value; - } - - /** - * Gets the value of the always property. - * - * @return - * possible object is - * {@link Fingerprint.Payload.Always } - * - */ - public Fingerprint.Payload.Always getAlways() { - return always; - } - - /** - * Sets the value of the always property. - * - * @param value - * allowed object is - * {@link Fingerprint.Payload.Always } - * - */ - public void setAlways(Fingerprint.Payload.Always value) { - this.always = value; - } - - /** - * Gets the value of the operation property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the operation property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getOperation().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link MatchFunction } - * {@link ByteTestFunction } - * {@link IsDataAtFunction } - * {@link ByteJumpFunction } - * {@link Anchor } - * {@link Return } - * - * - */ - public List getOperation() { - if (operation == null) { - operation = new ArrayList(); - } - return this.operation; - } - - /** - * Gets the value of the for property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getFor() { - return _for; - } - - /** - * Sets the value of the for property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFor(String value) { - this._for = value; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-         * <complexType>
-         *   <complexContent>
-         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *       <sequence>
-         *         <element ref="{}Return" maxOccurs="unbounded"/>
-         *       </sequence>
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "_return" - }) - public static class Always { - - @XmlElement(name = "Return", required = true) - protected List _return; - - /** - * Gets the value of the return property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the return property. - * - *

- * For example, to add a new item, do as follows: - *

-             *    getReturn().add(newItem);
-             * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Return } - * - * - */ - public List getReturn() { - if (_return == null) { - _return = new ArrayList(); - } - return this._return; - } - - } - - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/Header.java b/FPC4/src/TemplateEngine/Fingerprint3/Header.java deleted file mode 100644 index 79243e2..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/Header.java +++ /dev/null @@ -1,160 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for Header complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Header">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="Author" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="Description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="Tag" type="{}boundString" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Header", propOrder = { - "name", - "author", - "description", - "tag" -}) -public class Header { - - @XmlElement(name = "Name", required = true) - protected String name; - @XmlElement(name = "Author") - protected String author; - @XmlElement(name = "Description") - protected String description; - @XmlElement(name = "Tag") - protected List tag; - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the author property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getAuthor() { - return author; - } - - /** - * Sets the value of the author property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAuthor(String value) { - this.author = value; - } - - /** - * Gets the value of the description property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDescription(String value) { - this.description = value; - } - - /** - * Gets the value of the tag property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the tag property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getTag().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - public List getTag() { - if (tag == null) { - tag = new ArrayList(); - } - return this.tag; - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/IsDataAtFunction.java b/FPC4/src/TemplateEngine/Fingerprint3/IsDataAtFunction.java deleted file mode 100644 index bd7588f..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/IsDataAtFunction.java +++ /dev/null @@ -1,120 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for IsDataAtFunction complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="IsDataAtFunction">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{}AndThen"/>
- *       </sequence>
- *       <attribute name="Offset" use="required" type="{}FrameSize" />
- *       <attribute ref="{}Relative"/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "IsDataAtFunction", propOrder = { - "andThen" -}) -public class IsDataAtFunction { - - @XmlElement(name = "AndThen", required = true) - protected AndThen andThen; - @XmlAttribute(name = "Offset", required = true) - protected int offset; - @XmlAttribute(name = "Relative") - protected Boolean relative; - - /** - * Gets the value of the andThen property. - * - * @return - * possible object is - * {@link AndThen } - * - */ - public AndThen getAndThen() { - return andThen; - } - - /** - * Sets the value of the andThen property. - * - * @param value - * allowed object is - * {@link AndThen } - * - */ - public void setAndThen(AndThen value) { - this.andThen = value; - } - - /** - * Gets the value of the offset property. - * - */ - public int getOffset() { - return offset; - } - - /** - * Sets the value of the offset property. - * - */ - public void setOffset(int value) { - this.offset = value; - } - - /** - * Gets the value of the relative property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isRelative() { - if (relative == null) { - return false; - } else { - return relative; - } - } - - /** - * Sets the value of the relative property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setRelative(Boolean value) { - this.relative = value; - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/MatchFunction.java b/FPC4/src/TemplateEngine/Fingerprint3/MatchFunction.java deleted file mode 100644 index 97e06ae..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/MatchFunction.java +++ /dev/null @@ -1,405 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; - - -/** - *

Java class for MatchFunction complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="MatchFunction">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <choice>
- *           <element name="Pattern" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *           <element name="Content">
- *             <complexType>
- *               <simpleContent>
- *                 <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *                   <attribute name="Type" use="required" type="{}ContentType" />
- *                 </extension>
- *               </simpleContent>
- *             </complexType>
- *           </element>
- *         </choice>
- *         <element ref="{}AndThen"/>
- *       </sequence>
- *       <attribute name="Offset" type="{}FrameSize" default="0" />
- *       <attribute name="NoCase" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *       <attribute name="Depth" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
- *       <attribute name="Relative" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *       <attribute name="Within" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
- *       <attribute name="MoveCursors" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "MatchFunction", propOrder = { - "pattern", - "content", - "andThen" -}) -public class MatchFunction { - - @XmlElement(name = "Pattern") - protected String pattern; - @XmlElement(name = "Content") - protected MatchFunction.Content content; - @XmlElement(name = "AndThen", required = true) - protected AndThen andThen; - @XmlAttribute(name = "Offset") - protected Integer offset; - @XmlAttribute(name = "NoCase") - protected Boolean noCase; - @XmlAttribute(name = "Depth") - @XmlSchemaType(name = "unsignedShort") - protected Integer depth; - @XmlAttribute(name = "Relative") - protected Boolean relative; - @XmlAttribute(name = "Within") - @XmlSchemaType(name = "unsignedShort") - protected Integer within; - @XmlAttribute(name = "MoveCursors") - protected Boolean moveCursors; - - /** - * Gets the value of the pattern property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPattern() { - return pattern; - } - - /** - * Sets the value of the pattern property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPattern(String value) { - this.pattern = value; - } - - /** - * Gets the value of the content property. - * - * @return - * possible object is - * {@link MatchFunction.Content } - * - */ - public MatchFunction.Content getContent() { - return content; - } - - /** - * Sets the value of the content property. - * - * @param value - * allowed object is - * {@link MatchFunction.Content } - * - */ - public void setContent(MatchFunction.Content value) { - this.content = value; - } - - /** - * Gets the value of the andThen property. - * - * @return - * possible object is - * {@link AndThen } - * - */ - public AndThen getAndThen() { - return andThen; - } - - /** - * Sets the value of the andThen property. - * - * @param value - * allowed object is - * {@link AndThen } - * - */ - public void setAndThen(AndThen value) { - this.andThen = value; - } - - /** - * Gets the value of the offset property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getOffset() { - if (offset == null) { - return 0; - } else { - return offset; - } - } - - /** - * Sets the value of the offset property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setOffset(Integer value) { - this.offset = value; - } - - /** - * Gets the value of the noCase property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isNoCase() { - if (noCase == null) { - return false; - } else { - return noCase; - } - } - - /** - * Sets the value of the noCase property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setNoCase(Boolean value) { - this.noCase = value; - } - - /** - * Gets the value of the depth property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getDepth() { - if (depth == null) { - return 0; - } else { - return depth; - } - } - - /** - * Sets the value of the depth property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setDepth(Integer value) { - this.depth = value; - } - - /** - * Gets the value of the relative property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isRelative() { - if (relative == null) { - return true; - } else { - return relative; - } - } - - /** - * Sets the value of the relative property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setRelative(Boolean value) { - this.relative = value; - } - - /** - * Gets the value of the within property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getWithin() { - if (within == null) { - return 0; - } else { - return within; - } - } - - /** - * Sets the value of the within property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setWithin(Integer value) { - this.within = value; - } - - /** - * Gets the value of the moveCursors property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isMoveCursors() { - if (moveCursors == null) { - return true; - } else { - return moveCursors; - } - } - - /** - * Sets the value of the moveCursors property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setMoveCursors(Boolean value) { - this.moveCursors = value; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <simpleContent>
-     *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
-     *       <attribute name="Type" use="required" type="{}ContentType" />
-     *     </extension>
-     *   </simpleContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "value" - }) - public static class Content { - - @XmlValue - protected String value; - @XmlAttribute(name = "Type", required = true) - protected ContentType type; - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the type property. - * - * @return - * possible object is - * {@link ContentType } - * - */ - public ContentType getType() { - return type; - } - - /** - * Sets the value of the type property. - * - * @param value - * allowed object is - * {@link ContentType } - * - */ - public void setType(ContentType value) { - this.type = value; - } - - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/OPERATOR.java b/FPC4/src/TemplateEngine/Fingerprint3/OPERATOR.java deleted file mode 100644 index 934b649..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/OPERATOR.java +++ /dev/null @@ -1,94 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; - - -/** - *

Java class for OPERATOR complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="OPERATOR">
- *   <simpleContent>
- *     <extension base="<>LIMITED_CONTENT">
- *       <attribute ref="{}Type use="required""/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "OPERATOR", propOrder = { - "value" -}) -public class OPERATOR { - - @XmlValue - protected String value; - @XmlAttribute(name = "Type", required = true) - protected ContentType type; - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the type property. - * - * @return - * possible object is - * {@link ContentType } - * - */ - public ContentType getType() { - return type; - } - - /** - * Sets the value of the type property. - * - * @param value - * allowed object is - * {@link ContentType } - * - */ - public void setType(ContentType value) { - this.type = value; - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/ObjectFactory.java b/FPC4/src/TemplateEngine/Fingerprint3/ObjectFactory.java deleted file mode 100644 index 2c97861..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/ObjectFactory.java +++ /dev/null @@ -1,353 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import java.math.BigInteger; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the TemplateEngine.Fingerprint3 package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _Anchor_QNAME = new QName("", "Anchor"); - private final static QName _Return_QNAME = new QName("", "Return"); - private final static QName _FingerprintFilterWindow_QNAME = new QName("", "Window"); - private final static QName _FingerprintFilterSrcPort_QNAME = new QName("", "SrcPort"); - private final static QName _FingerprintFilterAck_QNAME = new QName("", "Ack"); - private final static QName _FingerprintFilterDstPort_QNAME = new QName("", "DstPort"); - private final static QName _FingerprintFilterFlags_QNAME = new QName("", "Flags"); - private final static QName _FingerprintFilterMSS_QNAME = new QName("", "MSS"); - private final static QName _FingerprintFilterTTL_QNAME = new QName("", "TTL"); - private final static QName _FingerprintFilterDsize_QNAME = new QName("", "Dsize"); - private final static QName _FingerprintFilterTTLWithin_QNAME = new QName("", "TTLWithin"); - private final static QName _FingerprintFilterDsizeWithin_QNAME = new QName("", "DsizeWithin"); - private final static QName _FingerprintFilterEthertype_QNAME = new QName("", "Ethertype"); - private final static QName _FingerprintFilterTransportProtocol_QNAME = new QName("", "TransportProtocol"); - private final static QName _FingerprintFilterSeq_QNAME = new QName("", "Seq"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: TemplateEngine.Fingerprint3 - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Fingerprint } - * - */ - public Fingerprint createFingerprint() { - return new Fingerprint(); - } - - /** - * Create an instance of {@link DetailGroup } - * - */ - public DetailGroup createDetailGroup() { - return new DetailGroup(); - } - - /** - * Create an instance of {@link MatchFunction } - * - */ - public MatchFunction createMatchFunction() { - return new MatchFunction(); - } - - /** - * Create an instance of {@link Fingerprint.Payload } - * - */ - public Fingerprint.Payload createFingerprintPayload() { - return new Fingerprint.Payload(); - } - - /** - * Create an instance of {@link Fingerprint.Filter } - * - */ - public Fingerprint.Filter createFingerprintFilter() { - return new Fingerprint.Filter(); - } - - /** - * Create an instance of {@link Header } - * - */ - public Header createHeader() { - return new Header(); - } - - /** - * Create an instance of {@link Anchor } - * - */ - public Anchor createAnchor() { - return new Anchor(); - } - - /** - * Create an instance of {@link Return } - * - */ - public Return createReturn() { - return new Return(); - } - - /** - * Create an instance of {@link Post } - * - */ - public Post createPost() { - return new Post(); - } - - /** - * Create an instance of {@link AndThen } - * - */ - public AndThen createAndThen() { - return new AndThen(); - } - - /** - * Create an instance of {@link ByteTestFunction } - * - */ - public ByteTestFunction createByteTestFunction() { - return new ByteTestFunction(); - } - - /** - * Create an instance of {@link IsDataAtFunction } - * - */ - public IsDataAtFunction createIsDataAtFunction() { - return new IsDataAtFunction(); - } - - /** - * Create an instance of {@link ByteJumpFunction } - * - */ - public ByteJumpFunction createByteJumpFunction() { - return new ByteJumpFunction(); - } - - /** - * Create an instance of {@link Extract } - * - */ - public Extract createExtract() { - return new Extract(); - } - - /** - * Create an instance of {@link OPERATOR } - * - */ - public OPERATOR createOPERATOR() { - return new OPERATOR(); - } - - /** - * Create an instance of {@link DetailGroup.Detail } - * - */ - public DetailGroup.Detail createDetailGroupDetail() { - return new DetailGroup.Detail(); - } - - /** - * Create an instance of {@link MatchFunction.Content } - * - */ - public MatchFunction.Content createMatchFunctionContent() { - return new MatchFunction.Content(); - } - - /** - * Create an instance of {@link Fingerprint.Payload.Always } - * - */ - public Fingerprint.Payload.Always createFingerprintPayloadAlways() { - return new Fingerprint.Payload.Always(); - } - - /** - * Create an instance of {@link Fingerprint.Filter.DsizeWithin } - * - */ - public Fingerprint.Filter.DsizeWithin createFingerprintFilterDsizeWithin() { - return new Fingerprint.Filter.DsizeWithin(); - } - - /** - * Create an instance of {@link Fingerprint.Filter.TTLWithin } - * - */ - public Fingerprint.Filter.TTLWithin createFingerprintFilterTTLWithin() { - return new Fingerprint.Filter.TTLWithin(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Anchor }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "Anchor") - public JAXBElement createAnchor(Anchor value) { - return new JAXBElement(_Anchor_QNAME, Anchor.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Return }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "Return") - public JAXBElement createReturn(Return value) { - return new JAXBElement(_Return_QNAME, Return.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Short }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "Window", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterWindow(Short value) { - return new JAXBElement(_FingerprintFilterWindow_QNAME, Short.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "SrcPort", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterSrcPort(Integer value) { - return new JAXBElement(_FingerprintFilterSrcPort_QNAME, Integer.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Long }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "Ack", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterAck(Long value) { - return new JAXBElement(_FingerprintFilterAck_QNAME, Long.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "DstPort", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterDstPort(Integer value) { - return new JAXBElement(_FingerprintFilterDstPort_QNAME, Integer.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "Flags", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterFlags(String value) { - return new JAXBElement(_FingerprintFilterFlags_QNAME, String.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link BigInteger }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "MSS", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterMSS(BigInteger value) { - return new JAXBElement(_FingerprintFilterMSS_QNAME, BigInteger.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link BigInteger }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "TTL", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterTTL(BigInteger value) { - return new JAXBElement(_FingerprintFilterTTL_QNAME, BigInteger.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link BigInteger }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "Dsize", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterDsize(BigInteger value) { - return new JAXBElement(_FingerprintFilterDsize_QNAME, BigInteger.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Fingerprint.Filter.TTLWithin }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "TTLWithin", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterTTLWithin(Fingerprint.Filter.TTLWithin value) { - return new JAXBElement(_FingerprintFilterTTLWithin_QNAME, Fingerprint.Filter.TTLWithin.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Fingerprint.Filter.DsizeWithin }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "DsizeWithin", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterDsizeWithin(Fingerprint.Filter.DsizeWithin value) { - return new JAXBElement(_FingerprintFilterDsizeWithin_QNAME, Fingerprint.Filter.DsizeWithin.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "Ethertype", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterEthertype(Integer value) { - return new JAXBElement(_FingerprintFilterEthertype_QNAME, Integer.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Short }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "TransportProtocol", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterTransportProtocol(Short value) { - return new JAXBElement(_FingerprintFilterTransportProtocol_QNAME, Short.class, Fingerprint.Filter.class, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Long }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "Seq", scope = Fingerprint.Filter.class) - public JAXBElement createFingerprintFilterSeq(Long value) { - return new JAXBElement(_FingerprintFilterSeq_QNAME, Long.class, Fingerprint.Filter.class, value); - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/Position.java b/FPC4/src/TemplateEngine/Fingerprint3/Position.java deleted file mode 100644 index fc11e4e..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/Position.java +++ /dev/null @@ -1,51 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for Position. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="Position">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *     <enumeration value="START_OF_PAYLOAD"/>
- *     <enumeration value="END_OF_PAYLOAD"/>
- *     <enumeration value="CURSOR_START"/>
- *     <enumeration value="CURSOR_MAIN"/>
- *     <enumeration value="CURSOR_END"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "Position") -@XmlEnum -public enum Position { - - START_OF_PAYLOAD, - END_OF_PAYLOAD, - CURSOR_START, - CURSOR_MAIN, - CURSOR_END; - - public String value() { - return name(); - } - - public static Position fromValue(String v) { - return valueOf(v); - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/Post.java b/FPC4/src/TemplateEngine/Fingerprint3/Post.java deleted file mode 100644 index 9a812d0..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/Post.java +++ /dev/null @@ -1,102 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="Convert" type="{}ContentType" />
- *       <attribute name="Lookup">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *             <enumeration value="BACNET"/>
- *             <enumeration value="ENIPVENDOR"/>
- *             <enumeration value="ENIPDEVICE"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "Post") -public class Post { - - @XmlAttribute(name = "Convert") - protected ContentType convert; - @XmlAttribute(name = "Lookup") - protected String lookup; - - /** - * Gets the value of the convert property. - * - * @return - * possible object is - * {@link ContentType } - * - */ - public ContentType getConvert() { - return convert; - } - - /** - * Sets the value of the convert property. - * - * @param value - * allowed object is - * {@link ContentType } - * - */ - public void setConvert(ContentType value) { - this.convert = value; - } - - /** - * Gets the value of the lookup property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLookup() { - return lookup; - } - - /** - * Sets the value of the lookup property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLookup(String value) { - this.lookup = value; - } - -} diff --git a/FPC4/src/TemplateEngine/Fingerprint3/Return.java b/FPC4/src/TemplateEngine/Fingerprint3/Return.java deleted file mode 100644 index f053a3c..0000000 --- a/FPC4/src/TemplateEngine/Fingerprint3/Return.java +++ /dev/null @@ -1,157 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.11.30 at 07:14:15 AM EST -// - - -package TemplateEngine.Fingerprint3; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for Return complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Return">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <choice minOccurs="0">
- *           <element name="Details" type="{}DetailGroup"/>
- *         </choice>
- *         <element ref="{}Extract" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute ref="{}Direction default="SOURCE""/>
- *       <attribute name="Confidence" use="required" type="{}Confidence" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Return", propOrder = { - "details", - "extract" -}) -public class Return { - - @XmlElement(name = "Details") - protected DetailGroup details; - @XmlElement(name = "Extract") - protected List extract; - @XmlAttribute(name = "Direction") - protected String direction; - @XmlAttribute(name = "Confidence", required = true) - protected int confidence; - - /** - * Gets the value of the details property. - * - * @return - * possible object is - * {@link DetailGroup } - * - */ - public DetailGroup getDetails() { - return details; - } - - /** - * Sets the value of the details property. - * - * @param value - * allowed object is - * {@link DetailGroup } - * - */ - public void setDetails(DetailGroup value) { - this.details = value; - } - - /** - * Gets the value of the extract property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the extract property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getExtract().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Extract } - * - * - */ - public List getExtract() { - if (extract == null) { - extract = new ArrayList(); - } - return this.extract; - } - - /** - * Gets the value of the direction property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getDirection() { - if (direction == null) { - return "SOURCE"; - } else { - return direction; - } - } - - /** - * Sets the value of the direction property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDirection(String value) { - this.direction = value; - } - - /** - * Gets the value of the confidence property. - * - */ - public int getConfidence() { - return confidence; - } - - /** - * Sets the value of the confidence property. - * - */ - public void setConfidence(int value) { - this.confidence = value; - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/ClassAdapter.java b/FPC4/src/TemplateEngine/Template4/ClassAdapter.java deleted file mode 100644 index 47f8872..0000000 --- a/FPC4/src/TemplateEngine/Template4/ClassAdapter.java +++ /dev/null @@ -1,24 +0,0 @@ -package TemplateEngine.Template4; - - -import TemplateEngine.Template4.Structure.ClassTemplate; - -/** - * Created by BESTDOG on 11/13/2015. - * - * Classes that extend this are meant to be added a a {@link ClassTemplate}. - * Upon being added to a class the {@link #onAppend(ClassTemplate)} method will be called, - * allowing ClassAdapters to change the class as they are added. - * - * This method MUST not be called more than once, all templates are assumed to be fully constructed - * before addition to a ClassTemplate. - * - */ -public interface ClassAdapter { - /** - * Called once added to a ClassTemplate. - * @param template Template4 where this ClassAdapter was added. - */ - void onAppend(ClassTemplate template); - -} diff --git a/FPC4/src/TemplateEngine/Template4/Exception/MissingTemplateError.java b/FPC4/src/TemplateEngine/Template4/Exception/MissingTemplateError.java deleted file mode 100644 index 736eb92..0000000 --- a/FPC4/src/TemplateEngine/Template4/Exception/MissingTemplateError.java +++ /dev/null @@ -1,12 +0,0 @@ -package TemplateEngine.Template4.Exception; - -/** - * Created by BESTDOG on 11/18/2015. - */ -public class MissingTemplateError extends TemplateEngineError { - - public MissingTemplateError(String msg) { - super(msg); - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/Exception/SourceCodeError.java b/FPC4/src/TemplateEngine/Template4/Exception/SourceCodeError.java deleted file mode 100644 index e52e406..0000000 --- a/FPC4/src/TemplateEngine/Template4/Exception/SourceCodeError.java +++ /dev/null @@ -1,12 +0,0 @@ -package TemplateEngine.Template4.Exception; - -/** - * Created by BESTDOG on 11/25/2015. - * - * Errors meant to be thrown dealing with pre-compilation source code. - */ -public class SourceCodeError extends TemplateEngineError { - public SourceCodeError(String msg) { - super(msg); - } -} diff --git a/FPC4/src/TemplateEngine/Template4/Exception/TemplateEngineError.java b/FPC4/src/TemplateEngine/Template4/Exception/TemplateEngineError.java deleted file mode 100644 index 0ae91c7..0000000 --- a/FPC4/src/TemplateEngine/Template4/Exception/TemplateEngineError.java +++ /dev/null @@ -1,12 +0,0 @@ -package TemplateEngine.Template4.Exception; - -/** - * Created by BESTDOG on 11/18/2015. - */ -public abstract class TemplateEngineError extends Error { - - TemplateEngineError(String msg) { - super(msg); - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/Exception/TemplateRequirmentsError.java b/FPC4/src/TemplateEngine/Template4/Exception/TemplateRequirmentsError.java deleted file mode 100644 index c60640d..0000000 --- a/FPC4/src/TemplateEngine/Template4/Exception/TemplateRequirmentsError.java +++ /dev/null @@ -1,10 +0,0 @@ -package TemplateEngine.Template4.Exception; - -/** - * Created by BESTDOG on 11/13/2015. - */ -public class TemplateRequirmentsError extends TemplateEngineError { - public TemplateRequirmentsError(String s) { - super(s); - } -} diff --git a/FPC4/src/TemplateEngine/Template4/Expression.java b/FPC4/src/TemplateEngine/Template4/Expression.java deleted file mode 100644 index bec1266..0000000 --- a/FPC4/src/TemplateEngine/Template4/Expression.java +++ /dev/null @@ -1,22 +0,0 @@ -package TemplateEngine.Template4; - - -import TemplateEngine.Template4.Structure.VariableDeclaration; - -import java.util.List; - -/** - * Created by BESTDOG on 11/12/2015. - *

- * An expression is a list of variables. - *

- * Its also a bunch of binary or unary operation to those variables, in abstract, but we handle that in Template4 specific code. - */ -public interface Expression { - /** - * Get a list of variables within this Expression. - * @return List of expression variables. - */ - List getVariables(); - -} diff --git a/FPC4/src/TemplateEngine/Template4/FunctionTemplate.java b/FPC4/src/TemplateEngine/Template4/FunctionTemplate.java deleted file mode 100644 index efb3b68..0000000 --- a/FPC4/src/TemplateEngine/Template4/FunctionTemplate.java +++ /dev/null @@ -1,29 +0,0 @@ -package TemplateEngine.Template4; - -import TemplateEngine.Fingerprint3.AndThen; - -/** - * Created by BESTDOG on 11/13/2015. - * - * Interface for interacting with "Function" templates, - * {@link TemplateEngine.Fingerprint3.MatchFunction} - * {@link TemplateEngine.Fingerprint3.ByteJumpFunction}, - * {@link TemplateEngine.Fingerprint3.ByteTestFunction} - * {@link TemplateEngine.Fingerprint3.IsDataAtFunction} - * {@link TemplateEngine.Fingerprint3.Anchor} - * - */ -public interface FunctionTemplate extends NestedBlock, ClassAdapter { - - /** - * An issue with the composition of the Fingerprint3.xsd does not permit strongly typed Objects as members of - * the un-marshalled JAXB object. - * - * All Operations are setup by passing a simple Object and the class handling it should know - * what to properly cast it to. - * @param obj Object to cast to either {@link TemplateEngine.Fingerprint3.MatchFunction}, {@link TemplateEngine.fingerprint3.ByteJumpFunction}, - * {@link TemplateEngine.Fingerprint3.ByteTestFunction}, {@link TemplateEngine.Fingerprint3.IsDataAtFunction}, {@link TemplateEngine.fingerprint3.Anchor} - */ - AndThen generateFunction(Object obj); - -} diff --git a/FPC4/src/TemplateEngine/Template4/NestedBlock.java b/FPC4/src/TemplateEngine/Template4/NestedBlock.java deleted file mode 100644 index 03af15f..0000000 --- a/FPC4/src/TemplateEngine/Template4/NestedBlock.java +++ /dev/null @@ -1,42 +0,0 @@ -package TemplateEngine.Template4; - -/** - * Created by BESTDOG on 11/13/2015. - * An interface for getting and setting nested blocks of code templates. - */ -public interface NestedBlock extends Template { - /** - * Get the body of this code block, which is also considered this Template4 child. - * - * @return - */ - NestedBlock getBody(); - - /** - * Set the inner-body, or child, of this Template4. - * - * @param body - */ - void setBody(NestedBlock body); - - /** - * @return True if this Template4 has a child, else false. - */ - default boolean hasBody() { - return getBody() != null; - } - - /** - * Descends the child hierarchy of this code block, adding the provided body to the first block without a child. - * - * @param body Template4 to add to the last descendant of this Template4. - */ - default void appendBody(NestedBlock body) { - NestedBlock nestedBlock = this; - while (nestedBlock.hasBody()) { - nestedBlock = nestedBlock.getBody(); - } - nestedBlock.setBody(body); - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/RegularTemplate.java b/FPC4/src/TemplateEngine/Template4/RegularTemplate.java deleted file mode 100644 index 8f2d08e..0000000 --- a/FPC4/src/TemplateEngine/Template4/RegularTemplate.java +++ /dev/null @@ -1,68 +0,0 @@ -package TemplateEngine.Template4; - -/** - * - * @author BESTDOG - * - * Regular code template which basic parental hiearchy achieved by setting all Template4 bodies as childen of the - * parent template. - * - */ -public abstract class RegularTemplate implements NestedBlock { - - NestedBlock body; - Template parent; - String template; - String templateName; - - /** - * The value used to construct a regular template is its return value for {@link #getName()}. - * @param templateName Name of this Template4 from the MasterTemplate.stg file. - */ - protected RegularTemplate(String templateName) { - this.templateName = templateName; - } - - @Override - public void setParent(Template parent) { - this.parent = parent; - } - - @Override - public Template getParent() { - return parent; - } - - public String getScopeName() { - return parent.getScopeName(); - } - - @Override - public String getName() { - return this.templateName; - } - - @Override - public String getTemplate() { - return this.template; - } - - @Override - public void setTemplate(String template) { - this.template = template; - } - - public NestedBlock getBody() { - return body; - } - - /** - * Adds a inner Template4 the body of this Template4. Sets the parent of the added body to this Template4. - * @param body Body to add and set this Template4 as its parent. - */ - public void setBody(NestedBlock body) { - this.body = body; - this.body.setParent(this); - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Anchor.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/Anchor.st deleted file mode 100644 index d04ee14..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Anchor.st +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Anchor is a method for users to delcare the location of a cursor. - * - * This can be used to set the cursors around a portion or data field. - * It may also be used to anchor the cursors some negative offset from the back of the payload. - */ - -Anchor(Cursor, Position, Relative, Offset, Body) ::= << - - -cursor.set(+); - - -cursor.set(cursor.get()+); - - ->> diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ByteJumpFunction.stg b/FPC4/src/TemplateEngine/Template4/SourceTemplate/ByteJumpFunction.stg deleted file mode 100644 index 050e221..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ByteJumpFunction.stg +++ /dev/null @@ -1,36 +0,0 @@ -/* - * A method/code block template for the ByteJumpFunction. - * Steps, - * 1. Reads some number of bytes from the payload - * 2. Converts it to an integer - * 3. (optional) Does follow up arithmatic ( number = x / 2 + 5 ) - * 4. Moves the cursor based on that converted number - * - * Uses "offset" & "position" variables - * "position" will have the integer stored as a signed int - */ - -group ByteJump; - -ByteJumpFunction(PostOffset, Relative, Endian, Offset, Bytes, Calc, Body) ::= << - - -location = 0; -offset = cursor.get()+0; -if(payload.size() > offset ) { - location = payload.getInt(offset, , falsetrue); - - { - int x = location; - location = ; - } - location += ; - if( payload.size() > location ) { - cursor.forwardset(location); - - - - - } -} ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ByteTestFunction.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/ByteTestFunction.st deleted file mode 100644 index 388853e..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ByteTestFunction.st +++ /dev/null @@ -1,17 +0,0 @@ -/* - * A method/code block template for the ByteTestFunction. - * Tests a bytes inequality. - * - * "Endian" attribute is handled in the Template class for this .st file. - * - */ - -ByteTestFunction(PostOffset, Relative, Endian, Offset, Bytes, Operator, Val, Body) ::= << - - -offset = cursor.get()+0; -if( payload.getInt(offset, , falsetrue) ) { - cursor.forward(); - -} ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Class.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/Class.st deleted file mode 100644 index ba78d3d..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Class.st +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Template for a java source file. - */ -Class(packageDrtv, importsDrtv, classDclr, globalDclr, interfaceDclr, interfaceGeneric, className, classBody, staticInit, methods) ::= << -package ; - - class implements \<\> { - }; separator="\n"> - static { - - } - - - - - }; separator="\n"> - -} ->> diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ClassImports.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/ClassImports.st deleted file mode 100644 index 7d1de79..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ClassImports.st +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Template expects an array of canonical class import strings, and formats them - * into a valid java source code import list. - */ - ClassImports(importList) ::= << -;}; separator="\n"> ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ClassMethod.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/ClassMethod.st deleted file mode 100644 index 6544ee7..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ClassMethod.st +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Template for a basic java method - Typical method for fingerprinting will contain these variables, - int offset; - int length; - int location; - String string; - Matcher matcher; - Make sure to set these to their failure value on success of any expression - */ -ClassMethod(name, body, initVars, argList, returnType, genericType, override=false) ::= << - - -@Override -public \<\> (}; separator=", ">) { - }; separator=";\n">; - -} ->> diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ConditionalBlock.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/ConditionalBlock.st deleted file mode 100644 index a9aa6a1..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/ConditionalBlock.st +++ /dev/null @@ -1,8 +0,0 @@ -/* - * A conditional code block. If 'x' then do 'y' - */ -ConditionalBlock(expression, body) ::= << -if() { - -} ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/DetailBlock.stg b/FPC4/src/TemplateEngine/Template4/SourceTemplate/DetailBlock.stg deleted file mode 100644 index cb83002..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/DetailBlock.stg +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Template consists of the code block which adds info to resulting data sets. - */ - -group Detail; -import "Matrix.stg" - -DetailBlock(FingerprintName, Confidence, Direction, Category, Role, Details=false) ::= << -ret = supplier.get(); -ret.putName(""); -ret.setConfidence(); -ret.setDirection(); -ret.setCategory(); -ret.setRole(); - -consumer.accept( ret ); ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Extract.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/Extract.st deleted file mode 100644 index 47067a7..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Extract.st +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Code block which extracts specified bytes and places then within the return details. - */ - -Extract(Name, From, To, MaxLength, Endian, PostProcess, Body) ::= << -ret.put("", payload.extractLittle(, , ), ); - ->> diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/FilterClass.stg b/FPC4/src/TemplateEngine/Template4/SourceTemplate/FilterClass.stg deleted file mode 100644 index 2533c55..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/FilterClass.stg +++ /dev/null @@ -1,95 +0,0 @@ -/* - * - * - * - */ - -group FilterClass; - -import "Matrix.stg" - -FilterClass(ClassName, ImplementingClass, CompilerClass, Imports, Entries, OperationCodes, FingerprintClass, OperationClass, ReturnType, FilterPackage, FilterCodes) ::= << - - - -public class implements \<\> { - - static final Integer[] EMPTY_INT = new Integer[0]; - static final compiler = .getCompiler(); - - \<\>}, OperationClass, ReturnType)> - - - public () { - } - - public \<\> getOperation(int hash) { - \<\> op; - switch(hash) { - - default: op = (t,a,b,c,s)-> System.err.println("FILTER-ERROR:OP-MISS"); break; - } - return op; - } - - }; separator="\n"> - - @SuppressWarnings("unchecked") - public \<\> load(String name) { - \<\> fp = null; - try { - \ generic = () compiler.getLoader().findClass(name).newInstance(); - fp = (\<\>) generic; - } catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) { - Logger.getLogger(.class.getName()).log(Level.SEVERE, "GENERATED-SOURCE", ex); - } - return fp; - } -} ->> - -DeclareFilterCodes(Codes) ::= << - = new Integer[] ;}; separator="\n"> ->> - -Array(Array) ::= << -{}; separator=", ">} ->> - -RenderPackage(Package) ::= << -@Override -public Integer[] get( int code ) { - Integer[] codes; - switch( code ) { - }; separator="\n"> - default: codes = EMPTY_INT; - \} - return codes; -\} ->> - -RenderPackageItem(Item) ::= << -case : codes = ; break; ->> - -SwitchOperationCodes(Codes) ::= << -: op = ; break;}; separator="\n"> ->> - -InitializeEntries(Entries) ::= << - = load(""); - = .loadMethod("");}; separator="\n"> -}> ->> - -DeclareEntries(Entries, FirstClass, SecondClass, ReturnType) ::= << - ; - -}> ->> - -Generic(FirstClass,SecondClass) ::= << -\<\> ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/FingerprintGetMethod.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/FingerprintGetMethod.st deleted file mode 100644 index 8119fea..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/FingerprintGetMethod.st +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Creates the {@link core.fingerprint.Operation} getMethod(String name) method - * used in {@link core.fingerprint.Fingerprint} classes to expose their entry methods. - */ -FingerprintGetMethod(methodNames, returnType) ::= << -FunctionalOperation\<\> op; -switch(name) { - ": op = this::; break; }; separator="\n"> - default: op = null; -} -return op; ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/IsDataAtFunction.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/IsDataAtFunction.st deleted file mode 100644 index 7817af4..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/IsDataAtFunction.st +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Method stub for testing the length of a packets payload and its length from the cursor. - */ - -IsDataAtFunction(Offset, Relative, Body) ::= << - - -if(payload.size() > cursor.get()+0) { - -} ->> diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/MasterTemplate.java b/FPC4/src/TemplateEngine/Template4/SourceTemplate/MasterTemplate.java deleted file mode 100644 index 99fb6bd..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/MasterTemplate.java +++ /dev/null @@ -1,34 +0,0 @@ -package TemplateEngine.Template4.SourceTemplate; - -import org.stringtemplate.v4.ST; -import org.stringtemplate.v4.STGroupFile; - -import java.net.URL; - -/** - * Created by BESTDOG on 11/13/2015. - */ -public class MasterTemplate { - - final STGroupFile groupFile; - final String charset = "UTF-8"; - final URL url = getClass().getResource("MasterTemplate.stg"); - final char start = STGroupFile.defaultGroup.delimiterStartChar; - final char end = STGroupFile.defaultGroup.delimiterStopChar; - - public MasterTemplate() { - this.groupFile = new STGroupFile(url, charset, start, end); - } - - public ST getInstanceOf(String name) { - return this.groupFile.getInstanceOf(name); - } - - public void printInfo() { - System.out.println(String.format("Delimiters : { start:%c, end:%c }", start, end)); - System.out.println( this.groupFile.getFileName() ); - System.out.println( this.groupFile.getImportedGroups() ); - System.out.println( this.groupFile.getTemplateNames() ); - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/MasterTemplate.stg b/FPC4/src/TemplateEngine/Template4/SourceTemplate/MasterTemplate.stg deleted file mode 100644 index 4e67f4a..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/MasterTemplate.stg +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The master template imports other templates within the package. - */ -group MasterTemplate; -import "Class.st" -import "DetailBlock.stg" -import "ClassMethod.st" -import "ClassImports.st" -import "ConditionalBlock.st" -import "FingerprintGetMethod.st" -import "Extract.st" - -import "Return.stg" -import "MatchFunction.stg" -import "ByteJumpFunction.stg" -import "ByteTestFunction.st" -import "IsDataAtFunction.st" -import "Anchor.st" - -import "FilterClass.stg" diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/MatchFunction.stg b/FPC4/src/TemplateEngine/Template4/SourceTemplate/MatchFunction.stg deleted file mode 100644 index c21165b..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/MatchFunction.stg +++ /dev/null @@ -1,41 +0,0 @@ -/* - * A method/code block template for the Match operation. - * Match will match a sequence of bytes or a regex on the string equivalent of the input. - * - */ -group Match; - -MatchFunction(Body, Depth=false, Offset=false, Relative=false, Within=false, MoveCursors=false, Pattern=false, Content=false) ::= << - - - -offset = Math.min(,cursor.get()+)-; -length = Math.min(payload.end(),cursor.get()+)payload.end(); - -offset = 0; -length = payload.end(); -<\\> - -string = payload.getString(offset, length); -matcher = null; -if( !string.isEmpty() && ( matcher = .matcher(string) ).matches() ) { - - cursor.setA(matcher.start()); - cursor.setB(matcher.end()); - - cursor.set(matcher.end()); - - -} - -if( (location = payload.match(, offset, length)) != -1 ) { - - cursor.setA(location); - cursor.setB(location+.length); - - cursor.set(location); - - -} - ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Matrix.stg b/FPC4/src/TemplateEngine/Template4/SourceTemplate/Matrix.stg deleted file mode 100644 index ef90686..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Matrix.stg +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Contains template to take a matrix and provide formatting for it. - */ - -MatrixToMap(matrix,var) ::= << -.put("}; separator=", ">);}; separator="\n"> ->> - -DeclarativeList(list, Class, Decl) ::= << - ;}; separator="\n"> ->> - -PrefixedList(Prefix, Items, Postfix) ::= << -}; separator="\n"> ->> - - -Append(Item,Postfix) ::= << - ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/MatrixToMap.st b/FPC4/src/TemplateEngine/Template4/SourceTemplate/MatrixToMap.st deleted file mode 100644 index b62c81a..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/MatrixToMap.st +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Contains template to take a matrix and provide formatting for it. - */ - -MatrixToMap(matrix,var) ::= << -.put("}; separator=", ">);}; separator="\n"> ->> diff --git a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Return.stg b/FPC4/src/TemplateEngine/Template4/SourceTemplate/Return.stg deleted file mode 100644 index b120071..0000000 --- a/FPC4/src/TemplateEngine/Template4/SourceTemplate/Return.stg +++ /dev/null @@ -1,13 +0,0 @@ -/* - * A method stub/template for the Return blocks. - * Match will match a sequence of bytes or a regex on the string equivalent of the input. - * - */ -group ReturnFunction; - -import "DetailBlock.stg" - -Return(FingerprintName, Confidence, Direction, Category, Role, Details, Body) ::= << - - ->> \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/Structure/ByteArrayDeclaration.java b/FPC4/src/TemplateEngine/Template4/Structure/ByteArrayDeclaration.java deleted file mode 100644 index a861fd5..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/ByteArrayDeclaration.java +++ /dev/null @@ -1,91 +0,0 @@ -package TemplateEngine.Template4.Structure; - -import java.nio.ByteBuffer; -import java.util.Arrays; - -/** - * Created by BESTDOG on 11/16/2015. - * A class scope variable declaration for any type which is to be compared as bytes. - * - * A class scope variable means it is append to a ClassTemplate outside of any method's body. - */ -public class ByteArrayDeclaration extends VariableDeclaration { - - ByteAdapter data; - - public ByteArrayDeclaration(String name, ByteAdapter data) { - super(byte[].class, name, data.toString()); - this.data = data; - this.setIsStatic(true); - } - - public String getValue() { - String string = data.getByteString(); - int len = string.length(); - return String.format("new byte[] { %s }", string.substring(1, len-1)); - } - - public interface ByteAdapter { - byte[] getByteArray(); - String getString(); - default String getByteString() { - return Arrays.toString(getByteArray()); - } - } - - public static class HexAdapter implements ByteAdapter { - String string; - public HexAdapter( String string ) { - this.string = string; - } - @Override - public byte[] getByteArray() { - int len = string.length(); - byte[] data = new byte[len /2]; - for(int i = 0; i < len; i+= 2) { - data[i/2] = (byte) ((Character.digit(string.charAt(i), 16) << 4) - +Character.digit(string.charAt(i+1), 16)); - } - return data; - } - @Override - public String getString() { - return string; - } - } - public static class RawBytes extends HexAdapter { - public RawBytes( String string ) { - super( string.replace("[^\\p{XDigit}]","") ); - } - } - public static class StringAdapter implements ByteAdapter { - String string; - public StringAdapter( String string ) { - this.string = string; - } - @Override - public byte[] getByteArray() { - return string.getBytes(); - } - @Override - public String getString() { - return string; - } - } - public static class IntAdapter implements ByteAdapter { - String string; - int value; - public IntAdapter( String string ) { - this.string = string; - value = Integer.valueOf(this.string); - } - @Override - public byte[] getByteArray() { - return ByteBuffer.allocate(Integer.BYTES).putInt(value).array(); - } - @Override - public String getString() { - return string; - } - } -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/ClassTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/ClassTemplate.java deleted file mode 100644 index faa2925..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/ClassTemplate.java +++ /dev/null @@ -1,209 +0,0 @@ -package TemplateEngine.Template4.Structure; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - -import TemplateEngine.Data.FunctionalFingerprint; -import TemplateEngine.Template4.Structure.Code.FingerprintGetMethod; -import TemplateEngine.Template4.TemplateAccessor; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.Template; - -/** - * @author BESTDOG - * - * Template4 for a Java-source file containing a single class; semi-specific to the needs of the - * {@link FunctionalFingerprint} class. - */ -public class ClassTemplate implements Template { - - private enum $ implements TemplateAccessor { - packageDrtv, - importsDrtv, - classDclr, - globalDclr, - interfaceDclr, - interfaceGeneric, - className, - classBody, - staticInit, - methods; - } - - String scopeName; - String template; - Package classPackage; - String classDirectives; - String className; - String staticCodeBlock; - Class implementingClass; - Class interfaceGeneric; - Class returnType; - ImportsTemplate classImports; - List globalVars; - List methods; - List initialVars; - - FingerprintGetMethod getMethod; - - public ClassTemplate(Class returnType) { - this.methods = new ArrayList<>(); - this.globalVars = new ArrayList<>(); - this.initialVars = new ArrayList<>(); - this.classImports = new ImportsTemplate(); - this.getMethod = new FingerprintGetMethod(returnType); - this.returnType = returnType; - this.interfaceGeneric = returnType; - } - - /** - * Adds a variable to the initial scope of the method. - * @param var Var to add to scope. - * @return This reference is returned so that methods may be chained. - */ - public ClassTemplate addInitialVariable(Variable var) { - this.initialVars.add(var); - return this; - } - - public ClassTemplate addMethod(MethodTemplate method) { - methods.add(method); - method.setInitialVars(this.initialVars); - method.setParent(this); - getMethod.addMethodIdentifier(method.getMethodName()); - method.onAppend(this); - return this; - } - - public ClassTemplate setClassImports(ImportsTemplate template) { - this.classImports = template; - return this; - } - - public ClassTemplate setStaticCodeBlock(String staticCodeBlock) { - this.staticCodeBlock = staticCodeBlock; - return this; - } - - public ClassTemplate setClassPackage(Package classPackage) { - this.classPackage = classPackage; - return this; - } - - public ClassTemplate setImplementingClass(Class implementingClass) { - this.implementingClass = implementingClass; - return this; - } - - public ClassTemplate setClassName(String className) { - this.className = className; - return this; - } - - public ClassTemplate setClassDirectives(String classDirectives) { - this.classDirectives = classDirectives; - return this; - } - - public ClassTemplate addVariable( VariableDeclaration declr ) { - globalVars.add(declr); - return this; - } - - public ImportsTemplate getClassImports() { - return classImports; - } - - public ClassTemplate setScopeName(String scopeName) { - this.scopeName = scopeName; - return this; - } - - public List getMethods() { - return methods; - } - - public String getClassName() { - return className; - } - - public Class getImplementingClass() { - return implementingClass; - } - - @Override - public void render(ST st) { - if( this.classPackage != null ) { - $.packageDrtv.add(st, this.classPackage.getName()); - } - if( this.classImports != null ) { - $.importsDrtv.add(st, this.classImports.render()); - } - $.className.add(st, this.className); - $.classDclr.add(st, this.classDirectives); - $.staticInit.add(st, this.staticCodeBlock); - if( this.implementingClass != null ) { - $.interfaceDclr.add(st, this.implementingClass.getSimpleName()); - $.interfaceGeneric.add(st, this.interfaceGeneric.getSimpleName()); - } - $.globalDclr.add(st, this.globalVars.toArray()); - $.methods.add(st, toRenderedTemplateArray(this.methods)); - renderImpl(st); - } - - public static Object[] toClassObjectArray(List classes) { - return classes.stream() - .map(Class::getCanonicalName) - .collect(Collectors.toList()) - .toArray(); - } - - public static Object[] toRenderedTemplateArray(Collection templates) { - Object[] array = new Object[templates.size()]; - int i = 0; - for( Template t : templates ) { - array[i++] = t.render(); - } - return array; - } - - protected void renderImpl(ST st) { - $.methods.add(st, getMethod.render()); - } - - /** - * A class template cannot have a parent set. - * @param parent ignored. - */ - @Override - public void setParent(Template parent) { - - } - - @Override - public Template getParent() { - return null; - } - - public String getScopeName() { - return this.scopeName; - } - - @Override - public String getName() { - return "Class"; - } - - @Override - public void setTemplate(String template) { - this.template = template; - } - - @Override - public String getTemplate() { - return this.template; - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/AnchorFunctionTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/AnchorFunctionTemplate.java deleted file mode 100644 index f6a4e2a..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/AnchorFunctionTemplate.java +++ /dev/null @@ -1,126 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import TemplateEngine.Template4.FunctionTemplate; -import TemplateEngine.Template4.RegularTemplate; -import TemplateEngine.Template4.Structure.ClassTemplate; -import TemplateEngine.Template4.TemplateAccessor; -import TemplateEngine.Fingerprint3.Anchor; -import TemplateEngine.Fingerprint3.AndThen; -import org.stringtemplate.v4.ST; - -/** - * Created by BESTDOG on 11/18/2015. - *

- * Anchor is a method for users to delcare the location of a cursor. - *

- * This can be used to set the cursors around a portion or data field. - * It may also be used to anchor the cursors some negative offset from the back of the payload. - */ -public class AnchorFunctionTemplate extends RegularTemplate implements FunctionTemplate { - - Integer offset; - String cursor; - String position; - boolean relative; - - public AnchorFunctionTemplate() { - super("Anchor"); - position = ""; - cursor = ""; - offset = 0; - relative = false; - } - - public void setOffset(Integer offset) { - if( offset != null && offset != 0 ) { - this.offset = offset; - } - } - - @Override - public AndThen generateFunction(Object obj) { - AndThen andThen = null; - if (obj instanceof Anchor) { - Anchor function = (Anchor) obj; - //andThen = function.getAndThen(); - - this.setOffset(function.getOffset()); - relative = function.isRelative(); - cursor = function.getCursor().value(); - position = function.getPosition() != null ? function.getPosition().value() : ""; - } - return andThen; - } - - @Override - public void onAppend(ClassTemplate template) { - - } - - @Override - public void render(ST st) { - $.Cursor.add(st, getCursor(this.cursor)); - $.Position.add(st, getPosition(this.position)); - $.Relative.add(st, this.relative); - $.Offset.add(st, this.offset); - if (this.hasBody()) { - $.Body.add(st, this.getBody().render()); - } - } - - /** - * @param position String from XML for the Fingerprint.Payload.Anchor.Position parameter. - * @return Formatted source code which will render for that selected {@link AnchorFunctionTemplate.Position} enumeration value. - */ - private String getPosition(String position) { - String ret; - try { - ret = Position.valueOf(position).code; - } catch (java.lang.IllegalArgumentException ex) { - ret = null; /** often null or empty values are contained in xml, this is ok */ - } - return ret; - } - - /** - * @param cursor String from XML for the Fingerprint.Payload.Anchor.Cursor parameter. - * @return Formatted source code which will render for that selected {@link AnchorFunctionTemplate.Cursor } enumeration value. - */ - private String getCursor(String cursor) { - return Cursor.valueOf(cursor).code; - } - - /** - * This template accessor enumeration, each value is mapped to a specific Template4 parameter. - */ - private enum $ implements TemplateAccessor { - Cursor, Position, Relative, Offset, Body; - } - - private enum Cursor { - START("A"), - MAIN(""), - END("B"); - - public final String code; - - Cursor(String code) { - this.code = code; - } - } - - private enum Position { - START_OF_PAYLOAD("0"), - END_OF_PAYLOAD("payload.end()"), - CURSOR_START("cursor.getA()"), - CURSOR_MAIN("cursor.get()"), - CURSOR_END("cursor.getB()"); - - public final String code; - - Position(String code) { - this.code = code; - } - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/ByteJumpFunctionTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/ByteJumpFunctionTemplate.java deleted file mode 100644 index 468e979..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/ByteJumpFunctionTemplate.java +++ /dev/null @@ -1,76 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import ICSDefines.Endian; -import TemplateEngine.Template4.Structure.ClassTemplate; -import TemplateEngine.Template4.TemplateAccessor; -import TemplateEngine.Fingerprint3.AndThen; -import TemplateEngine.Fingerprint3.ByteJumpFunction; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.FunctionTemplate; -import TemplateEngine.Template4.RegularTemplate; - -/** - * Created by BESTDOG on 11/18/2015. - * - * A method/code block template for the ByteJump operation. - * Steps, - * 1. Reads some number of bytes from the payload - * 2. Converts it to an integer - * 3. (optional) Does follow up arithmatic ( number = x / 2 + 5 ) - * 4. Moves the cursor based on that converted number - * - */ -public class ByteJumpFunctionTemplate extends RegularTemplate implements FunctionTemplate { - - boolean endian; - boolean relative; - String calc; - Integer bytes; - Integer offset; - Integer postOffset; - - public ByteJumpFunctionTemplate() { - super("ByteJumpFunction"); - } - - @Override - public AndThen generateFunction(Object obj) { - AndThen andThen = null; - if( obj instanceof ByteJumpFunction ) { - ByteJumpFunction function = (ByteJumpFunction) obj; - andThen = function.getAndThen(); - - calc = function.getCalc(); - bytes = function.getBytes(); - offset = function.getOffset(); - postOffset = function.getPostOffset(); - relative = function.isRelative(); - /** big is the default, to we omit the endian flag if false */ - endian = Endian.BIG.name().equals(function.getEndian()); - - } - return andThen; - } - - @Override - public void onAppend(ClassTemplate template) { - - } - - @Override - public void render(ST st) { - $.PostOffset.add(st, this.postOffset); - $.Relative.add(st, this.relative); - $.Endian.add(st, this.endian); - $.Offset.add(st, this.offset); - $.Bytes.add(st, this.bytes); - $.Calc.add(st, this.calc); - if( this.hasBody() ) { - $.Body.add(st, this.getBody().render()); - } - } - - private enum $ implements TemplateAccessor { - PostOffset, Relative, Endian, Offset, Bytes, Calc, Body; - } -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/ByteTestFunctionTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/ByteTestFunctionTemplate.java deleted file mode 100644 index 4e5dcf2..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/ByteTestFunctionTemplate.java +++ /dev/null @@ -1,131 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import ICSDefines.Endian; -import TemplateEngine.Template4.Structure.ClassTemplate; -import TemplateEngine.Template4.TemplateAccessor; -import TemplateEngine.Fingerprint3.AndThen; -import TemplateEngine.Fingerprint3.ByteTestFunction; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.FunctionTemplate; -import TemplateEngine.Template4.RegularTemplate; - -import java.math.BigInteger; - -/** - * Created by BESTDOG on 11/18/2015. - * - * Functional template which tests some integer value from the payload and continues if the inequality predicates. - */ -public class ByteTestFunctionTemplate extends RegularTemplate implements FunctionTemplate { - - boolean endian; - boolean relative; - Integer bytes; - Integer offset; - Integer postOffset; - Test operator; - String val; - - public ByteTestFunctionTemplate() { - super("ByteTestFunction"); - this.operator = Test.EQ; - this.val = "0"; - } - - @Override - public AndThen generateFunction(Object obj) { - AndThen andThen = null; - if( obj instanceof ByteTestFunction ) { - ByteTestFunction function = (ByteTestFunction) obj; - andThen = function.getAndThen(); - - bytes = function.getBytes(); - offset = function.getOffset(); - postOffset = function.getPostOffset(); - relative = function.isRelative(); - /** big is the default, to we omit the endian flag if false */ - endian = Endian.BIG.name().equals(function.getEndian()); - operator = getTest(function); - val = getValue(function).toString(); - } - return andThen; - } - - private BigInteger getValue(ByteTestFunction function) { - BigInteger value; - if( function.getAND() != null ) { - value = function.getAND(); - } else if( function.getOR() != null ) { - value = function.getOR(); - } else if( function.getGT() != null ) { - value = function.getGT(); - } else if( function.getGTE() != null ) { - value = function.getGTE(); - } else if( function.getLT() != null ) { - value = function.getLT(); - } else if( function.getLTE() != null ) { - value = function.getLTE(); - } else { - value = BigInteger.ZERO; - } - return value; - } - - private Test getTest(ByteTestFunction function) { - Test t = null; - if( function.getAND() != null ) { - t = Test.EQ; /** actual AND unsupported */ - } else if( function.getOR() != null ) { - t = Test.EQ; /** actual OR unsupported */ - } else if( function.getGT() != null ) { - t = Test.GT; - } else if( function.getGTE() != null ) { - t = Test.GTE; - } else if( function.getLT() != null ) { - t = Test.LT; - } else if( function.getLTE() != null ) { - t = Test.LTE; - } else { - t = Test.EQ; - } - return t; - } - - @Override - public void onAppend(ClassTemplate template) { - - } - - @Override - public void render(ST st) { - $.PostOffset.add(st, this.postOffset); - $.Relative.add(st, this.relative); - $.Offset.add(st, this.offset); - $.Bytes.add(st, this.bytes); - $.Operator.add(st, this.operator.code ); - $.Endian.add(st, this.endian); - $.Val.add(st, this.val); - if( this.hasBody() ) { - $.Body.add(st, this.getBody().render()); - } - } - - private enum $ implements TemplateAccessor { - PostOffset, Relative, Endian, Offset, Bytes, Operator, Val, Body; - } - - private enum Test { - GT(">"), - LT("<"), - GTE(">="), - LTE("<="), - EQ("=="), - AND("=="), - OR("=="); - public final String code; - Test(String code) { - this.code = code; - } - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/DetailBlockTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/DetailBlockTemplate.java deleted file mode 100644 index 180f93a..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/DetailBlockTemplate.java +++ /dev/null @@ -1,161 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import ICSDefines.Category; -import ICSDefines.Direction; -import ICSDefines.Role; -import TemplateEngine.Template4.TemplateAccessor; -import TemplateEngine.Fingerprint3.DetailGroup; -import TemplateEngine.Fingerprint3.Return; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.RegularTemplate; - -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Created by BESTDOG on 11/13/2015. - */ -public class DetailBlockTemplate extends RegularTemplate { - - private enum $ implements TemplateAccessor { - FingerprintName, - Confidence, - Direction, - Category, - Role, - Details; - } - - String fingerprintName; - Integer confidence; - Object[][] details; - Direction direction; - Category category; - Role role; - - protected DetailBlockTemplate(String templateName) { - super(templateName); - } - - public DetailBlockTemplate() { - this("DetailBlock"); - } - - private DetailBlockTemplate(DetailBlockTemplate original) { - this(); - this.setTemplate(original.getTemplate()); - } - - public DetailBlockTemplate newTemplate() { - return new DetailBlockTemplate(this); - } - - public DetailBlockTemplate setFingerprintName(String fingerprintName) { - this.fingerprintName = fingerprintName; - return this; - } - - public DetailBlockTemplate setReturn(Return return_) { - this.confidence = return_.getConfidence(); - this.direction = getDirection(return_); - this.category = getCategory(return_); - this.role = getRole(return_); - this.details = getDetails(return_); - return this; - } - - private Object[][] getDetails(Return r) { - Object[][] obj = null; - DetailGroup dg = r.getDetails(); - if( dg != null ) { - List details = dg.getDetail(); - if( details != null && !details.isEmpty() ) { - obj = new Object[details.size()][]; - int i = 0; - for (DetailGroup.Detail detail : details) { - String name = detail.getName(); - String val = detail.getValue(); - obj[i] = new Object[] { name, val }; - } - } - } - return obj; - } - - private Role getRole(Return r) { - Role val = null; - try { - if( r.getDetails() != null && r.getDetails().getRole() != null ) { - val = Role.valueOf(r.getDetails().getRole()); - } - } catch( Exception ex ) { - Logger.getAnonymousLogger().log(Level.SEVERE, "Error in xml.", ex); - } - return val; - } - - private Category getCategory(Return return_) { - Category val = null; - try { - if( return_.getDetails() != null ) { - String category = return_.getDetails().getCategory(); - if( category != null ) { - val = Category.valueOf(category); - } - } - } catch( Exception ex ) { - Logger.getAnonymousLogger().log(Level.SEVERE, "Error in xml.", ex); - } - return val; - } - - private Direction getDirection(Return return_) { - Direction val = null; - try { - val = Direction.valueOf(return_.getDirection()); - } catch( Exception ex ) { - Logger.getAnonymousLogger().log(Level.SEVERE, "Error in xml.", ex); - } - return val; - } - - public String getDirection() { - String string = null; - if( this.direction != null ) { - string = String.format("%s.%s", Direction.class.getSimpleName(), this.direction); - } - return string; - } - - public String getCategory() { - String string = null; - if( this.category != null ) { - string = String.format("%s.%s", Category.class.getSimpleName(), this.category.name()); - } - return string; - } - - public String getRole() { - String string = null; - if( this.role != null ) { - string = String.format("%s.%s", Role.class.getSimpleName(), this.role); - } - return string; - } - - public Object[][] getDetails() { - return this.details; - } - - @Override - public void render(ST st) { - $.FingerprintName.add(st, this.fingerprintName); - $.Confidence.add(st, this.confidence); - $.Direction.add(st, getDirection()); - $.Category.add(st, getCategory()); - $.Role.add(st, getRole()); - $.Details.add(st, getDetails()); - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/ExtractTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/ExtractTemplate.java deleted file mode 100644 index bd5dbd5..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/ExtractTemplate.java +++ /dev/null @@ -1,134 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import ICSDefines.Content; -import ICSDefines.Endian; -import ICSDefines.Lookup; -import TemplateEngine.Template4.TemplateAccessor; -import TemplateEngine.Fingerprint3.ContentType; -import TemplateEngine.Fingerprint3.Extract; -import TemplateEngine.Fingerprint3.Post; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.NestedBlock; -import TemplateEngine.Template4.RegularTemplate; - -import java.util.Scanner; - -/** - * Created by BESTDOG on 11/17/2015. - * - * Tempalte for the code block responsible for copying bytes from payloads. - * - * The position enumeration from the fingerprints maps to a few macro-defines of code snippets, - * START_OF_PAYLOAD - 0 - * END_OF_PAYLOAD - payload.end() - * CURSOR_START - cursor.getA() - * CURSOR_MAIN - cursor.get() - * CURSOR_END - cursor.getB() - * - */ -public class ExtractTemplate extends RegularTemplate { - - private enum $ implements TemplateAccessor { - Name, From, To, MaxLength, Endian, PostProcess, Body; - } - - private enum POSITION { - START_OF_PAYLOAD("0"), - END_OF_PAYLOAD("payload.end()"), - CURSOR_START("cursor.getA()"), - CURSOR_MAIN("cursor.get()"), - CURSOR_END("cursor.getB()"); - - String code; - - POSITION(String code) { - this.code = code; - } - - public static String getCodeSnippet(String string) { - String ret; - if( isInt(string) ) { - ret = string; - } else { - ret = POSITION.valueOf(string).code; - } - return ret; - } - - private static boolean isInt(String string) { - return new Scanner(string).hasNextInt(); - } - } - - String name; - String from; - String to; - String maxLength; - String postProcess; - boolean endian; - - public ExtractTemplate(Extract extract) { - this(); - setExtract(extract); - } - - public ExtractTemplate() { - super("Extract"); - } - - public ExtractTemplate setExtract(Extract extract) { - String endianVal; - - name = extract.getName(); - maxLength = Integer.toString(extract.getMaxLength()); - - from = POSITION.getCodeSnippet(extract.getFrom()); - to = POSITION.getCodeSnippet(extract.getTo()); - endianVal = extract.getEndian(); - - /** big is the default, to we omit the endian flag if false */ - endian = Endian.LITTLE.name().equals(endianVal); - - Post p = extract.getPost(); - if( p != null ) { - String lookup = p.getLookup(); - ContentType convert = p.getConvert(); - if( convert != null ) { - postProcess = getConvertPostProcess(convert.value()); - } else if( lookup != null ) { - postProcess = getLookupProcess(lookup); - } - } else { - postProcess = getConvertPostProcess(Content.STRING.name()); - } - return this; - } - - public String getLookupProcess(String string) { - String code; - code = String.format("%s.%s", Lookup.class.getSimpleName(), string); - return code; - } - - public String getConvertPostProcess(String string) { - String code; - code = String.format("%s.%s", Content.class.getSimpleName(), string); - return code; - } - - public void setBody(NestedBlock body) { - throw new UnsupportedOperationException("Body not accepted."); - } - - @Override - public void render(ST st) { - $.Name.add(st, this.name); - $.MaxLength.add(st, this.maxLength); - $.From.add(st, this.from); - $.To.add(st, this.to); - $.PostProcess.add(st, this.postProcess); - if(this.endian) { - $.Endian.add(st, this.endian); - } - } -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/FilterClassTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/FilterClassTemplate.java deleted file mode 100644 index beb10ba..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/FilterClassTemplate.java +++ /dev/null @@ -1,343 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import TemplateEngine.Data.Filter; -import TemplateEngine.Data.FunctionalFingerprint; -import TemplateEngine.Data.FunctionalOperation; -import TemplateEngine.Template4.RegularTemplate; -import TemplateEngine.Template4.Structure.*; -import TemplateEngine.Template4.Template; -import TemplateEngine.Template4.TemplateAccessor; -import org.stringtemplate.v4.ST; - -import java.lang.reflect.ParameterizedType; -import java.util.*; -import java.util.function.Predicate; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.stream.Collectors; - - -/** - * Created by BESTDOG on 11/19/2015. - *

- * The filter class is the mechanism GM uses to route packets to fingerprints which are likely to succeed in - * identifying the devices communicating. - *

- * It contains references to each of the Fingerprint objects and {@link FunctionalOperation} lambdas paired with - * their Fingerprint-Operation-Codes used with the {@link Filter#getOperation(int)} method. - */ -public class FilterClassTemplate extends RegularTemplate { - public static final String DEFAULT_CLASS_NAME = "FilterImpl"; - final Class filterClass; - Class compilerClass; - final Class operationClass; - final Class fingerprintClass; - final ArrayList imports; - final ArrayList entries; - final Class returnType; - String className; - - public FilterClassTemplate(Class compilerClass, Class returnType) { - super("FilterClass"); - this.returnType = returnType; - this.compilerClass = compilerClass; - this.className = DEFAULT_CLASS_NAME; - this.filterClass = Filter.class; - this.operationClass = FunctionalOperation.class; - this.fingerprintClass = FunctionalFingerprint.class; - this.imports = new ArrayList<>(); - this.entries = new ArrayList<>(); - this.addImports( - filterClass, - fingerprintClass, - operationClass, - returnType, - compilerClass, - Logger.class, - Level.class, - ParameterizedType.class - ); - } - - @Override - public void render(ST st) { - $.ClassName.add(st, this.className); - $.ImplementingClass.add(st, this.filterClass); - $.CompilerClass.add(st, this.compilerClass); - $.Imports.add(st, this.imports.toArray()); - $.Entries.add(st, this.getEntries()); - $.OperationCodes.add(st, this.getOperationCodes()); - $.FingerprintClass.add(st, this.fingerprintClass); - $.OperationClass.add(st, this.operationClass); - $.ReturnType.add(st, this.returnType); - /** the {@link #getFilterPackage(List)} method will also generate this list of variable names to initial values. */ - List codeMap = new ArrayList<>(); - $.FilterPackage.add(st, getFilterPackage(codeMap)); - $.FilterCodes.add(st, codeMap.toArray()); - } - - public void setCompilerClass(Class compilerClass) { - this.compilerClass = compilerClass; - } - - /** - * @return The name of this JavaClass. - */ - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - /** - * Generates the parameter vector responsible for populating the majority of the FilterClass.stg's fingerprint - * specific filtering code. - * - * @param codeMap The filtering process returns Fingerprint-Operation-Codes, this is map of those codes. - * @return The filter-package vector. - */ - private Object[] getFilterPackage(List codeMap) { - - HashMap>> map = new HashMap<>(); - - List units = entries.stream() - .map(Entry::getTemplate) - .map(ClassTemplate::getMethods) - .flatMap(List::stream) - .filter(MethodTemplate::hasFilterSupplier) - .map(FilterUnit::new) - .collect(Collectors.toList()); - - units.forEach(unit -> { - unit.getVariables().forEach(filter -> { - if (!map.containsKey(filter)) { - map.put(filter, new HashMap<>()); - } - }); - int i = 0; - for (List vars : unit.getGroups()) { - Integer affine = unit.getResolvingCode(); - vars.forEach(var -> { - HashMap> set = map.get(var.getName()); - if (!set.containsKey(var.getValue())) { - set.put(var.getValue(), new HashSet<>()); - } - set.get(var.getValue()).add(affine); - }); - } - }); - - // printMap(map); - /** no within methods are used in the initial filter operation */ - map.entrySet().removeIf(e -> e.getKey().contains("Within")); - - reduceMapSpray(map); - - Object[] fpac = new Object[map.size()]; - int i = 0; - for (Map.Entry>> entry : map.entrySet()) { - String filter = entry.getKey(); - Object[] function = new Object[entry.getValue().size() + 1]; - int x = 0; - function[x] = filter; - for (Map.Entry> values : entry.getValue().entrySet()) { - String value = values.getKey(); - String var = Template.asJavaIdentifier(String.format("%s%s", filter, value)); - codeMap.add(new Object[]{var, values.getValue().toArray()}); - function[++x] = new Object[]{value, var}; - } - fpac[i++] = function; - } - - return fpac; - } - - /** - * Reduces the amount of criteria which are required to predicate for a Fingerprint to apply itself to a payload. - * - * @param map Map of [{ FilterName : [ { Value : [ Fingerprint-Operation-Code, ... ] }, {...}, ...]}, ...] - */ - private void reduceMapSpray(HashMap>> map) { - Predicate duplicate = p -> - map.values().stream() - .map(Map::values) - .flatMap(Collection::stream) - .flatMap(Collection::stream) - .filter(p::equals) - .count() > 1L; - - map.entrySet().removeIf(e1 -> { - e1.getValue().entrySet().removeIf(e2 -> { - e2.getValue().removeIf(duplicate); - return e2.getValue().isEmpty(); - }); - return e1.getValue().isEmpty(); - }); - } - - /*** - * Depub method which write the filter "value" map to std::out - * - * @param map Map to print. - */ - public void printMap(HashMap>> map) { - map.forEach((k, v) -> { - System.out.println(k); - v.forEach((k0, v0) -> { - System.out.println("\t" + k0); - v0.forEach(v1 -> - System.out.println("\t\t" + v1) - ); - }); - }); - } - - /** - * Returns an array of all operation Codes mapped to the Fingerprint which will reflect the operation by name. - * - * @return Matrix of [[213091283, "MethodName1"], [ -21312481, "MethodName2" ]] - */ - private Object[] getOperationCodes() { - return this.entries.stream() - .map(Entry::getMethods) - .flatMap(List::stream) - .map(method -> new Object[]{Integer.toString(method.hashCode()), method}) - .collect(Collectors.toList()).toArray(); - } - - /** - * Generates the matrix of Fingerprints and Method within the each fingerprint - * which are reflected and used in Filtering and processing. - * - * @return Matrix of [[ Fingerprint name, method1, method2, ... ], ... ] - */ - private Object[][] getEntries() { - Object[][] obj = new Object[this.entries.size()][]; - for (int i = 0; i < entries.size(); i++) { - Entry e = entries.get(i); - Object[] methods = e.getMethods().toArray(); - Object[] entry = new Object[methods.length + 1]; - entry[0] = e.getName(); - System.arraycopy(methods, 0, entry, 1, methods.length); - obj[i] = entry; - } - return obj; - } - - /** - * Sets the imports used by the class this template creates. - * - * @param classes Array of classes to be used. - */ - private void addImports(Class... classes) { - for (int i = 0; i < classes.length; ++i) { - Class clazz = classes[i]; - this.imports.add(clazz.getCanonicalName()); - } - } - - /** - * Tries to add a fingerprint to this Filter. - * - * @param template Template4 to attempt to add. - */ - public void addFingerprint(ClassTemplate template) { - if (isFingerprint(template)) { - this.entries.add(new Entry(template)); - } - } - - /** - * Tests if a template contains methods with signatures that are required by the filter object. - * The Filter object is meant to be a "self reflecting" object. Meaning it can be cast to usable interfaces - * without explicitly reflecting the classes. - * - * @param classTemplate Template4 to check if it implements the required interface. - * @return True if this ClassTemplate is a fingerprint, else false. - */ - public boolean isFingerprint(ClassTemplate classTemplate) { - return fingerprintClass.equals(classTemplate.getImplementingClass()); - } - - private enum $ implements TemplateAccessor { - ClassName, - ImplementingClass, - CompilerClass, - Imports, - Entries, - OperationCodes, - FingerprintClass, - OperationClass, - ReturnType, - FilterPackage, - FilterCodes; - } - - /** - * link of a resolving method code to the filters it will check - */ - private class FilterUnit { - private final String resolvingMethod; - private final List> groups; - - public FilterUnit(MethodTemplate template) { - this.resolvingMethod = template.getMethodName(); - this.groups = template.getFilters(); - } - - public String getResolvingMethod() { - return resolvingMethod; - } - - public Integer getResolvingCode() { - return this.getResolvingMethod().hashCode(); - } - - public List> getGroups() { - return groups; - } - - public List getVariables() { - return this.groups.stream().flatMap(List::stream) - .map(Variable::getName) - .collect(Collectors.toList()); - } - - @Override - public String toString() { - return String.format("%s %s", this.getResolvingCode(), this.getVariables()); - } - } - - /*** - * Container class for each ClassTemplate (fingerprint) this filter Object will include in its Operation routes. - */ - private class Entry { - public final String name; - public final ClassTemplate template; - - public Entry(ClassTemplate template) { - this.template = template; - this.name = template.getClassName(); - } - - public String getName() { - return name; - } - - public ClassTemplate getTemplate() { - return this.template; - } - - public List getMethods() { - return this.template.getMethods() - .stream() - .map(MethodTemplate::getMethodName) - .collect(Collectors.toList()); - } - - } - -} \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/FilterExpression.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/FilterExpression.java deleted file mode 100644 index 9790e45..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/FilterExpression.java +++ /dev/null @@ -1,216 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import TemplateEngine.Fingerprint3.Fingerprint; -import TemplateEngine.Template4.Structure.Variable; -import TemplateEngine.Template4.Structure.VariableDeclaration; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.Expression; -import TemplateEngine.Template4.Template; - -import javax.xml.bind.JAXBElement; -import java.util.ArrayList; -import java.util.List; -import java.util.function.Function; - -/** - * Created by BESTDOG on 11/12/2015. - */ -public class FilterExpression implements Template, Expression { - /** used to delimit ranged values */ - private static final String RANGE_DELIMITER = "::"; - private enum $ { - /** variable names must coincide with Grassmarlins LogicalDataImportTask variable names */ - Ack(new Variable(String.class, "getAck()")), - Dsize(new Variable(int.class, "getDsize()")), - DsizeWithin(new Variable(int.class, "getDsize()"), true), - DstPort(new Variable(int.class, "getDst()")), - Ethertype(new Variable(int.class, "getEth()")), - Flags(new Variable(String.class, "getFlags()")), - Seq(new Variable(String.class, "getSeq()")), - SrcPort(new Variable(int.class, "getSrc()")), - TransportProtocol(new Variable(int.class, "getProto()")), - TTL(new Variable(int.class, "getTtl()")), - TTLWithin(new Variable(int.class, "getTtl()"), true), - Window(new Variable(int.class, "getWindow()")); - - Variable var; - - public final Function renderMethod; - - $(Variable var) { - this(var, false); - } - - $(Variable var, boolean isInequality) { - this.var = var; - if( isInequality ) { - renderMethod = this::inqualityMethod; - } else { - renderMethod = this::equalMethod; - } - } - - public String equalMethod(VariableDeclaration var) { - String expression = null; - String name = this.var.name; - String val = var.initialVal; - - if( this.var.isPrimitive() ) { - expression = String.format("t.%s==%s", name, val); - } else if( this.var.isString() ){ - expression = String.format("\"%s\".equals(t.%s)", val, name); - } else { - expression = String.format("Objects.equals(t.%s,%s)", name, val); - } - - return expression; - } - - public String inqualityMethod(VariableDeclaration var) { - String name = this.var.name; - String min = var.initialVal.split("::")[1]; - String max = var.initialVal.split("::")[0]; - String expression = String.format("t.%s<=%s && t.%s>=%s", name, max, name, min); - return expression; - } - - public static VariableDeclaration getVariable(JAXBElement element) { - String name = element.getName().toString(); - String value; - - if( element.getValue() instanceof Fingerprint.Filter.DsizeWithin ) { - Fingerprint.Filter.DsizeWithin within = (Fingerprint.Filter.DsizeWithin) element.getValue(); - value = String.format("%s%s%s", within.getMax(), RANGE_DELIMITER, within.getMin()); - } else if( element.getValue() instanceof Fingerprint.Filter.TTLWithin ) { - Fingerprint.Filter.TTLWithin within = (Fingerprint.Filter.TTLWithin) element.getValue(); - value = String.format("%s%s%s", within.getMax(), RANGE_DELIMITER, within.getMin()); - } else { - value = element.getValue().toString(); - } - - $ code = $.valueOf(name); - return new VariableDeclaration(code.var.clazz, code.name(), value); - } - - public static String getExpression(VariableDeclaration var) { - $ code = $.valueOf(var.name); - return code.renderMethod.apply(var); - } - - } - - List> expressions; - - Template parent; - - public FilterExpression() { - this.expressions = new ArrayList<>(); - } - - public FilterExpression(List filters) { - this(); - filters.forEach(this::addGroup); - } - - public List> getExpressions() { - return expressions; - } - - private void addGroup(Fingerprint.Filter filter) { - List expression = new ArrayList<>(); - for( JAXBElement element : filter.getAckAndMSSAndDsize() ) { - expression.add( $.getVariable(element) ); - } - this.expressions.add(expression); - } - - /** - *

-     * Generates the comparators for each of the filter operations.
-     * Members checks are as follows,
-     *     1. Window
-     *     2. TTLWithin
-     *     3. DsizeWithin
-     *     4. Flags
-     *     5. Seq
-     *     6. TTL
-     *     7. Dsize
-     *     8. Dstport
-     *     9. Srcport
-     *     10. Ethertype
-     *     11. TransportProtocol
-     * 
- * @return Formatted java expression string for checking the members of the LogicalDataImportTask object. - */ - public String render() { - final StringBuilder sb = new StringBuilder(); - final String AND_CODE = " && "; - final String OR_CODE = " || "; - Function formatFunction; - String AND = ""; - String OR = ""; - - for (List expression : this.expressions) { - if( !expression.isEmpty() ) { - if( expression.size() == 1 ) { - formatFunction = s -> s; - } else { - formatFunction = s -> "("+s+")"; - } - - sb.append(OR); - OR = OR_CODE; - AND = ""; - - for( VariableDeclaration var : expression ) { - String s = $.getExpression(var); - sb.append(AND).append( formatFunction.apply(s) ); - AND = AND_CODE; - } - } - } - if( sb.length() == 0 ) { - sb.append(false); - } - return sb.toString(); - } - - - @Override - public String getName() { - return ""; - } - - @Override - public String getTemplate() { - return null; - } - - @Override - public void setTemplate(String template) { - - } - - @Override - public void render(ST st) { - - } - - @Override - public void setParent(Template parent) { - this.parent = parent; - } - - @Override - public Template getParent() { - return parent; - } - - @Override - public List getVariables() { - List variables = new ArrayList<>(); - this.expressions.forEach(variables::addAll); - return variables; - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/FingerprintGetMethod.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/FingerprintGetMethod.java deleted file mode 100644 index b7fb3ac..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/FingerprintGetMethod.java +++ /dev/null @@ -1,65 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import TemplateEngine.Data.FunctionalFingerprint; -import TemplateEngine.Data.FunctionalOperation; -import TemplateEngine.Template4.Structure.MethodTemplate; -import TemplateEngine.Template4.Structure.Variable; -import TemplateEngine.Template4.TemplateAccessor; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.RegularTemplate; - -import java.util.ArrayList; -import java.util.List; - -/** - * Created by BESTDOG on 11/13/2015. - * - * Creates the {@link FunctionalOperation} getMethod(String name) method - * used in {@link FunctionalFingerprint} classes to expose their entry methods. - */ -public class FingerprintGetMethod extends RegularTemplate { - - private enum $ implements TemplateAccessor { - methodNames, returnType; - } - - List methodIdentifiers; - final Class returnType; - - public FingerprintGetMethod(Class returnType) { - super("FingerprintGetMethod"); - this.methodIdentifiers = new ArrayList<>(); - this.returnType = returnType; - } - - public FingerprintGetMethod addMethodIdentifier(String identifier) { - this.methodIdentifiers.add(identifier); - return this; - } - - @Override - public String render() { - MethodTemplate template = new MethodTemplate() { - @Override - public String getRenderedBody() { - ST st = FingerprintGetMethod.this.get(); - FingerprintGetMethod.this.render(st); - return st.render(); - } - } - .addArgument(new Variable(String.class, "name")) - .setReturnType(FunctionalOperation.class) - .setGenericReturnType(this.returnType) - .setMethodName("loadMethod") - .setMethodbody(this) - .setOverride(true) - .setInitialVars(null); - return template.render(); - } - - @Override - public void render(ST st) { - $.methodNames.add(st, methodIdentifiers.toArray()); - $.returnType.add(st, this.returnType); - } -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/IsDataAtFunctionTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/IsDataAtFunctionTemplate.java deleted file mode 100644 index 90f4476..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/IsDataAtFunctionTemplate.java +++ /dev/null @@ -1,58 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import TemplateEngine.Template4.Structure.ClassTemplate; -import TemplateEngine.Template4.TemplateAccessor; -import TemplateEngine.Fingerprint3.AndThen; -import TemplateEngine.Fingerprint3.IsDataAtFunction; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.FunctionTemplate; -import TemplateEngine.Template4.RegularTemplate; - -/** - * Created by BESTDOG on 11/18/2015. - * - * IsDataAt tests the remaining length before the end of the payload. - * - * - */ -public class IsDataAtFunctionTemplate extends RegularTemplate implements FunctionTemplate { - - public IsDataAtFunctionTemplate() { - super("IsDataAtFunction"); - } - - Integer offset; - boolean relative; - - @Override - public AndThen generateFunction(Object obj) { - AndThen andThen = null; - if( obj instanceof IsDataAtFunction) { - IsDataAtFunction function = (IsDataAtFunction) obj; - andThen = function.getAndThen(); - - offset = function.getOffset(); - relative = function.isRelative(); - } - return andThen; - } - - @Override - public void onAppend(ClassTemplate template) { - - } - - @Override - public void render(ST st) { - $.Offset.add(st, this.offset); - $.Relative.add(st, this.relative); - if( this.hasBody() ) { - $.Body.add(st, this.getBody().render()); - } - } - - private enum $ implements TemplateAccessor { - Offset, Relative, Body; - } - -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/MatchFunctionTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/MatchFunctionTemplate.java deleted file mode 100644 index 716fb98..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/MatchFunctionTemplate.java +++ /dev/null @@ -1,215 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import ICSDefines.Content; -import TemplateEngine.Template4.Exception.TemplateRequirmentsError; -import TemplateEngine.Template4.Structure.ByteArrayDeclaration; -import TemplateEngine.Template4.Structure.ClassTemplate; -import TemplateEngine.Template4.Structure.PatternDeclaration; -import TemplateEngine.Template4.TemplateAccessor; -import TemplateEngine.Fingerprint3.AndThen; -import TemplateEngine.Fingerprint3.MatchFunction; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.FunctionTemplate; -import TemplateEngine.Template4.NestedBlock; -import TemplateEngine.Template4.RegularTemplate; - -/** - * Created by BESTDOG on 11/13/2015. - * - * A method stub/template for the Match-Function. - * Match will match a sequence of bytes or a regex on the string equivalent of the input. - */ -public class MatchFunctionTemplate extends RegularTemplate implements FunctionTemplate { - - private enum $ implements TemplateAccessor { - Body, - Depth, - Offset, - Relative, - Within, - MoveCursors, - /* NoCase, not required in template */ - Pattern, - Content; - } - - private static int VARIABLE_INDEX = 0; - - private NestedBlock body; - String pattern; - private int depth; - private int offset; - private int within; - private boolean move; - private boolean relative; - private boolean noCase; - private PatternDeclaration patternDeclaration; - private ByteArrayDeclaration contentDeclaration; - - public MatchFunctionTemplate() { - super("MatchFunction"); - } - - /** depth can only be positive, its a forward only offset */ - public MatchFunctionTemplate setDepth(int depth) { - this.depth = Math.max(0, depth); - return this; - } - - /** limit to max frame size */ - public MatchFunctionTemplate setOffset(int offset) { - this.offset = Math.min(65535, offset); - return this; - } - - /** this is an abs value, its the range ahead or behind the location where a successful hit is accepted */ - public MatchFunctionTemplate setWithin(int within) { - this.within = Math.abs(within); - return this; - } - - /** - * If true both A and B cursors will be set upon succesful match. - * @param move true to move A and B cursors in addition to MAIN, else false and just main will be set on success. - * @return This reference is returned so that methods may be chained. - */ - public MatchFunctionTemplate setMove(boolean move) { - this.move = move; - return this; - } - - public MatchFunctionTemplate setRelative(boolean relative) { - this.relative = relative; - return this; - } - - public MatchFunctionTemplate setIgnoreCase(boolean noCase) { - this.noCase = noCase; - if( this.patternDeclaration != null ) { - this.setPattern(this.patternDeclaration.getPattern()); - } - return this; - } - - public MatchFunctionTemplate setPattern(String pattern) { - this.patternDeclaration = getPattern(pattern, noCase); - return this; - } - - public MatchFunctionTemplate setContent(String string, Content type) { - ByteArrayDeclaration.ByteAdapter byteAdapter; - String varName = getContentVariable(); - - switch( type ) { - case HEX: - byteAdapter = new ByteArrayDeclaration.HexAdapter(string); - break; - case INTEGER: - byteAdapter = new ByteArrayDeclaration.IntAdapter(string); - break; - case RAW_BYTES: - byteAdapter = new ByteArrayDeclaration.RawBytes(string); - break; - case STRING: - default: - byteAdapter = new ByteArrayDeclaration.StringAdapter(string); - } - - this.contentDeclaration = new ByteArrayDeclaration(varName, byteAdapter); - - return this; - } - - /** - * Generates function when manually constructed through code, not through JAXB object. - * @return This reference is returned so that methods may be chained. - */ - public MatchFunctionTemplate generateFunction() { - return this; - } - - @Override - public AndThen generateFunction(Object obj) { - AndThen andThen = null; - if( obj instanceof MatchFunction ) { - MatchFunction mf = (MatchFunction) obj; - MatchFunction.Content content = mf.getContent(); - pattern = mf.getPattern(); - - this.setDepth(mf.getDepth()) - .setOffset(mf.getOffset()) - .setMove(mf.isMoveCursors()) - .setRelative(mf.isRelative()) - .setIgnoreCase(mf.isNoCase()); - - if( content == null && (pattern == null || !patternValid(pattern)) ) { - throw new TemplateRequirmentsError("Expected Content or valid Pattern in MatchFunction."); - } else if( pattern != null ) { - this.setPattern(this.pattern); - } else { - String data = content.getValue(); - String typeName = content.getType().value(); - Content ct = Content.valueOf(typeName); - this.setContent(data, ct); - } - - andThen = mf.getAndThen(); - } - return andThen; - } - - private boolean patternValid(String pattern) { - return PatternDeclaration.patternValid(pattern); - } - - public PatternDeclaration getPattern(String pattern, boolean ignoreCase) { - return new PatternDeclaration(getPatternVariable(), pattern, ignoreCase); - } - - private String getContentVariable() { - int id = Math.abs(VARIABLE_INDEX++); - return String.format("CONTENT%d", id); - } - - private String getPatternVariable() { - int id = Math.abs(VARIABLE_INDEX++); - return String.format("PATTERN%d", id); - } - - @Override - public void onAppend(ClassTemplate template) { - if( patternDeclaration != null ) { - template.addVariable(this.patternDeclaration); - } else if( contentDeclaration != null ) { - template.addVariable(this.contentDeclaration); - } - } - - @Override - public NestedBlock getBody() { - return body; - } - - @Override - public void setBody(NestedBlock body) { - this.body = body; - this.body.setParent(this); - } - - @Override - public void render(ST st) { - $.Depth.add(st, this.depth); - $.Offset.add(st, this.offset); - $.Within.add(st, this.within); - $.Relative.add(st, this.relative); - $.MoveCursors.add(st, this.move); - if( body != null ) { - $.Body.add(st, this.body.render()); - } - if( patternDeclaration != null ) { - $.Pattern.add(st, this.patternDeclaration.name); - } else if( contentDeclaration != null ) { - $.Content.add(st, this.contentDeclaration.name); - } - } -} diff --git a/FPC4/src/TemplateEngine/Template4/Structure/Code/ReturnTemplate.java b/FPC4/src/TemplateEngine/Template4/Structure/Code/ReturnTemplate.java deleted file mode 100644 index 1887e88..0000000 --- a/FPC4/src/TemplateEngine/Template4/Structure/Code/ReturnTemplate.java +++ /dev/null @@ -1,85 +0,0 @@ -package TemplateEngine.Template4.Structure.Code; - -import TemplateEngine.Template4.Structure.ClassTemplate; -import TemplateEngine.Template4.TemplateAccessor; -import TemplateEngine.Fingerprint3.AndThen; -import TemplateEngine.Fingerprint3.Extract; -import TemplateEngine.Fingerprint3.Return; -import org.stringtemplate.v4.ST; -import TemplateEngine.Template4.FunctionTemplate; -import TemplateEngine.Template4.NestedBlock; -import TemplateEngine.Template4.Template; - -import java.util.ArrayList; -import java.util.List; - -/** - * Created by BESTDOG on 11/16/2015. - * - * Creates the function which extracts and returns information based on testing data in a packet's payload. - * - */ -public class ReturnTemplate extends DetailBlockTemplate implements FunctionTemplate { - - private enum $ implements TemplateAccessor { - Body, - FingerprintName; - } - - NestedBlock body; - String name; - List