2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.rib.impl;
10 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerRole;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
13 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
16 * Invoked on routes which we send to our normal home AS peers.
18 final class ToInternalExportPolicy extends AbstractReflectingExportPolicy {
19 ToInternalExportPolicy(final Ipv4Address originatorId, final ClusterIdentifier clusterId) {
20 super(originatorId, clusterId);
24 ContainerNode effectiveAttributes(final PeerRole sourceRole, final ContainerNode attributes) {
27 // eBGP -> Non-Client iBGP, propagate
30 // Non-Client iBGP -> Non-Client iBGP, block
33 // Client iBGP -> Non-Client iBGP, reflect
34 return reflectedAttributes(attributes);
36 throw new IllegalArgumentException("Unhandled source role " + sourceRole);