use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project netvirt by opendaylight.
the class InterVpnLinkUtil method installLPortDispatcherTableFlow.
/**
* Installs a Flow in LPortDispatcher table that matches on SI=2 and
* the lportTag of one InterVpnLink's endpoint and sets the vrfTag of the
* other endpoint and sends to FIB table.
*
* @param broker dataBroker service reference
* @param mdsalManager MDSAL API accessor
* @param interVpnLinkName Name of the InterVpnLink.
* @param dpnList The list of DPNs where this flow must be installed
* @param vpnUuidOtherEndpoint UUID of the other endpoint of the InterVpnLink
* @param lportTagOfOtherEndpoint Dataplane identifier of the other endpoint of the InterVpnLink
* @return the list of Futures for each and every flow that has been installed
*/
public static List<ListenableFuture<Void>> installLPortDispatcherTableFlow(DataBroker broker, IMdsalApiManager mdsalManager, String interVpnLinkName, List<BigInteger> dpnList, String vpnUuidOtherEndpoint, Long lportTagOfOtherEndpoint) {
List<ListenableFuture<Void>> result = new ArrayList<>();
long vpnId = VpnUtil.getVpnId(broker, vpnUuidOtherEndpoint);
for (BigInteger dpnId : dpnList) {
// insert into LPortDispatcher table
Flow lportDispatcherFlow = buildLPortDispatcherFlow(interVpnLinkName, vpnId, lportTagOfOtherEndpoint.intValue());
result.add(mdsalManager.installFlow(dpnId, lportDispatcherFlow));
}
return result;
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project netvirt by opendaylight.
the class ArpResponderUtil method removeFlow.
/**
* Remove flow form DPN.
*
* @param mdSalManager
* Reference of MDSAL API RPC that provides API for installing
* flow
* @param dpnId
* DPN form which flow to be removed
* @param flowId
* Uniquely Identifiable Arp Responder Table flow Id that is to
* be removed
*/
public static void removeFlow(IMdsalApiManager mdSalManager, BigInteger dpnId, String flowId) {
Flow flowEntity = MDSALUtil.buildFlow(NwConstants.ARP_RESPONDER_TABLE, flowId);
mdSalManager.removeFlow(dpnId, flowEntity);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project netvirt by opendaylight.
the class ElanServiceChainUtils method updateElanToLportTagMap.
/**
* Stores the relation between ElanLport and scfTag.
*
* @param broker dataBroker service reference
* @param elanInstanceName Name of the ELAN. Typically its UUID
* @param lportTag Dataplane identifier of the ElanPseudoPort
* @param scfTag Dataplane identifier of the SCF
* @param addOrRemove States if flows must be added or removed
*/
public static void updateElanToLportTagMap(final DataBroker broker, final String elanInstanceName, final int lportTag, final long scfTag, final int addOrRemove) {
Long portTag = Long.valueOf(lportTag);
ElanToPseudoPortDataKey key = new ElanToPseudoPortDataKey(portTag, scfTag);
InstanceIdentifier<ElanToPseudoPortData> path = InstanceIdentifier.builder(ElanInstances.class).child(ElanInstance.class, new ElanInstanceKey(elanInstanceName)).augmentation(ElanServiceChainState.class).child(ElanToPseudoPortData.class, key).build();
if (addOrRemove == NwConstants.ADD_FLOW) {
ElanToPseudoPortData newValue = new ElanToPseudoPortDataBuilder().setKey(key).setElanLportTag(portTag).setScfTag(scfTag).build();
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, path, newValue);
} else {
MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, path);
}
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project openflowplugin by opendaylight.
the class NodeConnectorRefToPortTranslator method fromNodeConnectorRef.
/**
* Gets port number from {@link NodeConnectorRef}.
* @param nodeConnectorRef Node connector reference
* @param version Openflow version
* @return port number
*/
@SuppressWarnings("unchecked")
@Nullable
public static Long fromNodeConnectorRef(@Nonnull NodeConnectorRef nodeConnectorRef, short version) {
Preconditions.checkNotNull(nodeConnectorRef);
Long port = null;
final InstanceIdentifier<?> value = nodeConnectorRef.getValue();
if (value instanceof KeyedInstanceIdentifier) {
KeyedInstanceIdentifier<NodeConnector, NodeConnectorKey> identifier = (KeyedInstanceIdentifier<NodeConnector, NodeConnectorKey>) value;
OpenflowVersion ofVersion = OpenflowVersion.get(version);
String nodeConnectorId = identifier.getKey().getId().getValue();
port = InventoryDataServiceUtil.portNumberfromNodeConnectorId(ofVersion, nodeConnectorId);
}
return port;
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project openflowplugin by opendaylight.
the class PacketInDispatcherImpl method onPacketReceived.
@Override
public void onPacketReceived(PacketReceived notification) {
// find corresponding handler
/*
* Notification contains reference to ingress port
* in a form of path in inventory: /nodes/node/node-connector
*
* In order to get path we shorten path to the first node reference
* by using firstIdentifierOf helper method provided by InstanceIdentifier,
* this will effectively shorten the path to /nodes/node.
*/
InstanceIdentifier<?> ingressPort = notification.getIngress().getValue();
InstanceIdentifier<Node> nodeOfPacket = ingressPort.firstIdentifierOf(Node.class);
/**
* We lookup up the the packet-in listener for this node.
*/
PacketProcessingListener nodeHandler = handlerMapping.get(nodeOfPacket);
/**
* If we have packet-processing listener, we delegate notification.
*/
if (nodeHandler != null) {
nodeHandler.onPacketReceived(notification);
}
}
Aggregations