@Test(expected = Exception.class) public void testProcessL1L2HelloPduMessage() throws Exception { helloPdu = new L1L2HelloPdu(isisHeader); helloPdu.setSourceMac(macAddress1); helloPdu.setCircuitType((byte) IsisRouterType.L2.value()); defaultIsisInterface.processL1L2HelloPduMessage(helloPdu, channel); assertThat(defaultIsisInterface, is(notNullValue())); }
public void processL1L2HelloPduMessage(IsisMessage isisMessage, Channel channel) { log.debug("Enters processL1L2HelloPduMessage ...!!!"); log.debug("IsisInterfaceImpl::processHelloMessage...!!!"); L1L2HelloPdu helloPacket = (L1L2HelloPdu) isisMessage; log.debug("IsisInterfaceImpl::processHelloMessage::Interface Type {} ISISInterfaceState {} ", networkType, interfaceState); if (!validateHelloMessage(helloPacket)) { return; } IsisNeighbor neighbor = neighbouringRouter(isisMessage.sourceMac()); if (!isNeighborInList(isisMessage.sourceMac())) { neighbor = new DefaultIsisNeighbor(helloPacket, this); addNeighbouringRouter(neighbor); } neighbor.setHoldingTime(helloPacket.holdingTime()); neighbor.stopInactivityTimeCheck(); neighbor.startInactivityTimeCheck(); String lanId = helloPacket.lanId(); if (IsisPduType.L1HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l1LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l1LanId = lanId; neighbor.setL1LanId(lanId); } else if (IsisPduType.L2HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l2LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l2LanId = lanId; neighbor.setL2LanId(lanId); } List<MacAddress> neighbors = helloPacket.neighborList(); if (neighbors != null) { for (MacAddress macAddress : neighbors) { if (interfaceMacAddress.equals(macAddress)) { neighbor.setNeighborState(IsisInterfaceState.UP); buildStoreAndSendSelfGeneratedLspIfNotExistInDb(channel, IsisRouterType.get(helloPacket.circuitType())); break; } } } }
DefaultIsisInterface implements IsisInterface { public void processL1L2HelloPduMessage(IsisMessage isisMessage, Channel channel) { log.debug("Enters processL1L2HelloPduMessage ...!!!"); log.debug("IsisInterfaceImpl::processHelloMessage...!!!"); L1L2HelloPdu helloPacket = (L1L2HelloPdu) isisMessage; log.debug("IsisInterfaceImpl::processHelloMessage::Interface Type {} ISISInterfaceState {} ", networkType, interfaceState); if (!validateHelloMessage(helloPacket)) { return; } IsisNeighbor neighbor = neighbouringRouter(isisMessage.sourceMac()); if (!isNeighborInList(isisMessage.sourceMac())) { neighbor = new DefaultIsisNeighbor(helloPacket, this); addNeighbouringRouter(neighbor); } neighbor.setHoldingTime(helloPacket.holdingTime()); neighbor.stopInactivityTimeCheck(); neighbor.startInactivityTimeCheck(); String lanId = helloPacket.lanId(); if (IsisPduType.L1HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l1LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l1LanId = lanId; neighbor.setL1LanId(lanId); } else if (IsisPduType.L2HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l2LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l2LanId = lanId; neighbor.setL2LanId(lanId); } List<MacAddress> neighbors = helloPacket.neighborList(); if (neighbors != null) { for (MacAddress macAddress : neighbors) { if (interfaceMacAddress.equals(macAddress)) { neighbor.setNeighborState(IsisInterfaceState.UP); buildStoreAndSendSelfGeneratedLspIfNotExistInDb(channel, IsisRouterType.get(helloPacket.circuitType())); break; } } } } }
DefaultIsisInterface implements IsisInterface { public void processL1L2HelloPduMessage(IsisMessage isisMessage, Channel channel) { log.debug("Enters processL1L2HelloPduMessage ...!!!"); log.debug("IsisInterfaceImpl::processHelloMessage...!!!"); L1L2HelloPdu helloPacket = (L1L2HelloPdu) isisMessage; log.debug("IsisInterfaceImpl::processHelloMessage::Interface Type {} ISISInterfaceState {} ", networkType, interfaceState); if (!validateHelloMessage(helloPacket)) { return; } IsisNeighbor neighbor = neighbouringRouter(isisMessage.sourceMac()); if (!isNeighborInList(isisMessage.sourceMac())) { neighbor = new DefaultIsisNeighbor(helloPacket, this); addNeighbouringRouter(neighbor); } neighbor.setHoldingTime(helloPacket.holdingTime()); neighbor.stopInactivityTimeCheck(); neighbor.startInactivityTimeCheck(); String lanId = helloPacket.lanId(); if (IsisPduType.L1HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l1LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l1LanId = lanId; neighbor.setL1LanId(lanId); } else if (IsisPduType.L2HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l2LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l2LanId = lanId; neighbor.setL2LanId(lanId); } List<MacAddress> neighbors = helloPacket.neighborList(); if (neighbors != null) { for (MacAddress macAddress : neighbors) { if (interfaceMacAddress.equals(macAddress)) { neighbor.setNeighborState(IsisInterfaceState.UP); buildStoreAndSendSelfGeneratedLspIfNotExistInDb(channel, IsisRouterType.get(helloPacket.circuitType())); break; } } } }  }
DefaultIsisInterface implements IsisInterface { public void processL1L2HelloPduMessage(IsisMessage isisMessage, Channel channel) { log.debug("Enters processL1L2HelloPduMessage ...!!!"); log.debug("IsisInterfaceImpl::processHelloMessage...!!!"); L1L2HelloPdu helloPacket = (L1L2HelloPdu) isisMessage; log.debug("IsisInterfaceImpl::processHelloMessage::Interface Type {} ISISInterfaceState {} ", networkType, interfaceState); if (!validateHelloMessage(helloPacket)) { return; } IsisNeighbor neighbor = neighbouringRouter(isisMessage.sourceMac()); if (!isNeighborInList(isisMessage.sourceMac())) { neighbor = new DefaultIsisNeighbor(helloPacket, this); addNeighbouringRouter(neighbor); } neighbor.setHoldingTime(helloPacket.holdingTime()); neighbor.stopInactivityTimeCheck(); neighbor.startInactivityTimeCheck(); String lanId = helloPacket.lanId(); if (IsisPduType.L1HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l1LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l1LanId = lanId; neighbor.setL1LanId(lanId); } else if (IsisPduType.L2HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l2LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l2LanId = lanId; neighbor.setL2LanId(lanId); } List<MacAddress> neighbors = helloPacket.neighborList(); if (neighbors != null) { for (MacAddress macAddress : neighbors) { if (interfaceMacAddress.equals(macAddress)) { neighbor.setNeighborState(IsisInterfaceState.UP); buildStoreAndSendSelfGeneratedLspIfNotExistInDb(channel, IsisRouterType.get(helloPacket.circuitType())); break; } } } }  IsisLsdb isisLsdb(); void setAllConfiguredInterfaceIps(List<Ip4Address> allConfiguredInterfaces); void removeNeighbor(IsisNeighbor isisNeighbor); void removeNeighbors(); IsisNeighbor lookup(MacAddress isisNeighborMac); Set<MacAddress> neighbors(); Channel channel(); int interfaceIndex(); void setInterfaceIndex(int interfaceIndex); Ip4Address interfaceIpAddress(); void setInterfaceIpAddress(Ip4Address interfaceIpAddress); byte[] networkMask(); void setNetworkMask(byte[] networkMask); MacAddress getInterfaceMacAddress(); void setInterfaceMacAddress(MacAddress interfaceMacAddress); String intermediateSystemName(); void setIntermediateSystemName(String intermediateSystemName); String systemId(); void setSystemId(String systemId); String l1LanId(); void setL1LanId(String l1LanId); String l2LanId(); void setL2LanId(String l2LanId); int getIdLength(); void setIdLength(int idLength); int getMaxAreaAddresses(); void setMaxAreaAddresses(int maxAreaAddresses); int reservedPacketCircuitType(); void setReservedPacketCircuitType(int reservedPacketCircuitType); IsisNetworkType networkType(); void setNetworkType(IsisNetworkType networkType); String areaAddress(); void setAreaAddress(String areaAddress); int getAreaLength(); void setAreaLength(int areaLength); int holdingTime(); void setHoldingTime(int holdingTime); int priority(); void setPriority(int priority); int helloInterval(); void setHelloInterval(int helloInterval); IsisInterfaceState interfaceState(); void setInterfaceState(IsisInterfaceState interfaceState); String circuitId(); void setCircuitId(String circuitId); void processIsisMessage(IsisMessage isisMessage, IsisLsdb isisLsdb, Channel channel); boolean validateHelloMessage(HelloPdu helloPdu); void processL1L2HelloPduMessage(IsisMessage isisMessage, Channel channel); void processP2pHelloPduMessage(IsisMessage isisMessage, Channel channel); void processLsPduMessage(IsisMessage isisMessage, Channel channel); void processPsnPduMessage(IsisMessage isisMessage, Channel channel); void processCsnPduMessage(IsisMessage isisMessage, Channel channel); String lspKeyP2P(String systemId); void startHelloSender(Channel channel); void stopHelloSender(); }
DefaultIsisInterface implements IsisInterface { public void processL1L2HelloPduMessage(IsisMessage isisMessage, Channel channel) { log.debug("Enters processL1L2HelloPduMessage ...!!!"); log.debug("IsisInterfaceImpl::processHelloMessage...!!!"); L1L2HelloPdu helloPacket = (L1L2HelloPdu) isisMessage; log.debug("IsisInterfaceImpl::processHelloMessage::Interface Type {} ISISInterfaceState {} ", networkType, interfaceState); if (!validateHelloMessage(helloPacket)) { return; } IsisNeighbor neighbor = neighbouringRouter(isisMessage.sourceMac()); if (!isNeighborInList(isisMessage.sourceMac())) { neighbor = new DefaultIsisNeighbor(helloPacket, this); addNeighbouringRouter(neighbor); } neighbor.setHoldingTime(helloPacket.holdingTime()); neighbor.stopInactivityTimeCheck(); neighbor.startInactivityTimeCheck(); String lanId = helloPacket.lanId(); if (IsisPduType.L1HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l1LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l1LanId = lanId; neighbor.setL1LanId(lanId); } else if (IsisPduType.L2HELLOPDU == helloPacket.isisPduType()) { buildUpdateAndSendSelfGeneratedLspIfDisChange(l2LanId, lanId, channel, IsisRouterType.get(helloPacket.circuitType())); l2LanId = lanId; neighbor.setL2LanId(lanId); } List<MacAddress> neighbors = helloPacket.neighborList(); if (neighbors != null) { for (MacAddress macAddress : neighbors) { if (interfaceMacAddress.equals(macAddress)) { neighbor.setNeighborState(IsisInterfaceState.UP); buildStoreAndSendSelfGeneratedLspIfNotExistInDb(channel, IsisRouterType.get(helloPacket.circuitType())); break; } } } }  IsisLsdb isisLsdb(); void setAllConfiguredInterfaceIps(List<Ip4Address> allConfiguredInterfaces); void removeNeighbor(IsisNeighbor isisNeighbor); void removeNeighbors(); IsisNeighbor lookup(MacAddress isisNeighborMac); Set<MacAddress> neighbors(); Channel channel(); int interfaceIndex(); void setInterfaceIndex(int interfaceIndex); Ip4Address interfaceIpAddress(); void setInterfaceIpAddress(Ip4Address interfaceIpAddress); byte[] networkMask(); void setNetworkMask(byte[] networkMask); MacAddress getInterfaceMacAddress(); void setInterfaceMacAddress(MacAddress interfaceMacAddress); String intermediateSystemName(); void setIntermediateSystemName(String intermediateSystemName); String systemId(); void setSystemId(String systemId); String l1LanId(); void setL1LanId(String l1LanId); String l2LanId(); void setL2LanId(String l2LanId); int getIdLength(); void setIdLength(int idLength); int getMaxAreaAddresses(); void setMaxAreaAddresses(int maxAreaAddresses); int reservedPacketCircuitType(); void setReservedPacketCircuitType(int reservedPacketCircuitType); IsisNetworkType networkType(); void setNetworkType(IsisNetworkType networkType); String areaAddress(); void setAreaAddress(String areaAddress); int getAreaLength(); void setAreaLength(int areaLength); int holdingTime(); void setHoldingTime(int holdingTime); int priority(); void setPriority(int priority); int helloInterval(); void setHelloInterval(int helloInterval); IsisInterfaceState interfaceState(); void setInterfaceState(IsisInterfaceState interfaceState); String circuitId(); void setCircuitId(String circuitId); void processIsisMessage(IsisMessage isisMessage, IsisLsdb isisLsdb, Channel channel); boolean validateHelloMessage(HelloPdu helloPdu); void processL1L2HelloPduMessage(IsisMessage isisMessage, Channel channel); void processP2pHelloPduMessage(IsisMessage isisMessage, Channel channel); void processLsPduMessage(IsisMessage isisMessage, Channel channel); void processPsnPduMessage(IsisMessage isisMessage, Channel channel); void processCsnPduMessage(IsisMessage isisMessage, Channel channel); String lspKeyP2P(String systemId); void startHelloSender(Channel channel); void stopHelloSender();  }