Beispiel #1
0
 /** Utility for test method. */
 private OspfInterfaceImpl createOspfInterface() throws Exception {
   ospfInterface = new OspfInterfaceImpl();
   LsaHeader lsaHeader = new LsaHeader();
   lsaHeader.setLsType(OspfLsaType.ROUTER.value());
   RouterLsa routerLsa = new RouterLsa();
   OspfAreaImpl ospfArea = new OspfAreaImpl();
   ospfArea.addLsa(routerLsa, true, ospfInterface);
   ospfNbr =
       new OspfNbrImpl(
           ospfArea, ospfInterface, ip4Address5, ip4Address6, 2, topologyForDeviceAndLink);
   ospfNbr.setState(OspfNeighborState.EXSTART);
   ospfNbr.setNeighborId(ip4Address7);
   this.ospfInterface = new OspfInterfaceImpl();
   this.ospfInterface.setIpAddress(ip4Address5);
   this.ospfInterface.setIpNetworkMask(subnetAddress);
   this.ospfInterface.setBdr(ip4Address4);
   this.ospfInterface.setDr(ip4Address4);
   this.ospfInterface.setHelloIntervalTime(20);
   this.ospfInterface.setInterfaceType(2);
   this.ospfInterface.setReTransmitInterval(2000);
   this.ospfInterface.setMtu(6500);
   this.ospfInterface.setRouterDeadIntervalTime(1000);
   this.ospfInterface.setRouterPriority(1);
   this.ospfInterface.setInterfaceType(1);
   this.ospfInterface.setInterfaceIndex(1);
   this.ospfInterface.addNeighbouringRouter(ospfNbr);
   this.ospfInterface.setOspfArea(ospfArea);
   return this.ospfInterface;
 }
Beispiel #2
0
 /** Utility method used by junit methods. */
 private LsaHeader createLsaHeader() {
   lsaHeader = new LsaHeader();
   lsaHeader.setLsType(3);
   lsaHeader.setLsPacketLen(48);
   lsaHeader.setLsCheckSum(10);
   lsaHeader.setAge(4);
   lsaHeader.setLinkStateId("10.226.165.164");
   lsaHeader.setLsSequenceNo(250);
   lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("100.226.165.165"));
   lsaHeader.setOptions(2);
   return lsaHeader;
 }