• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IpPrefix类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.onlab.packet.IpPrefix的典型用法代码示例。如果您正苦于以下问题:Java IpPrefix类的具体用法?Java IpPrefix怎么用?Java IpPrefix使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IpPrefix类属于org.onlab.packet包,在下文中一共展示了IpPrefix类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processBroadcastNextObjective

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * As per the OFDPA 2.0 TTP, packets are sent out of ports by using
 * a chain of groups. The broadcast Next Objective passed in by the application
 * has to be broken up into a group chain comprising of an
 * L2 Flood group whose buckets point to L2 Interface groups.
 *
 * @param nextObj  the nextObjective of type BROADCAST
 */
private void processBroadcastNextObjective(NextObjective nextObj) {
    VlanId assignedVlan = Ofdpa2Pipeline.readVlanFromSelector(nextObj.meta());
    if (assignedVlan == null) {
        log.warn("VLAN ID required by broadcast next obj is missing. Abort.");
        Ofdpa2Pipeline.fail(nextObj, ObjectiveError.BADPARAMS);
        return;
    }

    List<GroupInfo> groupInfos = prepareL2InterfaceGroup(nextObj, assignedVlan);

    IpPrefix ipDst = Ofdpa2Pipeline.readIpDstFromSelector(nextObj.meta());
    if (ipDst != null) {
        if (ipDst.isMulticast()) {
            createL3MulticastGroup(nextObj, assignedVlan, groupInfos);
        } else {
            log.warn("Broadcast NextObj with non-multicast IP address {}", nextObj);
            Ofdpa2Pipeline.fail(nextObj, ObjectiveError.BADPARAMS);
            return;
        }
    } else {
        createL2FloodGroup(nextObj, assignedVlan, groupInfos);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:Ofdpa2GroupHandler.java


示例2: programRouteRules

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
@Override
public void programRouteRules(DeviceId deviceId, SegmentationId l3Vni,
                              IpAddress dstVmIP, SegmentationId dstVni,
                              MacAddress dstVmGwMac, MacAddress dstVmMac,
                              Operation type) {
    TrafficSelector selector = DefaultTrafficSelector.builder()
            .matchEthType(IP_TYPE)
            .matchTunnelId(Long.parseLong(l3Vni.segmentationId()))
            .matchIPDst(IpPrefix.valueOf(dstVmIP, PREFIX_LENGTH)).build();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    treatment.setEthSrc(dstVmGwMac)
            .setEthDst(dstVmMac)
            .add(Instructions.modTunnelId(Long.parseLong(dstVni
                         .segmentationId())));
    ForwardingObjective.Builder objective = DefaultForwardingObjective
            .builder().withTreatment(treatment.build())
            .withSelector(selector).fromApp(appId).withFlag(Flag.SPECIFIC)
            .withPriority(L3FWD_PRIORITY);
    if (type.equals(Objective.Operation.ADD)) {
        log.debug("RouteRules-->ADD");
        flowObjectiveService.forward(deviceId, objective.add());
    } else {
        log.debug("RouteRules-->REMOVE");
        flowObjectiveService.forward(deviceId, objective.remove());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:L3ForwardServiceImpl.java


示例3: programUserdataClassifierRules

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
@Override
public void programUserdataClassifierRules(DeviceId deviceId,
                                           IpPrefix ipPrefix,
                                           IpAddress dstIp,
                                           MacAddress dstmac,
                                           SegmentationId actionVni,
                                           Objective.Operation type) {
    TrafficSelector selector = DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_IPV4).matchIPSrc(ipPrefix)
            .matchIPDst(IpPrefix.valueOf(dstIp, 32)).build();
    TrafficTreatment treatment = DefaultTrafficTreatment.builder()
            .setTunnelId(Long.parseLong(actionVni.segmentationId()))
            .setEthDst(dstmac).build();
    ForwardingObjective.Builder objective = DefaultForwardingObjective
            .builder().withTreatment(treatment).withSelector(selector)
            .fromApp(appId).withFlag(Flag.SPECIFIC)
            .withPriority(USERDATA_CLASSIFIER_PRIORITY);
    if (type.equals(Objective.Operation.ADD)) {
        log.debug("UserdataClassifierRules-->ADD");
        flowObjectiveService.forward(deviceId, objective.add());
    } else {
        log.debug("UserdataClassifierRules-->REMOVE");
        flowObjectiveService.forward(deviceId, objective.remove());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:ClassifierServiceImpl.java


示例4: programSnatSameSegmentUploadControllerRules

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
@Override
public void programSnatSameSegmentUploadControllerRules(DeviceId deviceId,
                                                        SegmentationId matchVni,
                                                        IpAddress srcIP,
                                                        IpAddress dstIP,
                                                        IpPrefix prefix,
                                                        Operation type) {

    TrafficSelector selector = DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_IPV4)
            .matchTunnelId(Long.parseLong(matchVni.segmentationId()))
            .matchIPSrc(IpPrefix.valueOf(srcIP, PREFIC_LENGTH))
            .matchIPDst(IpPrefix.valueOf(dstIP, prefix.prefixLength()))
            .build();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    treatment.add(Instructions.createOutput(PortNumber.CONTROLLER));
    ForwardingObjective.Builder objective = DefaultForwardingObjective
            .builder().withTreatment(treatment.build())
            .withSelector(selector).fromApp(appId).withFlag(Flag.SPECIFIC)
            .withPriority(SNAT_SAME_SEG_CON_PRIORITY);
    if (type.equals(Objective.Operation.ADD)) {
        flowObjectiveService.forward(deviceId, objective.add());
    } else {
        flowObjectiveService.forward(deviceId, objective.remove());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:SnatServiceImpl.java


示例5: programSnatSameSegmentRules

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
@Override
public void programSnatSameSegmentRules(DeviceId deviceId, SegmentationId matchVni,
                         IpAddress srcIP, IpAddress dstIP, MacAddress ethDst,
                         MacAddress ethSrc, IpAddress ipSrc,
                         SegmentationId actionVni, Objective.Operation type) {
    TrafficSelector selector = DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_IPV4)
            .matchTunnelId(Long.parseLong(matchVni.segmentationId()))
            .matchIPSrc(IpPrefix.valueOf(srcIP, PREFIC_LENGTH))
            .matchIPDst(IpPrefix.valueOf(dstIP, PREFIC_LENGTH)).build();

    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    treatment.setEthDst(ethDst).setEthSrc(ethSrc).setIpSrc(ipSrc)
            .setTunnelId(Long.parseLong(actionVni.segmentationId()));
    ForwardingObjective.Builder objective = DefaultForwardingObjective
            .builder().withTreatment(treatment.build())
            .withSelector(selector).fromApp(appId).withFlag(Flag.SPECIFIC)
            .withPriority(SNAT_SAME_SEG_PRIORITY);
    if (type.equals(Objective.Operation.ADD)) {
        flowObjectiveService.forward(deviceId, objective.add());
    } else {
        flowObjectiveService.forward(deviceId, objective.remove());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:SnatServiceImpl.java


示例6: processWideCommTarget

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
WideCommunityTarget processWideCommTarget(ExtTarget flow) {
    ExtPrefix localSpeaker;
    ExtPrefix remoteSpeaker;
    ListIterator<IpPrefix> pfxItr = null;
    ListIterator<IpPrefix> pfxItr1 = null;
    List<BgpValueType> wcIpv4 = null;
    ExtTarget target = flow;
    WideCommunityIpV4Neighbour wcIpV4Neighbour = null;
    WideCommunityTarget wcTarget = null;
    localSpeaker = target.localSpeaker();
    remoteSpeaker = target.remoteSpeaker();
    wcIpV4Neighbour = new WideCommunityIpV4Neighbour();

    pfxItr = localSpeaker.prefix().listIterator();
    pfxItr1 = remoteSpeaker.prefix().listIterator();
    while (pfxItr.hasNext()) {
        wcIpV4Neighbour.add(pfxItr.next().address(), pfxItr1.next().address());
    }

    wcIpv4 = new ArrayList<>();
    wcIpv4.add(wcIpV4Neighbour);
    wcTarget = new WideCommunityTarget(wcIpv4);
    return wcTarget;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:BgpcepFlowRuleProvider.java


示例7: fwdObjBuilder

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * Creates a forwarding objective builder for multicast.
 *
 * @param mcastIp multicast group
 * @param assignedVlan assigned VLAN ID
 * @param nextId next ID of the L3 multicast group
 * @return forwarding objective builder
 */
private ForwardingObjective.Builder fwdObjBuilder(IpAddress mcastIp,
        VlanId assignedVlan, int nextId) {
    TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder();
    IpPrefix mcastPrefix = IpPrefix.valueOf(mcastIp, IpPrefix.MAX_INET_MASK_LENGTH);
    sbuilder.matchEthType(Ethernet.TYPE_IPV4);
    sbuilder.matchIPDst(mcastPrefix);
    TrafficSelector.Builder metabuilder = DefaultTrafficSelector.builder();
    metabuilder.matchVlanId(assignedVlan);

    ForwardingObjective.Builder fwdBuilder = DefaultForwardingObjective.builder();
    fwdBuilder.withSelector(sbuilder.build())
            .withMeta(metabuilder.build())
            .nextStep(nextId)
            .withFlag(ForwardingObjective.Flag.SPECIFIC)
            .fromApp(srManager.appId)
            .withPriority(SegmentRoutingService.DEFAULT_PRIORITY);
    return fwdBuilder;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:McastHandler.java


示例8: isValid

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
@Override
public boolean isValid() {
    for (JsonNode node : array) {
        if (!hasOnlyFields((ObjectNode) node, NAME, IPS, MAC, VLAN)) {
            return false;
        }

        ObjectNode obj = (ObjectNode) node;

        if (!(isString(obj, NAME, FieldPresence.OPTIONAL) &&
                isMacAddress(obj, MAC, FieldPresence.OPTIONAL) &&
                isIntegralNumber(obj, VLAN, FieldPresence.OPTIONAL, 0, VlanId.MAX_VLAN))) {
            return false;
        }


        for (JsonNode ipNode : node.path(IPS)) {
            if (!ipNode.isTextual() || IpPrefix.valueOf(ipNode.asText()) == null) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:InterfaceConfig.java


示例9: VtnService

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * Creates a new VTN service with the specified entities.
 *
 * @param id service id
 * @param name user friendly name
 * @param serviceType service type
 * @param networkType network type
 * @param vni vni of this service network
 * @param subnet service network subnet range
 * @param serviceIp service ip for indirect service access
 * @param providerServices provider services
 * @param tenantServices tenant services
 */
public VtnService(VtnServiceId id,
                  String name,
                  ServiceType serviceType,
                  NetworkType networkType,
                  long vni,
                  IpPrefix subnet,
                  IpAddress serviceIp,
                  Set<VtnServiceId> providerServices,
                  Set<VtnServiceId> tenantServices) {
    this.id = checkNotNull(id);
    this.name = name;
    this.serviceType = serviceType;
    this.networkType = networkType;
    this.vni = vni;
    this.subnet = checkNotNull(subnet);
    this.serviceIp = checkNotNull(serviceIp);
    this.providerServices = providerServices == null ? Sets.newHashSet() : providerServices;
    this.tenantServices = tenantServices == null ? Sets.newHashSet() : tenantServices;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:33,代码来源:VtnService.java


示例10: activate

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * Active MulticastForwardingIntent.
 */
@Activate
public void activate() {
    appId = coreService.registerApplication("org.onosproject.mfwd");

    mcastIntentManager = new McastIntentManager();
    mcastRouteManager.addListener(mcastIntentManager);

    packetService.addProcessor(processor, PacketProcessor.director(2));

    // Build a traffic selector for all multicast traffic
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    selector.matchIPDst(IpPrefix.IPV4_MULTICAST_PREFIX);

    packetService.requestPackets(selector.build(), PacketPriority.REACTIVE, appId);

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:McastForwarding.java


示例11: findBestBgpRoute

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * Finds the best route entry among all BGP Sessions.
 *
 * @param prefix the prefix of the route
 * @return the best route if found, otherwise null
 */
private BgpRouteEntry findBestBgpRoute(IpPrefix prefix) {
    BgpRouteEntry bestRoute = null;

    // Iterate across all BGP Sessions and select the best route
    for (BgpSession bgpSession : bgpSessionManager.getBgpSessions()) {
        BgpRouteEntry route = bgpSession.findBgpRoute(prefix);
        if (route == null) {
            continue;
        }
        if ((bestRoute == null) || route.isBetterThan(bestRoute)) {
            bestRoute = route;
        }
    }
    return bestRoute;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:BgpRouteSelector.java


示例12: MockFlowClassifier

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
public MockFlowClassifier(FlowClassifierId flowClassifierId, TenantId tenantId, String name,
                          String description, String etherType, String protocol, int priority,
                          int minSrcPortRange, int maxSrcPortRange, int minDstPortRange, int maxDstPortRange,
                          IpPrefix srcIpPrefix, IpPrefix dstIpPrefix, VirtualPortId srcPort,
                          VirtualPortId dstPort) {
    this.flowClassifierId = flowClassifierId;
    this.tenantId = tenantId;
    this.name = name;
    this.description = description;
    this.etherType = etherType;
    this.protocol = protocol;
    this.priority = priority;
    this.minSrcPortRange = minSrcPortRange;
    this.maxSrcPortRange = maxSrcPortRange;
    this.minDstPortRange = minDstPortRange;
    this.maxDstPortRange = maxDstPortRange;
    this.srcIpPrefix = srcIpPrefix;
    this.dstIpPrefix = dstIpPrefix;
    this.srcPort = srcPort;
    this.dstPort = dstPort;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:FlowClassifierResourceTest.java


示例13: generateRibForwardingObj

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
private ForwardingObjective.Builder generateRibForwardingObj(IpPrefix prefix,
                                                             Integer nextId) {
    TrafficSelector selector = DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_IPV4)
            .matchIPDst(prefix)
            .build();

    int priority = prefix.prefixLength() * PRIORITY_MULTIPLIER + PRIORITY_OFFSET;

    ForwardingObjective.Builder fwdBuilder = DefaultForwardingObjective.builder()
            .fromApp(routerAppId)
            .makePermanent()
            .withSelector(selector)
            .withPriority(priority)
            .withFlag(ForwardingObjective.Flag.SPECIFIC);

    if (nextId == null) {
        // Route withdraws are not specified with next hops. Generating
        // dummy treatment as there is no equivalent nextId info.
        fwdBuilder.withTreatment(DefaultTrafficTreatment.builder().build());
    } else {
        fwdBuilder.nextStep(nextId);
    }
    return fwdBuilder;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:SingleSwitchFibInstaller.java


示例14: createForwardingObjective

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * Creates a new forwarding objective with the given parameters.
 *
 * @param prefix IP prefix
 * @param add whether to create an add objective or a remove objective
 * @return new forwarding objective
 */
private ForwardingObjective createForwardingObjective(IpPrefix prefix,
                                                      boolean add) {
    TrafficSelector selector = DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_IPV4)
            .matchIPDst(prefix)
            .build();

    int priority = prefix.prefixLength() * 5 + 100;
    ForwardingObjective.Builder fwdBuilder = DefaultForwardingObjective.builder()
            .fromApp(APPID)
            .makePermanent()
            .withSelector(selector)
            .withPriority(priority)
            .withFlag(ForwardingObjective.Flag.SPECIFIC);

    if (add) {
        fwdBuilder.nextStep(NEXT_ID);
    } else {
        fwdBuilder.withTreatment(DefaultTrafficTreatment.builder().build());
    }

    return add ? fwdBuilder.add() : fwdBuilder.remove();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:31,代码来源:SingleSwitchFibInstallerTest.java


示例15: testIpv4RouteAdd

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * Tests adding a IPv4 route entry.
 */
@Test
public void testIpv4RouteAdd() {
    // Construct a route entry
    IpPrefix prefix = Ip4Prefix.valueOf("1.1.1.0/24");
    IpAddress nextHopIp = Ip4Address.valueOf("192.168.10.1");

    RouteEntry routeEntry = new RouteEntry(prefix, nextHopIp);

    // Expected FIB entry
    FibEntry fibEntry = new FibEntry(prefix, nextHopIp,
            MacAddress.valueOf("00:00:00:00:00:01"));

    fibListener.update(Collections.singletonList(new FibUpdate(
            FibUpdate.Type.UPDATE, fibEntry)), Collections.emptyList());

    replay(fibListener);

    router.processRouteUpdates(Collections.singletonList(
            new RouteUpdate(RouteUpdate.Type.UPDATE, routeEntry)));

    verify(fibListener);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:RouterTest.java


示例16: testIpv4LocalRouteAdd

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * Tests adding a IPv4 route whose next hop is the local BGP speaker.
 */
@Test
public void testIpv4LocalRouteAdd() {
    // Construct a route entry, the next hop is the local BGP speaker
    RouteEntry routeEntry = new RouteEntry(
            Ip4Prefix.valueOf("1.1.1.0/24"),
            Ip4Address.valueOf("0.0.0.0"));

    // No methods on the FIB listener should be called
    replay(fibListener);

    reset(routingConfigurationService);
    expect(routingConfigurationService.isIpPrefixLocal(
            anyObject(IpPrefix.class))).andReturn(true);
    replay(routingConfigurationService);

    // Call the processRouteUpdates() method in Router class
    RouteUpdate routeUpdate = new RouteUpdate(RouteUpdate.Type.UPDATE,
                                              routeEntry);
    router.processRouteUpdates(Collections.singletonList(routeUpdate));

    // Verify
    assertEquals(1, router.getRoutes4().size());
    assertTrue(router.getRoutes4().contains(routeEntry));
    verify(fibListener);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:29,代码来源:RouterTest.java


示例17: VbngConfiguration

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param nextHopIpAddress the IP address of the next hop
 * @param prefixes the public IP prefix list for local SDN network
 * @param publicFacingMac the MAC address configured for all local
 *        public IP addresses
 * @param xosIpAddress the XOS server IP address
 * @param xosRestPort the port of the XOS server for REST
 * @param hosts map of hosts
 */
@JsonCreator
public VbngConfiguration(@JsonProperty("localPublicIpPrefixes")
                         List<IpPrefix> prefixes,
                         @JsonProperty("nextHopIpAddress")
                         IpAddress nextHopIpAddress,
                         @JsonProperty("publicFacingMac")
                         MacAddress publicFacingMac,
                         @JsonProperty("xosIpAddress")
                         IpAddress xosIpAddress,
                         @JsonProperty("xosRestPort")
                         int xosRestPort,
                         @JsonProperty("hosts")
                         Map<String, ConnectPointConfiguration> hosts) {
    localPublicIpPrefixes = prefixes;
    this.nextHopIpAddress = nextHopIpAddress;
    this.publicFacingMac = publicFacingMac;
    this.xosIpAddress = xosIpAddress;
    this.xosRestPort = xosRestPort;
    this.hosts = hosts;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:VbngConfiguration.java


示例18: buildFlowObjective

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
ForwardingObjective.Builder buildFlowObjective(DeviceId id, OpenstackSecurityGroupRule sgRule,
                                       Ip4Address vmIp, IpPrefix remoteIp) {
    if (remoteIp != null && remoteIp.equals(IpPrefix.valueOf(vmIp, 32))) {
        return null;
    }
    TrafficSelector.Builder sBuilder = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder();

    buildMatchs(sBuilder, sgRule, vmIp, remoteIp);

    ForwardingObjective.Builder foBuilder = DefaultForwardingObjective.builder()
            .withSelector(sBuilder.build())
            .withTreatment(tBuilder.build())
            .withPriority(ACL_RULE_PRIORITY)
            .withFlag(ForwardingObjective.Flag.SPECIFIC)
            .fromApp(appId);

    return foBuilder;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:OpenstackSecurityGroupRulePopulator.java


示例19: recycleAssignedPublicIpAddress

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
@Override
public synchronized IpAddress recycleAssignedPublicIpAddress(IpAddress
                                                privateIpAddress) {
    IpAddress publicIpAddress = ipAddressMap.remove(privateIpAddress);
    if (publicIpAddress == null) {
        return null;
    }

    Iterator<Entry<IpPrefix, Boolean>> prefixes =
            localPublicIpPrefixes.entrySet().iterator();
    while (prefixes.hasNext()) {
        Entry<IpPrefix, Boolean> prefixEntry = prefixes.next();
        if (prefixEntry.getKey().contains(publicIpAddress)
                && !prefixEntry.getValue()) {
            updateIpPrefixStatus(prefixEntry.getKey(), true);
        }
    }
    log.info("[DELETE] Private IP to Public IP mapping: {} --> {}",
             privateIpAddress, publicIpAddress);
    return publicIpAddress;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:VbngConfigurationManager.java


示例20: advertiseNodeLabelRule

import org.onlab.packet.IpPrefix; //导入依赖的package包/类
/**
 * Install a rule for pushing node labels to the device of other nodes.
 *
 * @param deviceId device to which flow should be pushed
 * @param labelId label for the device
 * @param ipPrefix device for which label is pushed
 * @param type type of operation
 * @param bBos is this the end of sync push
 */
public void advertiseNodeLabelRule(DeviceId deviceId, LabelResourceId labelId, IpPrefix ipPrefix,
                                   Objective.Operation type, boolean bBos) {
    checkNotNull(flowObjectiveService);
    checkNotNull(appId);
    TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder();

    selectorBuilder.matchMplsLabel(MplsLabel.mplsLabel(labelId.id().intValue()));
    selectorBuilder.matchIPSrc(ipPrefix);

    if (bBos) {
        selectorBuilder.matchMplsBos(bBos);
    }

    TrafficTreatment treatment = DefaultTrafficTreatment.builder().build();

    ForwardingObjective.Builder forwardingObjective = DefaultForwardingObjective.builder()
            .withSelector(selectorBuilder.build()).withTreatment(treatment)
            .withFlag(ForwardingObjective.Flag.VERSATILE).fromApp(appId).makePermanent();

    if (type.equals(Objective.Operation.ADD)) {
        flowObjectiveService.forward(deviceId, forwardingObjective.add());
    } else {
        flowObjectiveService.forward(deviceId, forwardingObjective.remove());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:35,代码来源:PceccSrTeBeHandler.java



注:本文中的org.onlab.packet.IpPrefix类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ChronicleMapBuilder类代码示例发布时间:2022-05-23
下一篇:
Java IGitblit类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap