diff --git a/.classpath b/.classpath index 7eebe5b..70a394f 100644 --- a/.classpath +++ b/.classpath @@ -2,34 +2,19 @@ - - - - - - - - - - - - - - - - - + + + - diff --git a/lib/JavaTUN0.3.jar b/lib/JavaTUN0.3.jar index 6b01d7c..cdb2fef 100644 Binary files a/lib/JavaTUN0.3.jar and b/lib/JavaTUN0.3.jar differ diff --git a/lib/disruptor-4.0.0-javadoc.jar b/lib/disruptor-4.0.0-javadoc.jar deleted file mode 100644 index 81bc63b..0000000 Binary files a/lib/disruptor-4.0.0-javadoc.jar and /dev/null differ diff --git a/lib/disruptor-4.0.0-sources.jar b/lib/disruptor-4.0.0-sources.jar deleted file mode 100644 index bcde337..0000000 Binary files a/lib/disruptor-4.0.0-sources.jar and /dev/null differ diff --git a/lib/disruptor-4.0.0.jar b/lib/disruptor-4.0.0.jar deleted file mode 100644 index d3ae6e4..0000000 Binary files a/lib/disruptor-4.0.0.jar and /dev/null differ diff --git a/lib/javassist.jar b/lib/javassist.jar deleted file mode 100644 index 33370bc..0000000 Binary files a/lib/javassist.jar and /dev/null differ diff --git a/lib/jctools-core-4.0.6-javadoc.jar b/lib/jctools-core-4.0.6-javadoc.jar deleted file mode 100644 index d6d818e..0000000 Binary files a/lib/jctools-core-4.0.6-javadoc.jar and /dev/null differ diff --git a/lib/jfreechart-1.5.3-javadoc.jar b/lib/jfreechart-1.5.3-javadoc.jar deleted file mode 100644 index e88e035..0000000 Binary files a/lib/jfreechart-1.5.3-javadoc.jar and /dev/null differ diff --git a/lib/pcap4j-core-1.8.2.jar b/lib/pcap4j-core-1.8.2.jar deleted file mode 100644 index 9663471..0000000 Binary files a/lib/pcap4j-core-1.8.2.jar and /dev/null differ diff --git a/lib/pcap4j-distribution-1.8.2-src.zip b/lib/pcap4j-distribution-1.8.2-src.zip deleted file mode 100644 index 4002cc7..0000000 Binary files a/lib/pcap4j-distribution-1.8.2-src.zip and /dev/null differ diff --git a/lib/pcap4j-packetfactory-propertiesbased-1.8.2.jar b/lib/pcap4j-packetfactory-propertiesbased-1.8.2.jar deleted file mode 100644 index 7f13634..0000000 Binary files a/lib/pcap4j-packetfactory-propertiesbased-1.8.2.jar and /dev/null differ diff --git a/lib/pcap4j-packetfactory-static-1.8.2.jar b/lib/pcap4j-packetfactory-static-1.8.2.jar deleted file mode 100644 index e5cf3ab..0000000 Binary files a/lib/pcap4j-packetfactory-static-1.8.2.jar and /dev/null differ diff --git a/lib/pcap4j-packettest-1.8.2-tests.jar b/lib/pcap4j-packettest-1.8.2-tests.jar deleted file mode 100644 index ea12ea3..0000000 Binary files a/lib/pcap4j-packettest-1.8.2-tests.jar and /dev/null differ diff --git a/lib/pcap4j-sample-1.8.2.jar b/lib/pcap4j-sample-1.8.2.jar deleted file mode 100644 index efc5b8a..0000000 Binary files a/lib/pcap4j-sample-1.8.2.jar and /dev/null differ diff --git a/lib/slf4j-api-2.0.9-javadoc.jar b/lib/slf4j-api-2.0.9-javadoc.jar deleted file mode 100644 index 17f14f3..0000000 Binary files a/lib/slf4j-api-2.0.9-javadoc.jar and /dev/null differ diff --git a/lib/slf4j-api-2.0.9-sources.jar b/lib/slf4j-api-2.0.9-sources.jar deleted file mode 100644 index 9a2a2dc..0000000 Binary files a/lib/slf4j-api-2.0.9-sources.jar and /dev/null differ diff --git a/lib/slf4j-api-2.0.9-tests.jar b/lib/slf4j-api-2.0.9-tests.jar deleted file mode 100644 index 2452fa4..0000000 Binary files a/lib/slf4j-api-2.0.9-tests.jar and /dev/null differ diff --git a/lib/slf4j-api-2.0.9.jar b/lib/slf4j-api-2.0.9.jar deleted file mode 100644 index 3796afe..0000000 Binary files a/lib/slf4j-api-2.0.9.jar and /dev/null differ diff --git a/lib/uuid-creator-6.1.1-javadoc.jar b/lib/uuid-creator-6.1.1-javadoc.jar deleted file mode 100644 index e45b88c..0000000 Binary files a/lib/uuid-creator-6.1.1-javadoc.jar and /dev/null differ diff --git a/lib/uuid-creator-6.1.1-sources.jar b/lib/uuid-creator-6.1.1-sources.jar deleted file mode 100644 index ad47277..0000000 Binary files a/lib/uuid-creator-6.1.1-sources.jar and /dev/null differ diff --git a/lib/uuid-creator-6.1.1.jar b/lib/uuid-creator-6.1.1.jar deleted file mode 100644 index f1fba8f..0000000 Binary files a/lib/uuid-creator-6.1.1.jar and /dev/null differ diff --git a/src/org/kne/cloud/network/klalb/KLALBVirtualDatagramSocket.java b/src/org/kne/cloud/network/klalb/KLALBVirtualDatagramSocket.java index 0fb1104..0428b3a 100644 --- a/src/org/kne/cloud/network/klalb/KLALBVirtualDatagramSocket.java +++ b/src/org/kne/cloud/network/klalb/KLALBVirtualDatagramSocket.java @@ -7,7 +7,6 @@ import java.net.SocketException; import org.kne.cloud.network.VirtualDatagramSocket; import org.kne.cloud.network.VirtualDatagramSocketImpl; -import org.pcap4j.core.Inets; public class KLALBVirtualDatagramSocket extends VirtualDatagramSocket { diff --git a/src/org/kne/cloud/network/perf/Kperf.java b/src/org/kne/cloud/network/perf/Kperf.java index df25da0..c15d917 100644 --- a/src/org/kne/cloud/network/perf/Kperf.java +++ b/src/org/kne/cloud/network/perf/Kperf.java @@ -145,7 +145,7 @@ public class Kperf implements Runnable{ System.out.println("测试2/3:带宽测试"); test.setLimitspeed(1000L*1024L*1024L*1024L); - testPacket=new TESTNPacket(65535); + testPacket=new TESTNPacket(9000); for (int i = 0; i < 60; i++) { Thread.sleep(1000); } diff --git a/src/org/kne/cloud/network/srv6/SRv6Router.java b/src/org/kne/cloud/network/srv6/SRv6Router.java index 4d2eb7a..d600670 100644 --- a/src/org/kne/cloud/network/srv6/SRv6Router.java +++ b/src/org/kne/cloud/network/srv6/SRv6Router.java @@ -52,7 +52,6 @@ import org.kne.cloud.network.klalb.ui.PerformanceStrategyItem; import org.kne.concurrent.HighPerformanceExecutor2; import org.kne.concurrent.TimeoutConcurrentHashMap; import org.kne.io.KNEChannels; -import org.pcap4j.packet.IllegalRawDataException; import com.google.gson.internal.Pair; @@ -483,7 +482,7 @@ public class SRv6Router { // 负载均衡路由 private boolean routingLoadBalance(IPv6NetworkLink linkfrom, IPv6Packet iPv6Packet, - StringBuilder dbg, List routes) throws IllegalRawDataException, IOException { + StringBuilder dbg, List routes) throws IOException { if(routes==null||routes.isEmpty()) { //System.out.println("Route not found:" + iPv6Packet); @@ -512,7 +511,7 @@ public class SRv6Router { private boolean loadBalance(IPv6NetworkLink linkfrom, IPv6Packet iPv6Packet, StringBuilder dbg, List routes, double cscale) - throws IllegalRawDataException, IOException { + throws IOException { // 遍历可用路由进行负载均衡 for (RouteItem tri : routes) { IPv6NetworkLink link = tri.getDestlink(); @@ -546,7 +545,7 @@ public class SRv6Router { // 处理数据包转发 private void processPacket(IPv6NetworkLink linkfrom, IPv6Packet iPv6Packet, RouteItem ri) - throws IllegalRawDataException, IOException { + throws IOException { int hop = iPv6Packet.getHopLimit(); if (ri.getDestlink().isLoopBack()) { // 环回链路处理 @@ -615,7 +614,7 @@ public class SRv6Router { } // 发送ICMP TTL超时消息 - private void sendTTLExceedPacket(IPv6Packet iPv6Packet) throws IOException, IllegalRawDataException { + private void sendTTLExceedPacket(IPv6Packet iPv6Packet) throws IOException { enqueuePacketSendTask(() -> { // 构建IPv6数据包封装ICMP消息 IPv6Packet icmpv = new IPv6Packet(); @@ -637,7 +636,7 @@ public class SRv6Router { // 处理SRv6数据包 private void processSRv6Packet(IPv6NetworkLink linkfrom, IPv6Packet iPv6Packet, RouteItem ri, IPv6SegmentRoutingHeader srhh) - throws IllegalRawDataException, IOException { + throws IOException { if (srhh.getSegmentsLeft() <= 0) { // 所有段已处理完毕 diff --git a/src/org/kne/concurrent/DisruptorExecutor.java b/src/org/kne/concurrent/DisruptorExecutor.java deleted file mode 100644 index 36449cd..0000000 --- a/src/org/kne/concurrent/DisruptorExecutor.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.kne.concurrent; - -import java.util.concurrent.Executor; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; - -import com.lmax.disruptor.BlockingWaitStrategy; -import com.lmax.disruptor.EventFactory; -import com.lmax.disruptor.EventHandler; -import com.lmax.disruptor.EventTranslator; -import com.lmax.disruptor.LiteBlockingWaitStrategy; -import com.lmax.disruptor.RingBuffer; -import com.lmax.disruptor.Sequence; -import com.lmax.disruptor.SequenceBarrier; -import com.lmax.disruptor.SleepingWaitStrategy; -import com.lmax.disruptor.YieldingWaitStrategy; -import com.lmax.disruptor.dsl.Disruptor; -import com.lmax.disruptor.dsl.ProducerType; - - -public class DisruptorExecutor implements Executor{ - - public static final DisruptorExecutor defaultExecutor=new DisruptorExecutor(); - private RunnableHandler[]rh; - - public DisruptorExecutor() { - this(Runtime.getRuntime().availableProcessors(),1024); - } - public DisruptorExecutor(int threadcount,int bufferSize) { - this(threadcount,bufferSize,Executors.defaultThreadFactory()); - //this(threadcount,bufferSize,Thread.ofVirtual().factory()); - } - public DisruptorExecutor(int threadcount,int bufferSize,ThreadFactory th) { - - - - rh=new RunnableHandler[threadcount]; - - for (int i = 0; i < rh.length; i++) { - rh[i]=new RunnableHandler(bufferSize,th); - } - - - } - - private class RunnableHandler implements EventHandler>{ - - private Disruptor>ring; - public RunnableHandler(int bufferSize,ThreadFactory tf) - {ring=new Disruptor>(new EventFactory>() { - - @Override - public AtomicReference newInstance() { - return new AtomicReference(); - } - }, bufferSize,tf,ProducerType.MULTI, new SleepingWaitStrategy()); - ring.handleEventsWith(this); - ring.start(); - } - - @Override - public void onEvent(AtomicReference arg0, long sequence, boolean onEndOfBatch) throws Exception { - //System.out.println(sequence); - Runnable r =arg0.get(); - if(r!=null) - try { - r.run(); - }catch(Throwable th) { - th.printStackTrace(); - } - - } - - } - /* - * public final class MyHandler implements EventHandler -{ - - public void onEvent(final ValueEvent entry, final long sequence, final boolean onEndOfBatch) - { - if ((sequence % numberOfConsumers) == ordinal) - { - // Process the event - } - } -} - */ - private AtomicLong al=new AtomicLong(); - @Override - public void execute(Runnable command) { - int v=(int) (al.getAndIncrement()%rh.length); - rh[v].ring.publishEvent(new EventTranslator>() { - - @Override - public void translateTo(AtomicReference arg0, long arg1) { - arg0.set(command); - //arg0.compareAndSet(null, command); - } - }); - } - public static void main(String[] args) throws InterruptedException { - DisruptorExecutor dre=new DisruptorExecutor(); - for (int i = 0; i < 20; i++) { - dre.execute(()->{ - System.out.println("run"); - }); - System.out.println("exc"); - } - Thread.sleep(1000); - } -}