Search in sources :

Example 91 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project bgpcep by opendaylight.

the class VpnIpv4RIBSupportTest method testPutRoutes.

@Test
public void testPutRoutes() {
    RIB_SUPPORT.putRoutes(this.tx, getTablePath(), createNlriAdvertiseRoute(REACH_NLRI), createAttributes());
    final VpnRoute route = (VpnRoute) this.insertedRoutes.get(0).getValue();
    assertEquals(ROUTE, route);
}
Also used : VpnRoute(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev171207.l3vpn.ip.route.VpnRoute) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Example 92 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project okhttp-digest by rburgst.

the class AuthenticationCacheInterceptorTest method beforeMethod.

@Before
public void beforeMethod() {
    MockitoAnnotations.initMocks(this);
    // setup some dummy data so that we dont get NPEs
    Address address = new Address("localhost", 8080, mockDns, socketFactory, null, null, null, proxyAuthenticator, null, Collections.singletonList(Protocol.HTTP_1_1), Collections.singletonList(ConnectionSpec.MODERN_TLS), proxySelector);
    InetSocketAddress inetSocketAddress = new InetSocketAddress("localhost", 8080);
    mockRoute = new Route(address, proxy, inetSocketAddress);
    given(mockConnection.route()).willReturn(mockRoute);
}
Also used : Address(okhttp3.Address) InetSocketAddress(java.net.InetSocketAddress) InetSocketAddress(java.net.InetSocketAddress) Route(okhttp3.Route) Before(org.junit.Before)

Example 93 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project okhttp-digest by rburgst.

the class DispatchingAuthenticatorTest method beforeMethod.

@Before
public void beforeMethod() {
    MockitoAnnotations.initMocks(this);
    // setup some dummy data so that we dont get NPEs
    Address address = new Address("localhost", 8080, mockDns, socketFactory, null, null, null, proxyAuthenticator, null, Collections.singletonList(Protocol.HTTP_1_1), Collections.singletonList(ConnectionSpec.MODERN_TLS), proxySelector);
    InetSocketAddress inetSocketAddress = new InetSocketAddress("localhost", 8080);
    mockRoute = new Route(address, proxy, inetSocketAddress);
    given(mockConnection.route()).willReturn(mockRoute);
}
Also used : Address(okhttp3.Address) InetSocketAddress(java.net.InetSocketAddress) InetSocketAddress(java.net.InetSocketAddress) Route(okhttp3.Route) Before(org.junit.Before)

Example 94 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project bgpcep by opendaylight.

the class AbstractFlowspecNlriParser method extractFlowspec.

public final List<Flowspec> extractFlowspec(final DataContainerNode<?> route) {
    requireNonNull(route, "Cannot extract flowspec from null route.");
    final List<Flowspec> fsList = new ArrayList<>();
    final Optional<DataContainerChild<? extends PathArgument, ?>> flowspecs = route.getChild(FLOWSPEC_NID);
    if (flowspecs.isPresent()) {
        for (final UnkeyedListEntryNode flowspec : ((UnkeyedListNode) flowspecs.get()).getValue()) {
            final FlowspecBuilder fsBuilder = new FlowspecBuilder();
            final Optional<DataContainerChild<?, ?>> flowspecType = flowspec.getChild(FLOWSPEC_TYPE_NID);
            if (flowspecType.isPresent()) {
                final ChoiceNode fsType = (ChoiceNode) flowspecType.get();
                processFlowspecType(fsType, fsBuilder);
            }
            fsList.add(fsBuilder.build());
        }
    }
    return fsList;
}
Also used : FlowspecBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.FlowspecBuilder) DataContainerChild(org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild) ArrayList(java.util.ArrayList) Flowspec(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.Flowspec) UnkeyedListEntryNode(org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode) ChoiceNode(org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode) PathArgument(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument) UnkeyedListNode(org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode)

Example 95 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project bgpcep by opendaylight.

the class AggregatorAttributeParser method serializeAttribute.

@Override
public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) {
    Preconditions.checkArgument(attribute instanceof Attributes, "Attribute parameter is not a PathAttribute object.");
    final Attributes pathAttributes = (Attributes) attribute;
    final Aggregator aggregator = pathAttributes.getAggregator();
    if (aggregator == null) {
        return;
    }
    Preconditions.checkArgument(aggregator.getAsNumber() != null, "Missing AS number that formed the aggregate route (encoded as 2 octets).");
    final ShortAsNumber shortAsNumber = new ShortAsNumber(aggregator.getAsNumber());
    final ByteBuf buffer = Unpooled.buffer();
    buffer.writeInt(shortAsNumber.getValue().intValue());
    buffer.writeBytes(Ipv4Util.bytesForAddress(aggregator.getNetworkAddress()));
    AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL | AttributeUtil.TRANSITIVE, TYPE, buffer, byteAggregator);
}
Also used : Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes) Aggregator(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.Aggregator) ShortAsNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ShortAsNumber) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ArrayList (java.util.ArrayList)82 VpnInstanceOpDataEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.VpnInstanceOpDataEntry)57 ExecutionException (java.util.concurrent.ExecutionException)55 VrfEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntry)55 Uint32 (org.opendaylight.yangtools.yang.common.Uint32)51 Uint64 (org.opendaylight.yangtools.yang.common.Uint64)45 Test (org.junit.Test)44 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)43 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)40 BigInteger (java.math.BigInteger)33 List (java.util.List)33 VrfTablesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey)33 Logger (org.slf4j.Logger)33 LoggerFactory (org.slf4j.LoggerFactory)33 Singleton (javax.inject.Singleton)32 Inject (javax.inject.Inject)30 RouteOrigin (org.opendaylight.netvirt.fibmanager.api.RouteOrigin)30 Collections (java.util.Collections)29 Prefixes (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.prefix.to._interface.vpn.ids.Prefixes)29 Routes (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.to.extraroutes.vpn.extra.routes.Routes)29