forked from KNEMC/KLALB
KLALB V3.6.0 写了一半
This commit is contained in:
@@ -24,7 +24,6 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.kne.cloud.network.*;
|
||||
import org.kne.cloud.network.klalb.ui.KLALBStateGUI2;
|
||||
import org.kne.cloud.network.klalb.ui.KLALBStateGUI3;
|
||||
import org.kne.cloud.network.klalb.ui.Language;
|
||||
import org.kne.cloud.network.klalb.ui.UIEnv;
|
||||
@@ -122,7 +121,6 @@ public class KLALBProxySystem {
|
||||
}
|
||||
public void loadConfigJson(JsonElement json) {
|
||||
KLALBConfig config= gson.fromJson(json, KLALBConfig.class);
|
||||
System.out.println(config);
|
||||
loadConfig(config);
|
||||
}
|
||||
public void loadConfig(KLALBConfig config) {
|
||||
@@ -141,31 +139,10 @@ public class KLALBProxySystem {
|
||||
}
|
||||
}
|
||||
}
|
||||
String vase= kcci.getVirtualAddress();
|
||||
//System.out.println(vase);
|
||||
List<InetAddress>daddr=new ArrayList<InetAddress>();
|
||||
List<InetAddress> vdns= kcci.getDNS();
|
||||
if(vdns!=null) {
|
||||
for(InetAddress dnsaddr:vdns) {
|
||||
daddr.add(dnsaddr);
|
||||
}
|
||||
|
||||
}
|
||||
if(vase!=null) {
|
||||
try {
|
||||
klalbController=new KLALBController((Inet6Address) InetAddress.getByName(vase),daddr);
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}else {
|
||||
klalbController=new KLALBController(daddr);
|
||||
}
|
||||
|
||||
|
||||
Long vasn= kcci.getVirtualASN();
|
||||
if(vasn!=null) {
|
||||
klalbController.getIpv6Router().setASN (vasn);
|
||||
}
|
||||
klalbController=new KLALBController(kcci);
|
||||
|
||||
|
||||
|
||||
|
||||
String vsne=kcci.getVirtualSocketName();
|
||||
@@ -183,7 +160,7 @@ public class KLALBProxySystem {
|
||||
|
||||
KLALBRemoteLine krs=null;
|
||||
try {
|
||||
krs = new KLALBRemoteLine(new StreamChannelKLALBPacketLink(soc));
|
||||
krs = new KLALBRemoteLine(klalbController,new StreamChannelKLALBPacketLink(soc));
|
||||
klalbController.addRemoteLine(krs);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@@ -206,7 +183,7 @@ public class KLALBProxySystem {
|
||||
|
||||
KLALBRemoteLine krs=null;
|
||||
try {
|
||||
krs = new KLALBRemoteLine(new SplitedDatagramKLALBPacketLink(soc));
|
||||
krs = new KLALBRemoteLine(klalbController,new SplitedDatagramKLALBPacketLink(soc));
|
||||
klalbController.addRemoteLine(krs);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@@ -219,33 +196,7 @@ public class KLALBProxySystem {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
List<MultipurposeSocketAddress> linele=kcci.getLineTable();
|
||||
if(linele!=null) {
|
||||
klalbController.getSelflineTable().addAll(linele);
|
||||
}
|
||||
List<MultipurposeSocketAddress> linetoc=kcci.getConnectLineTable();
|
||||
if(linetoc!=null) {
|
||||
linetoc.forEach((aline)->{
|
||||
klalbController.addRemoteLines(aline);
|
||||
});
|
||||
}
|
||||
|
||||
List<MultipurposeSocketAddress> ntps=kcci.getNtpServerTable();
|
||||
if(ntps!=null) {
|
||||
klalbController.getNTPTable().addAll(ntps);
|
||||
}
|
||||
|
||||
List<String> strexc=kcci.getNetworkInterfaceExcepts();
|
||||
klalbController.getNetworkInterfaceExcept().clear();
|
||||
if(strexc!=null) {
|
||||
for(String strexci:strexc) {
|
||||
try {
|
||||
klalbController.getNetworkInterfaceExcept().add(NetworkInterface.getByName(strexci));
|
||||
} catch (SocketException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}else if(item instanceof SocketBridgeConfigItem) {
|
||||
SocketBridgeConfigItem scci=(SocketBridgeConfigItem) item;
|
||||
|
||||
Reference in New Issue
Block a user