+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.concepts;
-
-import java.io.Serializable;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
-
-import com.google.common.base.Preconditions;
-
-/**
- * Object representation of a RFC1997 Community tag. Communities are a way for the advertising entitiy to attach
- * semantic meaning/policy to advertised objects.
- */
-public final class Community implements Serializable {
- /**
- * NO_EXPORT community. All routes received carrying a communities attribute containing this value MUST NOT be
- * advertised outside a BGP confederation boundary (a stand-alone autonomous system that is not part of a
- * confederation should be considered a confederation itself).
- */
- public static final Community NO_EXPORT = new Community(new AsNumber((long) 0xFFFF), 0xFF01);
- /**
- * NO_ADVERTISE community. All routes received carrying a communities attribute containing this value MUST NOT be
- * advertised to other BGP peers.
- */
- public static final Community NO_ADVERTISE = new Community(new AsNumber((long) 0xFFFF), 0xFF02);
- /**
- * NO_EXPORT_SUBCONFED community. All routes received carrying a communities attribute containing this value MUST
- * NOT be advertised to external BGP peers (this includes peers in other members autonomous systems inside a BGP
- * confederation).
- */
- public static final Community NO_EXPORT_SUBCONFED = new Community(new AsNumber((long) 0xFFFF), 0xFF03);
-
- private static final long serialVersionUID = -944853598551415685L;
-
- private final int semantics;
-
- private final AsNumber as;
-
- /**
- * Create a new community tag for a particular AS number and semantics.
- *
- * @param as Global semantics namespace identifier (usually the tagging Autonomous System)
- * @param semantics Sematics identifier (specific meaning defined externally by the namespace)
- */
- public Community(final AsNumber as, final int semantics) {
- Preconditions.checkArgument(semantics > 0 && semantics < 65535, "Invalid semantics specified");
- this.semantics = semantics;
- this.as = as;
- }
-
- /**
- * Return semantics attribute of community.
- *
- * @return Semantics attribute
- */
- public int getSemantics() {
- return this.semantics;
- }
-
- /**
- * Return ASNumber of community.
- *
- * @return {@link AsNumber}
- */
- public AsNumber getAs() {
- return this.as;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (!(o instanceof Community))
- return false;
-
- final Community c = (Community) o;
- return this.as.equals(c.as) && this.semantics == c.semantics;
- }
-
- @Override
- public int hashCode() {
- return 7 * this.as.hashCode() + 13 * this.semantics;
- }
-
- @Override
- public final String toString() {
- final StringBuilder sb = new StringBuilder(this.as.toString());
- sb.append(':');
- sb.append(this.semantics);
- return sb.toString();
- }
-
- /**
- * Creates a Community from its String representation.
- *
- * @param string String representation of a community
- * @return new Community
- */
- public static Community valueOf(final String string) {
- final String[] parts = string.split(":", 2);
-
- final int asn = Integer.valueOf(parts[0]);
- final int sem = Integer.valueOf(parts[1]);
- return new Community(new AsNumber((long) asn), sem);
- }
-}
type inet:ipv4-address;
}
}
+
+ grouping community {
+ reference "https://tools.ietf.org/html/rfc1997";
+ description "Community Path Attribute";
+ leaf as-number {
+ type inet:as-number;
+ }
+ leaf semantics {
+ type uint32 {
+ range 0..65535;
+ }
+ }
+ }
}
import java.util.Set;
import org.opendaylight.protocol.bgp.concepts.ASPath;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
-
import org.opendaylight.protocol.concepts.Identifier;
-import org.opendaylight.protocol.bgp.linkstate.NetworkObject;
-import org.opendaylight.protocol.bgp.linkstate.NetworkObjectState;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
+
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.base.Preconditions;
/**
* Implementation of {@link NetworkObject}
- *
+ *
* @param <T> {@link Identifier} type
*/
public class NetworkObjectImpl<T extends Identifier> implements NetworkObject<T> {
protected NetworkObjectState state;
/**
- *
+ *
* @param name
*/
public NetworkObjectImpl(final T name) {
}
/**
- *
+ *
* @param name T
* @param template T
*/
/**
* Standard setter for NetworkObject asPath attribute.
- *
- * @param asPath
- * {@link ASPath}
+ *
+ * @param asPath {@link ASPath}
*/
public final synchronized void setASPath(final ASPath asPath) {
- this.state = state.withASPath(asPath);
+ this.state = this.state.withASPath(asPath);
}
/**
* Standard setter for NetworkObject communities attribute.
- *
- * @param communities
- * {@link Community}
+ *
+ * @param communities {@link CommunityImpl}
*/
public final synchronized void setCommunities(final Set<Community> communities) {
- this.state = state.withCommunities(Collections.unmodifiableSet(communities));
+ this.state = this.state.withCommunities(Collections.unmodifiableSet(communities));
}
/**
* Standard setter for NetworkObject extendedCommunities attribute.
- *
- * @param extendedCommunities
- * {@link ExtendedCommunity}
+ *
+ * @param extendedCommunities {@link ExtendedCommunity}
*/
- public final synchronized void setExtendedCommunities(
- final Set<ExtendedCommunity> extendedCommunities) {
- this.state = state.withExtendedCommunities(Collections.unmodifiableSet(extendedCommunities));
+ public final synchronized void setExtendedCommunities(final Set<ExtendedCommunity> extendedCommunities) {
+ this.state = this.state.withExtendedCommunities(Collections.unmodifiableSet(extendedCommunities));
}
@Override
return addToStringAttributes(Objects.toStringHelper(this)).toString();
}
- protected ToStringHelper addToStringAttributes(ToStringHelper toStringHelper) {
- toStringHelper.add("name", name);
- toStringHelper.add("state", state);
+ protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
+ toStringHelper.add("name", this.name);
+ toStringHelper.add("state", this.state);
return toStringHelper;
}
@Override
public synchronized NetworkObjectState currentState() {
- return state;
+ return this.state;
}
}
import java.util.Set;
import org.opendaylight.protocol.bgp.concepts.ASPath;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
-
import org.opendaylight.protocol.concepts.State;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
+
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
container aggregator {
uses bgp-t:bgp-aggregator;
}
+ list communities {
+ uses bgp-t:community;
+ }
}
container withdrawn-routes {
leaf-list withdrawn-routes {
import org.junit.Test;
import org.opendaylight.protocol.bgp.concepts.BGPTableType;
import org.opendaylight.protocol.bgp.concepts.BaseBGPObjectState;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
import org.opendaylight.protocol.bgp.concepts.IPv4NextHop;
import org.opendaylight.protocol.bgp.linkstate.ISISAreaIdentifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpAddressFamily;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpSubsequentAddressFamily;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import org.opendaylight.protocol.bgp.concepts.ASPath;
import org.opendaylight.protocol.bgp.concepts.BGPObject;
import org.opendaylight.protocol.bgp.concepts.BaseBGPObjectState;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
import org.opendaylight.protocol.bgp.concepts.IPv4NextHop;
import org.opendaylight.protocol.bgp.concepts.IPv6NextHop;
import org.opendaylight.protocol.concepts.Prefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpAggregator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.protocol.bgp.parser.impl;
+
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130918.update.path.attributes.CommunitiesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
+
+/**
+ * Object representation of a RFC1997 Community tag. Communities are a way for the advertising entity to attach semantic
+ * meaning/policy to advertised objects.
+ */
+public final class CommunityUtil {
+ /**
+ * NO_EXPORT community. All routes received carrying a communities attribute containing this value MUST NOT be
+ * advertised outside a BGP confederation boundary (a stand-alone autonomous system that is not part of a
+ * confederation should be considered a confederation itself).
+ */
+ public static final Community NO_EXPORT = CommunityUtil.create(0xFFFF, 0xFF01);
+ /**
+ * NO_ADVERTISE community. All routes received carrying a communities attribute containing this value MUST NOT be
+ * advertised to other BGP peers.
+ */
+ public static final Community NO_ADVERTISE = CommunityUtil.create(0xFFFF, 0xFF02);
+ /**
+ * NO_EXPORT_SUBCONFED community. All routes received carrying a communities attribute containing this value MUST
+ * NOT be advertised to external BGP peers (this includes peers in other members autonomous systems inside a BGP
+ * confederation).
+ */
+ public static final Community NO_EXPORT_SUBCONFED = CommunityUtil.create(0xFFFF, 0xFF03);
+
+ /**
+ * Creates a new Community given AS number value and semantics using generated CommunitiesBuilder.
+ *
+ * @param asn long
+ * @param semantics long
+ * @return new Community
+ */
+ public static Community create(final long asn, final long semantics) {
+ final CommunitiesBuilder builder = new CommunitiesBuilder();
+ builder.setAsNumber(new AsNumber(asn));
+ builder.setSemantics(semantics);
+ return builder.build();
+ }
+
+ /**
+ * Creates a Community from its String representation.
+ *
+ * @param string String representation of a community
+ * @return new Community
+ */
+ public static Community valueOf(final String string) {
+ final String[] parts = string.split(":", 2);
+ final CommunitiesBuilder builder = new CommunitiesBuilder();
+ builder.setAsNumber(new AsNumber(Long.valueOf(parts[0])));
+ builder.setSemantics(Long.valueOf(parts[1]));
+ return builder.build();
+ }
+}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.protocol.bgp.concepts;
+package org.opendaylight.protocol.bgp.parser.impl;
+import org.opendaylight.protocol.bgp.concepts.ASSpecificExtendedCommunity;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
/**
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.protocol.bgp.concepts;
+package org.opendaylight.protocol.bgp.parser.impl;
+import org.opendaylight.protocol.bgp.concepts.ASSpecificExtendedCommunity;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
/**
// When our AS number does not fit into two bytes, we report it as AS_TRANS
AsNumber openAS = msg.getMyAS();
- if (openAS.getValue().longValue() > Integer.MAX_VALUE)
+ if (openAS.getValue().longValue() > 65535)
openAS = new AsNumber((long) 2345);
System.arraycopy(ByteArray.longToBytes(openAS.getValue()), 6, msgBody, offset, AS_SIZE);
import java.util.Arrays;
import org.opendaylight.protocol.bgp.concepts.ASSpecificExtendedCommunity;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
import org.opendaylight.protocol.bgp.concepts.Inet4SpecificExtendedCommunity;
import org.opendaylight.protocol.bgp.concepts.OpaqueExtendedCommunity;
-import org.opendaylight.protocol.bgp.concepts.RouteOriginCommunity;
-import org.opendaylight.protocol.bgp.concepts.RouteTargetCommunity;
import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
import org.opendaylight.protocol.bgp.parser.BGPError;
+import org.opendaylight.protocol.bgp.parser.impl.CommunityUtil;
+import org.opendaylight.protocol.bgp.parser.impl.RouteOriginCommunity;
+import org.opendaylight.protocol.bgp.parser.impl.RouteTargetCommunity;
import org.opendaylight.protocol.concepts.IPv4Address;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.primitives.UnsignedBytes;
if (bytes.length != COMMUNITY_LENGTH)
throw new BGPDocumentedException("Community with wrong length: " + bytes.length, BGPError.OPT_ATTR_ERROR);
if (Arrays.equals(bytes, new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x01 })) {
- return Community.NO_EXPORT;
+ return CommunityUtil.NO_EXPORT;
} else if (Arrays.equals(bytes, new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x02 })) {
- return Community.NO_ADVERTISE;
+ return CommunityUtil.NO_ADVERTISE;
} else if (Arrays.equals(bytes, new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x03 })) {
- return Community.NO_EXPORT_SUBCONFED;
+ return CommunityUtil.NO_EXPORT_SUBCONFED;
}
- return new Community(new AsNumber(ByteArray.bytesToLong(Arrays.copyOfRange(bytes, 0, AS_NUMBER_LENGTH))), ByteArray.bytesToInt(Arrays.copyOfRange(
- bytes, AS_NUMBER_LENGTH, AS_NUMBER_LENGTH + AS_NUMBER_LENGTH)));
+ return CommunityUtil.create((ByteArray.bytesToLong(Arrays.copyOfRange(bytes, 0, AS_NUMBER_LENGTH))),
+ ByteArray.bytesToLong(Arrays.copyOfRange(bytes, AS_NUMBER_LENGTH, AS_NUMBER_LENGTH + AS_NUMBER_LENGTH)));
}
/**
import org.opendaylight.protocol.bgp.concepts.ASPath;
import org.opendaylight.protocol.bgp.concepts.ClusterIdentifier;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
import org.opendaylight.protocol.bgp.concepts.IPv4NextHop;
import org.opendaylight.protocol.bgp.concepts.NextHop;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpAggregator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.opendaylight.protocol.bgp.concepts.BGPObject;
import org.opendaylight.protocol.bgp.concepts.BGPTableType;
import org.opendaylight.protocol.bgp.concepts.BaseBGPObjectState;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
import org.opendaylight.protocol.bgp.concepts.IPv4NextHop;
import org.opendaylight.protocol.bgp.concepts.IPv6NextHop;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpAggregator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpSubsequentAddressFamily;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
final IPv4NextHop nextHop = IPv4NextHop.forString("10.0.0.2");
- final Set<Community> comms = Sets.newHashSet(Community.NO_EXPORT, Community.NO_ADVERTISE, Community.NO_EXPORT_SUBCONFED,
- new Community(new AsNumber((long) 0xFFFF), 0xFF10));
+ final Set<Community> comms = new HashSet<>();
+ comms.add(CommunityUtil.NO_EXPORT);
+ comms.add(CommunityUtil.NO_ADVERTISE);
+ comms.add(CommunityUtil.NO_EXPORT_SUBCONFED);
+ comms.add(CommunityUtil.create(0xFFFF, 0xFF10));
// check path attributes
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.protocol.bgp.concepts;
+package org.opendaylight.protocol.bgp.parser.impl;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
+import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
+import org.opendaylight.protocol.bgp.concepts.OpaqueExtendedCommunity;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
public class CommunityTest {
@Test
public void testCommunity() {
- new Community(new AsNumber((long) 10), 222);
- final AsNumber as = new AsNumber((long) 12);
- final Community c = new Community(as, 12);
- assertEquals(as, c.getAs());
- assertEquals(12, c.getSemantics());
+ CommunityUtil.create(10, 222);
+ final Community c = CommunityUtil.create(12, 12);
+ assertEquals(12, c.getAsNumber().getValue().intValue());
+ assertEquals(12, c.getSemantics().intValue());
}
@Test
public void testOverflows() {
try {
- new Community(new AsNumber((long) 10), -2);
+ CommunityUtil.create(10, -2);
fail("Semantics under range.");
} catch (final IllegalArgumentException e) {
assertEquals("Invalid semantics specified", e.getMessage());
}
try {
- new Community(new AsNumber((long) 10), 65536);
+ CommunityUtil.create(10, 65536);
fail("Semantics above range.");
} catch (final IllegalArgumentException e) {
assertEquals("Invalid semantics specified", e.getMessage());
@Test
public void testEquals() {
- final Community c1 = new Community(new AsNumber((long) 10), 222);
- final Community c2 = new Community(new AsNumber((long) 10), 222);
+ final Community c1 = CommunityUtil.create(10, 222);
+ final Community c2 = CommunityUtil.create(10, 222);
assertEquals(c1, c2);
assertThat(c1, not(new Object()));
}
@Test
public void testHashCode() {
- final Community c1 = new Community(new AsNumber((long) 10), 222);
- final Community c2 = new Community(new AsNumber((long) 10), 222);
+ final Community c1 = CommunityUtil.create(10, 222);
+ final Community c2 = CommunityUtil.create(10, 222);
assertEquals(c1.hashCode(), c2.hashCode());
}
@Test
public void testToString() {
- final Community c = new Community(new AsNumber((long) 10), 222);
+ final Community c = CommunityUtil.create(10, 222);
assertNotNull(c.toString());
}
@Test
public void testValueOf() {
- final Community comm = Community.valueOf("12:50");
- assertEquals(comm, new Community(new AsNumber((long) 12), 50));
+ final Community comm = CommunityUtil.valueOf("12:50");
+ assertEquals(comm, CommunityUtil.create(12, 50));
}
@Test
import org.opendaylight.protocol.bgp.concepts.ASSpecificExtendedCommunity;
import org.opendaylight.protocol.bgp.concepts.Inet4SpecificExtendedCommunity;
import org.opendaylight.protocol.bgp.concepts.OpaqueExtendedCommunity;
-import org.opendaylight.protocol.bgp.concepts.RouteOriginCommunity;
-import org.opendaylight.protocol.bgp.concepts.RouteTargetCommunity;
import org.opendaylight.protocol.bgp.linkstate.IPv4InterfaceIdentifier;
import org.opendaylight.protocol.bgp.linkstate.ISISLANIdentifier;
import org.opendaylight.protocol.bgp.linkstate.ISISRouterIdentifier;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.protocol.bgp.concepts;
+package org.opendaylight.protocol.bgp.parser.impl;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
+import org.opendaylight.protocol.bgp.parser.impl.RouteOriginCommunity;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
public class RouteOriginCommunityTest {
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.protocol.bgp.concepts;
+package org.opendaylight.protocol.bgp.parser.impl;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
+import org.opendaylight.protocol.bgp.parser.impl.RouteTargetCommunity;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
public class RouteTargetCommunityTest {
import org.opendaylight.protocol.bgp.concepts.BGPObject;
import org.opendaylight.protocol.bgp.concepts.BGPTableType;
import org.opendaylight.protocol.bgp.concepts.BaseBGPObjectState;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
import org.opendaylight.protocol.bgp.concepts.IPv6NextHop;
import org.opendaylight.protocol.bgp.concepts.NextHop;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpAddressFamily;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpSubsequentAddressFamily;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.junit.Test;
import org.opendaylight.protocol.bgp.concepts.BaseBGPObjectState;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
import org.opendaylight.protocol.bgp.linkstate.LinkIdentifier;
import org.opendaylight.protocol.bgp.linkstate.LinkProtectionType;
import org.opendaylight.protocol.concepts.Metric;
import org.opendaylight.protocol.util.DefaultingTypesafeContainer;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
public class LinkTest {
import org.junit.Test;
import org.opendaylight.protocol.bgp.concepts.ASPath;
import org.opendaylight.protocol.bgp.concepts.BaseBGPObjectState;
-import org.opendaylight.protocol.bgp.concepts.Community;
import org.opendaylight.protocol.bgp.concepts.ExtendedCommunity;
import org.opendaylight.protocol.bgp.linkstate.IPv4PrefixIdentifier;
import org.opendaylight.protocol.bgp.linkstate.IPv6PrefixIdentifier;
import org.opendaylight.protocol.concepts.IPv6;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpOrigin;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Community;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;