當前位置: 首頁>>代碼示例>>Java>>正文


Java LsaHeader.lsType方法代碼示例

本文整理匯總了Java中org.onosproject.ospf.protocol.lsa.LsaHeader.lsType方法的典型用法代碼示例。如果您正苦於以下問題:Java LsaHeader.lsType方法的具體用法?Java LsaHeader.lsType怎麽用?Java LsaHeader.lsType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.onosproject.ospf.protocol.lsa.LsaHeader的用法示例。


在下文中一共展示了LsaHeader.lsType方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getLsAckBodyAsByteArray

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Gets LsAck body as byte array.
 *
 * @return byte array
 */
public byte[] getLsAckBodyAsByteArray() {
    List<Byte> bodyLst = new ArrayList<>();

    try {
        for (LsaHeader lsaHeader : linkStateHeaders) {
            if (lsaHeader.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA ||
                    lsaHeader.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA ||
                    lsaHeader.lsType() == OspfParameters.AS_OPAQUE_LSA) {
                OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader;
                bodyLst.addAll(Bytes.asList(header.getOpaqueLsaHeaderAsByteArray()));
            } else {
                bodyLst.addAll(Bytes.asList(lsaHeader.getLsaHeaderAsByteArray()));
            }
        }
    } catch (Exception e) {
        log.debug("Error::getLsAckBodyAsByteArray {}", e.getMessage());
        return Bytes.toArray(bodyLst);
    }

    return Bytes.toArray(bodyLst);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:27,代碼來源:LsAcknowledge.java

示例2: getLsaKey

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Gets the LSDB LSA key from Lsa Header.
 *
 * @param lsaHeader LSA header instance
 * @return key
 */
public String getLsaKey(LsaHeader lsaHeader) {
    String lsaKey = "";
    switch (lsaHeader.lsType()) {
        case OspfParameters.LINK_LOCAL_OPAQUE_LSA:
        case OspfParameters.AREA_LOCAL_OPAQUE_LSA:
        case OspfParameters.AS_OPAQUE_LSA:
            OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader;
            lsaKey = lsaHeader.lsType() + "-" + header.opaqueType() + header.opaqueId() + "-" +
                    lsaHeader.advertisingRouter();
            break;
        case OspfParameters.ROUTER:
        case OspfParameters.NETWORK:
        case OspfParameters.ASBR_SUMMARY:
        case OspfParameters.SUMMARY:
        case OspfParameters.EXTERNAL_LSA:
            lsaKey = lsaHeader.lsType() + "-" + lsaHeader.linkStateId() + "-" +
                    lsaHeader.advertisingRouter();
            break;
        default:
            log.debug("Unknown LSA type..!!!");
            break;
    }

    return lsaKey;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:32,代碼來源:OspfLsdbImpl.java

示例3: getDdBodyAsByteArray

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Gets DD body as byte array.
 *
 * @return DD body
 */
public byte[] getDdBodyAsByteArray() {
    List<Byte> bodyLst = new ArrayList<>();

    try {
        bodyLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.imtu())));
        bodyLst.add((byte) this.options());

        StringBuilder sb = new StringBuilder();
        sb.append(this.isInitialize());
        sb.append(this.isMore());
        sb.append(this.isMaster());

        bodyLst.add((byte) Integer.parseInt(sb.toString(), 2));
        bodyLst.addAll(Bytes.asList(OspfUtil.convertToFourBytes(this.sequenceNo()))); // passing long value

        for (LsaHeader lsaHeader : lsaHeaderList) {
            if (lsaHeader.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA ||
                    lsaHeader.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA ||
                    lsaHeader.lsType() == OspfParameters.AS_OPAQUE_LSA) {
                OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader;
                bodyLst.addAll(Bytes.asList(header.getOpaqueLsaHeaderAsByteArray()));
            } else {
                bodyLst.addAll(Bytes.asList(lsaHeader.getLsaHeaderAsByteArray()));
            }
        }
    } catch (Exception e) {
        log.debug("Error::getLsrBodyAsByteArray {}", e.getMessage());
        return Bytes.toArray(bodyLst);
    }

    return Bytes.toArray(bodyLst);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:38,代碼來源:DdPacket.java

示例4: processRefreshLsa

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Process refresh LSA.
 *
 * @param wrapper LSA wrapper instance
 */
private void processRefreshLsa(LsaWrapper wrapper) throws Exception {
    if (wrapper.isSelfOriginated()) { //self originated
        //set the destination
        OspfInterface ospfInterface = wrapper.ospfInterface();
        if (ospfInterface != null) {
            LsaHeader header = ((LsaWrapperImpl) wrapper).lsaHeader();
            header.setAge(wrapper.currentAge());
            if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.DR) {
                if (header.lsType() == OspfLsaType.ROUTER.value()) {
                    RouterLsa routerLsa = ((OspfAreaImpl) ospfArea).buildRouterLsa(ospfInterface);
                    ((OspfAreaImpl) ospfArea).addLsa(routerLsa, true, ospfInterface);
                    ((OspfAreaImpl) ospfArea).addToOtherNeighborLsaTxList(routerLsa);
                } else if (header.lsType() == OspfLsaType.NETWORK.value()) {
                    if (ospfInterface.listOfNeighbors().size() > 0) {
                        NetworkLsa networkLsa = ((OspfAreaImpl) ospfArea).buildNetworkLsa(
                                ospfInterface.ipAddress(), ospfInterface.ipNetworkMask());
                        ospfArea.addLsa(networkLsa, true, ospfInterface);
                        ((OspfAreaImpl) ospfArea).addToOtherNeighborLsaTxList(networkLsa);
                    }
                }
            }

            if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.BDR ||
                    ((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.POINT2POINT ||
                    ((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.DROTHER) {
                ospfArea.refreshArea(ospfInterface);
            }
            log.debug("LSAQueueConsumer: processRefreshLsa - Flooded SelfOriginated LSA {}",
                      ((LsaWrapperImpl) wrapper).lsaHeader());
        }
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:38,代碼來源:LsaQueueConsumer.java

示例5: deleteLsa

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Deletes the given LSA.
 *
 * @param lsaHeader LSA header instance
 */
public void deleteLsa(LsaHeader lsaHeader) {

    String lsaKey = getLsaKey(lsaHeader);
    switch (lsaHeader.lsType()) {
        case OspfParameters.LINK_LOCAL_OPAQUE_LSA:
            opaque9Lsas.remove(lsaKey);
            break;
        case OspfParameters.AREA_LOCAL_OPAQUE_LSA:
            opaque10Lsas.remove(lsaKey);
            break;
        case OspfParameters.AS_OPAQUE_LSA:
            opaque11Lsas.remove(lsaKey);
            break;
        case OspfParameters.ROUTER:
            routerLsas.remove(lsaKey);
            break;
        case OspfParameters.NETWORK:
            networkLsas.remove(lsaKey);
            break;
        case OspfParameters.ASBR_SUMMARY:
            asbrSummaryLSAs.remove(lsaKey);
            break;
        case OspfParameters.SUMMARY:
            summaryLsas.remove(lsaKey);
            break;
        case OspfParameters.EXTERNAL_LSA:
            externalLsas.remove(lsaKey);
            break;
        default:
            log.debug("Unknown LSA type to delete..!!!");
            break;
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:39,代碼來源:OspfLsdbImpl.java

示例6: addLsaHeaderForDelayAck

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Adds LSAHeader to map.
 *
 * @param lsaHeader LSA header instance
 */
public void addLsaHeaderForDelayAck(LsaHeader lsaHeader) {
    String key = lsaHeader.lsType() + "-" + lsaHeader.linkStateId() + "-" +
            lsaHeader.advertisingRouter();
    if (lsaHeader.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA ||
            lsaHeader.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA ||
            lsaHeader.lsType() == OspfParameters.AS_OPAQUE_LSA) {
        OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader;
        key = lsaHeader.lsType() + "-" + header.opaqueType() + header.opaqueId()
                + "-" + lsaHeader.advertisingRouter();
    }

    log.debug("Adding LSA key {} for delayed Ack", key);
    listOfNeighborMap.put(key, lsaHeader);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:20,代碼來源:OspfInterfaceImpl.java

示例7: processRefreshLsa

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Process refresh LSA.
 *
 * @param wrapper LSA wrapper instance
 */
private void processRefreshLsa(LsaWrapper wrapper) throws OspfParseException {
    if (wrapper.isSelfOriginated()) { //self originated
        //set the destination
        OspfInterface ospfInterface = wrapper.ospfInterface();
        if (ospfInterface != null) {
            LsaHeader header = ((LsaWrapperImpl) wrapper).lsaHeader();
            header.setAge(wrapper.currentAge());
            if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.DR) {
                if (header.lsType() == OspfLsaType.ROUTER.value()) {
                    RouterLsa routerLsa = ((OspfAreaImpl) ospfArea).buildRouterLsa(ospfInterface);
                    ((OspfAreaImpl) ospfArea).addLsa(routerLsa, true, ospfInterface);
                    ((OspfAreaImpl) ospfArea).addToOtherNeighborLsaTxList(routerLsa);
                } else if (header.lsType() == OspfLsaType.NETWORK.value()) {
                    if (ospfInterface.listOfNeighbors().size() > 0) {
                        NetworkLsa networkLsa = ((OspfAreaImpl) ospfArea).buildNetworkLsa(
                                ospfInterface.ipAddress(), ospfInterface.ipNetworkMask());
                        ospfArea.addLsa(networkLsa, true, ospfInterface);
                        ((OspfAreaImpl) ospfArea).addToOtherNeighborLsaTxList(networkLsa);
                    }
                }
            }

            if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.BDR ||
                    ((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.POINT2POINT ||
                    ((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.DROTHER) {
                ospfArea.refreshArea(ospfInterface);
            }
            log.debug("LSAQueueConsumer: processRefreshLsa - Flooded SelfOriginated LSA {}",
                      ((LsaWrapperImpl) wrapper).lsaHeader());
        }
    }
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:38,代碼來源:LsaQueueConsumer.java

示例8: addLsaHeaderForDelayAck

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Adds LSA header to map.
 *
 * @param lsaHeader LSA header instance
 */
public void addLsaHeaderForDelayAck(LsaHeader lsaHeader) {
    String key = lsaHeader.lsType() + "-" + lsaHeader.linkStateId() + "-" +
            lsaHeader.advertisingRouter();
    if (lsaHeader.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA ||
            lsaHeader.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA ||
            lsaHeader.lsType() == OspfParameters.AS_OPAQUE_LSA) {
        OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader;
        key = lsaHeader.lsType() + "-" + header.opaqueType() + header.opaqueId()
                + "-" + lsaHeader.advertisingRouter();
    }

    log.debug("Adding LSA key {} for delayed Ack", key);
    listOfNeighborMap.put(key, lsaHeader);
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:20,代碼來源:OspfInterfaceImpl.java

示例9: readFrom

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
@Override
public void readFrom(ChannelBuffer channelBuffer) throws OspfParseException {
    try {
        //From header 4 bytes is number of lsa's
        this.setNumberOfLsa(channelBuffer.readInt());
        //get the remaining bytes represents Number of LSA's present. Add all the LSA's
        while (channelBuffer.readableBytes() > OspfUtil.LSA_HEADER_LENGTH) {

            LsaHeader header = OspfUtil.readLsaHeader(channelBuffer.readBytes(OspfUtil.LSA_HEADER_LENGTH));
            int lsaLength = header.lsPacketLen();
            int lsType = header.lsType();

            switch (lsType) {
                case OspfParameters.LINK_LOCAL_OPAQUE_LSA:
                    OpaqueLsa9 opaqueLsa9 = new OpaqueLsa9((OpaqueLsaHeader) header);
                    opaqueLsa9.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH));
                    addLsa(opaqueLsa9);
                    break;
                case OspfParameters.AREA_LOCAL_OPAQUE_LSA:
                    OpaqueLsa10 opaqueLsa10 = new OpaqueLsa10((OpaqueLsaHeader) header);
                    opaqueLsa10.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH));
                    addLsa(opaqueLsa10);
                    break;
                case OspfParameters.AS_OPAQUE_LSA:
                    OpaqueLsa11 opaqueLsa11 = new OpaqueLsa11((OpaqueLsaHeader) header);
                    opaqueLsa11.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH));
                    addLsa(opaqueLsa11);
                    break;
                case OspfParameters.ROUTER:
                    RouterLsa routerLsa = new RouterLsa(header);
                    routerLsa.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH));
                    addLsa(routerLsa);
                    break;
                case OspfParameters.NETWORK:
                    NetworkLsa networkLsa = new NetworkLsa(header);
                    networkLsa.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH));
                    addLsa(networkLsa);
                    break;
                case OspfParameters.ASBR_SUMMARY:
                    AsbrSummaryLsa asbrSummaryLsa = new AsbrSummaryLsa(header);
                    asbrSummaryLsa.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH));
                    addLsa(asbrSummaryLsa);
                    break;
                case OspfParameters.SUMMARY:
                    SummaryLsa summaryLsa = new SummaryLsa(header);
                    summaryLsa.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH));
                    addLsa(summaryLsa);
                    break;
                case OspfParameters.EXTERNAL_LSA:
                    ExternalLsa externalLsa = new ExternalLsa(header);
                    externalLsa.readFrom(channelBuffer.readBytes(lsaLength - OspfUtil.LSA_HEADER_LENGTH));
                    addLsa(externalLsa);
                    break;
                default:
                    log.debug("LSUpdate::readLsUpdateBody::UnKnown LS Type: {}", lsType);
                    break;
            }
        }
    } catch (Exception e) {
        log.debug("Error::LsUpdate:: {}", e.getMessage());
        throw new OspfParseException(OspfErrorType.MESSAGE_HEADER_ERROR, OspfErrorType.BAD_MESSAGE_LENGTH);
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:64,代碼來源:LsUpdate.java

示例10: addToOtherNeighborLsaTxList

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Adds the received LSA in other neighbors tx list.
 *
 * @param recLsa LSA Header instance
 */
public void addToOtherNeighborLsaTxList(LsaHeader recLsa) {
    //Add the received LSA in other neighbors retransmission list.
    log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList");
    List<OspfInterface> ospfInterfaces = ospfInterfaceList();
    for (OspfInterface ospfInterfaceFromArea : ospfInterfaces) {
        Map neighbors = ospfInterfaceFromArea.listOfNeighbors();
        for (Object neighborIP : neighbors.keySet()) {
            OspfNbrImpl nbr = (OspfNbrImpl) neighbors.get(neighborIP);
            if (nbr.getState().getValue() < OspfNeighborState.EXCHANGE.getValue()) {
                continue;
            }
            String key = database.getLsaKey(recLsa);
            if (nbr.getState() == OspfNeighborState.EXCHANGE || nbr.getState() == OspfNeighborState.LOADING) {
                if (nbr.getLsReqList().containsKey(key)) {
                    LsaWrapper lsWrapper = lsaLookup(recLsa);
                    if (lsWrapper != null) {
                        LsaHeader ownLsa = (LsaHeader) lsWrapper.ospfLsa();
                        String status = isNewerOrSameLsa(recLsa, ownLsa);
                        if (status.equals("old")) {
                            continue;
                        } else if (status.equals("same")) {
                            log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList: " +
                                              "Removing lsa from reTxtList {}", key);
                            nbr.getLsReqList().remove(key);
                            continue;
                        } else {
                            log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList: " +
                                              "Removing lsa from reTxtList {}", key);
                            nbr.getLsReqList().remove(key);
                        }
                    }
                }
            }
            if (recLsa.advertisingRouter().equals((String) neighborIP)) {
                continue;
            }
            if ((recLsa.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA ||
                    recLsa.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA)) {
                if (nbr.isOpaqueCapable()) {
                    log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList: Adding lsa to reTxtList {}",
                              recLsa);
                    nbr.getReTxList().put(key, recLsa);
                }
            } else {
                log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList: Adding lsa to reTxtList {}",
                          recLsa);
                nbr.getReTxList().put(key, recLsa);
            }
        }
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:57,代碼來源:OspfAreaImpl.java

示例11: populateLsaLists

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Populates the LSA lists based on the input.
 *
 * @param header LSA header instance
 * @param area   OSPF area instance
 */
private void populateLsaLists(LsaHeader header, OspfArea area) {
    String seqNo = Long.toHexString(header.lsSequenceNo());
    String checkSum = Long.toHexString(header.lsCheckSum());
    if (seqNo.length() == 16) {
        seqNo = seqNo.substring(8, seqNo.length());
    }
    if (checkSum.length() == 16) {
        checkSum = checkSum.substring(8, checkSum.length());
    }
    StringBuffer strBuf = getBuffList(area.areaId().toString(), area.routerId().toString(),
                                      header.linkStateId(),
                                      header.advertisingRouter().toString(),
                                      header.age(), seqNo, checkSum);
    if (header.lsType() == OspfLsaType.ROUTER.value()) {
        strBuf.append(",");
        strBuf.append(((RouterLsa) header).noLink());
        routerLsa.add(strBuf.toString());
    } else if (header.lsType() == OspfLsaType.NETWORK.value()) {
        strBuf.append(",");
        strBuf.append("0");
        networkLsa.add(strBuf.toString());
    } else if (header.lsType() == OspfLsaType.SUMMARY.value()) {
        strBuf.append(",");
        strBuf.append("0");
        summaryLsa.add(strBuf.toString());
    } else if (header.lsType() == OspfLsaType.EXTERNAL_LSA.value()) {
        strBuf.append(",");
        strBuf.append("0");
        externalLsa.add(strBuf.toString());
    } else if (header.lsType() == OspfLsaType.ASBR_SUMMARY.value()) {
        strBuf.append(",");
        strBuf.append("0");
        asbrSumm.add(strBuf.toString());
    } else if (header.lsType() == OspfLsaType.AREA_LOCAL_OPAQUE_LSA.value()) {
        strBuf.append(",");
        strBuf.append("0");
        areaLocalOpaqLsa.add(strBuf.toString());
    } else if (header.lsType() == OspfLsaType.LINK_LOCAL_OPAQUE_LSA.value()) {
        strBuf.append(",");
        strBuf.append("0");
        linkLocalOpqLsa.add(strBuf.toString());
    } else if (header.lsType() == OspfLsaType.AS_OPAQUE_LSA.value()) {
        strBuf.append(",");
        strBuf.append("0");
        asOpqLsa.add(strBuf.toString());
    } else {
        strBuf.append(",");
        strBuf.append("0");
        undefinedLsa.add(strBuf.toString());
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:58,代碼來源:ApplicationOspfCommand.java

示例12: addToOtherNeighborLsaTxList

import org.onosproject.ospf.protocol.lsa.LsaHeader; //導入方法依賴的package包/類
/**
 * Adds the received LSA in other neighbors tx list.
 *
 * @param recLsa LSA Header instance
 */
public void addToOtherNeighborLsaTxList(LsaHeader recLsa) {
    //Add the received LSA in other neighbors retransmission list.
    log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList");
    List<OspfInterface> ospfInterfaces = ospfInterfaceList();
    for (OspfInterface ospfInterfaceFromArea : ospfInterfaces) {
        Map neighbors = ospfInterfaceFromArea.listOfNeighbors();
        for (Object neighborIP : neighbors.keySet()) {
            OspfNbrImpl nbr = (OspfNbrImpl) neighbors.get(neighborIP);
            if (nbr.getState().getValue() < OspfNeighborState.EXCHANGE.getValue()) {
                continue;
            }
            String key = database.getLsaKey(recLsa);
            if (nbr.getState() == OspfNeighborState.EXCHANGE || nbr.getState() == OspfNeighborState.LOADING) {
                if (nbr.getLsReqList().containsKey(key)) {
                    LsaWrapper lsWrapper = lsaLookup(recLsa);
                    if (lsWrapper != null) {
                        LsaHeader ownLsa = (LsaHeader) lsWrapper.ospfLsa();
                        String status = isNewerOrSameLsa(recLsa, ownLsa);
                        if (status.equals("old")) {
                            continue;
                        } else if (status.equals("same")) {
                            log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList: " +
                                              "Removing lsa from reTxtList {}", key);
                            nbr.getLsReqList().remove(key);
                            continue;
                        } else {
                            log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList: " +
                                              "Removing lsa from reTxtList {}", key);
                            nbr.getLsReqList().remove(key);
                        }
                    }
                }
            }
            if (recLsa.advertisingRouter().toString().equals((String) neighborIP)) {
                continue;
            }
            if ((recLsa.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA ||
                    recLsa.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA)) {
                if (nbr.isOpaqueCapable()) {
                    log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList: Adding lsa to reTxtList {}",
                              recLsa);
                    nbr.getReTxList().put(key, recLsa);
                }
            } else {
                log.debug("OspfAreaImpl: addToOtherNeighborLsaTxList: Adding lsa to reTxtList {}",
                          recLsa);
                nbr.getReTxList().put(key, recLsa);
            }
        }
    }
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:57,代碼來源:OspfAreaImpl.java


注:本文中的org.onosproject.ospf.protocol.lsa.LsaHeader.lsType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。