@Test(expected = Exception.class) public void testRun() throws Exception { isisInterface.setNetworkType(IsisNetworkType.P2P); isisInterface.setCircuitId(circuitId); isisInterface.setSystemId(systemId); isisInterface.setAreaAddress("490001"); isisInterface.setInterfaceIpAddress(interfaceAddress); isisHelloPduSender = new IsisHelloPduSender(channel, isisInterface); isisHelloPduSender.run(); assertThat(isisHelloPduSender, is(notNullValue())); isisInterface1.setNetworkType(IsisNetworkType.BROADCAST); isisInterface1.setCircuitId(circuitId); isisInterface1.setSystemId(systemId); isisInterface1.setAreaAddress(areaId); isisInterface1.setInterfaceIpAddress(interfaceAddress); isisInterface1.setReservedPacketCircuitType(1); isisInterface1.setL1LanId(lanId); isisHelloPduSender1 = new IsisHelloPduSender(channel, isisInterface1); isisHelloPduSender1.run(); assertThat(isisHelloPduSender1, is(notNullValue())); isisInterface1.setNetworkType(IsisNetworkType.BROADCAST); isisInterface1.setCircuitId(circuitId); isisInterface1.setSystemId(systemId); isisInterface1.setAreaAddress(areaId); isisInterface1.setInterfaceIpAddress(interfaceAddress); isisInterface1.setReservedPacketCircuitType(2); isisInterface1.setL2LanId(lanId); isisHelloPduSender1 = new IsisHelloPduSender(channel, isisInterface1); isisHelloPduSender1.run(); assertThat(isisHelloPduSender1, is(notNullValue())); isisInterface1.setNetworkType(IsisNetworkType.BROADCAST); isisInterface1.setCircuitId(circuitId); isisInterface1.setSystemId(systemId); isisInterface1.setAreaAddress(areaId); isisInterface1.setInterfaceIpAddress(interfaceAddress); isisInterface1.setReservedPacketCircuitType(3); isisInterface1.setL1LanId(lanId); isisInterface1.setL2LanId(lanId); isisHelloPduSender1 = new IsisHelloPduSender(channel, isisInterface1); isisHelloPduSender1.run(); assertThat(isisHelloPduSender1, is(notNullValue())); }
@Override public void run() { if (channel != null && channel.isConnected() && channel.isOpen()) { try { byte[] helloPdu = null; byte[] interfaceIndex = {(byte) isisInterface.interfaceIndex()}; if (isisInterface.networkType() == IsisNetworkType.P2P) { helloPdu = IsisUtil.getP2pHelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST) { switch (IsisRouterType.get(isisInterface.reservedPacketCircuitType())) { case L1: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L2: helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L1L2: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; default: log.debug("IsisHelloPduSender::Unknown circuit type...!!!"); break; } } } catch (Exception e) { log.debug("Exception @IsisHelloPduSender:: {}", e.getMessage()); } } }
IsisHelloPduSender implements Runnable { @Override public void run() { if (channel != null && channel.isConnected() && channel.isOpen()) { try { byte[] helloPdu = null; byte[] interfaceIndex = {(byte) isisInterface.interfaceIndex()}; if (isisInterface.networkType() == IsisNetworkType.P2P) { helloPdu = IsisUtil.getP2pHelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST) { switch (IsisRouterType.get(isisInterface.reservedPacketCircuitType())) { case L1: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L2: helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L1L2: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; default: log.debug("IsisHelloPduSender::Unknown circuit type...!!!"); break; } } } catch (Exception e) { log.debug("Exception @IsisHelloPduSender:: {}", e.getMessage()); } } } }
IsisHelloPduSender implements Runnable { @Override public void run() { if (channel != null && channel.isConnected() && channel.isOpen()) { try { byte[] helloPdu = null; byte[] interfaceIndex = {(byte) isisInterface.interfaceIndex()}; if (isisInterface.networkType() == IsisNetworkType.P2P) { helloPdu = IsisUtil.getP2pHelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST) { switch (IsisRouterType.get(isisInterface.reservedPacketCircuitType())) { case L1: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L2: helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L1L2: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; default: log.debug("IsisHelloPduSender::Unknown circuit type...!!!"); break; } } } catch (Exception e) { log.debug("Exception @IsisHelloPduSender:: {}", e.getMessage()); } } } IsisHelloPduSender(Channel channel, IsisInterface isisInterface); }
IsisHelloPduSender implements Runnable { @Override public void run() { if (channel != null && channel.isConnected() && channel.isOpen()) { try { byte[] helloPdu = null; byte[] interfaceIndex = {(byte) isisInterface.interfaceIndex()}; if (isisInterface.networkType() == IsisNetworkType.P2P) { helloPdu = IsisUtil.getP2pHelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST) { switch (IsisRouterType.get(isisInterface.reservedPacketCircuitType())) { case L1: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L2: helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L1L2: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; default: log.debug("IsisHelloPduSender::Unknown circuit type...!!!"); break; } } } catch (Exception e) { log.debug("Exception @IsisHelloPduSender:: {}", e.getMessage()); } } } IsisHelloPduSender(Channel channel, IsisInterface isisInterface); @Override void run(); }
IsisHelloPduSender implements Runnable { @Override public void run() { if (channel != null && channel.isConnected() && channel.isOpen()) { try { byte[] helloPdu = null; byte[] interfaceIndex = {(byte) isisInterface.interfaceIndex()}; if (isisInterface.networkType() == IsisNetworkType.P2P) { helloPdu = IsisUtil.getP2pHelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST) { switch (IsisRouterType.get(isisInterface.reservedPacketCircuitType())) { case L1: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L2: helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; case L1L2: helloPdu = IsisUtil.getL1HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); helloPdu = IsisUtil.getL2HelloPdu(isisInterface, true); helloPdu = Bytes.concat(helloPdu, interfaceIndex); channel.write(helloPdu); break; default: log.debug("IsisHelloPduSender::Unknown circuit type...!!!"); break; } } } catch (Exception e) { log.debug("Exception @IsisHelloPduSender:: {}", e.getMessage()); } } } IsisHelloPduSender(Channel channel, IsisInterface isisInterface); @Override void run();  }