本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress类的典型用法代码示例。如果您正苦于以下问题:Java IpAddress类的具体用法?Java IpAddress怎么用?Java IpAddress使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IpAddress类属于org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715包,在下文中一共展示了IpAddress类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildArpIpMatches
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
/**
* Builds the arp ip matches.
* @param ipPrefixOrAddress the ip prefix or address
* @return the MatchInfoBase list
*/
public static List<MatchInfoBase> buildArpIpMatches(IpPrefixOrAddress ipPrefixOrAddress) {
List<MatchInfoBase> flowMatches = new ArrayList<>();
IpPrefix ipPrefix = ipPrefixOrAddress.getIpPrefix();
if (ipPrefix != null) {
Ipv4Prefix ipv4Prefix = ipPrefix.getIpv4Prefix();
if (ipv4Prefix != null && !ipv4Prefix.getValue().equals(AclConstants.IPV4_ALL_NETWORK)) {
flowMatches.add(new MatchArpSpa(ipv4Prefix));
}
} else {
IpAddress ipAddress = ipPrefixOrAddress.getIpAddress();
if (ipAddress != null && ipAddress.getIpv4Address() != null) {
flowMatches.add(new MatchArpSpa(ipAddress.getIpv4Address().getValue(), "32"));
}
}
return flowMatches;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:AclServiceUtils.java
示例2: setPortDscpMarking
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
public void setPortDscpMarking(Port port, DscpmarkingRules dscpMark) {
if (!qosEosHandler.isQosClusterOwner()) {
LOG.trace("Not Qos Cluster Owner. Ignoring setting DSCP marking");
return;
}
LOG.trace("Setting DSCP value {} on Port {}", port, dscpMark);
BigInteger dpnId = getDpnForInterface(port.getUuid().getValue());
String ifName = port.getUuid().getValue();
IpAddress ipAddress = port.getFixedIps().get(0).getIpAddress();
Short dscpValue = dscpMark.getDscpMark();
if (dpnId.equals(BigInteger.ZERO)) {
LOG.info("DPN ID for interface {} not found", port.getUuid().getValue());
return;
}
//1. OF rules
addFlow(dpnId, dscpValue, ifName, ipAddress, getInterfaceStateFromOperDS(ifName));
if (qosServiceConfiguredPorts.add(port.getUuid())) {
// bind qos service to interface
bindservice(ifName);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:25,代码来源:QosNeutronUtils.java
示例3: getNeutronPortForIp
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
public static Port getNeutronPortForIp(DataBroker broker,
IpAddress targetIP, String deviceType) {
List<Port> ports = getNeutronPorts(
broker);
for (Port port : ports) {
if (deviceType.equals(port.getDeviceOwner()) && port.getFixedIps() != null) {
for (FixedIps ip : port.getFixedIps()) {
if (Objects.equals(ip.getIpAddress(), targetIP)) {
return port;
}
}
}
}
LOG.error("getNeutronPortForIp : Neutron Port missing for IP:{} DeviceType:{}", targetIP, deviceType);
return null;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:18,代码来源:NatUtil.java
示例4: updateTunnelToUnderlayNetworkOperDs
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
private void updateTunnelToUnderlayNetworkOperDs(StateTunnelList tunnelState, boolean isAdded) {
BigInteger srcDpId = getTepDpnId(tunnelState.getSrcInfo());
BigInteger dstDpId = getTepDpnId(tunnelState.getDstInfo());
String tunnelInterfaceName = tunnelState.getTunnelInterfaceName();
if (BigInteger.ZERO.equals(srcDpId) || BigInteger.ZERO.equals(dstDpId)) {
LOG.warn("No valid DPN found for tunnel {}", tunnelInterfaceName);
return;
}
IpAddress tunnelIp = getTunnelIp(tunnelState);
if (tunnelIp == null) {
LOG.warn("No tunnel ip found for tunnel {} DPN {}", tunnelInterfaceName, srcDpId);
return;
}
String underlayNetwork = policyServiceUtil.getTunnelUnderlayNetwork(srcDpId, tunnelIp);
if (underlayNetwork == null) {
LOG.debug("No underlay networks defined for tunnel {} DPN {}", tunnelInterfaceName, srcDpId);
return;
}
LOG.info("Handle tunnel state update for interface {} on DPN {} underlay network {}", tunnelInterfaceName,
srcDpId, underlayNetwork);
policyServiceUtil.updateTunnelInterfaceForUnderlayNetwork(underlayNetwork, srcDpId, dstDpId,
tunnelInterfaceName, isAdded);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:27,代码来源:TunnelStateChangeListener.java
示例5: getTunnelInterfaceName
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
protected String getTunnelInterfaceName(BigInteger srcDpId, org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.inet.types.rev130715.IpAddress dstIp) {
Class<? extends TunnelTypeBase> tunType = getReqTunType(getReqTransType().toUpperCase(Locale.getDefault()));
Future<RpcResult<GetInternalOrExternalInterfaceNameOutput>> result;
try {
result = itmManager.getInternalOrExternalInterfaceName(new GetInternalOrExternalInterfaceNameInputBuilder()
.setSourceDpid(srcDpId)
.setDestinationIp(dstIp)
.setTunnelType(tunType)
.build());
RpcResult<GetInternalOrExternalInterfaceNameOutput> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.warn("RPC Call to getTunnelInterfaceName returned with Errors {}", rpcResult.getErrors());
} else {
return rpcResult.getResult().getInterfaceName();
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Exception when getting tunnel interface Id for tunnel between {} and {}", srcDpId, dstIp, e);
}
return null;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:NexthopManager.java
示例6: buildBucketForDcGwLbGroup
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
private Bucket buildBucketForDcGwLbGroup(String ipAddress, BigInteger dpnId,
int index) {
List<Action> listAction = new ArrayList<>();
// ActionKey 0 goes to mpls label.
int actionKey = 1;
listAction.add(new ActionPushMpls().buildAction());
listAction.add(new ActionRegMove(actionKey++, FibConstants.NXM_REG_MAPPING
.get(index), 0, 19).buildAction());
String tunnelInterfaceName = getTunnelInterfaceName(dpnId, new IpAddress(ipAddress.toCharArray()));
List<Action> egressActions = getEgressActions(tunnelInterfaceName, actionKey++);
if (!egressActions.isEmpty()) {
listAction.addAll(getEgressActions(tunnelInterfaceName, actionKey++));
} else {
// clear off actions if there is no egress actions.
listAction = Collections.emptyList();
}
return MDSALUtil.buildBucket(listAction, MDSALUtil.GROUP_WEIGHT, index,
MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:NexthopManager.java
示例7: getEndpointIpForDpn
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
@Override
public Future<RpcResult<GetEndpointIpForDpnOutput>> getEndpointIpForDpn(GetEndpointIpForDpnInput input) {
BigInteger dpnId = input.getDpid();
// if the dpnId is DPN_ID_NO_EXIST, then an empty response will be returned
GetEndpointIpForDpnOutputBuilder builder = new GetEndpointIpForDpnOutputBuilder();
if (dpnId == GeniusProviderTestParams.DPN_ID) {
List<IpAddress> localIpList = new ArrayList<>();
localIpList.add(new IpAddress(new Ipv4Address(GeniusProviderTestParams.IPV4_ADDRESS_STR)));
builder.setLocalIps(localIpList);
} else if (dpnId == GeniusProviderTestParams.DPN_ID_INVALID) {
return Futures.immediateFuture(RpcResultBuilder.<GetEndpointIpForDpnOutput>failed()
.withError(ErrorType.APPLICATION, "Invalid data.").build());
}
return Futures.immediateFuture(RpcResultBuilder
.<GetEndpointIpForDpnOutput>success(builder.build()).build());
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:TestOdlInterfaceRpcService.java
示例8: onArpRequestReceived
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
@Override
public void onArpRequestReceived(ArpRequestReceived notification) {
String srcInterface = notification.getInterface();
IpAddress srcIP = notification.getSrcIpaddress();
PhysAddress srcMac = notification.getSrcMac();
IpAddress targetIP = notification.getDstIpaddress();
BigInteger metadata = notification.getMetadata();
boolean isGarp = srcIP.equals(targetIP);
if (!isGarp) {
LOG.info("ArpNotification Non-Gratuitous Request Received from "
+ "interface {} and IP {} having MAC {} target destination {}, ignoring..",
srcInterface, srcIP.getIpv4Address().getValue(),srcMac.getValue(),
targetIP.getIpv4Address().getValue());
return;
}
LOG.info("ArpNotification Gratuitous Request Received from "
+ "interface {} and IP {} having MAC {} target destination {}, learning MAC",
srcInterface, srcIP.getIpv4Address().getValue(),srcMac.getValue(),
targetIP.getIpv4Address().getValue());
processArpLearning(srcInterface, srcIP, srcMac, metadata, targetIP);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:ArpNotificationHandler.java
示例9: onArpResponseReceived
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
@Override
public void onArpResponseReceived(ArpResponseReceived notification) {
String srcInterface = notification.getInterface();
IpAddress srcIP = notification.getSrcIpaddress();
PhysAddress srcMac = notification.getSrcMac();
LOG.info("ArpNotification Response Received from interface {} and IP {} having MAC {}, learning MAC",
srcInterface, srcIP.getIpv4Address().getValue(), srcMac.getValue());
List<Adjacency> adjacencies = VpnUtil.getAdjacenciesForVpnInterfaceFromConfig(dataBroker, srcInterface);
if (adjacencies != null) {
for (Adjacency adj : adjacencies) {
String ipAddress = adj.getIpAddress();
try {
if (NWUtil.isIpInSubnet(NWUtil.ipAddressToInt(srcIP.getIpv4Address().getValue()), ipAddress)) {
return;
}
} catch (UnknownHostException e) {
LOG.error("Subnet string {} not convertible to InetAdddress", srcIP, e);
}
}
}
BigInteger metadata = notification.getMetadata();
IpAddress targetIP = notification.getDstIpaddress();
LOG.trace("ArpNotification Response Received from interface {} and IP {} having MAC {}, learning MAC",
srcInterface, srcIP.getIpv4Address().getValue(), srcMac.getValue());
processArpLearning(srcInterface, srcIP, srcMac, metadata, targetIP);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:27,代码来源:ArpNotificationHandler.java
示例10: addPsNode
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
CheckedFuture<Void, TransactionCommitFailedException> addPsNode(InstanceIdentifier<Node> path,
InstanceIdentifier<Node> parentPath, List<String> portNameList, WriteTransaction transaction)
throws Exception {
NodeBuilder nodeBuilder = null;
nodeBuilder = prepareOperationalNode(path);
PhysicalSwitchAugmentationBuilder physicalSwitchAugmentationBuilder = new PhysicalSwitchAugmentationBuilder();
physicalSwitchAugmentationBuilder.setManagedBy(new HwvtepGlobalRef(parentPath));
physicalSwitchAugmentationBuilder.setPhysicalSwitchUuid(getUUid("d1s3"));
physicalSwitchAugmentationBuilder.setHwvtepNodeName(new HwvtepNodeName("s3"));
physicalSwitchAugmentationBuilder.setHwvtepNodeDescription("description");
List<TunnelIps> tunnelIps = new ArrayList<>();
IpAddress ip = new IpAddress("192.168.122.30".toCharArray());
tunnelIps.add(new TunnelIpsBuilder().setKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build());
physicalSwitchAugmentationBuilder.setTunnelIps(tunnelIps);
nodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, physicalSwitchAugmentationBuilder.build());
PhysicalSwitchHelper.dId = parentPath;
nodeBuilder.setTerminationPoint(PhysicalSwitchHelper
.addPhysicalSwitchTerminationPoints(path, transaction, portNameList));
return TestUtil.submitNode(OPERATIONAL, path, nodeBuilder.build(), transaction);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:25,代码来源:NodeConnectedHandlerUtils.java
示例11: getGatewayIpAddressFromInterface
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
static Optional<IpAddress> getGatewayIpAddressFromInterface(String srcInterface,
INeutronVpnManager neutronVpnService, DataBroker dataBroker) {
Optional<IpAddress> gatewayIp = Optional.absent();
if (neutronVpnService != null) {
//TODO(Gobinath): Need to fix this as assuming port will belong to only one Subnet would be incorrect"
Port port = neutronVpnService.getNeutronPort(srcInterface);
if (port != null && port.getFixedIps() != null && port.getFixedIps().get(0) != null
&& port.getFixedIps().get(0).getSubnetId() != null) {
gatewayIp = Optional.of(
neutronVpnService.getNeutronSubnet(port.getFixedIps().get(0).getSubnetId()).getGatewayIp());
}
} else {
LOG.error("getGatewayIpAddressFromInterface: neutron vpn service is not configured."
+ " Failed for interface {}.", srcInterface);
}
return gatewayIp;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:18,代码来源:VpnUtil.java
示例12: getSourceDpnTepIp
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
/**
* Gets the source dpn tep ip.
*
* @param srcDpnId
* the src dpn id
* @param dstHwVtepNodeId
* the dst hw vtep node id
* @return the dpn tep ip
*/
public IpAddress getSourceDpnTepIp(BigInteger srcDpnId,
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId dstHwVtepNodeId) {
IpAddress dpnTepIp = null;
String tunnelInterfaceName = getExternalTunnelInterfaceName(String.valueOf(srcDpnId),
dstHwVtepNodeId.getValue());
if (tunnelInterfaceName != null) {
Interface tunnelInterface =
ElanL2GatewayUtils.getInterfaceFromConfigDS(new InterfaceKey(tunnelInterfaceName), broker);
if (tunnelInterface != null) {
dpnTepIp = tunnelInterface.getAugmentation(IfTunnel.class).getTunnelSource();
} else {
LOG.warn("Tunnel interface not found for tunnelInterfaceName {}", tunnelInterfaceName);
}
} else {
LOG.warn("Tunnel interface name not found for srcDpnId {} and dstHwVtepNodeId {}", srcDpnId,
dstHwVtepNodeId);
}
return dpnTepIp;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:29,代码来源:ElanItmUtils.java
示例13: remove
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
@Override
protected void remove(InstanceIdentifier<LocalUcastMacs> identifier,
LocalUcastMacs del) {
// Flow removal for table 18 is handled in Neutron Port delete.
//remove the new CR-DHCP
NodeId torNodeId = identifier.firstKeyOf(Node.class).getNodeId();
LogicalSwitches logicalSwitch = getLogicalSwitches(del);
if (null == logicalSwitch) {
LOG.error("DhcpUCastMacListener remove :Logical Switch ref doesn't have data");
return;
}
String elanInstanceName = logicalSwitch.getHwvtepNodeName().getValue();
L2GatewayDevice device = ElanL2GwCacheUtils.getL2GatewayDeviceFromCache(elanInstanceName, torNodeId.getValue());
if (device == null) {
LOG.error("Logical Switch Device with name {} is not present in L2GWCONN cache", elanInstanceName);
return;
}
IpAddress tunnelIp = device.getTunnelIp();
Pair<IpAddress, String> tunnelIpElanName = new ImmutablePair<>(tunnelIp, elanInstanceName);
dhcpExternalTunnelManager.removeFromAvailableCache(tunnelIpElanName);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:DhcpUCastMacListener.java
示例14: remove
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
@Override
protected void remove(InstanceIdentifier<Interface> identifier, Interface del) {
jobCoordinator.enqueueJob(DhcpServiceUtils.getJobKey(del.getName()), () -> {
IfTunnel tunnelInterface = del.getAugmentation(IfTunnel.class);
IfL2vlan vlanInterface = del.getAugmentation(IfL2vlan.class);
String interfaceName = del.getName();
if (tunnelInterface != null && !tunnelInterface.isInternal()) {
IpAddress tunnelIp = tunnelInterface.getTunnelDestination();
ParentRefs interfce = del.getAugmentation(ParentRefs.class);
if (interfce != null) {
if (LOG.isTraceEnabled()) {
LOG.trace("Calling handleTunnelStateDown for tunnelIp {} and interface {}",
tunnelIp, interfaceName);
}
return dhcpExternalTunnelManager.handleTunnelStateDown(tunnelIp,
interfce.getDatapathNodeIdentifier());
}
}
if (vlanInterface != null) {
WriteTransaction unbindTx = dataBroker.newWriteOnlyTransaction();
DhcpServiceUtils.unbindDhcpService(interfaceName, unbindTx);
return Collections.singletonList(unbindTx.submit());
}
return Collections.emptyList();
}, DhcpMConstants.RETRY_COUNT);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:27,代码来源:DhcpInterfaceConfigListener.java
示例15: getSourceIpAddress
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
public Optional<IpAddress> getSourceIpAddress(Ethernet ethernet) {
Optional<IpAddress> srcIpAddress = Optional.absent();
if (ethernet.getPayload() == null) {
return srcIpAddress;
}
byte[] ipAddrBytes = null;
if (ethernet.getPayload() instanceof IPv4) {
IPv4 ipv4 = (IPv4) ethernet.getPayload();
ipAddrBytes = Ints.toByteArray(ipv4.getSourceAddress());
} else if (ethernet.getPayload() instanceof ARP) {
ipAddrBytes = ((ARP) ethernet.getPayload()).getSenderProtocolAddress();
}
if (ipAddrBytes != null) {
String ipAddr = NWUtil.toStringIpAddress(ipAddrBytes);
return Optional.of(IpAddressBuilder.getDefaultInstance(ipAddr));
}
return srcIpAddress;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:ElanUtils.java
示例16: handleDesignatedDpnDown
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
public void handleDesignatedDpnDown(BigInteger dpnId, List<BigInteger> listOfDpns) {
LOG.trace("In handleDesignatedDpnDown dpnId {}, listOfDpns {}", dpnId, listOfDpns);
try {
Set<Pair<IpAddress, String>> setOfTunnelIpElanNamePairs = designatedDpnsToTunnelIpElanNameCache.get(dpnId);
WriteTransaction tx = broker.newWriteOnlyTransaction();
if (!dpnId.equals(DhcpMConstants.INVALID_DPID)) {
List<String> listOfVms = getAllVmMacs();
for (String vmMacAddress : listOfVms) {
unInstallDhcpEntries(dpnId, vmMacAddress, tx);
}
}
if (setOfTunnelIpElanNamePairs == null || setOfTunnelIpElanNamePairs.isEmpty()) {
LOG.trace("No tunnelIpElanName to handle for dpn {}. Returning", dpnId);
tx.cancel();
return;
}
for (Pair<IpAddress, String> pair : setOfTunnelIpElanNamePairs) {
updateCacheAndInstallNewFlows(dpnId, listOfDpns, pair, tx);
}
DhcpServiceUtils.submitTransaction(tx);
} catch (ExecutionException e) {
LOG.error("Error in handleDesignatedDpnDown {}", e);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:25,代码来源:DhcpExternalTunnelManager.java
示例17: removeFromLocalCache
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
private void removeFromLocalCache(String elanInstanceName, String vmMacAddress) {
for (Entry<Pair<IpAddress, String>, Set<String>> entry : tunnelIpElanNameToVmMacCache.entrySet()) {
Pair<IpAddress, String> pair = entry.getKey();
if (pair.getRight().trim().equalsIgnoreCase(elanInstanceName.trim())) {
Set<String> setOfExistingVmMacAddress = entry.getValue();
if (setOfExistingVmMacAddress == null || setOfExistingVmMacAddress.isEmpty()) {
continue;
}
LOG.trace("Removing vmMacAddress {} from listOfMacs {} for elanInstanceName {}", vmMacAddress,
setOfExistingVmMacAddress, elanInstanceName);
setOfExistingVmMacAddress.remove(vmMacAddress);
if (setOfExistingVmMacAddress.size() > 0) {
tunnelIpElanNameToVmMacCache.put(pair, setOfExistingVmMacAddress);
return;
}
tunnelIpElanNameToVmMacCache.remove(pair);
}
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:DhcpExternalTunnelManager.java
示例18: getTunnelIpBasedOnElan
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
public IpAddress getTunnelIpBasedOnElan(String elanInstanceName, String vmMacAddress) {
LOG.trace("DhcpExternalTunnelManager getTunnelIpBasedOnElan elanInstanceName {}", elanInstanceName);
IpAddress tunnelIp = null;
for (Entry<Pair<IpAddress, String>, Set<String>> entry : availableVMCache.entrySet()) {
Pair<IpAddress, String> pair = entry.getKey();
LOG.trace("DhcpExternalTunnelManager getTunnelIpBasedOnElan left {} right {}", pair.getLeft(),
pair.getRight());
if (pair.getRight().trim().equalsIgnoreCase(elanInstanceName.trim())) {
Set<String> listExistingVmMacAddress = entry.getValue();
if (listExistingVmMacAddress != null && !listExistingVmMacAddress.isEmpty()
&& listExistingVmMacAddress.contains(vmMacAddress)) {
tunnelIp = pair.getLeft();
break;
}
}
}
LOG.trace("DhcpExternalTunnelManager getTunnelIpBasedOnElan returned tunnelIP {}", tunnelIp);
return tunnelIp;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:DhcpExternalTunnelManager.java
示例19: sendArpRequest
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
@SuppressWarnings("checkstyle:IllegalCatch")
private void sendArpRequest(IpAddress srcIpAddress, IpAddress dstIpAddress, MacAddress srcMacAddress,
String interfaceName) {
if (srcIpAddress == null || dstIpAddress == null) {
LOG.trace("Skip sending ARP to external GW srcIp {} dstIp {}", srcIpAddress, dstIpAddress);
return;
}
PhysAddress srcMacPhysAddress = new PhysAddress(srcMacAddress.getValue());
try {
InterfaceAddress interfaceAddress = new InterfaceAddressBuilder().setInterface(interfaceName)
.setIpAddress(srcIpAddress).setMacaddress(srcMacPhysAddress).build();
SendArpRequestInput sendArpRequestInput = new SendArpRequestInputBuilder().setIpaddress(dstIpAddress)
.setInterfaceAddress(Collections.singletonList(interfaceAddress)).build();
ListenableFutures.addErrorLogging(JdkFutureAdapters.listenInPoolThread(
arpUtilService.sendArpRequest(sendArpRequestInput)), LOG, "Send ARP request");
} catch (Exception e) {
LOG.error("Failed to send ARP request to external GW {} from interface {}",
dstIpAddress.getIpv4Address().getValue(), interfaceName, e);
}
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:24,代码来源:NeutronSubnetGwMacResolver.java
示例20: removed
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; //导入依赖的package包/类
@Override
protected void removed(InstanceIdentifier<RemoteMcastMacs> identifier,
RemoteMcastMacs del) {
String elanInstanceName = getElanName(del);
IpAddress tunnelIp = dhcpL2GwUtil.getHwvtepNodeTunnelIp(identifier.firstIdentifierOf(Node.class));
if (tunnelIp == null) {
LOG.error("Could not find tunnelIp for {}", identifier);
return;
}
BigInteger designatedDpnId = externalTunnelManager.readDesignatedSwitchesForExternalTunnel(
tunnelIp, elanInstanceName);
if (designatedDpnId == null) {
LOG.error("Could not find designated DPN ID elanInstanceName {}, tunnelIp {}", elanInstanceName, tunnelIp);
return;
}
externalTunnelManager.removeDesignatedSwitchForExternalTunnel(designatedDpnId, tunnelIp, elanInstanceName);
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:18,代码来源:DhcpMcastMacListener.java
注:本文中的org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论