Loading javasrc/com/iskratel/ttcn/tri/IotConnectionOffline.java +254 −251 Original line number Diff line number Diff line Loading @@ -32,18 +32,20 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt TriPortId comPortId = null; TriPortId tsiPortId = null; Logger log = null; protected Logger log = null; public static Hashtable<String, TriPortId> ComponentCollection = new Hashtable<String,TriPortId>(); public static Hashtable<String, TriPortId> ComponentCollectionCompPort = new Hashtable<String,TriPortId>(); public static Hashtable<String, FilterPackets> ComponentCollectionFilter2Port = new Hashtable<String,FilterPackets>(); private Queue<TriComponentId> FilterMsgFIFO = new LinkedList<>(); // for selection sequence to which PTC first send // resonse private Queue<TriComponentId> FilterMsgFIFO = new LinkedList<>(); //for selection sequence to which PTC first send resonse public String tracefile=""; public class FilterPackets { public class FilterPackets { public List packets; public String filter; public TriComponentId componentId; Loading @@ -51,25 +53,31 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt public TriCommunicationTE cte; final IotConnectionOffline this$0; public boolean equals(Object obj) { if (obj instanceof FilterPackets) { public boolean equals(Object obj) { if(obj instanceof FilterPackets) { return filter.equals(((FilterPackets)obj).filter); } else { } else { return false; } } public int hashCode() { public int hashCode() { return filter.hashCode()+componentId.hashCode(); } public FilterPackets(String filter) { public FilterPackets(String filter) { super(); this$0 = IotConnectionOffline.this; this.filter = filter; } public FilterPackets(String filter, TriComponentId componentId, TriPortId tsiPortId, TriCommunicationTE cte) { public FilterPackets(String filter, TriComponentId componentId, TriPortId tsiPortId, TriCommunicationTE cte) { this(filter); this.componentId = componentId; this.tsiPortId = tsiPortId; Loading @@ -81,22 +89,21 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt } public String toString(){ return (componentId.getComponentName() + " " + tsiPortId.toString() + " " + ((filter != null) ? filter : "(null)"));// + "\n" + "packets count: " + ((packets != null) ? // packets.size() : "(null)")); return (componentId.getComponentName() + " " + tsiPortId.toString() + " " + ((filter != null) ? filter : "(null)"));// + "\n" + "packets count: " + ((packets != null) ? packets.size() : "(null)")); } } public IotConnectionOffline(Logger log, TriCommunicationTE cte) { this.cte = cte; this.log = log; } public synchronized TriStatus triMap(TriPortId comPortId, TriPortId tsiPortId) { try { boolean result=false; log.debug("comPortId.getPortName()= " + comPortId.getPortName() + "; tsiPortId.getPortName()= " + tsiPortId.getPortName()); log.debug("comPortId.getPortName()= " + comPortId.getPortName() + "; tsiPortId.getPortName()= " + tsiPortId.getPortName()); // Save parameters for later usage //this.comPortId = comPortId; //this.tsiPortId = tsiPortId; Loading @@ -116,27 +123,31 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt //log.debug(""+ComponentCollection.elements().toString()); result = true; //assume MTC acport was succesfully conected } } else if (tsiPortId.getPortName().equals("sipPort")) { }else if (tsiPortId.getPortName().equals("sipPort")){ ComponentCollection.put(comPortId.getComponent().getComponentName()+"-data", tsiPortId); ComponentCollectionCompPort.put(comPortId.getComponent().getComponentName()/*+"-sip"*/, comPortId); //log.debug(""+ComponentCollection.elements().toString()); result = true; //asuume MTC acport was succesfully conected } else if (tsiPortId.getPortName().equals("diameterPort")) { }else if (tsiPortId.getPortName().equals("diameterPort")){ ComponentCollection.put(comPortId.getComponent().getComponentName()+"-data", tsiPortId); ComponentCollectionCompPort.put(comPortId.getComponent().getComponentName()/* +"-diameter" */, comPortId); ComponentCollectionCompPort.put(comPortId.getComponent().getComponentName()/*+"-diameter"*/, comPortId); //log.debug(""+ComponentCollection.elements().toString()); result = true; //asuume MTC acport was succesfully conected } else if (tsiPortId.getPortName().equals("dPort")) { }else if (tsiPortId.getPortName().equals("dPort")){ ComponentCollection.put(comPortId.getComponent().getComponentName()+"-d", tsiPortId); ComponentCollectionCompPort.put(comPortId.getComponent().getComponentName()+"-d", comPortId); //log.debug(""+ComponentCollection.elements().toString()); result = true; //asuume MTC acport was succesfully conected } else if (tsiPortId.getPortName().equals("")) { }else if(tsiPortId.getPortName().equals("")){ result = false; } return (result == true) ? new TriStatusImpl(TriStatus.TRI_OK) : new TriStatusImpl(TriStatus.TRI_ERROR); return (result == true) ? new TriStatusImpl(TriStatus.TRI_OK) : new TriStatusImpl(TriStatus.TRI_ERROR); //return new TriStatusImpl(TriStatus.TRI_OK); } catch (Throwable ex) { ex.printStackTrace(); Loading @@ -145,8 +156,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt } //public synchronized TriStatus triSend(TriAddress triAddress, public TriStatus triSend(TriComponentId componentId, TriPortId tsiPortId, TriAddress triAddress, TriMessage triMessage) { public TriStatus triSend(TriComponentId componentId, TriPortId tsiPortId,TriAddress triAddress, TriMessage triMessage) { try { byte[] buffer = triMessage.getEncodedMessage(); Loading @@ -158,14 +168,12 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt int recv_reply = 0; int iotmsgType = buffer[0]&0xFF | buffer[1]&0xFF << 8; int iotmsgLen = 2 + 4 + (((buffer[2] & 0xFF)) | ((buffer[3] & 0xFF) << 8) | ((buffer[4] & 0xFF) << 16) | ((buffer[5] & 0xFF) << 24)); int iotmsgLen = 2+4+(((buffer[2] & 0xFF))|((buffer[3] & 0xFF) << 8)|((buffer[4] & 0xFF) << 16) | ((buffer[5] & 0xFF)<<24)); switch (iotmsgType){ case 7: /*OPEN_DEVICE_REQ = 0x0007; /**< ID of OpenDeviceRequest */ log.info("ConfigureREQ"); byte[] confresp = { 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 };/* OPEN_DEVICE_REP = 0x0008; /**< ID of OpenDeviceReply */ byte[] confresp= {0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};/*OPEN_DEVICE_REP = 0x0008; /**< ID of OpenDeviceReply*/ log.debug(this.getTraceFile()); Loading @@ -174,14 +182,12 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt case 2: /*SET_FILTER_REQ = 0x0002; /**< ID of SetFilterRequest */ log.info("FilterREQ: " + componentId.getComponentName()); byte[] filterresp = { 0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 };/* SET_FILTER_REP = 0x0009; /**< ID of SetFilterReply */ byte[] filterresp= {0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};/*SET_FILTER_REP = 0x0009; /**< ID of SetFilterReply */ String filter = new String(buffer,10,buffer.length-10); log.debug("FilterREQ: filter=" + filter); try { FilterPackets fp = new FilterPackets(filter, componentId, ComponentCollection.get(componentId.getComponentName() + "-data"), this.cte/* tsiPortId */); FilterPackets fp = new FilterPackets(filter, componentId,ComponentCollection.get(componentId.getComponentName()+"-data"), this.cte/*tsiPortId*/); ComponentCollectionFilter2Port.put(componentId.getComponentName(), fp); } catch (Exception e) { // TODO Auto-generated catch block Loading @@ -195,8 +201,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt case 3:/*START_CAPTURE_REQ = 0x0003; /**< ID of StartCaptureRequest */ log.info("StartCaptureREQ: " + componentId.getComponentName()); log.info("StartCaptureREQ: ComponentCollectionFilter2Port=" + ComponentCollectionFilter2Port.size()); byte[] startcapresp = { 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 };/* START_CAPTURE_REP = 0x0004; /**< ID of StartCaptureReply */ byte[] startcapresp= {0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};/*START_CAPTURE_REP = 0x0004; /**< ID of StartCaptureReply */ if (!ComponentCollectionFilter2Port.isEmpty()) { Loading @@ -207,10 +212,8 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt try{ String key = (String) keys.nextElement(); FilterPackets fp = ComponentCollectionFilter2Port.get(key); log.info("StartCaptureREQ: launch ReadCaptureThread for component " + fp.componentId.getComponentName()); ReadCaptureThread t = new ReadCaptureThread(fp.componentId.getComponentName(), log, tracefile, fp); log.info("StartCaptureREQ: launch ReadCaptureThread for component " + fp.componentId.getComponentName()); ReadCaptureThread t = new ReadCaptureThread (fp.componentId.getComponentName(),log, tracefile,fp); t.join(1000); Thread.sleep(100); }catch(Exception e){ Loading @@ -226,8 +229,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt case 5:/*STOP_CAPTURE_REQ = 0x0005; /**< ID of StopCaptureRequest */ log.info("StopCaptureREQ"); byte[] stopcapresp = { 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 };/* STOP_CAPTURE_REP = 0x0006; /**< ID of StopCaptureReply */ byte[] stopcapresp= {0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};/*STOP_CAPTURE_REP = 0x0006; /**< ID of StopCaptureReply */ if (!ComponentCollectionFilter2Port.isEmpty()) { Loading Loading @@ -264,10 +266,9 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt if (componentId.getComponentName().equals("MTC")){ //result = send(packet); result = true; } else { // for selection sequence to which PTC first send resonse //FILTER_REQ - // FILTER_REP //log.debug(FilterMsgFIFO.size()); } else{ //for selection sequence to which PTC first send resonse //FILTER_REQ - FILTER_REP //FilterMsgFIFO.add(componentId); //result = send(packet); result = true; Loading Loading @@ -298,8 +299,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt if(tsiPortId.getPortName().equals("acPort")){ if (comPortId.getComponent().getComponentName().equals("MTC")){ // ComponentCollection.remove(comPortId.getComponent().getComponentName(), // tsiPortId); //ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); result = true;//disconnect(); }else{ ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); Loading @@ -307,17 +307,20 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt //log.debug(ComponentCollection.elements().toString()); result = true; //assume MTC acport was successfully connected } } else if (tsiPortId.getPortName().equals("sipPort")) { }else if (tsiPortId.getPortName().equals("sipPort")){ ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); ComponentCollectionCompPort.remove(comPortId.getComponent().getComponentName()+"-data", comPortId); //log.debug(ComponentCollection.elements().toString()); result = true; //assume MTC acport was successfully connected } else if (tsiPortId.getPortName().equals("diameterPort")) { }else if (tsiPortId.getPortName().equals("diameterPort")){ ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); ComponentCollectionCompPort.remove(comPortId.getComponent().getComponentName()+"-data", comPortId); //log.debug(ComponentCollection.elements().toString()); result = true; //assume MTC acport was successfully connected } else if (tsiPortId.getPortName().equals("dPort")) { }else if (tsiPortId.getPortName().equals("dPort")){ ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); ComponentCollectionCompPort.remove(comPortId.getComponent().getComponentName()+"-d", comPortId); //log.debug(ComponentCollection.elements().toString()); Loading Loading @@ -345,7 +348,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt int iotmsg = ((buffer[0] & 0xFF))|((buffer[1] & 0xFF) << 8);//iot message type byte[] message = new byte[packetLength]; log.debug("IOT MSG TYPE "+iotmsg); if (iotmsg==1){ //CAPTURE_DATA_IND byte[] packetb = new byte[packetLength-0x1b]; System.arraycopy(buffer,0x1b, packetb, 0, packetLength-0x1b); Loading Loading
javasrc/com/iskratel/ttcn/tri/IotConnectionOffline.java +254 −251 Original line number Diff line number Diff line Loading @@ -32,18 +32,20 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt TriPortId comPortId = null; TriPortId tsiPortId = null; Logger log = null; protected Logger log = null; public static Hashtable<String, TriPortId> ComponentCollection = new Hashtable<String,TriPortId>(); public static Hashtable<String, TriPortId> ComponentCollectionCompPort = new Hashtable<String,TriPortId>(); public static Hashtable<String, FilterPackets> ComponentCollectionFilter2Port = new Hashtable<String,FilterPackets>(); private Queue<TriComponentId> FilterMsgFIFO = new LinkedList<>(); // for selection sequence to which PTC first send // resonse private Queue<TriComponentId> FilterMsgFIFO = new LinkedList<>(); //for selection sequence to which PTC first send resonse public String tracefile=""; public class FilterPackets { public class FilterPackets { public List packets; public String filter; public TriComponentId componentId; Loading @@ -51,25 +53,31 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt public TriCommunicationTE cte; final IotConnectionOffline this$0; public boolean equals(Object obj) { if (obj instanceof FilterPackets) { public boolean equals(Object obj) { if(obj instanceof FilterPackets) { return filter.equals(((FilterPackets)obj).filter); } else { } else { return false; } } public int hashCode() { public int hashCode() { return filter.hashCode()+componentId.hashCode(); } public FilterPackets(String filter) { public FilterPackets(String filter) { super(); this$0 = IotConnectionOffline.this; this.filter = filter; } public FilterPackets(String filter, TriComponentId componentId, TriPortId tsiPortId, TriCommunicationTE cte) { public FilterPackets(String filter, TriComponentId componentId, TriPortId tsiPortId, TriCommunicationTE cte) { this(filter); this.componentId = componentId; this.tsiPortId = tsiPortId; Loading @@ -81,22 +89,21 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt } public String toString(){ return (componentId.getComponentName() + " " + tsiPortId.toString() + " " + ((filter != null) ? filter : "(null)"));// + "\n" + "packets count: " + ((packets != null) ? // packets.size() : "(null)")); return (componentId.getComponentName() + " " + tsiPortId.toString() + " " + ((filter != null) ? filter : "(null)"));// + "\n" + "packets count: " + ((packets != null) ? packets.size() : "(null)")); } } public IotConnectionOffline(Logger log, TriCommunicationTE cte) { this.cte = cte; this.log = log; } public synchronized TriStatus triMap(TriPortId comPortId, TriPortId tsiPortId) { try { boolean result=false; log.debug("comPortId.getPortName()= " + comPortId.getPortName() + "; tsiPortId.getPortName()= " + tsiPortId.getPortName()); log.debug("comPortId.getPortName()= " + comPortId.getPortName() + "; tsiPortId.getPortName()= " + tsiPortId.getPortName()); // Save parameters for later usage //this.comPortId = comPortId; //this.tsiPortId = tsiPortId; Loading @@ -116,27 +123,31 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt //log.debug(""+ComponentCollection.elements().toString()); result = true; //assume MTC acport was succesfully conected } } else if (tsiPortId.getPortName().equals("sipPort")) { }else if (tsiPortId.getPortName().equals("sipPort")){ ComponentCollection.put(comPortId.getComponent().getComponentName()+"-data", tsiPortId); ComponentCollectionCompPort.put(comPortId.getComponent().getComponentName()/*+"-sip"*/, comPortId); //log.debug(""+ComponentCollection.elements().toString()); result = true; //asuume MTC acport was succesfully conected } else if (tsiPortId.getPortName().equals("diameterPort")) { }else if (tsiPortId.getPortName().equals("diameterPort")){ ComponentCollection.put(comPortId.getComponent().getComponentName()+"-data", tsiPortId); ComponentCollectionCompPort.put(comPortId.getComponent().getComponentName()/* +"-diameter" */, comPortId); ComponentCollectionCompPort.put(comPortId.getComponent().getComponentName()/*+"-diameter"*/, comPortId); //log.debug(""+ComponentCollection.elements().toString()); result = true; //asuume MTC acport was succesfully conected } else if (tsiPortId.getPortName().equals("dPort")) { }else if (tsiPortId.getPortName().equals("dPort")){ ComponentCollection.put(comPortId.getComponent().getComponentName()+"-d", tsiPortId); ComponentCollectionCompPort.put(comPortId.getComponent().getComponentName()+"-d", comPortId); //log.debug(""+ComponentCollection.elements().toString()); result = true; //asuume MTC acport was succesfully conected } else if (tsiPortId.getPortName().equals("")) { }else if(tsiPortId.getPortName().equals("")){ result = false; } return (result == true) ? new TriStatusImpl(TriStatus.TRI_OK) : new TriStatusImpl(TriStatus.TRI_ERROR); return (result == true) ? new TriStatusImpl(TriStatus.TRI_OK) : new TriStatusImpl(TriStatus.TRI_ERROR); //return new TriStatusImpl(TriStatus.TRI_OK); } catch (Throwable ex) { ex.printStackTrace(); Loading @@ -145,8 +156,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt } //public synchronized TriStatus triSend(TriAddress triAddress, public TriStatus triSend(TriComponentId componentId, TriPortId tsiPortId, TriAddress triAddress, TriMessage triMessage) { public TriStatus triSend(TriComponentId componentId, TriPortId tsiPortId,TriAddress triAddress, TriMessage triMessage) { try { byte[] buffer = triMessage.getEncodedMessage(); Loading @@ -158,14 +168,12 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt int recv_reply = 0; int iotmsgType = buffer[0]&0xFF | buffer[1]&0xFF << 8; int iotmsgLen = 2 + 4 + (((buffer[2] & 0xFF)) | ((buffer[3] & 0xFF) << 8) | ((buffer[4] & 0xFF) << 16) | ((buffer[5] & 0xFF) << 24)); int iotmsgLen = 2+4+(((buffer[2] & 0xFF))|((buffer[3] & 0xFF) << 8)|((buffer[4] & 0xFF) << 16) | ((buffer[5] & 0xFF)<<24)); switch (iotmsgType){ case 7: /*OPEN_DEVICE_REQ = 0x0007; /**< ID of OpenDeviceRequest */ log.info("ConfigureREQ"); byte[] confresp = { 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 };/* OPEN_DEVICE_REP = 0x0008; /**< ID of OpenDeviceReply */ byte[] confresp= {0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};/*OPEN_DEVICE_REP = 0x0008; /**< ID of OpenDeviceReply*/ log.debug(this.getTraceFile()); Loading @@ -174,14 +182,12 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt case 2: /*SET_FILTER_REQ = 0x0002; /**< ID of SetFilterRequest */ log.info("FilterREQ: " + componentId.getComponentName()); byte[] filterresp = { 0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 };/* SET_FILTER_REP = 0x0009; /**< ID of SetFilterReply */ byte[] filterresp= {0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};/*SET_FILTER_REP = 0x0009; /**< ID of SetFilterReply */ String filter = new String(buffer,10,buffer.length-10); log.debug("FilterREQ: filter=" + filter); try { FilterPackets fp = new FilterPackets(filter, componentId, ComponentCollection.get(componentId.getComponentName() + "-data"), this.cte/* tsiPortId */); FilterPackets fp = new FilterPackets(filter, componentId,ComponentCollection.get(componentId.getComponentName()+"-data"), this.cte/*tsiPortId*/); ComponentCollectionFilter2Port.put(componentId.getComponentName(), fp); } catch (Exception e) { // TODO Auto-generated catch block Loading @@ -195,8 +201,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt case 3:/*START_CAPTURE_REQ = 0x0003; /**< ID of StartCaptureRequest */ log.info("StartCaptureREQ: " + componentId.getComponentName()); log.info("StartCaptureREQ: ComponentCollectionFilter2Port=" + ComponentCollectionFilter2Port.size()); byte[] startcapresp = { 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 };/* START_CAPTURE_REP = 0x0004; /**< ID of StartCaptureReply */ byte[] startcapresp= {0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};/*START_CAPTURE_REP = 0x0004; /**< ID of StartCaptureReply */ if (!ComponentCollectionFilter2Port.isEmpty()) { Loading @@ -207,10 +212,8 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt try{ String key = (String) keys.nextElement(); FilterPackets fp = ComponentCollectionFilter2Port.get(key); log.info("StartCaptureREQ: launch ReadCaptureThread for component " + fp.componentId.getComponentName()); ReadCaptureThread t = new ReadCaptureThread(fp.componentId.getComponentName(), log, tracefile, fp); log.info("StartCaptureREQ: launch ReadCaptureThread for component " + fp.componentId.getComponentName()); ReadCaptureThread t = new ReadCaptureThread (fp.componentId.getComponentName(),log, tracefile,fp); t.join(1000); Thread.sleep(100); }catch(Exception e){ Loading @@ -226,8 +229,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt case 5:/*STOP_CAPTURE_REQ = 0x0005; /**< ID of StopCaptureRequest */ log.info("StopCaptureREQ"); byte[] stopcapresp = { 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 };/* STOP_CAPTURE_REP = 0x0006; /**< ID of StopCaptureReply */ byte[] stopcapresp= {0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};/*STOP_CAPTURE_REP = 0x0006; /**< ID of StopCaptureReply */ if (!ComponentCollectionFilter2Port.isEmpty()) { Loading Loading @@ -264,10 +266,9 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt if (componentId.getComponentName().equals("MTC")){ //result = send(packet); result = true; } else { // for selection sequence to which PTC first send resonse //FILTER_REQ - // FILTER_REP //log.debug(FilterMsgFIFO.size()); } else{ //for selection sequence to which PTC first send resonse //FILTER_REQ - FILTER_REP //FilterMsgFIFO.add(componentId); //result = send(packet); result = true; Loading Loading @@ -298,8 +299,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt if(tsiPortId.getPortName().equals("acPort")){ if (comPortId.getComponent().getComponentName().equals("MTC")){ // ComponentCollection.remove(comPortId.getComponent().getComponentName(), // tsiPortId); //ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); result = true;//disconnect(); }else{ ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); Loading @@ -307,17 +307,20 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt //log.debug(ComponentCollection.elements().toString()); result = true; //assume MTC acport was successfully connected } } else if (tsiPortId.getPortName().equals("sipPort")) { }else if (tsiPortId.getPortName().equals("sipPort")){ ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); ComponentCollectionCompPort.remove(comPortId.getComponent().getComponentName()+"-data", comPortId); //log.debug(ComponentCollection.elements().toString()); result = true; //assume MTC acport was successfully connected } else if (tsiPortId.getPortName().equals("diameterPort")) { }else if (tsiPortId.getPortName().equals("diameterPort")){ ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); ComponentCollectionCompPort.remove(comPortId.getComponent().getComponentName()+"-data", comPortId); //log.debug(ComponentCollection.elements().toString()); result = true; //assume MTC acport was successfully connected } else if (tsiPortId.getPortName().equals("dPort")) { }else if (tsiPortId.getPortName().equals("dPort")){ ComponentCollection.remove(comPortId.getComponent().getComponentName(), tsiPortId); ComponentCollectionCompPort.remove(comPortId.getComponent().getComponentName()+"-d", comPortId); //log.debug(ComponentCollection.elements().toString()); Loading Loading @@ -345,7 +348,7 @@ public class IotConnectionOffline extends Thread/* PCAP */ implements LocalAdapt int iotmsg = ((buffer[0] & 0xFF))|((buffer[1] & 0xFF) << 8);//iot message type byte[] message = new byte[packetLength]; log.debug("IOT MSG TYPE "+iotmsg); if (iotmsg==1){ //CAPTURE_DATA_IND byte[] packetb = new byte[packetLength-0x1b]; System.arraycopy(buffer,0x1b, packetb, 0, packetLength-0x1b); Loading