org.bdware.dogp.sample.TestAddressSystemMain Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doip-audit-tool Show documentation
Show all versions of doip-audit-tool Show documentation
doip audit tool developed by bdware
package org.bdware.dogp.sample;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bdware.dogp.NettyUDPDOGPAddressServer;
public class TestAddressSystemMain {
static Logger LOGGER = LogManager.getLogger(TestAddressSystemMain.class);
public static void main(String[] args) throws Exception {
LOGGER.info("Usage: java -cp doip-audit.jar:./libs/* org.bdware.dogp.sample.TestAddressSystemMain [dstInjectAddress] [listenPort]" +
"\n\t\t in default,dstInjectAddress=192.168.1.1:8888 listenPort:21044 ");
String content = "192.168.1.1";
int port = 8888;
if (args.length > 0) {
String[] split = args[0].split(":");
content = split[0];
port = Integer.valueOf(split[1]);
}
int lport = 21044;
if (args.length > 1) {
lport = Integer.valueOf(args[1]);
}
LOGGER.info("configuration: inject dst: " + content + ":" + port + ", listen at: " + lport);
DOGPDstNaiveFiller filler = new DOGPDstNaiveFiller(content, port);
NettyUDPDOGPAddressServer server = new NettyUDPDOGPAddressServer(lport, filler);
server.start();
}
}