public static List<OFAction> prependUnRewriteActions(final OFMatch match) { final List<OFAction> actions = new LinkedList<OFAction>(); if (!match.getWildcardObj().isWildcarded(Flag.NW_SRC)) { final OVXActionNetworkLayerSource srcAct = new OVXActionNetworkLayerSource(); srcAct.setNetworkAddress(match.getNetworkSource()); actions.add(srcAct); } if (!match.getWildcardObj().isWildcarded(Flag.NW_DST)) { final OVXActionNetworkLayerDestination dstAct = new OVXActionNetworkLayerDestination(); dstAct.setNetworkAddress(match.getNetworkDestination()); actions.add(dstAct); } return actions; } }
jGen.writeNumberField("networkProtocol", match.getNetworkProtocol()); jGen.writeStringField("networkSource", this.intToIp(match.getNetworkSource())); jGen.writeNumberField("networkSourceMaskLen", match.getNetworkSourceMaskLen());
private void learnHostIP(OFMatch match, Mappable map) { if (!match.getWildcardObj().isWildcarded(Flag.NW_SRC)) { try { map.getVirtualNetwork(tenantId).getHost(ovxPort) .setIPAddress(match.getNetworkSource()); } catch (NetworkMappingException e) { log.warn("Failed to lookup virtual network {}", this.tenantId); return; } catch (NullPointerException npe) { log.warn("No host attached at {} port {}", this.ovxPort .getParentSwitch().getSwitchName(), this.ovxPort .getPhysicalPortNumber()); } } }
this.pad_size = 0; if (match.getNetworkSource() != 0) { InetAddress address = NetUtils.getInetAddress(match.getNetworkSource()); InetAddress mask = NetUtils.getInetNetworkMask(match.getNetworkSourceMaskLen(), false); this.setNetworkSource(address, mask);
public static void rewriteMatch(final Integer tenantId, final OFMatch match) { match.setNetworkSource(getPhysicalIp(tenantId, match.getNetworkSource())); match.setNetworkDestination(getPhysicalIp(tenantId, match.getNetworkDestination())); }
.getDataLayerVirtualLanPriorityCodePoint()); if (ofMatch.getNetworkSource() != 0) { salMatch.setField(MatchType.NW_SRC, NetUtils .getInetAddress(ofMatch.getNetworkSource()), NetUtils.getInetNetworkMask( ofMatch.getNetworkSourceMaskLen(),
public static List<OFAction> prependRewriteActions(final Integer tenantId, final OFMatch match) { final List<OFAction> actions = new LinkedList<OFAction>(); if (!match.getWildcardObj().isWildcarded(Flag.NW_SRC)) { final OVXActionNetworkLayerSource srcAct = new OVXActionNetworkLayerSource(); srcAct.setNetworkAddress(getPhysicalIp(tenantId, match.getNetworkSource())); actions.add(srcAct); } if (!match.getWildcardObj().isWildcarded(Flag.NW_DST)) { final OVXActionNetworkLayerDestination dstAct = new OVXActionNetworkLayerDestination(); dstAct.setNetworkAddress(getPhysicalIp(tenantId, match.getNetworkDestination())); actions.add(dstAct); } return actions; }
private void prependRewriteActions() { if (!this.match.getWildcardObj().isWildcarded(Flag.NW_SRC)) { final OVXActionNetworkLayerSource srcAct = new OVXActionNetworkLayerSource(); srcAct.setNetworkAddress(IPMapper.getPhysicalIp(sw.getTenantId(), this.match.getNetworkSource())); this.approvedActions.add(0, srcAct); } if (!this.match.getWildcardObj().isWildcarded(Flag.NW_DST)) { final OVXActionNetworkLayerDestination dstAct = new OVXActionNetworkLayerDestination(); dstAct.setNetworkAddress(IPMapper.getPhysicalIp(sw.getTenantId(), this.match.getNetworkDestination())); this.approvedActions.add(0, dstAct); } }
/** * Checks for "ANY" values that should be wildcards but aren't, such as * NW_SRC/DST 0.0.0.0, and TCP/UDP port 0. * * @param omatch * The OFMatch of the FlowMod we are comparing entries against * @param owcard * The wildcard field of the FlowMod. * @return the modified wildcard value (a copy). */ private int convertToWcards(OFMatch omatch) { int owcard = omatch.getWildcards(); if (omatch.getNetworkDestination() == 0) { owcard |= OFMatch.OFPFW_NW_DST_ALL | OFMatch.OFPFW_NW_DST_MASK; } if (omatch.getNetworkSource() == 0) { owcard |= OFMatch.OFPFW_NW_SRC_ALL | OFMatch.OFPFW_NW_SRC_MASK; } if (omatch.getNetworkProtocol() == 0) { owcard |= OFMatch.OFPFW_NW_PROTO; } if (omatch.getTransportDestination() == 0) { owcard |= OFMatch.OFPFW_TP_DST; } if (omatch.getTransportSource() == 0) { owcard |= OFMatch.OFPFW_TP_SRC; } return owcard; }
private void prependRewriteActions(final OVXSwitch sw) { if (!this.match.getWildcardObj().isWildcarded(Flag.NW_SRC)) { final OVXActionNetworkLayerSource srcAct = new OVXActionNetworkLayerSource(); srcAct.setNetworkAddress(IPMapper.getPhysicalIp(sw.getTenantId(), this.match.getNetworkSource())); this.approvedActions.add(0, srcAct); } if (!this.match.getWildcardObj().isWildcarded(Flag.NW_DST)) { final OVXActionNetworkLayerDestination dstAct = new OVXActionNetworkLayerDestination(); dstAct.setNetworkAddress(IPMapper.getPhysicalIp(sw.getTenantId(), this.match.getNetworkDestination())); this.approvedActions.add(0, dstAct); } }
private void learnAddresses(final OFMatch match, final Mappable map) { if (match.getDataLayerType() == Ethernet.TYPE_IPV4 || match.getDataLayerType() == Ethernet.TYPE_ARP) { if (!match.getWildcardObj().isWildcarded(Flag.NW_SRC)) { IPMapper.getPhysicalIp(this.tenantId, match.getNetworkSource()); } if (!match.getWildcardObj().isWildcarded(Flag.NW_DST)) { IPMapper.getPhysicalIp(this.tenantId, match.getNetworkDestination()); } } }
if (match.getNetworkSource() != 0) { InetAddress address = null; try { address = InetAddress.getByAddress(ByteBuffer.allocate(4) .putInt(match.getNetworkSource()).array()); } catch (UnknownHostException e) { logger.error("",e);
/** * Instantiates a new OVXmatch from an OFMatch instance. * * @param match * the match */ public OVXMatch(final OFMatch match) { this.wildcards = match.getWildcards(); this.inputPort = match.getInputPort(); this.dataLayerSource = match.getDataLayerSource(); this.dataLayerDestination = match.getDataLayerDestination(); this.dataLayerVirtualLan = match.getDataLayerVirtualLan(); this.dataLayerVirtualLanPriorityCodePoint = match .getDataLayerVirtualLanPriorityCodePoint(); this.dataLayerType = match.getDataLayerType(); this.networkTypeOfService = match.getNetworkTypeOfService(); this.networkProtocol = match.getNetworkProtocol(); this.networkSource = match.getNetworkSource(); this.networkDestination = match.getNetworkDestination(); this.transportSource = match.getTransportSource(); this.transportDestination = match.getTransportDestination(); this.cookie = 0; this.pktData = null; }
|| match.getDataLayerType() == Ethernet.TYPE_ARP) { PhysicalIPAddress srcIP = new PhysicalIPAddress( match.getNetworkSource()); PhysicalIPAddress dstIP = new PhysicalIPAddress( match.getNetworkDestination());
if (findDisjoint(twcard, (OFMatch.OFPFW_NW_SRC_ALL | OFMatch.OFPFW_NW_SRC_MASK), intersect, tmatch.getNetworkSource(), omatch.getNetworkSource())) { return DISJOINT;