隧道链接改成标准URI格式

This commit is contained in:
2026-07-11 22:28:50 +08:00
parent 053450429c
commit 314f90b5f3
66 changed files with 1578 additions and 1506 deletions
@@ -3,32 +3,42 @@ package org.kne.cloud.network.klalb;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.kne.cloud.network.MultipurposeSocketAddress;
import org.kne.cloud.network.MultiProtocolSocketAddress;
public class KLALBControllerConfigItem extends KLALBConfigItem {
private String language;
private boolean nogui;
private String VirtualAddress;
private String VirtualAddress=KLALBUtils.randomKLALBIPv6Address().toString();
private Long VirtualASN;
private List<InetAddress> DNS;
private MultipurposeSocketAddress TCPListen;
private MultipurposeSocketAddress UDPListen;
private MultiProtocolSocketAddress TCPListen=new MultiProtocolSocketAddress("0.0.0.0",4565);
private MultiProtocolSocketAddress UDPListen=new MultiProtocolSocketAddress("udp","0.0.0.0",4565);
private String VirtualSocketName;
private List<MultipurposeSocketAddress>LineTable=new ArrayList<>();
private List<MultipurposeSocketAddress>ConnectLineTable=new ArrayList<>();
private List<MultipurposeSocketAddress>ntpServerTable=new ArrayList<>();
private List<MultiProtocolSocketAddress>LineTable=new ArrayList<>();
private List<MultiProtocolSocketAddress>ConnectLineTable=new ArrayList<>();
private List<MultiProtocolSocketAddress>ntpServerTable=new ArrayList<>();
private boolean denyLineTableQuery=false;
private boolean denyLineTableBroadcast=false;
private String congestionAlgorithm="BBR";
private double burstLimit=1.20;
private double burstLimit=1.50;
private double delayUpperBound=1.20;
private double delayLowerBound=1.15;
private long nagleDelayTime=1000000L;
private long linkNagleDelayTime=1000000L;
private int linkConnectionsCount=1;
private String TUNName=CONST.KLALB_S_RV6;
private String performanceStrategy="multifill";
public String getPerformanceStrategy() {
return performanceStrategy;
}
public void setPerformanceStrategy(String performanceStrategy) {
this.performanceStrategy = performanceStrategy;
}
public void setNetworkInterfaceExcepts(List<String> networkInterfaceExcepts) {
NetworkInterfaceExcepts = networkInterfaceExcepts;
}
@@ -52,8 +62,8 @@ public class KLALBControllerConfigItem extends KLALBConfigItem {
public KLALBControllerConfigItem(String type) {
super(type);
public KLALBControllerConfigItem() {
super("KLALBController");
}
@@ -124,62 +134,62 @@ public class KLALBControllerConfigItem extends KLALBConfigItem {
public MultipurposeSocketAddress getTCPListen() {
public MultiProtocolSocketAddress getTCPListen() {
return TCPListen;
}
public void setTCPListen(MultipurposeSocketAddress tCPListen) {
public void setTCPListen(MultiProtocolSocketAddress tCPListen) {
TCPListen = tCPListen;
}
public MultipurposeSocketAddress getUDPListen() {
public MultiProtocolSocketAddress getUDPListen() {
return UDPListen;
}
public void setUDPListen(MultipurposeSocketAddress uDPListen) {
public void setUDPListen(MultiProtocolSocketAddress uDPListen) {
UDPListen = uDPListen;
}
public List<MultipurposeSocketAddress> getLineTable() {
public List<MultiProtocolSocketAddress> getLineTable() {
return LineTable;
}
public void setLineTable(List<MultipurposeSocketAddress> lineTable) {
public void setLineTable(List<MultiProtocolSocketAddress> lineTable) {
LineTable = lineTable;
}
public List<MultipurposeSocketAddress> getConnectLineTable() {
public List<MultiProtocolSocketAddress> getConnectLineTable() {
return ConnectLineTable;
}
public void setConnectLineTable(List<MultipurposeSocketAddress> connectLineTable) {
public void setConnectLineTable(List<MultiProtocolSocketAddress> connectLineTable) {
ConnectLineTable = connectLineTable;
}
public List<MultipurposeSocketAddress> getNtpServerTable() {
public List<MultiProtocolSocketAddress> getNtpServerTable() {
return ntpServerTable;
}
public void setNtpServerTable(List<MultipurposeSocketAddress> ntpServerTable) {
public void setNtpServerTable(List<MultiProtocolSocketAddress> ntpServerTable) {
this.ntpServerTable = ntpServerTable;
}
@@ -306,146 +316,43 @@ public class KLALBControllerConfigItem extends KLALBConfigItem {
@Override
public String toString() {
return "KLALBControllerConfigItem [language=" + language + ", nogui=" + nogui + ", VirtualAddress="
+ VirtualAddress + ", VirtualASN=" + VirtualASN + ", DNS=" + DNS + ", TCPListen=" + TCPListen
+ ", UDPListen=" + UDPListen + ", VirtualSocketName=" + VirtualSocketName + ", LineTable=" + LineTable
+ ", ConnectLineTable=" + ConnectLineTable + ", ntpServerTable=" + ntpServerTable
+ ", denyLineTableQuery=" + denyLineTableQuery + ", denyLineTableBroadcast=" + denyLineTableBroadcast
+ ", congestionAlgorithm=" + congestionAlgorithm + ", delayUpperBound=" + delayUpperBound
+ ", delayLowerBound=" + delayLowerBound + ", nagleDelayTime=" + nagleDelayTime
+ ", linkNagleDelayTime=" + linkNagleDelayTime + ", linkConnectionsCount=" + linkConnectionsCount
+ ", TUNName=" + TUNName + ", NetworkInterfaceExcepts=" + NetworkInterfaceExcepts + "]";
return "KLALBControllerConfigItem{" +
"language='" + language + '\'' +
", nogui=" + nogui +
", VirtualAddress='" + VirtualAddress + '\'' +
", VirtualASN=" + VirtualASN +
", DNS=" + DNS +
", TCPListen=" + TCPListen +
", UDPListen=" + UDPListen +
", VirtualSocketName='" + VirtualSocketName + '\'' +
", LineTable=" + LineTable +
", ConnectLineTable=" + ConnectLineTable +
", ntpServerTable=" + ntpServerTable +
", denyLineTableQuery=" + denyLineTableQuery +
", denyLineTableBroadcast=" + denyLineTableBroadcast +
", congestionAlgorithm='" + congestionAlgorithm + '\'' +
", burstLimit=" + burstLimit +
", delayUpperBound=" + delayUpperBound +
", delayLowerBound=" + delayLowerBound +
", nagleDelayTime=" + nagleDelayTime +
", linkNagleDelayTime=" + linkNagleDelayTime +
", linkConnectionsCount=" + linkConnectionsCount +
", TUNName='" + TUNName + '\'' +
", performanceStrategy='" + performanceStrategy + '\'' +
", NetworkInterfaceExcepts=" + NetworkInterfaceExcepts +
'}';
}
@Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
KLALBControllerConfigItem that = (KLALBControllerConfigItem) o;
return nogui == that.nogui && denyLineTableQuery == that.denyLineTableQuery && denyLineTableBroadcast == that.denyLineTableBroadcast && Double.compare(burstLimit, that.burstLimit) == 0 && Double.compare(delayUpperBound, that.delayUpperBound) == 0 && Double.compare(delayLowerBound, that.delayLowerBound) == 0 && nagleDelayTime == that.nagleDelayTime && linkNagleDelayTime == that.linkNagleDelayTime && linkConnectionsCount == that.linkConnectionsCount && Objects.equals(language, that.language) && Objects.equals(VirtualAddress, that.VirtualAddress) && Objects.equals(VirtualASN, that.VirtualASN) && Objects.equals(DNS, that.DNS) && Objects.equals(TCPListen, that.TCPListen) && Objects.equals(UDPListen, that.UDPListen) && Objects.equals(VirtualSocketName, that.VirtualSocketName) && Objects.equals(LineTable, that.LineTable) && Objects.equals(ConnectLineTable, that.ConnectLineTable) && Objects.equals(ntpServerTable, that.ntpServerTable) && Objects.equals(congestionAlgorithm, that.congestionAlgorithm) && Objects.equals(TUNName, that.TUNName) && Objects.equals(performanceStrategy, that.performanceStrategy) && Objects.equals(NetworkInterfaceExcepts, that.NetworkInterfaceExcepts);
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((ConnectLineTable == null) ? 0 : ConnectLineTable.hashCode());
result = prime * result + ((DNS == null) ? 0 : DNS.hashCode());
result = prime * result + ((LineTable == null) ? 0 : LineTable.hashCode());
result = prime * result + ((NetworkInterfaceExcepts == null) ? 0 : NetworkInterfaceExcepts.hashCode());
result = prime * result + ((TCPListen == null) ? 0 : TCPListen.hashCode());
result = prime * result + ((TUNName == null) ? 0 : TUNName.hashCode());
result = prime * result + ((UDPListen == null) ? 0 : UDPListen.hashCode());
result = prime * result + ((VirtualASN == null) ? 0 : VirtualASN.hashCode());
result = prime * result + ((VirtualAddress == null) ? 0 : VirtualAddress.hashCode());
result = prime * result + ((VirtualSocketName == null) ? 0 : VirtualSocketName.hashCode());
result = prime * result + ((congestionAlgorithm == null) ? 0 : congestionAlgorithm.hashCode());
long temp;
temp = Double.doubleToLongBits(delayLowerBound);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(delayUpperBound);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + (denyLineTableBroadcast ? 1231 : 1237);
result = prime * result + (denyLineTableQuery ? 1231 : 1237);
result = prime * result + ((language == null) ? 0 : language.hashCode());
result = prime * result + linkConnectionsCount;
result = prime * result + (int) (linkNagleDelayTime ^ (linkNagleDelayTime >>> 32));
result = prime * result + (int) (nagleDelayTime ^ (nagleDelayTime >>> 32));
result = prime * result + (nogui ? 1231 : 1237);
result = prime * result + ((ntpServerTable == null) ? 0 : ntpServerTable.hashCode());
return result;
return Objects.hash(super.hashCode(), language, nogui, VirtualAddress, VirtualASN, DNS, TCPListen, UDPListen, VirtualSocketName, LineTable, ConnectLineTable, ntpServerTable, denyLineTableQuery, denyLineTableBroadcast, congestionAlgorithm, burstLimit, delayUpperBound, delayLowerBound, nagleDelayTime, linkNagleDelayTime, linkConnectionsCount, TUNName, performanceStrategy, NetworkInterfaceExcepts);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
KLALBControllerConfigItem other = (KLALBControllerConfigItem) obj;
if (ConnectLineTable == null) {
if (other.ConnectLineTable != null)
return false;
} else if (!ConnectLineTable.equals(other.ConnectLineTable))
return false;
if (DNS == null) {
if (other.DNS != null)
return false;
} else if (!DNS.equals(other.DNS))
return false;
if (LineTable == null) {
if (other.LineTable != null)
return false;
} else if (!LineTable.equals(other.LineTable))
return false;
if (NetworkInterfaceExcepts == null) {
if (other.NetworkInterfaceExcepts != null)
return false;
} else if (!NetworkInterfaceExcepts.equals(other.NetworkInterfaceExcepts))
return false;
if (TCPListen == null) {
if (other.TCPListen != null)
return false;
} else if (!TCPListen.equals(other.TCPListen))
return false;
if (TUNName == null) {
if (other.TUNName != null)
return false;
} else if (!TUNName.equals(other.TUNName))
return false;
if (UDPListen == null) {
if (other.UDPListen != null)
return false;
} else if (!UDPListen.equals(other.UDPListen))
return false;
if (VirtualASN == null) {
if (other.VirtualASN != null)
return false;
} else if (!VirtualASN.equals(other.VirtualASN))
return false;
if (VirtualAddress == null) {
if (other.VirtualAddress != null)
return false;
} else if (!VirtualAddress.equals(other.VirtualAddress))
return false;
if (VirtualSocketName == null) {
if (other.VirtualSocketName != null)
return false;
} else if (!VirtualSocketName.equals(other.VirtualSocketName))
return false;
if (congestionAlgorithm == null) {
if (other.congestionAlgorithm != null)
return false;
} else if (!congestionAlgorithm.equals(other.congestionAlgorithm))
return false;
if (Double.doubleToLongBits(delayLowerBound) != Double.doubleToLongBits(other.delayLowerBound))
return false;
if (Double.doubleToLongBits(delayUpperBound) != Double.doubleToLongBits(other.delayUpperBound))
return false;
if (denyLineTableBroadcast != other.denyLineTableBroadcast)
return false;
if (denyLineTableQuery != other.denyLineTableQuery)
return false;
if (language == null) {
if (other.language != null)
return false;
} else if (!language.equals(other.language))
return false;
if (linkConnectionsCount != other.linkConnectionsCount)
return false;
if (linkNagleDelayTime != other.linkNagleDelayTime)
return false;
if (nagleDelayTime != other.nagleDelayTime)
return false;
if (nogui != other.nogui)
return false;
if (ntpServerTable == null) {
if (other.ntpServerTable != null)
return false;
} else if (!ntpServerTable.equals(other.ntpServerTable))
return false;
return true;
}
}