Search in sources :

Example 1 with PCEPStatefulCapability

use of org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability in project bgpcep by opendaylight.

the class PCCSyncAvoidanceProcedureTest method getCapabilities.

@Override
protected List<PCEPCapability> getCapabilities() {
    final List<PCEPCapability> caps = new ArrayList<>();
    caps.add(new PCEPStatefulCapability(true, true, true, false, false, false, true));
    return caps;
}
Also used : PCEPStatefulCapability(org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability) ArrayList(java.util.ArrayList) PCEPCapability(org.opendaylight.protocol.pcep.PCEPCapability)

Example 2 with PCEPStatefulCapability

use of org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability in project bgpcep by opendaylight.

the class PCCTriggeredLspResyncTest method getCapabilities.

@Override
protected List<PCEPCapability> getCapabilities() {
    final List<PCEPCapability> caps = new ArrayList<>();
    caps.add(new PCEPStatefulCapability(true, true, true, false, true, false, true));
    return caps;
}
Also used : PCEPStatefulCapability(org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability) ArrayList(java.util.ArrayList) PCEPCapability(org.opendaylight.protocol.pcep.PCEPCapability)

Example 3 with PCEPStatefulCapability

use of org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability in project bgpcep by opendaylight.

the class PCCTriggeredSyncTest method getCapabilities.

@Override
protected List<PCEPCapability> getCapabilities() {
    final List<PCEPCapability> caps = new ArrayList<>();
    caps.add(new PCEPStatefulCapability(true, true, true, true, false, false, true));
    return caps;
}
Also used : PCEPStatefulCapability(org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability) ArrayList(java.util.ArrayList) PCEPCapability(org.opendaylight.protocol.pcep.PCEPCapability)

Example 4 with PCEPStatefulCapability

use of org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability in project bgpcep by opendaylight.

the class Main method main.

public static void main(final String[] args) throws UnknownHostException, InterruptedException, ExecutionException {
    if (args.length == 0 || args.length == 1 && args[0].equalsIgnoreCase("--help")) {
        LOG.info(Main.USAGE);
        return;
    }
    InetSocketAddress address = null;
    int keepAliveValue = KA_DEFAULT;
    int deadTimerValue = 0;
    boolean stateful = false;
    boolean active = false;
    boolean instant = false;
    int pos = 0;
    while (pos < args.length) {
        if (args[pos].equalsIgnoreCase("-a") || args[pos].equalsIgnoreCase("--address")) {
            final String[] ip = args[pos + 1].split(":");
            address = new InetSocketAddress(InetAddress.getByName(ip[0]), Integer.parseInt(ip[1]));
            pos++;
        } else if (args[pos].equalsIgnoreCase("-d") || args[pos].equalsIgnoreCase("--deadtimer")) {
            deadTimerValue = Integer.parseInt(args[pos + 1]);
            pos++;
        } else if (args[pos].equalsIgnoreCase("-ka") || args[pos].equalsIgnoreCase("--keepalive")) {
            keepAliveValue = Integer.parseInt(args[pos + 1]);
            pos++;
        } else if (args[pos].equalsIgnoreCase("--stateful")) {
            stateful = true;
        } else if (args[pos].equalsIgnoreCase("--active")) {
            stateful = true;
            active = true;
        } else if (args[pos].equalsIgnoreCase("--instant")) {
            stateful = true;
            instant = true;
        } else {
            LOG.warn("WARNING: Unrecognized argument: {}", args[pos]);
        }
        pos++;
    }
    if (deadTimerValue != 0 && deadTimerValue != keepAliveValue * KA_TO_DEADTIMER_RATIO) {
        LOG.warn("WARNING: The value of DeadTimer should be 4 times the value of KeepAlive.");
    }
    if (deadTimerValue == 0) {
        deadTimerValue = keepAliveValue * KA_TO_DEADTIMER_RATIO;
    }
    final List<PCEPCapability> caps = new ArrayList<>();
    caps.add(new PCEPStatefulCapability(stateful, active, instant, false, false, false, false));
    final PCEPSessionProposalFactory spf = new BasePCEPSessionProposalFactory(deadTimerValue, keepAliveValue, caps);
    final MessageRegistry handlerRegistry = ServiceLoader.load(PCEPExtensionConsumerContext.class).findFirst().orElseThrow().getMessageHandlerRegistry();
    final PCEPDispatcherImpl dispatcher = new PCEPDispatcherImpl(handlerRegistry, new DefaultPCEPSessionNegotiatorFactory(spf, MAX_UNKNOWN_MESSAGES), new NioEventLoopGroup(), new NioEventLoopGroup());
    dispatcher.createServer(new TestToolPCEPDispatcherDependencies(address)).get();
}
Also used : PCEPDispatcherImpl(org.opendaylight.protocol.pcep.impl.PCEPDispatcherImpl) PCEPStatefulCapability(org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability) DefaultPCEPSessionNegotiatorFactory(org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory) InetSocketAddress(java.net.InetSocketAddress) BasePCEPSessionProposalFactory(org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory) ArrayList(java.util.ArrayList) BasePCEPSessionProposalFactory(org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory) PCEPSessionProposalFactory(org.opendaylight.protocol.pcep.PCEPSessionProposalFactory) MessageRegistry(org.opendaylight.protocol.pcep.spi.MessageRegistry) PCEPCapability(org.opendaylight.protocol.pcep.PCEPCapability) PCEPExtensionConsumerContext(org.opendaylight.protocol.pcep.spi.PCEPExtensionConsumerContext) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)

Example 5 with PCEPStatefulCapability

use of org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability in project bgpcep by opendaylight.

the class PCCTriggeredFullDBResyncTest method getCapabilities.

@Override
protected List<PCEPCapability> getCapabilities() {
    final List<PCEPCapability> caps = new ArrayList<>();
    caps.add(new PCEPStatefulCapability(true, true, true, false, true, false, true));
    return caps;
}
Also used : PCEPStatefulCapability(org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability) ArrayList(java.util.ArrayList) PCEPCapability(org.opendaylight.protocol.pcep.PCEPCapability)

Aggregations

PCEPStatefulCapability (org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability)7 ArrayList (java.util.ArrayList)6 PCEPCapability (org.opendaylight.protocol.pcep.PCEPCapability)6 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)1 InetSocketAddress (java.net.InetSocketAddress)1 Test (org.junit.Test)1 PCEPSessionProposalFactory (org.opendaylight.protocol.pcep.PCEPSessionProposalFactory)1 BasePCEPSessionProposalFactory (org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory)1 DefaultPCEPSessionNegotiatorFactory (org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory)1 PCEPDispatcherImpl (org.opendaylight.protocol.pcep.impl.PCEPDispatcherImpl)1 MessageRegistry (org.opendaylight.protocol.pcep.spi.MessageRegistry)1 PCEPExtensionConsumerContext (org.opendaylight.protocol.pcep.spi.PCEPExtensionConsumerContext)1 TlvsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder)1