区分了ENDXSID和ENDSID。移除了多余的路由表对象的isLoopback(),因为是否是环回是链路的属性,不是路由表的。

This commit is contained in:
2026-08-31 10:57:08 +08:00
parent 02d7bcd93b
commit 58913254e0
4 changed files with 16 additions and 19 deletions
@@ -4,6 +4,10 @@ import java.util.Objects;
import java.util.function.Supplier;
public class RouteItem implements Comparable<RouteItem>,Cloneable{
public static final String DIRECT="Direct";
public static final String SRv6_ENDSID="SRv6 ENDSID";
public static final String SRv6_ENDXSID="SRv6 ENDXSID";
private IPv6AddressGroup destination;
private IPv6Address nexthop;
private IPv6NetworkLink destlink;
@@ -12,7 +16,6 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
private long cost;
private String flag;
private Supplier<Long> costSupplier;
private boolean isLoopback;
public String getFlag() {
return flag;
}
@@ -34,7 +37,7 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
&& pre == other.pre && Objects.equals(proto, other.proto);
}
public RouteItem(IPv6AddressGroup destination, IPv6Address nexthop, IPv6NetworkLink destlink, String proto, int pre,
long cost,String flag,boolean isLoopback) {
long cost,String flag) {
super();
this.destination = destination;
this.nexthop = nexthop;
@@ -43,10 +46,9 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
this.pre = pre;
this.cost = cost;
this.flag=flag;
this.isLoopback=isLoopback;
}
public RouteItem(IPv6AddressGroup destination, IPv6Address nexthop, IPv6NetworkLink destlink, String proto, int pre,
long cost,Supplier<Long> costSupplier,String flag,boolean isLoopback) {
long cost,Supplier<Long> costSupplier,String flag) {
super();
this.destination = destination;
this.nexthop = nexthop;
@@ -56,7 +58,6 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
this.cost = cost;
this.costSupplier=costSupplier;
this.flag=flag;
this.isLoopback=isLoopback;
}
public IPv6AddressGroup getDestination() {
return destination;
@@ -73,9 +74,6 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
public int getPre() {
return pre;
}
public boolean isLoopback() {
return isLoopback;
}
@Override
public String toString() {
return getDestination()+"\t"+getProto()+"\t"+getPre()+"\t"+getCost()+"\t"+getFlag()+"\t"+getNexthop()+"\t"+getDestlink().getName();