Search in sources :

Example 1 with TunnelEndPointInfo

use of org.opendaylight.genius.itm.utils.TunnelEndPointInfo in project genius by opendaylight.

the class DpnTepStateCache method getInterfaceFromCache.

public Interface getInterfaceFromCache(String tunnelName) {
    TunnelEndPointInfo endPointInfo = getTunnelEndPointInfoFromCache(tunnelName);
    BigInteger srcDpnId = new BigInteger(endPointInfo.getSrcEndPointInfo());
    BigInteger dstDpnId = new BigInteger(endPointInfo.getDstEndPointInfo());
    Interface iface = null;
    int monitoringInt = 1000;
    DpnTepInterfaceInfo dpnTepInfo = getDpnTepInterface(srcDpnId, dstDpnId);
    if (dpnTepInfo != null) {
        List<DPNTEPsInfo> srcDpnTEPsInfo = dpnTepsInfoCache.getDPNTepListFromDPNId(Collections.singletonList(srcDpnId));
        List<DPNTEPsInfo> dstDpnTEPsInfo = dpnTepsInfoCache.getDPNTepListFromDPNId(Collections.singletonList(dstDpnId));
        iface = ItmUtils.buildTunnelInterface(srcDpnId, tunnelName, String.format("%s %s", ItmUtils.convertTunnelTypetoString(dpnTepInfo.getTunnelType()), "Trunk Interface"), true, dpnTepInfo.getTunnelType(), srcDpnTEPsInfo.get(0).getTunnelEndPoints().get(0).getIpAddress(), dstDpnTEPsInfo.get(0).getTunnelEndPoints().get(0).getIpAddress(), srcDpnTEPsInfo.get(0).getTunnelEndPoints().get(0).getGwIpAddress(), srcDpnTEPsInfo.get(0).getTunnelEndPoints().get(0).getVLANID(), true, dpnTepInfo.isMonitoringEnabled(), TunnelMonitoringTypeBfd.class, monitoringInt, true, null);
    }
    return iface;
}
Also used : TunnelMonitoringTypeBfd(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelMonitoringTypeBfd) BigInteger(java.math.BigInteger) TunnelEndPointInfo(org.opendaylight.genius.itm.utils.TunnelEndPointInfo) DPNTEPsInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo) Interface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface) DpnTepInterfaceInfo(org.opendaylight.genius.itm.utils.DpnTepInterfaceInfo)

Example 2 with TunnelEndPointInfo

use of org.opendaylight.genius.itm.utils.TunnelEndPointInfo in project genius by opendaylight.

the class DpnTepStateCache method addTunnelEndPointInfoToCache.

// Start: TunnelEndPoint Cache accessors
private void addTunnelEndPointInfoToCache(String tunnelName, String srcEndPtInfo, String dstEndPtInfo) {
    TunnelEndPointInfo tunnelEndPointInfo = new TunnelEndPointInfoBuilder().setSrcEndPointInfo(srcEndPtInfo).setDstEndPointInfo(dstEndPtInfo).build();
    tunnelEndpointMap.put(tunnelName, tunnelEndPointInfo);
}
Also used : TunnelEndPointInfo(org.opendaylight.genius.itm.utils.TunnelEndPointInfo) TunnelEndPointInfoBuilder(org.opendaylight.genius.itm.utils.TunnelEndPointInfoBuilder)

Aggregations

TunnelEndPointInfo (org.opendaylight.genius.itm.utils.TunnelEndPointInfo)2 BigInteger (java.math.BigInteger)1 DpnTepInterfaceInfo (org.opendaylight.genius.itm.utils.DpnTepInterfaceInfo)1 TunnelEndPointInfoBuilder (org.opendaylight.genius.itm.utils.TunnelEndPointInfoBuilder)1 Interface (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface)1 TunnelMonitoringTypeBfd (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelMonitoringTypeBfd)1 DPNTEPsInfo (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo)1