private List<OspfLink> createOspfLinks() { List<OspfLink> links = new ArrayList<OspfLink>(); OspfLink link = createOspfLink( m_node1, "192.168.100.246", "255.255.255.252", 0, 10101, "192.168.100.249", "192.168.100.245", 0); link.setId(1); links.add(link); OspfLink link2 = createOspfLink( m_node2, "192.168.100.245", "255.255.255.252", 0, 10100, "192.168.100.250", "192.168.100.246", 0); link2.setId(2); links.add(link2); return links; }
private List<OspfLink> createChennaiDehliLinks() { List<OspfLink> links = new ArrayList<OspfLink>(); OspfLink link = createOspfLink( m_nodeChennai, "10.205.56.21", "255.255.0.0", 0, 13, "192.168.8.1", "10.205.56.8", 0); link.setId(7); links.add(link); OspfLink link2 = createOspfLink( m_nodeDehli, "10.205.56.8", "255.255.0.0", 0, 13, "192.168.6.1", "10.205.56.21", 0); link2.setId(8); links.add(link2); return links; }
private OspfLink createOspfLink( OnmsNode node, String sourceIpAddr, String sourceIpMask, int addrLessIndex, int ifIndex, String remRouterId, String remIpAddr, int remAddrLessIndex) { final OspfLink ospfLink = new OspfLink(); ospfLink.setNode(node); ospfLink.setOspfIpAddr(InetAddressUtils.addr(sourceIpAddr)); ospfLink.setOspfIpMask(InetAddressUtils.addr(sourceIpMask)); ospfLink.setOspfAddressLessIndex(addrLessIndex); ospfLink.setOspfIfIndex(ifIndex); ospfLink.setOspfRemRouterId(InetAddressUtils.addr(remRouterId)); ospfLink.setOspfRemIpAddr(InetAddressUtils.addr(remIpAddr)); ospfLink.setOspfRemAddressLessIndex(remAddrLessIndex); return ospfLink; }