Loading javasrc/adapter/org/etsi/adapter/ITERequired.java +11 −0 Original line number Diff line number Diff line Loading @@ -60,4 +60,15 @@ public interface ITERequired { * @return Value associated to the TA parameter */ Value getTaParameter(String param); /** * Logs the debug message. */ void logDebug(String debugMessage); /** * Logs the error message. */ void logError(String errorMessage); } javasrc/adapter/org/etsi/its/adapter/ComponentMgr.java +14 −13 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Observer; import org.etsi.adapter.TERFactory; import org.etsi.common.ITuple; import org.etsi.common.Tuple; import org.etsi.its.adapter.ports.IObservable; Loading Loading @@ -58,7 +59,7 @@ public class ComponentMgr{ public void addComponent(TriComponentId component) { // Sanity check if(component == null) { System.err.println("Error: Trying to add null component"); TERFactory.getInstance().logError("Error: Trying to add null component"); return; } Loading @@ -81,11 +82,11 @@ public class ComponentMgr{ public void addPort(final String componentName, final TriPortId ttcnPort, final IPort port) { // Sanity checks if(componentName.isEmpty() || (ttcnPort == null) || (port == null)) { System.err.println("Wrong parameters"); TERFactory.getInstance().logError("Wrong parameters"); return; } if(!mapCompNameToTriComp.containsKey(componentName)) { System.err.println("Error: Trying to add port to unknown component"); TERFactory.getInstance().logError("Error: Trying to add port to unknown component"); return; } if(!mapTriPortToTuple.containsKey(componentName)) { Loading @@ -110,7 +111,7 @@ public class ComponentMgr{ // Sanity checks if(componentName == null || componentName.isEmpty()) { System.err.println("Invalid component"); TERFactory.getInstance().logError("Invalid component"); return null; } Loading @@ -127,15 +128,15 @@ public class ComponentMgr{ // Sanity checks if(componentName.isEmpty() || portName.isEmpty()) { System.err.println("Wrong parameters"); TERFactory.getInstance().logError("Wrong parameters"); return null; } if(!mapCompNameToTriComp.containsKey(componentName)) { System.err.println("Unknown component"); TERFactory.getInstance().logError("Unknown component"); return null; } if(!mapTriPortToTuple.containsKey(componentName)) { System.err.println("No port list entry"); TERFactory.getInstance().logError("No port list entry"); return null; } Loading @@ -160,15 +161,15 @@ public class ComponentMgr{ // Sanity checks if(componentName.isEmpty() || portName.isEmpty()) { System.err.println("Wrong parameters"); TERFactory.getInstance().logError("Wrong parameters"); return null; } if(!mapCompNameToTriComp.containsKey(componentName)) { System.err.println("Unknown component"); TERFactory.getInstance().logError("Unknown component"); return null; } if(!mapTriPortToTuple.containsKey(componentName)) { System.err.println("No port list entry"); TERFactory.getInstance().logError("No port list entry"); return null; } Loading Loading @@ -204,15 +205,15 @@ public class ComponentMgr{ // Sanity checks if(componentName.isEmpty() || portName.isEmpty()) { System.err.println("Wrong parameters"); TERFactory.getInstance().logError("Wrong parameters"); return; } if(!mapCompNameToTriComp.containsKey(componentName)) { System.err.println("Unknown component"); TERFactory.getInstance().logError("Unknown component"); return; } if(!mapTriPortToTuple.containsKey(componentName)) { System.err.println("No port list entry"); TERFactory.getInstance().logError("No port list entry"); return; } Loading javasrc/adapter/org/etsi/its/adapter/Management.java +3 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class Management implements IManagementTA, IManagementLayers { /** * Maximum time for getting Long position vector (in seconds) */ private static final int GET_LPV_TIMEOUT = 10; private static final int GET_LPV_TIMEOUT = 10; //FIXME: Might be a parameter rather than a constant /** * Interval for polling the location table during GetLpv (in ms) Loading Loading @@ -353,6 +353,8 @@ public class Management implements IManagementTA, IManagementLayers { // Ensure that management settings are reset beaconHeader = null; enqueueBeacon = null; locTable.clear(); } @Override Loading javasrc/adapter/org/etsi/its/adapter/PcapMultiplexer.java +7 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ public class PcapMultiplexer implements Runnable { int r = Pcap.findAllDevs(alldevs, errbuf); if (r == Pcap.NOT_OK || alldevs.isEmpty()) { System.err.printf("Can't read list of devices, error is %s", errbuf.toString()); TERFactory.getInstance().logError("Can't read list of devices, error is %s" + errbuf.toString()); return; } Loading @@ -72,7 +72,7 @@ public class PcapMultiplexer implements Runnable { } device = alldevs.get(ifaceIndex); System.out.println("Listening: " + device.getName()); // TERFactory.getInstance().logDebug("Listening: " + device.getName()); } /** Loading @@ -84,7 +84,7 @@ public class PcapMultiplexer implements Runnable { } public synchronized void register(Layer client, byte[] macAddress, short frameType) { System.out.println(">>>PcapMultiplexer.registering: " + frameType); // TERFactory.getInstance().logDebug(">>>PcapMultiplexer.registering: " + frameType); if(clientsToMacs.isEmpty()) { // Open interface Loading @@ -94,7 +94,7 @@ public class PcapMultiplexer implements Runnable { pcap = Pcap.openLive(device.getName(), snaplen, flags, timeout, errbuf); if (pcap == null) { System.err.printf("Error while opening device for capture: " TERFactory.getInstance().logError("Error while opening device for capture: " + errbuf.toString()); return; } Loading @@ -103,7 +103,7 @@ public class PcapMultiplexer implements Runnable { filter = ""; } else { System.out.println("Another Client !"); // TERFactory.getInstance().logDebug("Another Client !"); filter = filter + " and "; } Loading @@ -114,7 +114,7 @@ public class PcapMultiplexer implements Runnable { } filter = filter + "not ether src " + strMacAddress; System.out.println("New filter: " + filter); // TERFactory.getInstance().logDebug("New filter: " + filter); // Apply filter PcapBpfProgram bpfFilter = new PcapBpfProgram(); Loading @@ -122,7 +122,7 @@ public class PcapMultiplexer implements Runnable { int netmask = 0; int r = pcap.compile(bpfFilter, filter, optimize, netmask); if (r != Pcap.OK) { System.out.println("Filter error: " + pcap.getErr()); // TERFactory.getInstance().logDebug("Filter error: " + pcap.getErr()); } pcap.setFilter(bpfFilter); Loading javasrc/adapter/org/etsi/its/adapter/SecurityHelper.java +144 −124 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
javasrc/adapter/org/etsi/adapter/ITERequired.java +11 −0 Original line number Diff line number Diff line Loading @@ -60,4 +60,15 @@ public interface ITERequired { * @return Value associated to the TA parameter */ Value getTaParameter(String param); /** * Logs the debug message. */ void logDebug(String debugMessage); /** * Logs the error message. */ void logError(String errorMessage); }
javasrc/adapter/org/etsi/its/adapter/ComponentMgr.java +14 −13 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Observer; import org.etsi.adapter.TERFactory; import org.etsi.common.ITuple; import org.etsi.common.Tuple; import org.etsi.its.adapter.ports.IObservable; Loading Loading @@ -58,7 +59,7 @@ public class ComponentMgr{ public void addComponent(TriComponentId component) { // Sanity check if(component == null) { System.err.println("Error: Trying to add null component"); TERFactory.getInstance().logError("Error: Trying to add null component"); return; } Loading @@ -81,11 +82,11 @@ public class ComponentMgr{ public void addPort(final String componentName, final TriPortId ttcnPort, final IPort port) { // Sanity checks if(componentName.isEmpty() || (ttcnPort == null) || (port == null)) { System.err.println("Wrong parameters"); TERFactory.getInstance().logError("Wrong parameters"); return; } if(!mapCompNameToTriComp.containsKey(componentName)) { System.err.println("Error: Trying to add port to unknown component"); TERFactory.getInstance().logError("Error: Trying to add port to unknown component"); return; } if(!mapTriPortToTuple.containsKey(componentName)) { Loading @@ -110,7 +111,7 @@ public class ComponentMgr{ // Sanity checks if(componentName == null || componentName.isEmpty()) { System.err.println("Invalid component"); TERFactory.getInstance().logError("Invalid component"); return null; } Loading @@ -127,15 +128,15 @@ public class ComponentMgr{ // Sanity checks if(componentName.isEmpty() || portName.isEmpty()) { System.err.println("Wrong parameters"); TERFactory.getInstance().logError("Wrong parameters"); return null; } if(!mapCompNameToTriComp.containsKey(componentName)) { System.err.println("Unknown component"); TERFactory.getInstance().logError("Unknown component"); return null; } if(!mapTriPortToTuple.containsKey(componentName)) { System.err.println("No port list entry"); TERFactory.getInstance().logError("No port list entry"); return null; } Loading @@ -160,15 +161,15 @@ public class ComponentMgr{ // Sanity checks if(componentName.isEmpty() || portName.isEmpty()) { System.err.println("Wrong parameters"); TERFactory.getInstance().logError("Wrong parameters"); return null; } if(!mapCompNameToTriComp.containsKey(componentName)) { System.err.println("Unknown component"); TERFactory.getInstance().logError("Unknown component"); return null; } if(!mapTriPortToTuple.containsKey(componentName)) { System.err.println("No port list entry"); TERFactory.getInstance().logError("No port list entry"); return null; } Loading Loading @@ -204,15 +205,15 @@ public class ComponentMgr{ // Sanity checks if(componentName.isEmpty() || portName.isEmpty()) { System.err.println("Wrong parameters"); TERFactory.getInstance().logError("Wrong parameters"); return; } if(!mapCompNameToTriComp.containsKey(componentName)) { System.err.println("Unknown component"); TERFactory.getInstance().logError("Unknown component"); return; } if(!mapTriPortToTuple.containsKey(componentName)) { System.err.println("No port list entry"); TERFactory.getInstance().logError("No port list entry"); return; } Loading
javasrc/adapter/org/etsi/its/adapter/Management.java +3 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class Management implements IManagementTA, IManagementLayers { /** * Maximum time for getting Long position vector (in seconds) */ private static final int GET_LPV_TIMEOUT = 10; private static final int GET_LPV_TIMEOUT = 10; //FIXME: Might be a parameter rather than a constant /** * Interval for polling the location table during GetLpv (in ms) Loading Loading @@ -353,6 +353,8 @@ public class Management implements IManagementTA, IManagementLayers { // Ensure that management settings are reset beaconHeader = null; enqueueBeacon = null; locTable.clear(); } @Override Loading
javasrc/adapter/org/etsi/its/adapter/PcapMultiplexer.java +7 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ public class PcapMultiplexer implements Runnable { int r = Pcap.findAllDevs(alldevs, errbuf); if (r == Pcap.NOT_OK || alldevs.isEmpty()) { System.err.printf("Can't read list of devices, error is %s", errbuf.toString()); TERFactory.getInstance().logError("Can't read list of devices, error is %s" + errbuf.toString()); return; } Loading @@ -72,7 +72,7 @@ public class PcapMultiplexer implements Runnable { } device = alldevs.get(ifaceIndex); System.out.println("Listening: " + device.getName()); // TERFactory.getInstance().logDebug("Listening: " + device.getName()); } /** Loading @@ -84,7 +84,7 @@ public class PcapMultiplexer implements Runnable { } public synchronized void register(Layer client, byte[] macAddress, short frameType) { System.out.println(">>>PcapMultiplexer.registering: " + frameType); // TERFactory.getInstance().logDebug(">>>PcapMultiplexer.registering: " + frameType); if(clientsToMacs.isEmpty()) { // Open interface Loading @@ -94,7 +94,7 @@ public class PcapMultiplexer implements Runnable { pcap = Pcap.openLive(device.getName(), snaplen, flags, timeout, errbuf); if (pcap == null) { System.err.printf("Error while opening device for capture: " TERFactory.getInstance().logError("Error while opening device for capture: " + errbuf.toString()); return; } Loading @@ -103,7 +103,7 @@ public class PcapMultiplexer implements Runnable { filter = ""; } else { System.out.println("Another Client !"); // TERFactory.getInstance().logDebug("Another Client !"); filter = filter + " and "; } Loading @@ -114,7 +114,7 @@ public class PcapMultiplexer implements Runnable { } filter = filter + "not ether src " + strMacAddress; System.out.println("New filter: " + filter); // TERFactory.getInstance().logDebug("New filter: " + filter); // Apply filter PcapBpfProgram bpfFilter = new PcapBpfProgram(); Loading @@ -122,7 +122,7 @@ public class PcapMultiplexer implements Runnable { int netmask = 0; int r = pcap.compile(bpfFilter, filter, optimize, netmask); if (r != Pcap.OK) { System.out.println("Filter error: " + pcap.getErr()); // TERFactory.getInstance().logDebug("Filter error: " + pcap.getErr()); } pcap.setFilter(bpfFilter); Loading
javasrc/adapter/org/etsi/its/adapter/SecurityHelper.java +144 −124 File changed.Preview size limit exceeded, changes collapsed. Show changes