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 reflector peers. This is a special-case of
17 * FromInternalImportPolicy.
19 final class ToReflectorClientExportPolicy extends AbstractReflectingExportPolicy {
21 ToReflectorClientExportPolicy(final Ipv4Address originatorId, final ClusterIdentifier clusterId) {
22 super(originatorId, clusterId);
26 ContainerNode effectiveAttributes(final PeerRole sourceRole, final ContainerNode attributes) {
29 // eBGP -> Client iBGP, propagate
32 // Non-Client iBGP -> Client iBGP, reflect
33 return reflectedAttributes(attributes);
35 // Client iBGP -> Client iBGP, reflect
36 return reflectedAttributes(attributes);
38 throw new IllegalArgumentException("Unhandled source role " + sourceRole);